|
ATLAS Offline Software
|
#include <JetCaloQualityToolFE.h>
|
| JetCaloQualityToolFE (const std::string &name) |
|
virtual StatusCode | decorate (const xAOD::JetContainer &jets) const override |
| Decorate a jet collection without otherwise modifying it. More...
|
|
virtual StatusCode | initialize () override |
| Dummy implementation of the initialisation function. More...
|
|
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...
|
|
Definition at line 21 of file JetCaloQualityToolFE.h.
◆ StoreGateSvc_t
◆ JetCaloQualityToolFE()
JetCaloQualityToolFE::JetCaloQualityToolFE |
( |
const std::string & |
name | ) |
|
◆ 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()
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extractConstituents()
Definition at line 105 of file JetCaloQualityToolFE.cxx.
107 std::vector<const xAOD::CaloCluster*>
clusters;
114 for (
size_t i = 0;
i <
jet.numConstituents();
i++ ) {
128 ATH_MSG_VERBOSE(
" Constituents are ParticleFlow objects stored as FlowElements.");
129 for (
size_t i = 0;
i <
jet.numConstituents();
i++ ) {
137 if(cluster !=
nullptr){
146 for (
size_t i = 0;
i <
jet.numConstituents();
i++ ) {
157 if(index_pfo<0)
continue;
168 if(!cluster){
continue;}
◆ 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
◆ fillQualityVariables()
void JetCaloQualityToolFE::fillQualityVariables |
( |
const xAOD::Jet & |
jet | ) |
const |
|
protected |
Definition at line 182 of file JetCaloQualityToolFE.cxx.
189 float sum_E_square = 0.0;
191 float sum_badLarQ = 0.0;
192 float sum_badHECQ = 0.0;
193 float sum_e_HEC = 0.0;
194 float sum_e_neg = 0.0;
195 float sum_avg_lar_q = 0.0;
196 float sum_timing = 0.0;
197 float centroid_x = 0.0, centroid_y = 0.0, centroid_z = 0.0;
198 float sum_e_bad_cells = 0.0;
200 std::vector<float> sum_OOT;
203 std::vector<int> counter_Nfrac;
206 std::vector<float> cluster_energies;
215 sum_E_square += cluster_E*cluster_E;
217 cluster_energies.push_back(cluster_E);
225 sum_badLarQ += bad_frac*cluster_E;
231 sum_badHECQ += bad_frac*e_HEC;
239 sum_e_neg += cluster_E - e_pos;
244 double avg_lar_q=0.0;
246 sum_avg_lar_q += avg_lar_q*cluster_E*cluster_E;
251 double x = 0.0,
y = 0.0,
z = 0.0;
256 centroid_x +=
x*cluster_E;
257 centroid_y +=
y*cluster_E;
258 centroid_z +=
z*cluster_E;
263 double cells_bad_E = 0.0;
265 sum_e_bad_cells += cells_bad_E;
273 sum_timing +=
timing*cluster_E*cluster_E;
279 sum_OOT[j] += cluster_E;
288 std::sort(cluster_energies.rbegin(),cluster_energies.rend());
290 for(
size_t iFracCut = 0; iFracCut <
m_thresholdCuts.size(); iFracCut++){
295 for(
unsigned int iClus = 0; iClus < cluster_energies.size(); iClus++){
296 tmp_sum += cluster_energies[iClus];
300 counter_Nfrac[iFracCut] =
counter;
310 if(calcN ==
"LArQuality"){
311 decHandle(
jet) = sum_E != 0. ? sum_badLarQ/sum_E : 0.;
313 else if(calcN ==
"HECQuality"){
314 decHandle(
jet) = sum_e_HEC != 0. ? sum_badHECQ/sum_e_HEC : 0.;
316 else if(calcN ==
"NegativeE"){
317 decHandle(
jet) = sum_e_neg;
319 else if(calcN ==
"AverageLArQF"){
320 decHandle(
jet) = sum_E_square != 0. ? sum_avg_lar_q/sum_E_square : 0.;
322 else if(calcN ==
"Timing"){
323 decHandle(
jet) = sum_E_square != 0. ? sum_timing/sum_E_square : 0.;
325 else if(calcN ==
"Centroid"){
326 decHandle(
jet) = sum_E_square != 0. ? sqrt(centroid_x*centroid_x+centroid_y*centroid_y+centroid_z*centroid_z)/sum_E_square : 0.;
328 else if(calcN ==
"BchCorrCell"){
335 decHandle_timing(
jet) = sum_E != 0. ? sum_OOT[iCut]/sum_E : 0. ;
338 for(
size_t iFracCut = 0; iFracCut <
m_thresholdCuts.size(); iFracCut++){
342 decHandle_frac(
jet) = counter_Nfrac[iFracCut];
◆ 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
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ initialize()
StatusCode JetCaloQualityToolFE::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 22 of file JetCaloQualityToolFE.cxx.
26 ATH_MSG_ERROR(
"OutputDecorKeys should not be configured manually!");
27 return StatusCode::FAILURE;
30 ATH_MSG_ERROR(
"JetCaloQualityToolFE needs to have its input jet container name configured!");
31 return StatusCode::FAILURE;
37 if(calcN ==
"LArQuality"){
40 else if(calcN ==
"HECQuality"){
43 else if(calcN ==
"NegativeE"){
46 else if(calcN ==
"AverageLArQF"){
49 else if(calcN ==
"Timing"){
52 else if(calcN ==
"Centroid"){
55 else if(calcN ==
"BchCorrCell"){
59 if(calcN ==
"Centroid"){
71 s << std::setprecision(0) << std::fixed <<
"OotFracClusters" << timeCut;
77 std::ostringstream sout;
78 sout <<
"N" << fracCut <<
"Constituents";
90 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()
◆ 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_calculationNames
Gaudi::Property<std::vector<std::string> > JetCaloQualityToolFE::m_calculationNames |
|
protected |
Initial value:{this, "Calculations", {},
"Name of calo quantities to compute and add as decorations"}
Definition at line 34 of file JetCaloQualityToolFE.h.
◆ m_detStore
◆ m_doAvgLAr
bool JetCaloQualityToolFE::m_doAvgLAr = false |
|
protected |
◆ m_doBchCorrCell
bool JetCaloQualityToolFE::m_doBchCorrCell = false |
|
protected |
◆ m_doCentroid
bool JetCaloQualityToolFE::m_doCentroid = false |
|
protected |
◆ m_doHECQ
bool JetCaloQualityToolFE::m_doHECQ = false |
|
protected |
◆ m_doLArQ
bool JetCaloQualityToolFE::m_doLArQ = false |
|
protected |
◆ m_doNegE
bool JetCaloQualityToolFE::m_doNegE = false |
|
protected |
◆ m_doTime
bool JetCaloQualityToolFE::m_doTime = false |
|
protected |
◆ m_evtStore
◆ m_jetContainerName
Gaudi::Property<std::string> JetCaloQualityToolFE::m_jetContainerName |
|
protected |
Initial value:{this, "JetContainer", "",
"SG key of input jet container"}
Definition at line 40 of file JetCaloQualityToolFE.h.
◆ m_thresholdCuts
Gaudi::Property<std::vector<int> > JetCaloQualityToolFE::m_thresholdCuts |
|
protected |
Initial value:{this, "ThresholdCuts", {},
"Thresholds cuts (NxConstituents)"}
Definition at line 38 of file JetCaloQualityToolFE.h.
◆ m_timingTimeCuts
Gaudi::Property<std::vector<double> > JetCaloQualityToolFE::m_timingTimeCuts |
|
protected |
Initial value:{this, "TimingCuts", {},
"Time cuts for out-of-time calo quantities"}
Definition at line 36 of file JetCaloQualityToolFE.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeDecorKeys
Initial value:{this, "OutputDecorKeys", {},
"SG keys for output decorations (not to be configured manually!)"}
Definition at line 43 of file JetCaloQualityToolFE.h.
◆ m_writeDecorKeys_Nfrac
Initial value:{this, "OutputNfracConstitDecorKeys", {},
"SG keys for output NfracConstituents decorations (not to be configured manually!)"}
Definition at line 49 of file JetCaloQualityToolFE.h.
◆ m_writeDecorKeys_OOT
Initial value:{this, "OutputOOTDecorKeys", {},
"SG keys for output OOT decorations (not to be configured manually!)"}
Definition at line 46 of file JetCaloQualityToolFE.h.
The documentation for this class was generated from the following files:
flt_t time() const
Access cluster time.
std::string find(const std::string &s)
return a remapped string
@ CENTER_X
Cluster Centroid ( )
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::size_t nOtherObjects() const
@ AVG_LAR_Q
Sum(E_cell_LAr^2 Q_cell_LAr)/Sum(E_cell_LAr^2)
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.
#define ATH_MSG_VERBOSE(x)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
virtual void setOwner(IDataHandleHolder *o)=0
@ CENTER_Z
Cluster Centroid ( )
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Description of a calorimeter cluster.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Handle class for adding a decoration to an object.
signal_t signalType() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
size_t index() const
Return the index of this element within its container.
@ 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
float eSample(const CaloSample sampling) const
virtual StatusCode decorate(const xAOD::JetContainer &jets) const =0
Decorate a jet collection without otherwise modifying it.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
const xAOD::IParticle * otherObject(std::size_t i) const
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual double e() const
The total energy of the particle.
@ CENTER_Y
Cluster Centroid ( )
@ ENG_POS
Total positive Energy of this cluster.
std::vector< const xAOD::IParticle * > otherObjects() const
A detector object made of other lower level object(s)
@ BADLARQ_FRAC
Energy fraction of LAr cells with quality larger than a given cut.