Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
DerivationFramework::TruthCollectionMaker Class Reference

#include <TruthCollectionMaker.h>

Inheritance diagram for DerivationFramework::TruthCollectionMaker:
Collaboration diagram for DerivationFramework::TruthCollectionMaker:

Public Member Functions

 TruthCollectionMaker (const std::string &t, const std::string &n, const IInterface *p)
 
 ~TruthCollectionMaker ()
 
StatusCode initialize ()
 
StatusCode finalize ()
 
virtual StatusCode addBranches () const
 Pass the thinning service
More...
 
StatusCode initializeParser (const ExpressionParsing::SelectionArg< 1 > &selection_string)
 
StatusCode finalizeParser ()
 
virtual bool updateDataNeeds (const std::vector< const DataObjID * > &input_data_in, const std::vector< const DataObjID * > &output_data_in, std::vector< Gaudi::DataHandle * > &new_input_handles, std::vector< Gaudi::DataHandle * > &new_output_handles) override
 Inform a dynamic data consumer about all consumed or produced data. More...
 
virtual bool renounceInput (const DataObjID &output_data_id) override
 
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

StatusCode _initializeParser (const ExpressionParsing::SelectionArg< NUM_PARSER > &selection_string, ExpressionParsing::AppendLoaderFunc pre_xaod_loader=ExpressionParsing::NoLoaderFunc, ExpressionParsing::AppendLoaderFunc post_xaod_loader=ExpressionParsing::NoLoaderFunc)
 
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...
 

Protected Attributes

ExpressionParsing::SGxAODProxyLoaderm_xAODProxyLoader
 The expression parser. More...
 
std::unique_ptr< ExpressionParsing::IProxyLoaderm_proxyLoaders
 
std::conditional< NUM_PARSER==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > >::type m_parser
 
std::vector< std::string > m_renounce
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

std::atomic< unsigned int > m_ntotpart
 
std::atomic< unsigned int > m_npasspart
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_particlesKey {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"}
 
SG::WriteHandleKey< xAOD::TruthParticleContainerm_outputParticlesKey {this, "NewCollectionName", "OutputTruthCollection", "WriteHandleKey for new TruthParticleContainer"}
 
Gaudi::Property< std::string > m_partString {this, "ParticleSelectionString", "", "ExpressionEvaluation string for particle selection"}
 
Gaudi::Property< bool > m_do_compress {this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"}
 
Gaudi::Property< bool > m_do_sherpa {this, "Do_Sherpa", false, "Checks if there are truth W bosons in the current record. If not, tries to combine W daughters to create one"}
 
Gaudi::Property< bool > m_keep_navigation_info {this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_linkDecoratorKey {this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_originDecoratorKey {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_typeDecoratorKey {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_outcomeDecoratorKey {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_classificationDecoratorKey {this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_motherIDDecoratorKey {this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_daughterIDDecoratorKey {this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_hadronOriginDecoratorKey {this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_originReadDecorKey {this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_typeReadDecorKey {this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_outcomeReadDecorKey {this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_classificationReadDecorKey {this, "inputClassification", m_particlesKey, "Classification", "Classification code"}
 
ServiceHandle< StoreGateSvcm_metaStore
 Handle on the metadata store for init. More...
 
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 29 of file TruthCollectionMaker.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

◆ TruthCollectionMaker()

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

Definition at line 29 of file TruthCollectionMaker.cxx.

33  , m_ntotpart(0)
34  , m_npasspart(0)
35  , m_metaStore( "MetaDataStore", n )
36 {
37  declareInterface<DerivationFramework::IAugmentationTool>(this);
38  declareProperty("MetaDataStore", m_metaStore );
39 }

◆ ~TruthCollectionMaker()

DerivationFramework::TruthCollectionMaker::~TruthCollectionMaker ( )

Definition at line 42 of file TruthCollectionMaker.cxx.

42  {
43 }

Member Function Documentation

◆ _initializeParser()

StatusCode ExpressionParserUserBase< AthAlgTool , NUM_PARSER >::_initializeParser ( const ExpressionParsing::SelectionArg< NUM_PARSER > &  selection_string,
ExpressionParsing::AppendLoaderFunc  pre_xaod_loader = ExpressionParsing::NoLoaderFunc,
ExpressionParsing::AppendLoaderFunc  post_xaod_loader = ExpressionParsing::NoLoaderFunc 
)
protectedinherited

◆ addBranches()

StatusCode DerivationFramework::TruthCollectionMaker::addBranches ( ) const
virtual

Pass the thinning service

Implements DerivationFramework::IAugmentationTool.

Definition at line 96 of file TruthCollectionMaker.cxx.

97 {
98  // Event context for AthenaMT
99  const EventContext& ctx = Gaudi::Hive::currentContext();
100 
101  // Set up for some metadata handling
102  // TODO: this isn't MT compliant. This information should go into the config level and avoid meta store
103  static const bool is_sherpa = [this]() {
104  bool is_sherpa = false;
105  if (m_metaStore->contains<xAOD::TruthMetaDataContainer>("TruthMetaData")){
106  // Note that I'd like to get this out of metadata in general, but it seems that the
107  // metadata isn't fully available in initialize, and since this is a const function
108  // I can only do the retrieve every event, rather than lazy-initializing, since this
109  // metadata ought not change during a run
110  const xAOD::TruthMetaDataContainer* truthMetaData(nullptr);
111  // Shamelessly stolen from the file meta data tool
112  if (m_metaStore->retrieve(truthMetaData).isSuccess() && !truthMetaData->empty()){
113  // Let's just be super sure...
114  const std::string gens = truthMetaData->at(0)->generators();
115  is_sherpa = (gens.find("sherpa")==std::string::npos &&
116  gens.find("Sherpa")==std::string::npos &&
117  gens.find("SHERPA")==std::string::npos) ? false : true;
118  } // Seems to be the only sure way...
119  else {
120  ATH_MSG_WARNING("Found xAODTruthMetaDataContainer empty! Configuring to be NOT Sherpa.");
121  }
122  ATH_MSG_INFO("From metadata configured: Sherpa? " << is_sherpa);
123  } else {
124  ATH_MSG_WARNING("Could not find metadata container in storegate; assuming NOT Sherpa");
125  }
126  return is_sherpa;
127  }();
128 
129  // Retrieve truth collections
131  if (!truthParticles.isValid()) {
132  ATH_MSG_ERROR("Couldn't retrieve TruthParticle collection with name " << m_particlesKey);
133  return StatusCode::FAILURE;
134  }
135 
136  // Create the new particle containers and WriteHandles
138  ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
139  std::make_unique<xAOD::TruthParticleAuxContainer>()));
140  ATH_MSG_DEBUG( "Recorded new TruthParticleContainer with key: " << (m_outputParticlesKey.key()));
141 
142  // Set up a mask with the same entries as the full collections
143  unsigned int nParticles = truthParticles->size();
144  m_ntotpart += nParticles;
145 
146  // Set up decor readers
151 
152  // Set up decorators
161 
162  // Execute the text parsers and update the mask
163  if (!m_partString.empty()) {
164  std::vector<int> entries = m_parser->evaluateAsVector();
165  unsigned int nEntries = entries.size();
166  // check the sizes are compatible
167  if (nParticles != nEntries ) {
168  ATH_MSG_ERROR("Sizes incompatible! Are you sure your selection string used TruthParticles?");
169  return StatusCode::FAILURE;
170  } else {
171  // add relevant particles to new collection
172 
173  //---------------
174  //This is some code to *add* new particles. Probably a good idea to break this off as a sub-function, but I'll let James C decide where that should go.
175  //---------------
176 
177  //Let's check if we want to build W/Z bosons
178  bool SherpaW = false;
179  bool SherpaZ = false;
180  if (m_partString.value().find("24") != std::string::npos && m_do_sherpa && is_sherpa) {
181  SherpaW = true;
182  }
183  if (m_partString.value().find("23") != std::string::npos && m_do_sherpa && is_sherpa) {
184  SherpaZ = true;
185  }
186  if ((SherpaW or SherpaZ) && is_sherpa){
187  if (std::accumulate(entries.begin(),entries.end(),0) > 0){ //We actually have some W and Z bosons in there.
188  SherpaW = false;
189  SherpaZ = false;
190  }
191  }
192 
193  if ((SherpaW || SherpaZ) && is_sherpa){
194  // Currently only handles un-ambiguous cases
195  std::vector<const xAOD::TruthParticle*> status_nonPhysical;
196  for (unsigned int i=0; i<nParticles; ++i) {
197  // Nullptr check
198  if (!truthParticles->at(i)) continue;
199  // Only collect leptons
200  if (!MC::isSMLepton(truthParticles->at(i))) continue;
201  // Gather by status
202  if (!MC::isPhysical(truthParticles->at(i))) status_nonPhysical.push_back( truthParticles->at(i) );
203  } // Done with loop over truth particles
204  // Boson cases that we can actually deal with -- generically up to VVV
205  if ((status_nonPhysical.size()==2 || status_nonPhysical.size()==4 || status_nonPhysical.size()==6) && (SherpaZ || SherpaW)){
206  // Basic boson pairing...
207  int gens[3] = {0,0,0};
208  for (size_t i=0;i<status_nonPhysical.size();++i){
209  if (status_nonPhysical[i]->absPdgId()<13) gens[0]++;
210  else if (status_nonPhysical[i]->absPdgId()<15) gens[1]++;
211  else gens[2]++;
212  } // Loop over status_nonPhysical particles
213  // Should only have even numbers per generation. Any number greater than 2 or ==1 and we're dead
214  if (gens[0]>2 || gens[0]==1 || gens[1]>2 || gens[1]==1 || gens[2]>2 || gens[2]==1){
215  // In agreeing with Sherpa authors, these are Q-M ambiguous states. Do not let users be evil.
216  ATH_MSG_VERBOSE("Too many leptons of one generation. Cannot make bosons. Give up");
217  return StatusCode::SUCCESS;
218  }
219  std::vector<const xAOD::TruthParticle*> boson;
220  for (size_t i=0;i<status_nonPhysical.size();++i){
221  if (status_nonPhysical[i]->absPdgId()<13) boson.push_back(status_nonPhysical[i]);
222  else if (gens[0]==0 && status_nonPhysical[i]->absPdgId()<15) boson.push_back(status_nonPhysical[i]);
223  else if (gens[0]==0 && gens[1]==0) boson.push_back(status_nonPhysical[i]);
224  if (boson.size()==2){
225  // Make a boson! Just have to figure out _which_ boson!
226  int pdg_id=0;
227  // Easy case: Z boson
228  if (boson[0]->pdgId()==-boson[1]->pdgId()) pdg_id=23;
229  else if (std::abs(boson[0]->pdgId()+boson[1]->pdgId())!=1){
230  // No idea what you were
231  ATH_MSG_WARNING("Do not know how to interpret as a boson: " << boson[0]->pdgId() << " " << boson[1]->pdgId());
232  } else {
233  // W boson
234  pdg_id=24*(boson[0]->pdgId()+boson[1]->pdgId());
235  }
236  if ( (SherpaW && MC::isW(pdg_id)) ||
237  (SherpaZ && MC::isZ(pdg_id)) ){
238  // Make a Z or a W
239  xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle();
240  newParticlesWriteHandle->push_back( xTruthParticle );
242  if (boson[0]->hasProdVtx()) {
243  if ((boson[0]->prodVtx()->nIncomingParticles() > 0) && (boson[0]->prodVtx()->incomingParticle(0)!=nullptr)) {
244  motherIDDecorator(*xTruthParticle) = boson[0]->prodVtx()->incomingParticle(0)->pdgId();
245  } else {motherIDDecorator(*xTruthParticle) = 0;}
246  } else {motherIDDecorator(*xTruthParticle) = 0;}
247  if (boson[0]->hasDecayVtx()) {
248  if ((boson[0]->decayVtx()->nOutgoingParticles() > 0) && (boson[0]->decayVtx()->outgoingParticle(0)!=nullptr)) {
249  daughterIDDecorator(*xTruthParticle) = boson[0]->decayVtx()->outgoingParticle(0)->pdgId();
250  } else {daughterIDDecorator(*xTruthParticle) = 0;}
251  } else {daughterIDDecorator(*xTruthParticle) = 0;}
252  }
253  // Set with what makes sense here
254  xTruthParticle->setPdgId(pdg_id);
255  // Set dummy values
256  xTruthParticle->setBarcode(HepMC::INVALID_PARTICLE_ID);
257  xTruthParticle->setStatus(3);
258  // Use the sum of the momenta
259  xAOD::IParticle::FourMom_t new_mom = boson[0]->p4()+boson[1]->p4();
260  xTruthParticle->setM(new_mom.M());
261  xTruthParticle->setPx(new_mom.Px());
262  xTruthParticle->setPy(new_mom.Py());
263  xTruthParticle->setPz(new_mom.Pz());
264  xTruthParticle->setE(new_mom.E());
265  }
266  // Now clear the vectors
267  boson.clear();
268  // And move to the next generation
269  if (gens[0]==0 && gens[1]==0) gens[2]=0;
270  else if (gens[0]==0) gens[1]=0;
271  else gens[0]=0;
272  } // Done making a boson
273  } // Done looping over particles
274  }
275  if (status_nonPhysical.size()==1 || status_nonPhysical.size()==3 || status_nonPhysical.size()==5 || status_nonPhysical.size()>6){
276  ATH_MSG_WARNING(status_nonPhysical.size() << " leptons found in the Sherpa event record. Not sure how to deal with this.");
277  }
278  return StatusCode::SUCCESS;
279  }
280  for (unsigned int i=0; i<nParticles; ++i) {
281  ElementLink<xAOD::TruthParticleContainer> eltp(*truthParticles,i);
282  if (entries[i]==1) {
283  //In TRUTH3, we want to remove all particles but the first and last in a decay chain. This is off in TRUTH1. The first and last particles in the decay chain are decorated as such.
284 
285  const xAOD::TruthParticle* theParticle = (*truthParticles)[i];
286  if (m_do_compress){
287  bool same_as_mother = false;
288  bool same_as_daughter = false;
289  if (theParticle->hasProdVtx()){
290  if ((theParticle->prodVtx()->nIncomingParticles() > 0) && (theParticle->prodVtx()->incomingParticle(0)!=nullptr)) {
291  if (theParticle->prodVtx()->incomingParticle(0)->pdgId() == theParticle->pdgId()){
292  same_as_mother = true;
293  }
294  }
295  }
296  if (theParticle->hasDecayVtx()){
297  if ((theParticle->decayVtx()->nOutgoingParticles() > 0) && (theParticle->decayVtx()->outgoingParticle(0)!=nullptr)) {
298  if (theParticle->decayVtx()->outgoingParticle(0)->pdgId() == theParticle->pdgId()){
299  same_as_daughter = true;
300  }
301  }
302  }
303  if (same_as_mother && same_as_daughter){
304  entries[i]=0;
305  continue;
306  }
307  }
308  xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle();
309  newParticlesWriteHandle->push_back( xTruthParticle );
311  if (theParticle->hasProdVtx()) {
312  if ((theParticle->prodVtx()->nIncomingParticles() > 0) && (theParticle->prodVtx()->incomingParticle(0)!=nullptr)) {
313  motherIDDecorator(*xTruthParticle) = theParticle->prodVtx()->incomingParticle(0)->pdgId();
314  } else {motherIDDecorator(*xTruthParticle) = 0;}
315  } else {motherIDDecorator(*xTruthParticle) = 0;}
316  if (theParticle->hasDecayVtx()) {
317  if ((theParticle->decayVtx()->nOutgoingParticles() > 0) && (theParticle->decayVtx()->outgoingParticle(0)!=nullptr)) {
318  daughterIDDecorator(*xTruthParticle) = theParticle->decayVtx()->outgoingParticle(0)->pdgId();
319  } else {daughterIDDecorator(*xTruthParticle) = 0;}
320  } else {daughterIDDecorator(*xTruthParticle) = 0;}
321  }
322  // Fill with numerical content
323  *xTruthParticle=*theParticle;
324  // Copy over the decorations if they are available
325  typeDecorator(*xTruthParticle) =
326  typeReadDecor.withDefault(*theParticle, 0);
327 
328  originDecorator(*xTruthParticle) =
329  originReadDecor.withDefault(*theParticle, 0);
330 
331  outcomeDecorator(*xTruthParticle) =
332  outcomeReadDecor.withDefault(*theParticle, 0);
333 
334  classificationDecorator(*xTruthParticle) =
335  classificationReadDecor.withDefault(*theParticle, 0);
336 
337  if (m_outputParticlesKey.key()=="TruthHFHadrons"){
338  static const SG::ConstAccessor<int> TopHadronOriginFlagAcc("TopHadronOriginFlag");
339  hadronOriginDecorator(*xTruthParticle) =
340  TopHadronOriginFlagAcc.withDefault (*theParticle, 0);
341  }
342 
343  if(m_keep_navigation_info) linkDecorator(*xTruthParticle) = eltp;
344  }
345  }
346  }
347  // Count the mask
348  for (unsigned int i=0; i<nParticles; ++i) if (entries[i]) ++m_npasspart;
349  }
350 
351  return StatusCode::SUCCESS;
352 }

◆ 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

◆ finalize()

StatusCode DerivationFramework::TruthCollectionMaker::finalize ( )

Definition at line 86 of file TruthCollectionMaker.cxx.

87 {
88  ATH_MSG_VERBOSE("finalize() ...");
89  //ATH_MSG_INFO("Processed "<< m_ntotvtx <<" truth vertices, "<< m_npassvtx << " were retained ");
90  ATH_MSG_INFO("Processed "<< m_ntotpart <<" truth particles, "<< m_npasspart << " were retained ");
92  return StatusCode::SUCCESS;
93 }

◆ finalizeParser()

StatusCode ExpressionParserUserBase< AthAlgTool , NUM_PARSER >::finalizeParser ( )
inherited

◆ initialize()

StatusCode DerivationFramework::TruthCollectionMaker::initialize ( )

Definition at line 46 of file TruthCollectionMaker.cxx.

47 {
48  ATH_MSG_VERBOSE("initialize() ...");
49  // Input truth particles
51  ATH_MSG_INFO("Using " << m_particlesKey.key() << " as the input truth container key");
52 
53  // Output (new) truth particles
55  ATH_MSG_INFO("New truth particles container key: " << m_outputParticlesKey.key() );
56 
57  if (m_partString.empty()) {
58  ATH_MSG_FATAL("No selection string provided");
59  return StatusCode::FAILURE;
60  } else {ATH_MSG_INFO("Truth particle selection string: " << m_partString );}
61 
62  // Set up the text-parsing machinery for thinning the truth directly according to user cuts
63  if (!m_partString.empty()) {
65  }
66 
67  // Initialise read handle keys
72 
73  // Initialise decorator handle keys
82 
83  return StatusCode::SUCCESS;
84 }

◆ initializeParser()

StatusCode ExpressionParserUser< AthAlgTool , 1 >::initializeParser ( const ExpressionParsing::SelectionArg< NUM_PARSER > &  selection_string)
inherited

◆ 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; }

◆ 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  }

◆ renounceInput()

virtual bool ExpressionParserUserBase< AthAlgTool , NUM_PARSER >::renounceInput ( const DataObjID &  output_data_id)
overridevirtualinherited

◆ 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.

◆ updateDataNeeds()

virtual bool ExpressionParserUserBase< AthAlgTool , NUM_PARSER >::updateDataNeeds ( const std::vector< const DataObjID * > &  input_data_in,
const std::vector< const DataObjID * > &  output_data_in,
std::vector< Gaudi::DataHandle * > &  new_input_handles,
std::vector< Gaudi::DataHandle * > &  new_output_handles 
)
overridevirtualinherited

Inform a dynamic data consumer about all consumed or produced data.

Parameters
input_data_inthe input data object IDs of all algorithms and tools
output_data_inthe output data object IDs of all algorithms and tools
new_input_handlesthe new input data handles added by this call
new_output_handlesthe new output data handles added by this call
Returns
true if the consumer did update its handles, false otherwise

Implements IDynamicDataConsumer.

◆ 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_classificationDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_classificationDecoratorKey {this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"}
private

Definition at line 62 of file TruthCollectionMaker.h.

◆ m_classificationReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_classificationReadDecorKey {this, "inputClassification", m_particlesKey, "Classification", "Classification code"}
private

Definition at line 79 of file TruthCollectionMaker.h.

◆ m_daughterIDDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_daughterIDDecoratorKey {this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"}
private

Definition at line 66 of file TruthCollectionMaker.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_do_compress

Gaudi::Property<bool> DerivationFramework::TruthCollectionMaker::m_do_compress {this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"}
private

Definition at line 47 of file TruthCollectionMaker.h.

◆ m_do_sherpa

Gaudi::Property<bool> DerivationFramework::TruthCollectionMaker::m_do_sherpa {this, "Do_Sherpa", false, "Checks if there are truth W bosons in the current record. If not, tries to combine W daughters to create one"}
private

Definition at line 49 of file TruthCollectionMaker.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_hadronOriginDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_hadronOriginDecoratorKey {this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"}
private

Definition at line 68 of file TruthCollectionMaker.h.

◆ m_keep_navigation_info

Gaudi::Property<bool> DerivationFramework::TruthCollectionMaker::m_keep_navigation_info {this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"}
private

Definition at line 51 of file TruthCollectionMaker.h.

◆ m_linkDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_linkDecoratorKey {this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"}
private

Definition at line 54 of file TruthCollectionMaker.h.

◆ m_metaStore

ServiceHandle<StoreGateSvc> DerivationFramework::TruthCollectionMaker::m_metaStore
private

Handle on the metadata store for init.

Definition at line 82 of file TruthCollectionMaker.h.

◆ m_motherIDDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_motherIDDecoratorKey {this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"}
private

Definition at line 64 of file TruthCollectionMaker.h.

◆ m_npasspart

std::atomic<unsigned int> DerivationFramework::TruthCollectionMaker::m_npasspart
private

Definition at line 38 of file TruthCollectionMaker.h.

◆ m_ntotpart

std::atomic<unsigned int> DerivationFramework::TruthCollectionMaker::m_ntotpart
mutableprivate

Definition at line 38 of file TruthCollectionMaker.h.

◆ m_originDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_originDecoratorKey {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
private

Definition at line 56 of file TruthCollectionMaker.h.

◆ m_originReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_originReadDecorKey {this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"}
private

Definition at line 73 of file TruthCollectionMaker.h.

◆ m_outcomeDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_outcomeDecoratorKey {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
private

Definition at line 60 of file TruthCollectionMaker.h.

◆ m_outcomeReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_outcomeReadDecorKey {this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"}
private

Definition at line 77 of file TruthCollectionMaker.h.

◆ m_outputParticlesKey

SG::WriteHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_outputParticlesKey {this, "NewCollectionName", "OutputTruthCollection", "WriteHandleKey for new TruthParticleContainer"}
private

Definition at line 42 of file TruthCollectionMaker.h.

◆ m_parser

std::conditional< NUM_PARSER == 1, std::unique_ptr<ExpressionParsing::ExpressionParser>, std::array< std::unique_ptr<ExpressionParsing::ExpressionParser>, NUM_PARSER> >::type ExpressionParserUserBase< AthAlgTool , NUM_PARSER >::m_parser
protectedinherited

Definition at line 100 of file ExpressionParserUser.h.

◆ m_particlesKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_particlesKey {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"}
private

Definition at line 40 of file TruthCollectionMaker.h.

◆ m_partString

Gaudi::Property<std::string> DerivationFramework::TruthCollectionMaker::m_partString {this, "ParticleSelectionString", "", "ExpressionEvaluation string for particle selection"}
private

Definition at line 45 of file TruthCollectionMaker.h.

◆ m_proxyLoaders

std::unique_ptr<ExpressionParsing::IProxyLoader> ExpressionParserUserBase< AthAlgTool , NUM_PARSER >::m_proxyLoaders
protectedinherited

Definition at line 97 of file ExpressionParserUser.h.

◆ m_renounce

std::vector<std::string> ExpressionParserUserBase< AthAlgTool , NUM_PARSER >::m_renounce
protectedinherited

Definition at line 102 of file ExpressionParserUser.h.

◆ m_typeDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_typeDecoratorKey {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
private

Definition at line 58 of file TruthCollectionMaker.h.

◆ m_typeReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_typeReadDecorKey {this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"}
private

Definition at line 75 of file TruthCollectionMaker.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.

◆ m_xAODProxyLoader

ExpressionParsing::SGxAODProxyLoader* ExpressionParserUserBase< AthAlgTool , NUM_PARSER >::m_xAODProxyLoader
protectedinherited

The expression parser.

Definition at line 96 of file ExpressionParserUser.h.


The documentation for this class was generated from the following files:
xAOD::TruthVertex_v1::nOutgoingParticles
size_t nOutgoingParticles() const
Get the number of outgoing particles.
ExpressionParserUserBase< AthAlgTool, 1 >::finalizeParser
StatusCode finalizeParser()
xAOD::TruthParticle_v1::setStatus
void setStatus(int value)
Set status code.
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DerivationFramework::TruthCollectionMaker::m_daughterIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
Definition: TruthCollectionMaker.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle< xAOD::TruthParticleContainer >
xAOD::TruthParticle_v1::setE
void setE(float value)
Set the energy of the particle.
Definition: TruthParticle_v1.cxx:235
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ExpressionParserUserBase< AthAlgTool, 1 >::m_parser
std::conditional< NUM_PARSER==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > >::type m_parser
Definition: ExpressionParserUser.h:100
xAOD::TruthParticle_v1::setBarcode
void setBarcode(int value)
Set barcode.
DerivationFramework::TruthCollectionMaker::m_do_sherpa
Gaudi::Property< bool > m_do_sherpa
Definition: TruthCollectionMaker.h:50
DerivationFramework::TruthCollectionMaker::m_outcomeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
Definition: TruthCollectionMaker.h:61
DerivationFramework::TruthCollectionMaker::m_do_compress
Gaudi::Property< bool > m_do_compress
Definition: TruthCollectionMaker.h:48
HepMC::INVALID_PARTICLE_ID
constexpr int INVALID_PARTICLE_ID
Definition: MagicNumbers.h:57
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
DerivationFramework::TruthCollectionMaker::m_typeReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeReadDecorKey
Definition: TruthCollectionMaker.h:76
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
DerivationFramework::TruthCollectionMaker::m_particlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
Definition: TruthCollectionMaker.h:41
xAOD::TruthParticle_v1::setPx
void setPx(float value)
Set the x component of the particle's momentum.
SG::ConstAccessor< int >
DerivationFramework::TruthCollectionMaker::m_hadronOriginDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_hadronOriginDecoratorKey
Definition: TruthCollectionMaker.h:69
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::TruthCollectionMaker::m_npasspart
std::atomic< unsigned int > m_npasspart
Definition: TruthCollectionMaker.h:38
isSMLepton
bool isSMLepton(const T &p)
Definition: AtlasPID.h:183
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:69
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
MC::isPhysical
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
Definition: HepMCHelpers.h:51
xAOD::TruthParticle_v1::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
xAOD::TruthParticle_v1::setM
void setM(float value)
Also store the mass.
Definition: TruthParticle_v1.cxx:241
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
lumiFormat.i
int i
Definition: lumiFormat.py:85
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.
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
isZ
bool isZ(const T &p)
Definition: AtlasPID.h:352
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition: TruthParticle_v1.cxx:74
xAOD::TruthParticle_v1::setPy
void setPy(float value)
Set the y component of the particle's momentum.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::TruthCollectionMaker::m_classificationDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
Definition: TruthCollectionMaker.h:63
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::TruthVertex_v1::incomingParticle
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
Definition: TruthVertex_v1.cxx:69
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
DerivationFramework::TruthCollectionMaker::m_typeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
Definition: TruthCollectionMaker.h:59
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::TruthCollectionMaker::m_originReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originReadDecorKey
Definition: TruthCollectionMaker.h:74
DerivationFramework::TruthCollectionMaker::m_ntotpart
std::atomic< unsigned int > m_ntotpart
Definition: TruthCollectionMaker.h:38
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
ExpressionParserUser< AthAlgTool >::initializeParser
StatusCode initializeParser(const ExpressionParsing::SelectionArg< 1 > &selection_string)
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
DerivationFramework::TruthCollectionMaker::m_linkDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_linkDecoratorKey
Definition: TruthCollectionMaker.h:55
ExpressionParserUser< AthAlgTool >
xAOD::TruthParticle_v1::setPdgId
void setPdgId(int pid)
Set PDG ID code.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DerivationFramework::TruthCollectionMaker::m_keep_navigation_info
Gaudi::Property< bool > m_keep_navigation_info
Definition: TruthCollectionMaker.h:52
DerivationFramework::TruthCollectionMaker::m_outputParticlesKey
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
Definition: TruthCollectionMaker.h:43
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
isW
bool isW(const T &p)
Definition: AtlasPID.h:355
runIDAlign.accumulate
accumulate
Update flags based on parser line args.
Definition: runIDAlign.py:63
a
TList * a
Definition: liststreamerinfos.cxx:10
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::TruthVertex_v1::nIncomingParticles
size_t nIncomingParticles() const
Get the number of incoming particles.
Definition: TruthVertex_v1.cxx:47
xAOD::TruthParticle_v1::setPz
void setPz(float value)
Set the z component of the particle's momentum.
DerivationFramework::TruthCollectionMaker::m_outcomeReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeReadDecorKey
Definition: TruthCollectionMaker.h:78
DerivationFramework::TruthCollectionMaker::m_originDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
Definition: TruthCollectionMaker.h:57
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
entries
double entries
Definition: listroot.cxx:49
DerivationFramework::TruthCollectionMaker::m_metaStore
ServiceHandle< StoreGateSvc > m_metaStore
Handle on the metadata store for init.
Definition: TruthCollectionMaker.h:82
DerivationFramework::TruthCollectionMaker::m_motherIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
Definition: TruthCollectionMaker.h:65
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
dqBeamSpot.nEntries
int nEntries
Definition: dqBeamSpot.py:73
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:119
DerivationFramework::TruthCollectionMaker::m_classificationReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationReadDecorKey
Definition: TruthCollectionMaker.h:80
fitman.k
k
Definition: fitman.py:528
DerivationFramework::TruthCollectionMaker::m_partString
Gaudi::Property< std::string > m_partString
Definition: TruthCollectionMaker.h:46