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

#include <EtaPtFilterTool.h>

Inheritance diagram for EtaPtFilterTool:
Collaboration diagram for EtaPtFilterTool:

Public Member Functions

 EtaPtFilterTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor with parameters: More...
 
virtual ~EtaPtFilterTool ()
 Destructor: More...
 
StatusCode buildMcAod (const McEventCollection *in, McEventCollection *out)
 This method will check the validity of the input McEventCollection and build a filtered one from the strategy implemented by this concrete tool. More...
 
StatusCode initialize ()
 Athena Algorithm's Hooks. More...
 
StatusCode execute ()
 
StatusCode finalize ()
 
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 ()
 Inline methods:
More...
 

Protected Types

using ParticleMap_t = std::unordered_map< const HepMC::GenParticle *, HepMC::GenParticlePtr >
 
using VertexMap_t = std::unordered_map< const HepMC::GenVertex *, HepMC::GenVertexPtr >
 
typedef ToolHandle< IMcVtxFilterToolMcVtxFilterTool_t
 
typedef ToolHandle< ITruthIsolationToolIsolTool_t
 

Protected Member Functions

 EtaPtFilterTool ()
 Default constructor: More...
 
StatusCode buildGenEvent (const HepMC::GenEvent *in, HepMC::GenEvent *out)
 This method will check the validity of the input HepMC::GenEvent and build a filtered one from the strategy implemented by this concrete tool. More...
 
bool isAccepted (const HepMC::ConstGenParticlePtr &mcPart) const
 Check if a given particle is within the acceptance (pt+eta) More...
 
bool isAccepted (const HepMC::ConstGenVertexPtr &vtx) const
 Check if a given vertex has at least one in-going or out-going particle within the acceptance (pt+eta) More...
 
StatusCode addVertex (const HepMC::ConstGenVertexPtr &srcVtx, HepMC::GenEvent *evt, VertexMap_t &vmap, ParticleMap_t &pmap, bool isSignalVertex=false) const
 Helper method to copy a given vertex and add it to a GenEvent. More...
 
bool isPartonVertex (const HepMC::ConstGenVertexPtr &vtx) const
 
bool isFromHardScattering (const HepMC::ConstGenVertexPtr &vtx) const
 
StatusCode initializeTool ()
 Method to initialize the tool: we need to check the validity of the parameters given for the inner and outer eta regions. More...
 
void setupInnerEtaRegionCuts (Gaudi::Details::PropertyBase &innerEtaRegionCuts)
 Callback function to setup the "InnerEtaRegionCuts" property. More...
 
void setupOuterEtaRegionCuts (Gaudi::Details::PropertyBase &outerEtaRegionCuts)
 Callback function to setup the "OuterEtaRegionCuts" property. More...
 
virtual StatusCode finalizeTool ()
 
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

DoubleArrayProperty m_innerEtaRegionCuts
 vector of cuts parameters for the inner region delimited in |eta| 0-th element is the minimum |eta| of this region 1-st element is the maximum |eta| of this region 2-nd element is the minimum pt for the stable particles to be accepted More...
 
DoubleArrayProperty m_outerEtaRegionCuts
 vector of cuts parameters for the outer region delimited in |eta| 0-th element is the minimum |eta| of this region 1-st element is the maximum |eta| of this region 2-nd element is the minimum pt for the stable particles to be accepted More...
 
BooleanProperty m_onlyGenerator
 Switch to only include particles from generation and reject particles from detector simulation (Geant4) More...
 
BooleanProperty m_butKeepAllGeneratorStable
 Switch to keep all stable generator particles (IsGenStable) regardless what eta or pt cuts are defined. More...
 
BooleanProperty m_keepDocumentaries
 Switch to keep all generator particles which are documentaries (statuscode == 3) More...
 
BooleanProperty m_keepAllLeptons
 Switch to keep all leptons - i.e. More...
 
std::map< int, double > m_isol_energies
 
McVtxFilterTool_t m_mcVtxFilterTool
 Pointer to the McVtxFilterTool to be able to select additional vertices on some decay pattern criterion. More...
 
IsolTool_t m_isolationTool
 Pointer to the TruthIsolationTool to be able to compute transverse energy isolations for various isolation cones cuts. More...
 
BooleanProperty m_doEtIsolation
 Switch to compute or not the Et-isolations for TruthParticle (and their underlying HepMC::GenParticle). More...
 
SG::ReadHandleKey< McEventCollectionm_mcEventsReadHandleKey {this,"McEvents","TruthEvent","ReadHandleKey for input McEventCollection one wants to filter"}
 ReadHandleKey for the input McEventCollection one wants to filter. More...
 
SG::WriteHandleKey< McEventCollectionm_mcEventsOutputWriteHandleKey {this,"McEventsOutput","GEN_AOD","WriteHandleKey for the output McEventCollection which has been filtered"}
 Location of the output McEventCollection which has been filtered. More...
 

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

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 23 of file EtaPtFilterTool.h.

Member Typedef Documentation

◆ IsolTool_t

typedef ToolHandle<ITruthIsolationTool> TruthParticleFilterBaseTool::IsolTool_t
protectedinherited

Definition at line 80 of file TruthParticleFilterBaseTool.h.

◆ McVtxFilterTool_t

typedef ToolHandle<IMcVtxFilterTool> TruthParticleFilterBaseTool::McVtxFilterTool_t
protectedinherited

Definition at line 74 of file TruthParticleFilterBaseTool.h.

◆ ParticleMap_t

Definition at line 53 of file EtaPtFilterTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ VertexMap_t

using EtaPtFilterTool::VertexMap_t = std::unordered_map<const HepMC::GenVertex*, HepMC::GenVertexPtr>
protected

Definition at line 55 of file EtaPtFilterTool.h.

Constructor & Destructor Documentation

◆ EtaPtFilterTool() [1/2]

EtaPtFilterTool::EtaPtFilterTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor with parameters:

Constructors.

Definition at line 34 of file EtaPtFilterTool.cxx.

36  :
38 {
39  //
40  // Property declaration
41  //
42  //declareProperty( "Property", m_nProperty );
43 
44  declareProperty( "InnerEtaRegionCuts",
46  "Vector of cuts parameters for the inner region.\n"
47  "Two first elements are minimum and maximum |eta| values "
48  "for this inner region.\n"
49  "Third element is the minimum pT for the stable particles "
50  "to be accepted." );
51  // defaults
52  std::vector<double> innerEtaRegionCuts;
53  innerEtaRegionCuts.push_back( 0.0 ); // minimum |eta|
54  innerEtaRegionCuts.push_back( 3.5 ); // maximum |eta|
55  innerEtaRegionCuts.push_back( 0.3*GeV ); // minimum pT of particles
56  m_innerEtaRegionCuts.set( innerEtaRegionCuts );
57 
59  this );
60 
61  declareProperty( "OuterEtaRegionCuts",
63  "Vector of cuts parameters for the outer region.\n"
64  "Two first elements are minimum and maximum |eta| values "
65  "for this outer region.\n"
66  "Third element is the minimum pT for the stable particles "
67  "to be accepted." );
68  // defaults
69  std::vector<double> outerEtaRegionCuts;
70  outerEtaRegionCuts.push_back( 3.5 ); // minimum |eta|
71  outerEtaRegionCuts.push_back( 5.5 ); // maximum |eta|
72  outerEtaRegionCuts.push_back( 1.0*GeV ); // minimum pT of particles
73  m_outerEtaRegionCuts.set( outerEtaRegionCuts );
74 
76  this );
77 
78  // switches
79  declareProperty( "OnlyGenerator",
80  m_onlyGenerator = false,
81  "Switch to only include particles from generation and "
82  "reject particles from detector simulation (Geant4)" );
83 
84 
85  declareProperty( "ButKeepAllGeneratorStable",
87  "Switch to keep all generated stable particles (they sum to "
88  "14 TeV) regardless of the eta and pt cuts defined for the "
89  "remaining particles" );
90 
91 
92  declareProperty( "KeepDocumentaries",
93  m_keepDocumentaries = true,
94  "Switch to keep *all* generator particles which are "
95  "documentaries (statuscode == 3)" );
96 
97  declareProperty( "KeepAllLeptons",
98  m_keepAllLeptons = true,
99  "Switch to keep *all* leptons - i.e. do not apply kinematic cuts on them");
100 
101 }

◆ ~EtaPtFilterTool()

EtaPtFilterTool::~EtaPtFilterTool ( )
virtual

Destructor:

Destructor.

Definition at line 105 of file EtaPtFilterTool.cxx.

106 {
107  ATH_MSG_DEBUG("Calling destructor");
108 }

◆ EtaPtFilterTool() [2/2]

EtaPtFilterTool::EtaPtFilterTool ( )
protected

Default constructor:

Member Function Documentation

◆ addVertex()

StatusCode EtaPtFilterTool::addVertex ( const HepMC::ConstGenVertexPtr srcVtx,
HepMC::GenEvent *  evt,
VertexMap_t vmap,
ParticleMap_t pmap,
bool  isSignalVertex = false 
) const
protected

Helper method to copy a given vertex and add it to a GenEvent.

Fill the parent branch

Fill the children branch

Definition at line 295 of file EtaPtFilterTool.cxx.

299 {
300  if ( 0 == srcVtx || 0 == evt ) {
301  ATH_MSG_ERROR("In addVertex(vtx,evt) : INVALID pointer given !!" << endmsg << " vtx: " << srcVtx << endmsg << " evt: " << evt);
302  return StatusCode::FAILURE;
303  }
304 #ifdef HEPMC3
305  HepMC::GenVertexPtr& vtx = vmap[srcVtx.get()];
306  if ( !vtx ) {
307  vtx = HepMC::newGenVertexPtr();
308  evt->add_vertex(vtx);
309  vtx->set_position( srcVtx->position() );
310  vtx->set_status( srcVtx->status() );
312  vtx->add_attribute("weights",srcVtx->attribute<HepMC3::VectorDoubleAttribute> ("weights"));
313  if (isSignalVertex) HepMC::set_signal_process_vertex(evt,vtx);
314  }
317  for ( auto parent: srcVtx->particles_in()) {
318  HepMC::GenParticlePtr& p = pmap[parent.get()];
319  if ( !p ) {
321  vtx->add_particle_in( p );
322  p->set_momentum( parent->momentum() );
323  p->set_generated_mass( parent->generated_mass() );
324  p->set_pdg_id( parent->pdg_id() );
325  p->set_status( parent->status() );
326  HepMC::set_flow(p, HepMC::flow(parent) );
329  }
330  // set the mother's decay to our (new) vertex
331  vtx->add_particle_in( p );
332 
333  }//> loop over ingoing particles
334 
337  for (auto child: srcVtx->particles_out()) {
338  HepMC::GenParticlePtr& p = pmap[child.get()];
339  if ( !p ) {
341  vtx->add_particle_out( p );
342  p->set_momentum( child->momentum() );
343  p->set_generated_mass( child->generated_mass() );
344  p->set_pdg_id( child->pdg_id() );
345  if ( m_butKeepAllGeneratorStable && !isAccepted(child) && MC::isDecayed(child) )
346  p->set_status( HepMC::SPECIALSTATUS ) ;
347  else
348  p->set_status( child->status() );
349  HepMC::set_flow(p, HepMC::flow(child) );
352  }
353  // set the daughter's production vertex to our new vertex
354  vtx->add_particle_out( p );
355  }//> loop over outgoing particles
356 #else
357 
358  HepMC::GenVertexPtr& vtx = vmap[srcVtx];
359  if ( !vtx ) {
360  vtx = new HepMC::GenVertex();
361  vtx->set_position( srcVtx->position() );
362  vtx->set_id( srcVtx->id() );
363  vtx->suggest_barcode( srcVtx->barcode() );
364  vtx->weights() = srcVtx->weights();
365  evt->add_vertex(vtx);
366  if (isSignalVertex) evt->set_signal_process_vertex(vtx);
367  }
368 
371  for ( HepMC::GenVertex::particles_in_const_iterator
372  parent = srcVtx->particles_in_const_begin(),
373  parentEnd = srcVtx->particles_in_const_end();
374  parent != parentEnd;
375  ++parent ) {
376  HepMC::GenParticlePtr& p = pmap[*parent];
377  if ( !p ) {
378  p = new HepMC::GenParticle;
379  p->set_momentum( (*parent)->momentum() );
380  p->set_generated_mass( (*parent)->generated_mass() );
381  p->set_pdg_id( (*parent)->pdg_id() );
382  p->set_status( (*parent)->status() );
383  p->set_flow( (*parent)->flow() );
384  p->set_polarization( (*parent)->polarization() );
385  p->suggest_barcode( (*parent)->barcode() );
386  }
387  // set the mother's decay to our (new) vertex
388  vtx->add_particle_in( p );
389 
390  }//> loop over ingoing particles
391 
394  for ( HepMC::GenVertex::particles_out_const_iterator
395  child = srcVtx->particles_out_const_begin(),
396  childEnd = srcVtx->particles_out_const_end();
397  child != childEnd;
398  ++child ) {
399  HepMC::GenParticlePtr& p = pmap[*child];
400  if ( !p ) {
401  p = new HepMC::GenParticle;
402  p->set_momentum( (*child)->momentum() );
403  p->set_generated_mass( (*child)->generated_mass() );
404  p->set_pdg_id( (*child)->pdg_id() );
405  if ( m_butKeepAllGeneratorStable && !isAccepted(*child) && MC::isDecayed(*child) )
406  p->set_status( HepMC::SPECIALSTATUS );
407  else
408  p->set_status( (*child)->status() );
409  p->set_flow( (*child)->flow() );
410  p->set_polarization( (*child)->polarization() );
411  p->suggest_barcode( (*child)->barcode() );
412  }
413 
414  // set the daughter's production vertex to our new vertex
415  vtx->add_particle_out( p );
416 
417  }//> loop over outgoing particles
418 #endif
419 
420  return StatusCode::SUCCESS;
421 }

◆ buildGenEvent()

StatusCode EtaPtFilterTool::buildGenEvent ( const HepMC::GenEvent *  in,
HepMC::GenEvent *  out 
)
protected

This method will check the validity of the input HepMC::GenEvent and build a filtered one from the strategy implemented by this concrete tool.

Const methods:

Definition at line 155 of file EtaPtFilterTool.cxx.

156 {
157  if ( nullptr == in || nullptr == out ) {
158  ATH_MSG_ERROR("Invalid pointer to GenEvent !!" << endmsg
159  << " in: " << in << endmsg
160  << " out: " << out);
161  return StatusCode::FAILURE;
162  }
163 
164  // loop over vertices
165  VertexMap_t vmap;
166  ParticleMap_t pmap;
167  auto spv = HepMC::signal_process_vertex(in); //AV To be removed in the future
168 #ifdef HEPMC3
169  for ( auto vtx: in->vertices() ) {
170 #else
171  for ( HepMC::GenEvent::vertex_const_iterator vtxit = in->vertices_begin(); vtxit != in->vertices_end(); ++vtxit ) {
172  auto vtx=*vtxit;
173 #endif
174  bool isSignalVertex = (vtx == spv);
175  if ( !isAccepted(vtx) && !isSignalVertex ) {
176  // no in-going nor out-going particles at this vertex matches
177  // the requirements nor it is a signal process vertex : ==> Skip it
178  continue;
179  }
180 
181  if ( addVertex( vtx, out, vmap, pmap, isSignalVertex ).isFailure() )
182  {
183  ATH_MSG_WARNING("Could not add vertex " << vtx );
184  }
185 
186  } //> end loop over vertices
187 
188  return StatusCode::SUCCESS;
189 }

◆ buildMcAod()

StatusCode EtaPtFilterTool::buildMcAod ( const McEventCollection in,
McEventCollection out 
)
virtual

This method will check the validity of the input McEventCollection and build a filtered one from the strategy implemented by this concrete tool.

Implements ITruthParticleFilterTool.

Definition at line 111 of file EtaPtFilterTool.cxx.

112 {
113  if ( !in || !out ) {
114  ATH_MSG_ERROR("Invalid pointer to McEventCollection !" << endmsg
115  << " in: " << in << endmsg
116  << " out: " << out);
117  return StatusCode::FAILURE;
118  }
119 
120  for ( unsigned int iEvt = 0; iEvt != in->size(); ++iEvt ) {
121  const HepMC::GenEvent * inEvt = (*in)[iEvt];
122  if ( 0 == inEvt ) {
124  ("Could not launch filtering procedure for GenEvent number ["
125  << iEvt << "] from McEventCollection ["
126  << m_mcEventsReadHandleKey.key() << " !!"
127  << endmsg
128  << " inEvt: " << inEvt);
129  continue;
130  }
131  HepMC::GenEvent* outEvt = HepMC::copyemptyGenEvent( inEvt);
132 
133  if ( buildGenEvent( inEvt, outEvt ).isFailure() ) {
134  ATH_MSG_ERROR("Could filter GenEvent number [" << iEvt
135  << "] from McEventCollection [" << m_mcEventsReadHandleKey.key()
136  << "] !!");
137  delete outEvt;
138  outEvt = 0;
139  continue;
140  }
141 
142  TruthHelper::copyBeamParticles (*inEvt, *outEvt);
143 
144  out->push_back( outEvt );
145  }
146 
147  return StatusCode::SUCCESS;
148 }

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

◆ execute()

StatusCode TruthParticleFilterBaseTool::execute ( )
virtualinherited

Implements ITruthParticleFilterTool.

Definition at line 120 of file TruthParticleFilterBaseTool.cxx.

121 {
122  ATH_MSG_DEBUG("Executing " << name() << "...");
123 
124  //Setup Handle to read input container
126 
127  if (!mcEventsReadHandle.isValid()){
128  ATH_MSG_ERROR("Invalid ReadHandle to McEventColleciton with key: " << m_mcEventsReadHandleKey.key());
129  return StatusCode::FAILURE;
130  }
131 
132  //Setup WriteHandle, and then record new McEventCollection.
134  ATH_CHECK(mcEventsOutputWriteHandle.record(std::make_unique<McEventCollection>()));
135 
136  if (!mcEventsOutputWriteHandle.isValid()){
137  ATH_MSG_ERROR("Invalid WriteHamdle for McEventCollection with key ["
138  <<m_mcEventsOutputWriteHandleKey.key() << "] !!");
139  return StatusCode::FAILURE;
140  }
141 
142  // Compute isolation for gamma/lepton.
143  if ( m_doEtIsolation.value() ) {
144  ATH_MSG_VERBOSE("Computing Et isolations...");
145  if ( m_isolationTool->buildEtIsolations(m_mcEventsReadHandleKey.key()).isFailure() ) {
146  ATH_MSG_ERROR("Could not compute Et isolations !!");
147  return StatusCode::FAILURE;
148  }
149  } //> end do Et-isolation
150 
151  if ( this->buildMcAod( mcEventsReadHandle.ptr(), mcEventsOutputWriteHandle.ptr() ).isFailure() ) {
152  ATH_MSG_ERROR("Could not buildMcAod(in,out) !!");
153  return StatusCode::FAILURE;
154  }
155 
156  // We have slimmed the mcEventsOutputWriteHandle.
157  // To not bias the map of isolation energies for this GenEvent, we alias
158  // it to its original one
159  if ( m_doEtIsolation.value() &&
162  ).isSuccess() ) {
163  ATH_MSG_WARNING("Could not create an alias in the map of "\
164  "isolation energies !");
165  }
166 
167  return StatusCode::SUCCESS;
168 }

◆ 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 TruthParticleFilterBaseTool::finalize ( )
virtualinherited

Implements ITruthParticleFilterTool.

Definition at line 105 of file TruthParticleFilterBaseTool.cxx.

106 {
107  ATH_MSG_INFO("Finalizing " << name() << "...");
108 
109  m_mcVtxFilterTool->stats();
110 
111  // Give the concrete (derived) tool a chance to finalize itself
112  if ( finalizeTool().isFailure() ) {
113  ATH_MSG_ERROR("Could not finalize concrete tool !");
114  return StatusCode::FAILURE;
115  }
116 
117  return StatusCode::SUCCESS;
118 }

◆ finalizeTool()

StatusCode TruthParticleFilterBaseTool::finalizeTool ( )
inlineprotectedvirtualinherited

Definition at line 124 of file TruthParticleFilterBaseTool.h.

125 {
126  return StatusCode::SUCCESS;
127 }

◆ initialize()

StatusCode TruthParticleFilterBaseTool::initialize ( )
virtualinherited

Athena Algorithm's Hooks.

Retrieves a private AlgTool to filter a McEventCollection

Retrieves the isolation tool (public, to be used also in TruthParticleCnvTool)

Implements ITruthParticleFilterTool.

Definition at line 65 of file TruthParticleFilterBaseTool.cxx.

66 {
67  ATH_MSG_INFO("Initializing " << name() << "...");
68 
70  if ( !m_mcVtxFilterTool.retrieve().isSuccess() ) {
71  ATH_MSG_ERROR("Creation of algTool IMcVtxFilterTool FAILED !");
72  return StatusCode::FAILURE;
73  }
74 
76  if( m_doEtIsolation.value()) {
77  ATH_CHECK(m_isolationTool.retrieve());
78  }
79  else {
80  m_isolationTool.disable();
81  }
82 
83  //initialize DataHandleKeys
86 
88  (" DoEtIsolations: [" << std::boolalpha << m_doEtIsolation.value()
89  << "]" << endmsg
90  << " McEvents: [" << m_mcEventsReadHandleKey.key() << "]" << endmsg
91  << " McEventsOutput: [" << m_mcEventsOutputWriteHandleKey.key() << "]");
92 
93  // Give the concrete (derived) tool a chance to initialize itself
94  if ( initializeTool().isFailure() ) {
95  ATH_MSG_ERROR("Could not initialize concrete tool !");
96  return StatusCode::FAILURE;
97  }
98 
99  ATH_MSG_INFO("Options of the McVtxFilterTool:");
100  m_mcVtxFilterTool->displayOptions();
101 
102  return StatusCode::SUCCESS;
103 }

◆ initializeTool()

StatusCode EtaPtFilterTool::initializeTool ( )
protectedvirtual

Method to initialize the tool: we need to check the validity of the parameters given for the inner and outer eta regions.

Non-const methods:

Reimplemented from TruthParticleFilterBaseTool.

Definition at line 465 of file EtaPtFilterTool.cxx.

466 {
467  ATH_MSG_INFO("Initializing " << name() << "...");
468 
469  // make sure the properties are synchronised
472 
473  if ( m_innerEtaRegionCuts.value().size() != 3 ||
474  m_outerEtaRegionCuts.value().size() != 3 ) {
476  ("Wrong size for eta regions cut :" << endmsg
477  << "\tinner region: " << m_innerEtaRegionCuts.value().size()
478  << endmsg
479  << "\touter region: " << m_outerEtaRegionCuts.value().size()
480  << endmsg
481  << "You have to provide a list of cuts of the form : " << endmsg
482  << " |etaMin| |etaMax| ptMin");
483  return StatusCode::FAILURE;
484  }
485 
487  ("Inner Eta region cuts : nCuts = "
488  << m_innerEtaRegionCuts.value().size()
489  << endmsg
490  << "\tetaMin = " << m_innerEtaRegionCuts.value()[0] << endmsg
491  << "\tetaMax = " << m_innerEtaRegionCuts.value()[1] << endmsg
492  << "\tPtMin = " << m_innerEtaRegionCuts.value()[2] << endmsg
493  << "Outer Eta region cuts : nCuts = "
494  << m_outerEtaRegionCuts.value().size()
495  << endmsg
496  << "\tetaMin = " << m_outerEtaRegionCuts.value()[0] << endmsg
497  << "\tetaMax = " << m_outerEtaRegionCuts.value()[1] << endmsg
498  << "\tPtMin = " << m_outerEtaRegionCuts.value()[2]);
499 
500  return StatusCode::SUCCESS;
501 }

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

const InterfaceID & ITruthParticleFilterTool::interfaceID ( )
inlinestaticinherited

Inline methods:

Definition at line 70 of file ITruthParticleFilterTool.h.

71 {
72  return IID_ITruthParticleFilterTool;
73 }

◆ isAccepted() [1/2]

bool EtaPtFilterTool::isAccepted ( const HepMC::ConstGenParticlePtr mcPart) const
protected

Check if a given particle is within the acceptance (pt+eta)

Definition at line 191 of file EtaPtFilterTool.cxx.

192 {
193  if ( ! mc ) {
194  return false;
195  }
196 
197  if ( m_butKeepAllGeneratorStable.value() ) {
198  // static IsGenStable isStable;
199  if ( MC::isStable(mc) ) {
200  return true;
201  }
202  }
203 
204  if ( m_onlyGenerator.value() ) {
205  // helper class to know if a GenParticle has been produced at Generator
206  // level. ie: not at simulation level (Geant4)
207 
209  return false;
210  }
211  }
212 
213  if ( m_keepDocumentaries.value() ) {
214  if ( mc->status() == 3 ) {
215  return true;
216  }
217  }
218 
219  // Skip kinematic cuts for leptons
220  if ( m_keepAllLeptons.value() ) {
221  if ( MC::isLepton(mc) ) {
222  return true;
223  }
224  }
225 
226  const HepMC::FourVector hlv = mc->momentum();
227  const double pt = hlv.perp();
228  const double eta = hlv.pseudoRapidity();
229  if ( ( std::abs( eta ) >= m_innerEtaRegionCuts.value()[0] &&
230  std::abs( eta ) < m_innerEtaRegionCuts.value()[1] &&
231  pt > m_innerEtaRegionCuts.value()[2] )
232 
233  ||
234 
235  ( std::abs( eta ) >= m_outerEtaRegionCuts.value()[0] &&
236  std::abs( eta ) < m_outerEtaRegionCuts.value()[1] &&
237  pt > m_outerEtaRegionCuts.value()[2] ) ) {
238  return true;
239  } else {
240  return false;
241  }
242 }

◆ isAccepted() [2/2]

bool EtaPtFilterTool::isAccepted ( const HepMC::ConstGenVertexPtr vtx) const
protected

Check if a given vertex has at least one in-going or out-going particle within the acceptance (pt+eta)

Definition at line 244 of file EtaPtFilterTool.cxx.

245 {
246  if ( !vtx ) {
247  return false;
248  }
249 
250  // check if this vertex looks like a vertex from the hard-scattering
251  if ( isFromHardScattering(vtx) ) {
252  return true;
253  }
254 
255  // check if this vertex matches some decay pattern given
256  // to the McVtxFilterTool
257  if ( m_mcVtxFilterTool->isAccepted(vtx) ) {
258  return true;
259  }
260 
261  // ///////////////////////////////////////////////////////////////////////
262  // Now we check if at least one in- or out-going particle can be accepted.
263  // If yes, then we accept the entire vertex
264  //
265 #ifdef HEPMC3
266  // check the parent branch
267  for ( const auto& p: vtx->particles_in() ) {
268  if ( isAccepted(p) ) {
269  return true;
270  }
271  }//> end loop over parents
272 #else
273  // check the parent branch
274  for ( HepMC::GenVertex::particles_in_const_iterator
275  p = vtx->particles_in_const_begin(),
276  pEnd = vtx->particles_in_const_end();
277  p != pEnd;
278  ++p ) {
279  if ( isAccepted(*p) ) {
280  return true;
281  }
282  }//> end loop over parents
283 #endif
284 
285  // check the child branch
286  for ( auto p : *vtx) {
287  if ( isAccepted(p) ) {
288  return true;
289  }
290  }//> end loop over children
291 
292  return false;
293 }

◆ isFromHardScattering()

bool EtaPtFilterTool::isFromHardScattering ( const HepMC::ConstGenVertexPtr vtx) const
protected

Definition at line 447 of file EtaPtFilterTool.cxx.

448 {
449  int partonsin = 0;
450  int showerout = 0;
451 #ifdef HEPMC3
452  for (auto& p: vtx->particles_in()) if (MC::isQuark(p) || MC::isGluon(p)) partonsin++;
453 #else
454  for (auto p = vtx->particles_in_const_begin();p!=vtx->particles_in_const_end();++p ) if (MC::isQuark(*p) || MC::isGluon(*p)) partonsin++;
455 #endif
456  for (auto& p: *vtx) if (p->pdg_id() == 91||p->pdg_id() == 92||p->pdg_id() == 94) showerout++;
457 
458  return isPartonVertex(vtx) && (partonsin >= 2) && (showerout == 0);
459 }

◆ isPartonVertex()

bool EtaPtFilterTool::isPartonVertex ( const HepMC::ConstGenVertexPtr vtx) const
protected

Definition at line 423 of file EtaPtFilterTool.cxx.

424 {
425  if (!vtx) return false;
426 #ifdef HEPMC3
427  for (auto& p: vtx->particles_in()) {
428  if (MC::isHadron(p)&&!MC::isBeam(p)) return false;
429  auto pv = p->production_vertex();
430  if (pv && !isPartonVertex(pv)) return false;
431  }
432  for (auto& p: vtx->particles_out()) {
433  if (MC::isHadron(p)&&!MC::isBeam(p)) return false;
434  }
435 #else
436  for ( auto p = vtx->particles_in_const_begin(), parentEnd = vtx->particles_in_const_end(); p != parentEnd; ++p ) {
437  if (MC::isHadron(*p)&&!MC::isBeam(*p)) return false;
438  auto pv = (*p)->production_vertex();
439  if (pv && !isPartonVertex(pv)) return false;
440 }
441 for ( auto p = vtx->particles_out_const_begin(), parentEnd = vtx->particles_out_const_end(); p != parentEnd; ++p ) {
442  if (MC::isHadron(*p)&&!MC::isBeam(*p)) return false;
443  }
444 #endif
445  return true;
446 }

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

◆ setupInnerEtaRegionCuts()

void EtaPtFilterTool::setupInnerEtaRegionCuts ( Gaudi::Details::PropertyBase &  innerEtaRegionCuts)
protected

Callback function to setup the "InnerEtaRegionCuts" property.

Definition at line 503 of file EtaPtFilterTool.cxx.

504 {
505  return;
506 }

◆ setupOuterEtaRegionCuts()

void EtaPtFilterTool::setupOuterEtaRegionCuts ( Gaudi::Details::PropertyBase &  outerEtaRegionCuts)
protected

Callback function to setup the "OuterEtaRegionCuts" property.

Definition at line 508 of file EtaPtFilterTool.cxx.

509 {
510  return;
511 }

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

BooleanProperty EtaPtFilterTool::m_butKeepAllGeneratorStable
protected

Switch to keep all stable generator particles (IsGenStable) regardless what eta or pt cuts are defined.

Definition at line 136 of file EtaPtFilterTool.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_doEtIsolation

BooleanProperty TruthParticleFilterBaseTool::m_doEtIsolation
protectedinherited

Switch to compute or not the Et-isolations for TruthParticle (and their underlying HepMC::GenParticle).

Default is to not compute these Et-isolations (and save CPU)

Definition at line 94 of file TruthParticleFilterBaseTool.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_innerEtaRegionCuts

DoubleArrayProperty EtaPtFilterTool::m_innerEtaRegionCuts
protected

vector of cuts parameters for the inner region delimited in |eta| 0-th element is the minimum |eta| of this region 1-st element is the maximum |eta| of this region 2-nd element is the minimum pt for the stable particles to be accepted

Definition at line 119 of file EtaPtFilterTool.h.

◆ m_isol_energies

std::map<int,double> EtaPtFilterTool::m_isol_energies
protected

Definition at line 149 of file EtaPtFilterTool.h.

◆ m_isolationTool

IsolTool_t TruthParticleFilterBaseTool::m_isolationTool
protectedinherited

Pointer to the TruthIsolationTool to be able to compute transverse energy isolations for various isolation cones cuts.

See McParticleEvent/TruthParticleParameters.h for cone cuts.

Definition at line 85 of file TruthParticleFilterBaseTool.h.

◆ m_keepAllLeptons

BooleanProperty EtaPtFilterTool::m_keepAllLeptons
protected

Switch to keep all leptons - i.e.

do not apply kinematic cuts on them

Definition at line 145 of file EtaPtFilterTool.h.

◆ m_keepDocumentaries

BooleanProperty EtaPtFilterTool::m_keepDocumentaries
protected

Switch to keep all generator particles which are documentaries (statuscode == 3)

Definition at line 141 of file EtaPtFilterTool.h.

◆ m_mcEventsOutputWriteHandleKey

SG::WriteHandleKey<McEventCollection> TruthParticleFilterBaseTool::m_mcEventsOutputWriteHandleKey {this,"McEventsOutput","GEN_AOD","WriteHandleKey for the output McEventCollection which has been filtered"}
protectedinherited

Location of the output McEventCollection which has been filtered.

Definition at line 104 of file TruthParticleFilterBaseTool.h.

◆ m_mcEventsReadHandleKey

SG::ReadHandleKey<McEventCollection> TruthParticleFilterBaseTool::m_mcEventsReadHandleKey {this,"McEvents","TruthEvent","ReadHandleKey for input McEventCollection one wants to filter"}
protectedinherited

ReadHandleKey for the input McEventCollection one wants to filter.

Definition at line 100 of file TruthParticleFilterBaseTool.h.

◆ m_mcVtxFilterTool

McVtxFilterTool_t TruthParticleFilterBaseTool::m_mcVtxFilterTool
protectedinherited

Pointer to the McVtxFilterTool to be able to select additional vertices on some decay pattern criterion.

Definition at line 78 of file TruthParticleFilterBaseTool.h.

◆ m_onlyGenerator

BooleanProperty EtaPtFilterTool::m_onlyGenerator
protected

Switch to only include particles from generation and reject particles from detector simulation (Geant4)

Definition at line 131 of file EtaPtFilterTool.h.

◆ m_outerEtaRegionCuts

DoubleArrayProperty EtaPtFilterTool::m_outerEtaRegionCuts
protected

vector of cuts parameters for the outer region delimited in |eta| 0-th element is the minimum |eta| of this region 1-st element is the maximum |eta| of this region 2-nd element is the minimum pt for the stable particles to be accepted

Definition at line 126 of file EtaPtFilterTool.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:
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
EtaPtFilterTool::isPartonVertex
bool isPartonVertex(const HepMC::ConstGenVertexPtr &vtx) const
Definition: EtaPtFilterTool.cxx:423
HepMC::suggest_barcode
bool suggest_barcode(T &p, int i)
Definition: GenEvent.h:548
TruthParticleFilterBaseTool::m_doEtIsolation
BooleanProperty m_doEtIsolation
Switch to compute or not the Et-isolations for TruthParticle (and their underlying HepMC::GenParticle...
Definition: TruthParticleFilterBaseTool.h:94
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
HepMC::polarization
Polarization polarization(const T &a)
Definition: Polarization.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
EtaPtFilterTool::isFromHardScattering
bool isFromHardScattering(const HepMC::ConstGenVertexPtr &vtx) const
Definition: EtaPtFilterTool.cxx:447
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
SG::ReadHandle< McEventCollection >
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ITruthParticleFilterTool::buildMcAod
virtual StatusCode buildMcAod(const McEventCollection *in, McEventCollection *filtered)=0
This method will check the validity of the input McEventCollection and build a filtered one from the ...
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
EtaPtFilterTool::setupInnerEtaRegionCuts
void setupInnerEtaRegionCuts(Gaudi::Details::PropertyBase &innerEtaRegionCuts)
Callback function to setup the "InnerEtaRegionCuts" property.
Definition: EtaPtFilterTool.cxx:503
TruthParticleFilterBaseTool::finalizeTool
virtual StatusCode finalizeTool()
Definition: TruthParticleFilterBaseTool.h:124
test_pyathena.pt
pt
Definition: test_pyathena.py:11
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
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
EtaPtFilterTool::addVertex
StatusCode addVertex(const HepMC::ConstGenVertexPtr &srcVtx, HepMC::GenEvent *evt, VertexMap_t &vmap, ParticleMap_t &pmap, bool isSignalVertex=false) const
Helper method to copy a given vertex and add it to a GenEvent.
Definition: EtaPtFilterTool.cxx:295
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
EtaPtFilterTool::VertexMap_t
std::unordered_map< const HepMC::GenVertex *, HepMC::GenVertexPtr > VertexMap_t
Definition: EtaPtFilterTool.h:56
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
TruthParticleFilterBaseTool::initializeTool
virtual StatusCode initializeTool()
I/O operators.
Definition: TruthParticleFilterBaseTool.h:117
isGluon
bool isGluon(const T &p)
Definition: AtlasPID.h:158
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TruthHelper::copyBeamParticles
void copyBeamParticles(const HepMC::GenEvent &inEvt[[maybe_unused]], HepMC::GenEvent &outEvt[[maybe_unused]])
Definition: copyBeamParticles.cxx:21
isQuark
bool isQuark(const T &p)
PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to dot...
Definition: AtlasPID.h:113
mc
Definition: mc.PG_single_nu_valid.py:1
HepMC::set_signal_process_vertex
void set_signal_process_vertex(GenEvent *e, T v)
Definition: GenEvent.h:528
HepMC::SPECIALSTATUS
constexpr int SPECIALSTATUS
Constant that the meaning of which is currently lost, to be recovered...
Definition: MagicNumbers.h:41
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
HepMC::flow
int flow(const T &a, int i)
Definition: Flow.h:51
EtaPtFilterTool::m_innerEtaRegionCuts
DoubleArrayProperty m_innerEtaRegionCuts
vector of cuts parameters for the inner region delimited in |eta| 0-th element is the minimum |eta| o...
Definition: EtaPtFilterTool.h:119
HepMC::newGenVertexPtr
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
Definition: GenVertex.h:64
TruthParticleFilterBaseTool::m_mcEventsReadHandleKey
SG::ReadHandleKey< McEventCollection > m_mcEventsReadHandleKey
ReadHandleKey for the input McEventCollection one wants to filter.
Definition: TruthParticleFilterBaseTool.h:100
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
EtaPtFilterTool::m_outerEtaRegionCuts
DoubleArrayProperty m_outerEtaRegionCuts
vector of cuts parameters for the outer region delimited in |eta| 0-th element is the minimum |eta| o...
Definition: EtaPtFilterTool.h:126
TruthParticleFilterBaseTool::m_mcVtxFilterTool
McVtxFilterTool_t m_mcVtxFilterTool
Pointer to the McVtxFilterTool to be able to select additional vertices on some decay pattern criteri...
Definition: TruthParticleFilterBaseTool.h:78
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
TruthParticleFilterBaseTool::m_isolationTool
IsolTool_t m_isolationTool
Pointer to the TruthIsolationTool to be able to compute transverse energy isolations for various isol...
Definition: TruthParticleFilterBaseTool.h:85
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
HepMC::set_polarization
void set_polarization(T &a, Polarization b)
Definition: Polarization.h:44
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
EtaPtFilterTool::m_onlyGenerator
BooleanProperty m_onlyGenerator
Switch to only include particles from generation and reject particles from detector simulation (Geant...
Definition: EtaPtFilterTool.h:131
EtaPtFilterTool::m_keepDocumentaries
BooleanProperty m_keepDocumentaries
Switch to keep all generator particles which are documentaries (statuscode == 3)
Definition: EtaPtFilterTool.h:141
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
TruthParticleFilterBaseTool::TruthParticleFilterBaseTool
TruthParticleFilterBaseTool()
Default constructor:
EtaPtFilterTool::isAccepted
bool isAccepted(const HepMC::ConstGenParticlePtr &mcPart) const
Check if a given particle is within the acceptance (pt+eta)
Definition: EtaPtFilterTool.cxx:191
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
isHadron
bool isHadron(const T &p)
Definition: AtlasPID.h:207
EtaPtFilterTool::buildGenEvent
StatusCode buildGenEvent(const HepMC::GenEvent *in, HepMC::GenEvent *out)
This method will check the validity of the input HepMC::GenEvent and build a filtered one from the st...
Definition: EtaPtFilterTool.cxx:155
SG::WriteHandle< McEventCollection >
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
a
TList * a
Definition: liststreamerinfos.cxx:10
HepMC::newGenParticlePtr
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
Definition: GenParticle.h:39
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
EtaPtFilterTool::ParticleMap_t
std::unordered_map< const HepMC::GenParticle *, HepMC::GenParticlePtr > ParticleMap_t
Definition: EtaPtFilterTool.h:54
MC::isDecayed
bool isDecayed(const T &p)
Definition: HepMCHelpers.h:29
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MC::isBeam
bool isBeam(const T &p)
Definition: HepMCHelpers.h:28
isLepton
bool isLepton(const T &p)
APID: the fourth generation leptons are leptons.
Definition: AtlasPID.h:130
python.changerun.pv
pv
Definition: changerun.py:81
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
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
HepMC::copyemptyGenEvent
GenEvent * copyemptyGenEvent(const GenEvent *inEvt)
Definition: GenEvent.h:531
EtaPtFilterTool::m_keepAllLeptons
BooleanProperty m_keepAllLeptons
Switch to keep all leptons - i.e.
Definition: EtaPtFilterTool.h:145
EtaPtFilterTool::setupOuterEtaRegionCuts
void setupOuterEtaRegionCuts(Gaudi::Details::PropertyBase &outerEtaRegionCuts)
Callback function to setup the "OuterEtaRegionCuts" property.
Definition: EtaPtFilterTool.cxx:508
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TruthParticleFilterBaseTool::m_mcEventsOutputWriteHandleKey
SG::WriteHandleKey< McEventCollection > m_mcEventsOutputWriteHandleKey
Location of the output McEventCollection which has been filtered.
Definition: TruthParticleFilterBaseTool.h:104
fitman.k
k
Definition: fitman.py:528
GenParticle
@ GenParticle
Definition: TruthClasses.h:30
EtaPtFilterTool::m_butKeepAllGeneratorStable
BooleanProperty m_butKeepAllGeneratorStable
Switch to keep all stable generator particles (IsGenStable) regardless what eta or pt cuts are define...
Definition: EtaPtFilterTool.h:136
HepMC::signal_process_vertex
GenVertex * signal_process_vertex(const GenEvent *e)
Definition: GenEvent.h:503