![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <GenFilterTool.h>
|
| GenFilterTool (const std::string &t, const std::string &n, const IInterface *p) |
|
| ~GenFilterTool () |
|
virtual StatusCode | addBranches () const override final |
| Pass the thinning service
More...
|
|
virtual StatusCode | initialize () override final |
|
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 |
|
|
SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfoKey {this,"EventInfoName" , "EventInfo"} |
|
SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_mcKey {this, "MCCollectionName", "TruthParticles"} |
|
SG::ReadHandleKey< xAOD::JetContainer > | m_truthJetsKey {this, "TruthJetCollectionName", "AntiKt4TruthWZJets"} |
|
SG::ReadHandleKey< xAOD::JetContainer > | m_truthFatJetsKey {this, "TruthFatJetCollectionName", "AntiKt10TruthJets"} |
|
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > | m_mcReadDecor {this, "TruthClassKey",""} |
|
SG::WriteDecorHandleKeyArray< xAOD::EventInfo > | m_decorKeys {this, "DecorationKeys", {} , "Decorations added to the eventinfo"} |
|
Gaudi::Property< float > | m_MinJetPt {this, "MinJetPt", 35.* Gaudi::Units::GeV} |
| Min pT for the truth jets. More...
|
|
Gaudi::Property< float > | m_MaxJetEta {this, "MaxJetEta", 2.5} |
| Max eta for the truth jets. More...
|
|
Gaudi::Property< float > | m_MinLepPt {this,"MinLeptonPt", 25.*Gaudi::Units::GeV} |
| Min pT for the truth leptons. More...
|
|
Gaudi::Property< float > | m_MaxLepEta {this, "MaxLeptonEta", 2.5} |
| Max eta for the truth leptons. More...
|
|
PublicToolHandle< IMCTruthClassifier > | m_classif {this, "TruthClassifier", "MCTruthClassifier/DFCommonTruthClassifier"} |
|
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 |
|
Definition at line 34 of file GenFilterTool.h.
◆ StoreGateSvc_t
◆ GenFilterTool()
DerivationFramework::GenFilterTool::GenFilterTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
Definition at line 41 of file GenFilterTool.cxx.
44 declareInterface<DerivationFramework::IAugmentationTool>(
this);
◆ ~GenFilterTool()
DerivationFramework::GenFilterTool::~GenFilterTool |
( |
| ) |
|
|
default |
◆ addBranches()
StatusCode DerivationFramework::GenFilterTool::addBranches |
( |
| ) |
const |
|
finaloverridevirtual |
Pass the thinning service
Implements DerivationFramework::IAugmentationTool.
Definition at line 96 of file GenFilterTool.cxx.
98 const EventContext& ctx = Gaudi::Hive::currentContext();
100 if (!eventInfo.isValid()) {
102 return StatusCode::FAILURE;
106 float genFiltHT{0.f}, genFiltHTinclNu{0.f}, genFiltMET{0.f}, genFiltPTZ{0.f}, genFiltFatJ{0.f};
109 ATH_MSG_DEBUG(
"Computed generator filter quantities: HT " << genFiltHT/1
e3 <<
", HTinclNu " << genFiltHTinclNu/1
e3 <<
", MET " << genFiltMET/1
e3 <<
", PTZ " << genFiltPTZ/1
e3 <<
", FatJ " << genFiltFatJ/1
e3 );
111 dec_genFiltHT(*eventInfo) = genFiltHT;
112 dec_genFiltHTinclNu(*eventInfo) = genFiltHTinclNu;
113 dec_genFiltMET(*eventInfo) = genFiltMET;
114 dec_genFiltPTZ(*eventInfo) = genFiltPTZ;
115 dec_genFiltFatJ(*eventInfo) = genFiltFatJ;
117 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);
◆ 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.
◆ 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.
◆ 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]
◆ 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
◆ getGenFiltVars()
StatusCode DerivationFramework::GenFilterTool::getGenFiltVars |
( |
const EventContext & |
ctx, |
|
|
float & |
genFiltHT, |
|
|
float & |
genFiltHTinclNu, |
|
|
float & |
genFiltMET, |
|
|
float & |
genFiltPTZ, |
|
|
float & |
genFiltFatJ |
|
) |
| const |
|
private |
Definition at line 120 of file GenFilterTool.cxx.
124 if (!tpc.isValid()) {
126 return StatusCode::FAILURE;
130 if (!truthjets.isValid()){
132 return StatusCode::FAILURE;
137 genFiltHTinclNu = 0.;
138 for (
const auto *
const tj : *truthjets) {
141 <<
", eta " << tj->eta()
142 <<
", phi " << tj->phi()
143 <<
", nconst = " << tj->numConstituents());
144 genFiltHT += tj->pt();
145 genFiltHTinclNu += tj->pt();
150 float MEx(0.), MEy(0.);
151 for (
const auto *
const tp : *tpc){
152 int pdgid =
tp->pdgId();
160 <<
", eta " <<
tp->eta()
161 <<
", phi " <<
tp->phi()
162 <<
", status " <<
tp->status()
163 <<
", pdgId " << pdgid);
164 genFiltHT +=
tp->pt();
165 genFiltHTinclNu +=
tp->pt();
172 if (
tp->isNeutrino() && isFromWZTau(
tp)) {
174 <<
", eta " <<
tp->eta()
175 <<
", phi " <<
tp->phi()
176 <<
", status " <<
tp->status()
177 <<
", pdgId " << pdgid);
178 genFiltHTinclNu +=
tp->pt();
183 <<
", eta " <<
tp->eta()
184 <<
", phi " <<
tp->phi()
185 <<
", status " <<
tp->status()
186 <<
", pdgId " << pdgid);
191 genFiltMET = sqrt(MEx*MEx+MEy*MEy);
195 float MinPt_PTZ(5000.), MaxEta_PTZ(5.0), MinMass_PTZ(20000.), MaxMass_PTZ(14000000.);
196 bool AllowElecMu_PTZ =
false;
197 bool AllowSameCharge_PTZ =
false;
199 int pdgId1 = pitr1->pdgId();
203 if (std::abs(pdgId1) == 11 || std::abs(pdgId1) == 13) {
204 if (pitr1->pt() >= MinPt_PTZ && std::abs(pitr1->eta()) <= MaxEta_PTZ){
206 if (pitr2==pitr1)
continue;
209 int pdgId2 = pitr2->pdgId();
213 if ((AllowSameCharge_PTZ && (std::abs(pdgId2) == std::abs(pdgId1) || (AllowElecMu_PTZ && (std::abs(pdgId2) == 11 || std::abs(pdgId2) == 13) ) ) ) ||
214 (!AllowSameCharge_PTZ && (pdgId2 == -1*pdgId1 || (AllowElecMu_PTZ && (pdgId2 == (pdgId1 < 0 ? 1 : -1) * 11 || (pdgId1 < 0 ? 1 : -1) * pdgId2 == 13) ) ) ) ) {
215 if (pitr2->pt() >= MinPt_PTZ && std::abs(pitr2->eta()) <= MaxEta_PTZ){
216 double invMass = (pitr1->p4()+pitr2->p4()).M();
217 double dilepPt = (pitr1->p4()+pitr2->p4()).
Pt();
220 if (dilepPt > PtZ) PtZ = dilepPt;
233 if ( !truthjets10.isValid()){
235 return StatusCode::FAILURE;
238 for (
const auto *
const j : *truthjets10) {
239 if (j->pt()>genFiltFatJ) genFiltFatJ=j->pt();
243 return StatusCode::SUCCESS;
◆ initialize()
StatusCode DerivationFramework::GenFilterTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 81 of file GenFilterTool.cxx.
87 dec_genFiltHT, dec_genFiltHTinclNu, dec_genFiltMET, dec_genFiltPTZ, dec_genFiltFatJ
94 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.
◆ interfaceID()
static const InterfaceID& DerivationFramework::IAugmentationTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 31 of file IAugmentationTool.h.
31 {
return IID_IAugmentationTool; }
◆ isPrompt()
◆ msg() [1/2]
◆ msg() [2/2]
◆ 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.
◆ 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_classif
◆ m_decorKeys
◆ m_detStore
◆ m_eventInfoKey
◆ m_evtStore
◆ m_MaxJetEta
Gaudi::Property<float> DerivationFramework::GenFilterTool::m_MaxJetEta {this, "MaxJetEta", 2.5} |
|
private |
◆ m_MaxLepEta
Gaudi::Property<float> DerivationFramework::GenFilterTool::m_MaxLepEta {this, "MaxLeptonEta", 2.5} |
|
private |
◆ m_mcKey
◆ m_mcReadDecor
◆ m_MinJetPt
Gaudi::Property<float> DerivationFramework::GenFilterTool::m_MinJetPt {this, "MinJetPt", 35.* Gaudi::Units::GeV} |
|
private |
◆ m_MinLepPt
Gaudi::Property<float> DerivationFramework::GenFilterTool::m_MinLepPt {this,"MinLeptonPt", 25.*Gaudi::Units::GeV} |
|
private |
◆ m_truthFatJetsKey
◆ m_truthJetsKey
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
double invMass(const I4Momentum &pA, const I4Momentum &pB)
invariant mass from two I4momentum references
static AuxTypeRegistry & instance()
Return the singleton registry instance.
bool isSpecialNonInteracting(const T &p)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual void setOwner(IDataHandleHolder *o)=0
Helper class to provide type-safe access to aux data.
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Class describing a truth particle in the MC record.
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.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool isStable(const T &p)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool isZeroEnergyPhoton(const T &p)
Identify a photon with zero energy. Probably a workaround for a generator bug.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>