ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DerivationFramework::GenFilterTool Class Reference

#include <GenFilterTool.h>

Inheritance diagram for DerivationFramework::GenFilterTool:
Collaboration diagram for DerivationFramework::GenFilterTool:

Public Member Functions

 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode getGenFiltVars (const EventContext &ctx, float &genFiltHT, float &genFiltHTinclNu, float &genFiltMET, float &genFiltPTZ, float &genFiltFatJ) const
 
bool isPrompt (const xAOD::TruthParticle *tp) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this,"EventInfoName" , "EventInfo"}
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_mcKey {this, "MCCollectionName", "TruthParticles"}
 
SG::ReadHandleKey< xAOD::JetContainerm_truthJetsKey {this, "TruthJetCollectionName", "AntiKt4TruthWZJets"}
 
SG::ReadHandleKey< xAOD::JetContainerm_truthFatJetsKey {this, "TruthFatJetCollectionName", "AntiKt10TruthJets"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_mcReadDecor {this, "TruthClassKey",""}
 
SG::WriteDecorHandleKeyArray< xAOD::EventInfom_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< IMCTruthClassifierm_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
 

Detailed Description

Definition at line 34 of file GenFilterTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ GenFilterTool()

DerivationFramework::GenFilterTool::GenFilterTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 41 of file GenFilterTool.cxx.

42  : AthAlgTool(t,n,p) {
43 
44  declareInterface<DerivationFramework::IAugmentationTool>(this);
45 
46  }

◆ ~GenFilterTool()

DerivationFramework::GenFilterTool::~GenFilterTool ( )
default

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::GenFilterTool::addBranches ( ) const
finaloverridevirtual

Pass the thinning service

Implements DerivationFramework::IAugmentationTool.

Definition at line 96 of file GenFilterTool.cxx.

96  {
97  ATH_MSG_VERBOSE("GenFilterTool::addBranches()");
98  const EventContext& ctx = Gaudi::Hive::currentContext();
100  if (!eventInfo.isValid()) {
101  ATH_MSG_ERROR("could not retrieve event info " <<m_eventInfoKey.fullKey());
102  return StatusCode::FAILURE;
103  }
104 
105 
106  float genFiltHT{0.f}, genFiltHTinclNu{0.f}, genFiltMET{0.f}, genFiltPTZ{0.f}, genFiltFatJ{0.f};
107  ATH_CHECK( getGenFiltVars(ctx, genFiltHT, genFiltHTinclNu, genFiltMET, genFiltPTZ, genFiltFatJ) );
108 
109  ATH_MSG_DEBUG("Computed generator filter quantities: HT " << genFiltHT/1e3 << ", HTinclNu " << genFiltHTinclNu/1e3 << ", MET " << genFiltMET/1e3 << ", PTZ " << genFiltPTZ/1e3 << ", FatJ " << genFiltFatJ/1e3 );
110 
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;
116 
117  return StatusCode::SUCCESS;
118  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

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.

120  {
121  // Get jet container out
122 
124  if (!tpc.isValid()) {
125  ATH_MSG_ERROR("WARNING could not retrieve TruthParticleContainer " <<m_mcKey.fullKey());
126  return StatusCode::FAILURE;
127  }
128 
130  if (!truthjets.isValid()){
131  ATH_MSG_ERROR( "No xAOD::JetContainer found in StoreGate with key " << m_truthJetsKey );
132  return StatusCode::FAILURE;
133  }
134 
135  // Get HT
136  genFiltHT = 0.;
137  genFiltHTinclNu = 0.; // this HT definition includes neutrinos from W/Z/tau
138  for (const auto *const tj : *truthjets) {
139  if ( tj->pt()>m_MinJetPt && std::abs(tj->eta())<m_MaxJetEta ) {
140  ATH_MSG_VERBOSE("Adding truth jet with pt " << tj->pt()
141  << ", eta " << tj->eta()
142  << ", phi " << tj->phi()
143  << ", nconst = " << tj->numConstituents());
144  genFiltHT += tj->pt();
145  genFiltHTinclNu += tj->pt();
146  }
147  }
148 
149  // Get MET and add leptons to HT
150  float MEx(0.), MEy(0.);
151  for (const auto *const tp : *tpc){
152  int pdgid = tp->pdgId();
153  if (HepMC::is_simulation_particle(tp)) continue; // Particle is from G4
154  if (MC::isZeroEnergyPhoton(tp)) continue; // Work around for an old generator bug
155  if ( !MC::isStable(tp)) continue; // Stable!
156 
157  if ((std::abs(pdgid)==11 || std::abs(pdgid)==13) && tp->pt()>m_MinLepPt && std::abs(tp->eta())<m_MaxLepEta) {
158  if( isPrompt(tp) ) {
159  ATH_MSG_VERBOSE("Adding prompt lepton with pt " << tp->pt()
160  << ", eta " << tp->eta()
161  << ", phi " << tp->phi()
162  << ", status " << tp->status()
163  << ", pdgId " << pdgid);
164  genFiltHT += tp->pt();
165  genFiltHTinclNu += tp->pt();
166  }
167  }
168 
169  // include neutrinos from W/Z/Tau in one of the HT definitions
170  // this corresponds to a subset of HT-sliced samples where the HT filter
171  // was configured to include these particles
172  if (tp->isNeutrino() && isFromWZTau(tp)) {
173  ATH_MSG_VERBOSE("Adding neutrino from W/Z/Tau with pt " << tp->pt()
174  << ", eta " << tp->eta()
175  << ", phi " << tp->phi()
176  << ", status " << tp->status()
177  << ", pdgId " << pdgid);
178  genFiltHTinclNu += tp->pt();
179  }
180 
182  ATH_MSG_VERBOSE("Found prompt nonInteracting particle with pt " << tp->pt()
183  << ", eta " << tp->eta()
184  << ", phi " << tp->phi()
185  << ", status " << tp->status()
186  << ", pdgId " << pdgid);
187  MEx += tp->px();
188  MEy += tp->py();
189  }
190  }
191  genFiltMET = sqrt(MEx*MEx+MEy*MEy);
192 
193  // Get PTZ
194  float PtZ(.0);
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;
198  for (const xAOD::TruthParticle* pitr1 : *tpc){
199  int pdgId1 = pitr1->pdgId();
200  if (HepMC::is_simulation_particle(pitr1)) continue;
201  if (!MC::isStable(pitr1)) continue;
202  // Pick electrons or muons with Pt > MinPt_PTZ and |eta| < m_maxEta
203  if (std::abs(pdgId1) == 11 || std::abs(pdgId1) == 13) {
204  if (pitr1->pt() >= MinPt_PTZ && std::abs(pitr1->eta()) <= MaxEta_PTZ){
205  for (const xAOD::TruthParticle* pitr2 : *tpc){
206  if (pitr2==pitr1) continue;
207  if (HepMC::is_simulation_particle(pitr2)) continue;
208  if (!MC::isStable(pitr2)) continue;
209  int pdgId2 = pitr2->pdgId();
210  // Pick electrons or muons with Pt > MinPt_PTZ and |eta| < MaxEta_PTZ
211  // If AllowSameCharge_PTZ is not true only pick those with opposite charge to the first particle
212  // If AllowElecMu_PTZ is true allow also Z -> emu compinations (with charge requirements as above)
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();
218  // Only consider pair that fall in the mass window
219  if (MinMass_PTZ < invMass && invMass < MaxMass_PTZ) {
220  if (dilepPt > PtZ) PtZ = dilepPt;
221  }
222  }
223  }
224  }
225  }
226  }
227  }
228  genFiltPTZ = PtZ;
229 
230  //Get FatJ
231  // Get correct jet container
233  if ( !truthjets10.isValid()){
234  ATH_MSG_ERROR( "No xAOD::JetContainer found in StoreGate with key "<<m_truthFatJetsKey.fullKey() );
235  return StatusCode::FAILURE;
236  }
237  genFiltFatJ=0.;
238  for (const auto *const j : *truthjets10) {
239  if (j->pt()>genFiltFatJ) genFiltFatJ=j->pt();
240  }
241 
242 
243  return StatusCode::SUCCESS;
244  }

◆ initialize()

StatusCode DerivationFramework::GenFilterTool::initialize ( )
finaloverridevirtual

Definition at line 81 of file GenFilterTool.cxx.

81  {
84  ATH_CHECK(m_truthJetsKey.initialize());
85  ATH_CHECK(m_truthFatJetsKey.initialize());
86  for (const SG::AuxElement::Decorator<float>& dec : {
87  dec_genFiltHT, dec_genFiltHTinclNu, dec_genFiltMET, dec_genFiltPTZ, dec_genFiltFatJ
88  }) {
89  m_decorKeys.emplace_back(m_eventInfoKey.key() + "." + SG::AuxTypeRegistry::instance().getName(dec.auxid()));
90  }
91  ATH_CHECK(m_decorKeys.initialize());
92  m_mcReadDecor = m_mcKey.key() + "." + SG::AuxTypeRegistry::instance().getName(acc_PartOrigin.auxid());
94  return StatusCode::SUCCESS;
95  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

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()

bool DerivationFramework::GenFilterTool::isPrompt ( const xAOD::TruthParticle tp) const
private

Definition at line 51 of file GenFilterTool.cxx.

52  {
53  ParticleOrigin orig = m_classif->particleTruthClassifier( tp ).second;
54  ATH_MSG_VERBOSE("Particle has origin " << orig);
55 
56  switch(orig) {
57  case NonDefined:
58  case PhotonConv:
59  case DalitzDec:
60  case ElMagProc:
61  case Mu:
62  case LightMeson:
63  case StrangeMeson:
64  case CharmedMeson:
65  case BottomMeson:
66  case CCbarMeson:
67  case JPsi:
68  case BBbarMeson:
69  case LightBaryon:
70  case StrangeBaryon:
71  case CharmedBaryon:
72  case BottomBaryon:
73  case PionDecay:
74  case KaonDecay:
75  return false;
76  default:
77  break;
78  }
79  return true;
80  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

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()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_classif

PublicToolHandle<IMCTruthClassifier> DerivationFramework::GenFilterTool::m_classif {this, "TruthClassifier", "MCTruthClassifier/DFCommonTruthClassifier"}
private

Definition at line 62 of file GenFilterTool.h.

◆ m_decorKeys

SG::WriteDecorHandleKeyArray<xAOD::EventInfo> DerivationFramework::GenFilterTool::m_decorKeys {this, "DecorationKeys", {} , "Decorations added to the eventinfo"}
private

Definition at line 56 of file GenFilterTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::GenFilterTool::m_eventInfoKey {this,"EventInfoName" , "EventInfo"}
private

Definition at line 48 of file GenFilterTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_MaxJetEta

Gaudi::Property<float> DerivationFramework::GenFilterTool::m_MaxJetEta {this, "MaxJetEta", 2.5}
private

Max eta for the truth jets.

Definition at line 58 of file GenFilterTool.h.

◆ m_MaxLepEta

Gaudi::Property<float> DerivationFramework::GenFilterTool::m_MaxLepEta {this, "MaxLeptonEta", 2.5}
private

Max eta for the truth leptons.

Definition at line 60 of file GenFilterTool.h.

◆ m_mcKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::GenFilterTool::m_mcKey {this, "MCCollectionName", "TruthParticles"}
private

Definition at line 49 of file GenFilterTool.h.

◆ m_mcReadDecor

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::GenFilterTool::m_mcReadDecor {this, "TruthClassKey",""}
private

Definition at line 53 of file GenFilterTool.h.

◆ m_MinJetPt

Gaudi::Property<float> DerivationFramework::GenFilterTool::m_MinJetPt {this, "MinJetPt", 35.* Gaudi::Units::GeV}
private

Min pT for the truth jets.

Definition at line 57 of file GenFilterTool.h.

◆ m_MinLepPt

Gaudi::Property<float> DerivationFramework::GenFilterTool::m_MinLepPt {this,"MinLeptonPt", 25.*Gaudi::Units::GeV}
private

Min pT for the truth leptons.

Definition at line 59 of file GenFilterTool.h.

◆ m_truthFatJetsKey

SG::ReadHandleKey<xAOD::JetContainer> DerivationFramework::GenFilterTool::m_truthFatJetsKey {this, "TruthFatJetCollectionName", "AntiKt10TruthJets"}
private

Definition at line 51 of file GenFilterTool.h.

◆ m_truthJetsKey

SG::ReadHandleKey<xAOD::JetContainer> DerivationFramework::GenFilterTool::m_truthJetsKey {this, "TruthJetCollectionName", "AntiKt4TruthWZJets"}
private

Definition at line 50 of file GenFilterTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
StrangeMeson
@ StrangeMeson
Definition: TruthClasses.h:80
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
P4Helpers::invMass
double invMass(const I4Momentum &pA, const I4Momentum &pB)
invariant mass from two I4momentum references
Definition: P4Helpers.h:239
Mu
@ Mu
Definition: TruthClasses.h:62
BBbarMeson
@ BBbarMeson
Definition: TruthClasses.h:85
BottomMeson
@ BottomMeson
Definition: TruthClasses.h:82
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:49
MC::isSpecialNonInteracting
bool isSpecialNonInteracting(const T &p)
Definition: HepMCHelpers.h:57
PionDecay
@ PionDecay
Definition: TruthClasses.h:90
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SG::AuxTypeRegistry::getName
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Definition: AuxTypeRegistry.cxx:277
ElMagProc
@ ElMagProc
Definition: TruthClasses.h:61
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
ParticleTest.tp
tp
Definition: ParticleTest.py:25
PhotonConv
@ PhotonConv
Definition: TruthClasses.h:59
DerivationFramework::GenFilterTool::m_truthFatJetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_truthFatJetsKey
Definition: GenFilterTool.h:51
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
DerivationFramework::GenFilterTool::m_mcReadDecor
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_mcReadDecor
Definition: GenFilterTool.h:53
DerivationFramework::GenFilterTool::m_MaxJetEta
Gaudi::Property< float > m_MaxJetEta
Max eta for the truth jets.
Definition: GenFilterTool.h:58
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
DerivationFramework::GenFilterTool::m_MinJetPt
Gaudi::Property< float > m_MinJetPt
Min pT for the truth jets.
Definition: GenFilterTool.h:57
CCbarMeson
@ CCbarMeson
Definition: TruthClasses.h:83
NonDefined
@ NonDefined
Definition: TruthClasses.h:52
DerivationFramework::GenFilterTool::m_decorKeys
SG::WriteDecorHandleKeyArray< xAOD::EventInfo > m_decorKeys
Definition: GenFilterTool.h:56
DerivationFramework::GenFilterTool::m_classif
PublicToolHandle< IMCTruthClassifier > m_classif
Definition: GenFilterTool.h:62
CharmedBaryon
@ CharmedBaryon
Definition: TruthClasses.h:88
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:58
HepMC::is_simulation_particle
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...
Definition: MagicNumbers.h:299
SG::ReadDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
DerivationFramework::GenFilterTool::getGenFiltVars
StatusCode getGenFiltVars(const EventContext &ctx, float &genFiltHT, float &genFiltHTinclNu, float &genFiltMET, float &genFiltPTZ, float &genFiltFatJ) const
Definition: GenFilterTool.cxx:120
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ParticleOrigin
ParticleOrigin
Definition: TruthClasses.h:51
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
StrangeBaryon
@ StrangeBaryon
Definition: TruthClasses.h:87
LightMeson
@ LightMeson
Definition: TruthClasses.h:79
DerivationFramework::GenFilterTool::m_MaxLepEta
Gaudi::Property< float > m_MaxLepEta
Max eta for the truth leptons.
Definition: GenFilterTool.h:60
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
JPsi
@ JPsi
Definition: TruthClasses.h:84
CharmedMeson
@ CharmedMeson
Definition: TruthClasses.h:81
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
DerivationFramework::GenFilterTool::m_truthJetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetsKey
Definition: GenFilterTool.h:50
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
DerivationFramework::GenFilterTool::isPrompt
bool isPrompt(const xAOD::TruthParticle *tp) const
Definition: GenFilterTool.cxx:51
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
BottomBaryon
@ BottomBaryon
Definition: TruthClasses.h:89
LightBaryon
@ LightBaryon
Definition: TruthClasses.h:86
DerivationFramework::GenFilterTool::m_mcKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_mcKey
Definition: GenFilterTool.h:49
DerivationFramework::GenFilterTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: GenFilterTool.h:48
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
Prompt::Def::Pt
@ Pt
Definition: VarHolder.h:76
a
TList * a
Definition: liststreamerinfos.cxx:10
h
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
DerivationFramework::GenFilterTool::m_MinLepPt
Gaudi::Property< float > m_MinLepPt
Min pT for the truth leptons.
Definition: GenFilterTool.h:59
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
DalitzDec
@ DalitzDec
Definition: TruthClasses.h:60
MC::isZeroEnergyPhoton
bool isZeroEnergyPhoton(const T &p)
Identify a photon with zero energy. Probably a workaround for a generator bug.
Definition: HepMCHelpers.h:53
KaonDecay
@ KaonDecay
Definition: TruthClasses.h:91
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528