|
ATLAS Offline Software
|
JetBadChanCorrTool.
More...
#include <JetBadChanCorrTool.h>
|
| JetBadChanCorrTool (const std::string &name) |
|
virtual | ~JetBadChanCorrTool () |
|
virtual StatusCode | initialize () override |
| Dummy implementation of the initialisation function. More...
|
|
virtual StatusCode | decorate (const xAOD::JetContainer &jets) const override |
| Decorate a jet collection without otherwise modifying it. More...
|
|
virtual StatusCode | setupEvent () |
|
virtual void | print () const |
| Print the state of the tool. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
virtual StatusCode | modify (xAOD::JetContainer &jets) const override final |
| Concrete implementation of the function inherited from IJetModifier. More...
|
|
|
ServiceHandle< ITHistSvc > | m_thistSvc |
|
Gaudi::Property< std::string > | m_jetContainerName {this, "JetContainer", "", "SG key for the input jet container"} |
|
Gaudi::Property< int > | m_nBadCellLimit {this, "NBadCellLimit", 10000, "Limit to calculate moments"} |
|
Gaudi::Property< std::string > | m_streamName {this, "StreamName", "/JetBadChanCorrTool/", "Stream name"} |
|
Gaudi::Property< std::string > | m_profileName {this, "ProfileName", "JetBadChanCorrTool.root", "Profile name"} |
|
Gaudi::Property< std::string > | m_profileTag {this, "ProfileTag", "", "Profile tag"} |
|
Gaudi::Property< bool > | m_useCone {this, "UseCone", true, "Use cone?"} |
|
Gaudi::Property< bool > | m_useClusters {this, "UseClusters", false, "Use clusters?"} |
|
SG::ReadHandleKey< jet::CaloCellFastMap > | m_badCellMap_key {this, "MissingCellMap", "MissingCaloCellsMap", "SG key for missing cell map"} |
|
SG::WriteDecorHandleKey< xAOD::JetContainer > | m_corrCellKey {this, "CorrCellDecorKey", "BchCorrCell", "SG key for cell level decoration"} |
|
SG::WriteDecorHandleKey< xAOD::JetContainer > | m_corrDotxKey {this, "CorrDotxDecorKey", "BchCorrDotx", "SG key for DOTX decoration"} |
|
SG::WriteDecorHandleKey< xAOD::JetContainer > | m_corrJetKey {this, "CorrJetDecorKey", "BchCorrJet", "SG key for jet level decoration"} |
|
SG::WriteDecorHandleKey< xAOD::JetContainer > | m_corrJetForCellKey {this, "CorrJetForCellDecorKey", "BchCorrJetForCell", "SG key for JetForCell decoration"} |
|
std::vector< ProfileData > | m_profileDatas [CaloCell_ID::Unknown] |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
JetBadChanCorrTool.
The energy fraction of dead cells are estimated by jet-level estimator using jet profile. Some cells are already corrected in cell-level using neighboring cells, so this fraction is calculated. The estimation by jet-level for those cells corrected in cell-level is also stored to see the difference or combined the corrections.
BCH_CORR_JET= jet level estimation of the energy fraction of dead cells BCH_CORR_CELL= cell level correction, which is already corrected BCH_CORR_JET_FORCELL= jet level estimation for the corrected cells in cell level
The relation and usage of the moment is jet = jet already corrected in cell level jet x ( 1 - BCH_CORR_CELL ) = jet without cell level correction jet x ( 1 - BCH_CORR_CELL + BCH_CORR_JET ) = jet corrected by jet level estimation jet x ( 1 + BCH_CORR_JET - BCH_CORR_JET_FORCELL ) = jet with cell level correction and corrected in jet level for not covered cells
Properties:
Name | Type | Default | Description
|
ProcessNJetMax | | 999999 | |
NBadCellLimit | | 10000 | limit to calculate the moments, if exceed, giving up the calculation ie) when Calorimeter off |
AttachCorrCell | | True | switch to attach BCH_CORR_CELL |
AttachCorrDOTX | | True | switch to attach BCH_CORR_DOTX |
AttachCorrJet | | True | switch to attach BCH_CORR_JET |
AttachCorrJetForCell | | True | switch to attach BCH_CORR_JET_FORCELL
|
StreamName | | "/JetBadChanCorrTool/" | name of stream name |
ProfileName | | "JetBadChanCorrTool.root" | name of profile data |
ProfileTag | | "" | tag to select profile,"" for all in file |
UseCone | | True | boundary of correction, cone or only associated cells |
ConeDr | | 0.4 | boundary of correction in case UseCone=True |
UseCalibScale | | False | scale for calculation of the contribution of bad cells |
CellCalibrator | | | calibration tool for cell-level correction
|
Definition at line 51 of file JetBadChanCorrTool.h.
◆ StoreGateSvc_t
◆ JetBadChanCorrTool()
JetBadChanCorrTool::JetBadChanCorrTool |
( |
const std::string & |
name | ) |
|
◆ ~JetBadChanCorrTool()
JetBadChanCorrTool::~JetBadChanCorrTool |
( |
| ) |
|
|
virtualdefault |
◆ correctionFromCellsInCone()
Definition at line 247 of file JetBadChanCorrTool.cxx.
249 ATH_MSG_DEBUG(
" Missing cells for cone search "<< badCellMap->
size() <<
" jet="<<
jet->index() <<
" R="
250 <<
jet->getSizeParameter() <<
" input="<<
jet->getInputType() <<
" jet_eta="<<
jet->eta() ) ;
252 double corr_jet_cone=0;
256 double jeteta =
jet->eta();
257 double jetphi =
jet->phi();
258 std::vector<jet::CellPosition> closeCells = badCellMap->
cellsInDeltaR(jeteta,jetphi,
jet->getSizeParameter() );
262 for(; itr!=itrE; ++itr){
264 double cell_eta = itr->x();
265 double cell_phi = itr->phi();
270 double frac_cell =
getProfile(rawPt,
dr, sampling, cell_eta, cell_phi);
272 corr_jet_cone += frac_cell;
275 return corr_jet_cone;
◆ correctionFromCellsInJet()
Definition at line 165 of file JetBadChanCorrTool.cxx.
175 double rawPt = p4.Pt();
176 double rawE = p4.E();
179 double corr_jet_associate=0;
180 double corr_jet_forcell=0;
187 for( ;cellIt!=cellItE; ++cellIt) {
191 double cellWeight = cellIt.
weight();
193 double cell_energy =
cell->e() * cellWeight;
197 bool considerBad =
cell->badcell();
204 if(
cell->provenance() & 0x0200)
210 double frac = frac_cell * cellWeight;
212 corr_jet_associate +=
frac;
218 corr_dotx += cell_energy;
220 corr_cell += cell_energy;
222 corr_jet_forcell +=
frac;
227 const double inv_rawE = 1. / rawE;
228 corr_cell *= inv_rawE;
229 corr_dotx *= inv_rawE;
231 <<
" BCH_CORR_CELL=" << corr_cell
232 <<
" BCH_CORR_DOTX=" << corr_dotx
233 <<
" BCH_CORR_JET=" << corr_jet_associate
234 <<
" BCH_CORR_JET_FORCELL=" << corr_jet_forcell <<
endmsg;
236 corrCellHandle(*
jet) = corr_cell;
237 corrDotxHandle(*
jet) = corr_dotx;
238 corrJetForCellHandle(*
jet) = corr_jet_forcell;
242 corrJetHandle(*
jet) = corr_jet_associate;
244 return StatusCode::SUCCESS;
◆ correctionFromClustersBadCells()
Definition at line 278 of file JetBadChanCorrTool.cxx.
286 size_t nconstit=
jet->numConstituents();
287 for(
size_t i=0;
i<nconstit;
i++) {
293 if(
v) corrCell += badE;
297 if(rawE==0) corrCellHandle(*
jet) = 0;
298 else corrCellHandle(*
jet) = corrCell / rawE;
300 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ decorate()
Decorate a jet collection without otherwise modifying it.
Implements IJetDecorator.
Definition at line 134 of file JetBadChanCorrTool.cxx.
140 if (!handle.isValid()){
142 return StatusCode::FAILURE;
145 const auto *badCellMap = handle.cptr();
154 corrCellHandle(*
jet) = -1.;
155 corrDotxHandle(*
jet) = -1.;
156 corrJetHandle(*
jet) = -1.;
157 corrJetForCellHandle(*
jet) = -1.;
159 return StatusCode::SUCCESS;
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ getKey()
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the SG::sgkey_t
key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getName
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getName()
const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the std::string
name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getKey
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getProfile()
double JetBadChanCorrTool::getProfile |
( |
double |
pt, |
|
|
double |
dr, |
|
|
int |
sample, |
|
|
double |
eta, |
|
|
double |
phi |
|
) |
| const |
|
private |
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ initialize()
StatusCode JetBadChanCorrTool::initialize |
( |
| ) |
|
|
overridevirtual |
Dummy implementation of the initialisation function.
It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...
Reimplemented from asg::AsgTool.
Definition at line 39 of file JetBadChanCorrTool.cxx.
48 return StatusCode::FAILURE;
50 TFile tf(
fname.c_str());
53 return StatusCode::FAILURE;
56 std::vector<std::string> histsInSvc =
m_thistSvc->getHists();
58 TListIter
next(tf.GetListOfKeys());
62 if(
hname.find(
'_')==std::string::npos)
continue;
64 std::string para =
hname.substr(
hname.find(
'_')+1);
69 if(
find(histsInSvc.begin(),histsInSvc.end(),location)==histsInSvc.end()){
73 return StatusCode::FAILURE;
83 int ret = sscanf(para.c_str(),
"sample%d_pt%lf_%lf_eta%lf_%lf_phi%lf_%lf",
95 return StatusCode::FAILURE;
100 <<
" ptMin=" << ptMin <<
" ptMax=" << ptMax
102 <<
" phiMin=" << phiMin <<
" phiMax=" << phiMax <<
endmsg;
108 ATH_MSG_ERROR(
"JetBadChanCorrTool needs to have its input jet container name configured!");
109 return StatusCode::FAILURE;
125 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ modify()
|
inlinefinaloverridevirtualinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msg_level_name()
const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ print()
void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ renounce()
◆ renounceArray()
◆ setupEvent()
StatusCode JetBadChanCorrTool::setupEvent |
( |
| ) |
|
|
virtual |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_badCellMap_key
◆ m_corrCellKey
◆ m_corrDotxKey
◆ m_corrJetForCellKey
◆ m_corrJetKey
◆ m_detStore
◆ m_evtStore
◆ m_jetContainerName
Gaudi::Property<std::string> JetBadChanCorrTool::m_jetContainerName {this, "JetContainer", "", "SG key for the input jet container"} |
|
private |
◆ m_nBadCellLimit
Gaudi::Property<int> JetBadChanCorrTool::m_nBadCellLimit {this, "NBadCellLimit", 10000, "Limit to calculate moments"} |
|
private |
◆ m_profileDatas
◆ m_profileName
Gaudi::Property<std::string> JetBadChanCorrTool::m_profileName {this, "ProfileName", "JetBadChanCorrTool.root", "Profile name"} |
|
private |
◆ m_profileTag
Gaudi::Property<std::string> JetBadChanCorrTool::m_profileTag {this, "ProfileTag", "", "Profile tag"} |
|
private |
◆ m_streamName
Gaudi::Property<std::string> JetBadChanCorrTool::m_streamName {this, "StreamName", "/JetBadChanCorrTool/", "Stream name"} |
|
private |
◆ m_thistSvc
◆ m_useClusters
Gaudi::Property<bool> JetBadChanCorrTool::m_useClusters {this, "UseClusters", false, "Use clusters?"} |
|
private |
◆ m_useCone
Gaudi::Property<bool> JetBadChanCorrTool::m_useCone {this, "UseCone", true, "Use cone?"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
static const_iterator end(const xAOD::Jet *jet)
Scalar phi() const
phi method
std::string find(const std::string &s)
return a remapped string
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.
const std::string & key() const
Return the StoreGate ID for the referenced object.
Class providing the definition of the 4-vector interface.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
unsigned int size() const
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Description of a calorimeter cluster.
std::vector< CellPosition > cellsInDeltaR(double eta, double phi, double r) const
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
static const_iterator begin(const xAOD::Jet *jet)
@ ENG_BAD_CELLS
Total em-scale energy of bad cells in this cluster.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool is_tile() const
cell belongs to Tile
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Data object for each calorimeter readout cell.
virtual StatusCode decorate(const xAOD::JetContainer &jets) const =0
Decorate a jet collection without otherwise modifying it.
CaloCell_ID::CaloSample getSampling() const
cell sampling
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
weight_t weight() const
Accessor for weight associated to this cell.
float eta() const
cell eta
float phi() const
cell phi
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>