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
OldSpclMcFilterTool Class Reference

#include <OldSpclMcFilterTool.h>

Inheritance diagram for OldSpclMcFilterTool:
Collaboration diagram for OldSpclMcFilterTool:

Public Member Functions

 OldSpclMcFilterTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor with parameters: More...
 
virtual ~OldSpclMcFilterTool ()
 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

typedef ToolHandle< IMcVtxFilterToolMcVtxFilterTool_t
 
typedef ToolHandle< ITruthIsolationToolIsolTool_t
 

Protected Member Functions

 OldSpclMcFilterTool ()
 Default constructor: More...
 
StatusCode selectSpclMcBarcodes ()
 Retrieve the GenParticles from the GenEvent object (located into the McEventCollection container), filter them and store their barcode into the list of barcodes of particles to keep. More...
 
StatusCode shapeGenEvent (McEventCollection *outEvt)
 Build the out McEventCollection by removing all the GenParticles whose barcode is not in the list of barcodes to keep. More...
 
StatusCode reconnectParticles (const McEventCollection *inEvt, McEventCollection *out)
 Reconnect the particles of the filtered McEventCollection. More...
 
StatusCode rebuildLinks (const HepMC::GenEvent *mcEvent, HepMC::GenEvent *outEvt, const HepMC::GenParticlePtr &mcPart)
 Rebuild the links between particles which were connected, eg by a long FSR chain. More...
 
StatusCode initializeTool ()
 to get tesIO 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

std::set< int > m_barcodes
 List of particles (in fact their unique barcode) which have been labelled as "special". More...
 
DoubleProperty m_rIsol
 deltaR isolation energy cut for electrons, muons, taus and photons More...
 
DoubleProperty m_ptGamMin
 Minimum threshold for transverse momentum of photons. More...
 
DoubleProperty m_ptMin
 Minimum threshold for transverse momentum for all particles. More...
 
DoubleProperty m_etaRange
 Eta acceptance cut applied on all stable particles. More...
 
BooleanProperty m_includeSimul
 Switch to include or not particles from detector simulation (Geant4) More...
 
BooleanProperty m_includePartonShowers
 Switch to include or not parton showers. More...
 
TruthHelper::GenAccessIOm_tesIO
 Pointer to a StoreGateSvc helper (Mc particle retrieval with predicates) More...
 
BooleanProperty m_removeDecayToSelf
 Switch to remove particles which decay into themselves (t->tg) but only for generated particles, not the ones from the Geant4 interactions. More...
 
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 29 of file OldSpclMcFilterTool.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.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ OldSpclMcFilterTool() [1/2]

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

Constructor with parameters:

Definition at line 41 of file OldSpclMcFilterTool.cxx.

43  :
45  m_tesIO( nullptr )
46 {
47  //
48  // Property declaration
49  //
50  //declareProperty( "Property", m_nProperty );
51 
52  declareProperty( "rIsolation",
53  m_rIsol = 0.45,
54  "DeltaR isolation energy cut for electrons, muons, "
55  "taus and photons" );
56 
57  declareProperty( "ptGammaMin",
58  m_ptGamMin = 0.5*GeV,
59  "Minimum threshold for transverse momentum of photons" );
60 
61  declareProperty( "ptMin",
62  m_ptMin = 0.5*GeV,
63  "Minimum threshold for transverse momentum for all particles.\n"
64  "Warning: this cut is applied *before* Pt photon cut !" );
65 
66  declareProperty( "etaRange",
67  m_etaRange = 5.0,
68  "Eta acceptance cut applied on all stable particles" );
69 
70  // switches
71 
72  declareProperty( "IncludeSimul",
73  m_includeSimul = true,
74  "Switch to include or not particles from detector simulation "
75  "(Geant 4)" );
76 
77  declareProperty( "IncludePartonShowers",
79  "Switch to include or not parton showers" );
80 
81  declareProperty( "RemoveDecayToSelf",
82  m_removeDecayToSelf = true,
83  "Switch to remove particles which decay into themselves (t->tg) "
84  "*but* only for generated particles, not the ones from the "
85  "Geant4 interactions" );
86 
87 }

◆ ~OldSpclMcFilterTool()

OldSpclMcFilterTool::~OldSpclMcFilterTool ( )
virtual

Destructor:

Definition at line 91 of file OldSpclMcFilterTool.cxx.

92 {
93  delete m_tesIO; m_tesIO = nullptr;
94  ATH_MSG_DEBUG("Calling destructor");
95 }

◆ OldSpclMcFilterTool() [2/2]

OldSpclMcFilterTool::OldSpclMcFilterTool ( )
protected

Default constructor:

Member Function Documentation

◆ buildMcAod()

StatusCode OldSpclMcFilterTool::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 101 of file OldSpclMcFilterTool.cxx.

103 {
104  if ( nullptr == in || nullptr == out ) {
105  ATH_MSG_ERROR("Invalid pointer to McEventCollection !" << endmsg
106  << " in: " << in << endmsg
107  << " out: " << out);
108  return StatusCode::FAILURE;
109  }
110 
111  // we just copy the input McEventCollection and put it into the output one
112  out->operator=( *in );
113 
114  // select the barcodes of the "special" particles from the input GenEvent
115  if ( selectSpclMcBarcodes().isFailure() ) {
116  ATH_MSG_ERROR("Could not select the \"special\" barcodes !!");
117  return StatusCode::FAILURE;
118  }
119 
120  // remove the not "special" particles from the filtered McEventCollection
121  if ( shapeGenEvent(out).isFailure() ) {
122  ATH_MSG_ERROR("Could not remove the not \"special\" particles from the "\
123  "filtered McEventCollection !!");
124  return StatusCode::FAILURE;
125  }
126 
127  // reconnect the particles
128  if ( reconnectParticles(in, out).isFailure() ) {
129  ATH_MSG_ERROR("Could not reconnect the particles in the filtered "\
130  "McEventCollection !!");
131  return StatusCode::FAILURE;
132  }
133 
134  return StatusCode::SUCCESS;
135 }

◆ 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 OldSpclMcFilterTool::initializeTool ( )
protectedvirtual

to get tesIO

Reimplemented from TruthParticleFilterBaseTool.

Definition at line 626 of file OldSpclMcFilterTool.cxx.

627 {
628  ATH_MSG_DEBUG("Calling initializeTool");
629  delete m_tesIO; m_tesIO = nullptr;
630  // accessor for particles
631  m_tesIO = new GenAccessIO();
632  if( m_tesIO == nullptr ) {
633  ATH_MSG_ERROR("Unable to retrieve GenAccessIO pointer");
634  return StatusCode::FAILURE;
635  }
636  return StatusCode::SUCCESS;
637 }

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

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

◆ rebuildLinks()

StatusCode OldSpclMcFilterTool::rebuildLinks ( const HepMC::GenEvent *  mcEvent,
HepMC::GenEvent *  outEvt,
const HepMC::GenParticlePtr mcPart 
)
protected

Rebuild the links between particles which were connected, eg by a long FSR chain.

Definition at line 485 of file OldSpclMcFilterTool.cxx.

488 {
489 
490  if ( !mcPart ) {
491  ATH_MSG_WARNING("Null GenParticle: can not rebuildLinks");
492  return StatusCode::FAILURE;
493  }
494 
495  if ( mcPart->end_vertex() ) {
496  ATH_MSG_VERBOSE("GenParticle has already a decay vertex : nothing to do");
497  return StatusCode::SUCCESS;
498  }
499 
500  if ( !mcEvt ) {
501  ATH_MSG_WARNING("Null input HepMC::GenEvent : can not rebuildLinks");
502  return StatusCode::FAILURE;
503  }
504 
505  if ( !outEvt ) {
506  ATH_MSG_WARNING("Null output HepMC::GenEvent: can not rebuildLinks");
507  return StatusCode::FAILURE;
508  }
509 #ifdef HEPMC3
510  return StatusCode::SUCCESS;
511 #else
512  // Cache some useful infos
513  const int pdgId = mcPart->pdg_id();
514  const int bc = HepMC::barcode(mcPart);
515 
516 //AV: Const correctness is broken for HepMC2.
518  HepMC::GenVertexPtr dcyVtx = inPart->end_vertex();
519 
520  if ( !dcyVtx ) {
521  ATH_MSG_VERBOSE("No decay vertex for the particle #" << bc << " : " << "No link to rebuild...");
522  return StatusCode::SUCCESS;
523  }
524 
525  std::list<int> bcChildPart;
526  std::list<int> bcChildVert;
527 
528  //
529  // Loop over all descendants of the GenParticle
530  // Store the barcode of the GenParticles entering into each GenVertex
531  //
532  const HepMC::GenVertex::vertex_iterator endVtx = dcyVtx->vertices_end(HepMC::descendants);
533  for ( HepMC::GenVertex::vertex_iterator itrVtx = dcyVtx->vertices_begin( HepMC::descendants );
534  itrVtx != endVtx;
535  ++itrVtx ) {
536  bool foundPdgId = false;
537  HepMC::GenVertex::particles_in_const_iterator endPart = (*itrVtx)->particles_in_const_end();
538  for ( HepMC::GenVertex::particles_in_const_iterator itrPart = (*itrVtx)->particles_in_const_begin();
539  itrPart != endPart;
540  ++itrPart ) {
541 
542  // because the vertices are traversed in POST ORDER !!
543  // (quoting GenVertex::vertex_iterator)
544  bcChildPart.push_front( (*itrPart)->barcode() );
545 
546  if ( (*itrPart)->pdg_id() == pdgId ) {
547  foundPdgId = true;
548  }
549  }//> loop over in-going particles of this vertex
550 
551  if ( foundPdgId ) {
552  bcChildVert.push_front( (*itrVtx)->barcode() );
553  }
554 
555  }//> loop over descendants of decay vertex
556 
557  //
558  // Now we loop over the previously stored barcodes and
559  // we connect our GenParticle to the first found barcode
560  //
561  std::list<int>::const_iterator bcVtxEnd = bcChildVert.end();
562  for ( std::list<int>::const_iterator itrBcVtx = bcChildVert.begin();
563  itrBcVtx != bcVtxEnd;
564  ++itrBcVtx ) {
565  HepMC::GenVertex * childVtx = outEvt->barcode_to_vertex(*itrBcVtx);
566  if ( childVtx ) {
567  if ( childVtx->particles_in_size() > 0 ) {
568  HepMC::GenVertex::particles_in_const_iterator endPart = childVtx->particles_in_const_end();
569  for ( HepMC::GenVertex::particles_in_const_iterator itrPart = childVtx->particles_in_const_begin();
570  itrPart != endPart;
571  ++itrPart ) {
572  if ( (*itrPart)->pdg_id() == pdgId ) {
573  HepMC::GenVertex * prodVtx = (*itrPart)->production_vertex();
574  if ( prodVtx ) {
575  if ( prodVtx->particles_in_size() > 0 ) {
576  // Humm... This is not what we'd have expected
577  // so we skip it
578  if ( msgLvl(MSG::VERBOSE) ) {
580  << "found a particle = "
581  << (*itrPart) << ", "
582  << "but its production vertex has incoming particles !"
583  << endmsg;
584  continue;
585  }
586  // create a GenVertex which will be the decay vertex of our
587  // GenParticle and the production vertex of the GenParticle
588  // we just found
590  outEvt->add_vertex( linkVtx );
591  linkVtx->add_particle_in( mcPart );
592  linkVtx->add_particle_out( *itrPart );
593 
594  msg(MSG::ERROR)
595  << "====================================================="
596  << endmsg
597  << "Created a GenVertex - link !"
598  << std::endl;
599  std::stringstream vtxLink("");
600  linkVtx->print(vtxLink);
601  msg(MSG::ERROR)
602  << vtxLink.str()
603  << endmsg
604  << "====================================================="
605  << endmsg;
606  }
607  }
608  }
609  }//> loop over incoming particles
610  } else {
611  // no incoming particle : so we just add this particle
612  // a bit odd though : FIXME ?
613  childVtx->add_particle_in(mcPart);
614  msg(MSG::WARNING) << "Odd situation:" << std::endl;
615  std::stringstream vtxDump( "" );
616  childVtx->print(vtxDump);
617  msg(MSG::WARNING) << vtxDump.str() << endmsg;
618  return StatusCode::SUCCESS;
619  }//> end if incoming particles
620  }//> found a child-vertex
621  }//> loop over child-vertex-barcodes
622  return StatusCode::FAILURE;
623 #endif
624 }

◆ reconnectParticles()

StatusCode OldSpclMcFilterTool::reconnectParticles ( const McEventCollection inEvt,
McEventCollection out 
)
protected

Reconnect the particles of the filtered McEventCollection.

We need the original McEventCollection to know if 2 particles were connected

Definition at line 429 of file OldSpclMcFilterTool.cxx.

431 {
432  if ( nullptr == in || nullptr == out ) {
433  ATH_MSG_ERROR("Invalid pointer to McEventCollection !!" << endmsg
434  << " in: " << in << endmsg
435  << " out: " << out);
436  return StatusCode::FAILURE;
437  }
438 #ifdef HEPMC3
439  return StatusCode::SUCCESS;
440 #else
441  for ( unsigned int iEvt = 0; iEvt != in->size(); ++iEvt) {
442  const HepMC::GenEvent * evt = (*in)[iEvt];
443  HepMC::GenEvent * outEvt = (*out)[iEvt];
444 
445  // Reconnect the particles
446  ATH_MSG_VERBOSE("Reconnecting particles...");
447  for (const auto& itrPart: *outEvt) {
448  if ( itrPart->end_vertex() ) {
449  continue;
450  }
451  if ( rebuildLinks( evt, outEvt, itrPart ).isFailure() ) {
452  ATH_MSG_WARNING("Could not rebuild links for this particle = "<< itrPart);
453  } else if ( msgLvl(MSG::VERBOSE) ) {
455  << "==========================================================="
456  << endmsg << "Production vertex for particle " << itrPart << " : ";
457  if ( itrPart->production_vertex() ) {
458  std::stringstream prodVtx("");
459  HepMC::Print::line(prodVtx,itrPart->production_vertex());
460  msg(MSG::VERBOSE) << std::endl << prodVtx.str() << endmsg;
461  } else {
462  msg(MSG::VERBOSE) << "[No production vertex]" << endmsg;
463  }
464 
465  msg(MSG::VERBOSE) << "Decay vertex for particle "
466  << itrPart << " : ";
467  if ( itrPart->end_vertex() ) {
468  std::stringstream dcyVtx("");
469  HepMC::Print::line(dcyVtx, itrPart->end_vertex());
470  msg(MSG::VERBOSE) << std::endl
471  << dcyVtx.str()
472  << endmsg;
473  } else {
474  msg(MSG::VERBOSE) << endmsg << "[No decay vertex]" << endmsg;
475  }
476  }//> end VERBOSE messages
477 
478  }//> loop over particles
479  }//> loop over GenEvents
480 
481  return StatusCode::SUCCESS;
482 #endif
483 }

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

◆ selectSpclMcBarcodes()

StatusCode OldSpclMcFilterTool::selectSpclMcBarcodes ( )
protected

Retrieve the GenParticles from the GenEvent object (located into the McEventCollection container), filter them and store their barcode into the list of barcodes of particles to keep.

skip stuff with no end-vertex

stable particles

Save photons

Save photon only if it does not decay (ie no end_vertex)

ask McVtxFilterTool for its decision ie: final word is given to the user

Definition at line 140 of file OldSpclMcFilterTool.cxx.

141 {
142  StatusCode sc = StatusCode::SUCCESS;
143 
144  // Get all of the generated particles (does not have Geant secondaries)
145 
146  std::vector<HepMC::ConstGenParticlePtr> particles;
147  if ( m_includeSimul ) {
149  } else {
151  }
152  if ( sc.isFailure() ) {
153  ATH_MSG_ERROR("Could not get Monte Carlo particles from TDS at : "
155  return StatusCode::FAILURE;
156  }
157 
158  m_barcodes.clear();
159 
160  // Loop over all particles, selecting special ones
161  // keep track of them using their barcodes
162 
163  for (const auto& part : particles) {
164 
165  const int id = part->pdg_id();
166  const int ida = std::abs(id);
167  const HepMC::FourVector hlv = part->momentum();
168  const double pt = hlv.perp();
169  const double eta = hlv.pseudoRapidity();
170  const double mass = hlv.m();
171  const int barcode = HepMC::barcode(part);
172 
173  HepMC::ConstGenVertexPtr decayVtx = part->end_vertex();
174  HepMC::ConstGenVertexPtr prodVtx = part->production_vertex();
175 
176  bool isSpcl = false;
177 
179  if( !MC::isStable(part) && !decayVtx ) continue;
180 
181  const bool accept = pt > m_ptMin;
182 
184  // Select special particles
186 
188  if (m_includeSimul ) {
189  if ( MC::isSimStable(part) && accept && std::abs(eta) < m_etaRange ) isSpcl = true;
190  } else {
191  if ( MC::isGenStable(part) && accept && std::abs(eta) < m_etaRange ) isSpcl = true;
192  }
193  // e, mu, tau, neutrino
194  // Hard coded cut pt>2GeV to remove beam-jet Dalitz decays, etc.
195  if( MC::isSMLepton(part) && pt>2.*GeV && std::abs(eta) < m_etaRange ) isSpcl = true;
196 
199  if ( MC::isPhoton(part) && pt>m_ptGamMin && std::abs(eta) < m_etaRange ) {
201  if ( nullptr == part->end_vertex() ) {
202  isSpcl=true;
203  }
204  }
205 
206  // Any long-lived B meson or baryon 5x1 or 5xx2
207  int ifl=0;
208  if( ida>100 && ida<1000) ifl=ida/100;
209  if( ida>1000 && ida<10000) ifl=ida/1000;
210  int jj1 = ida%10;
211  if( (ifl==5 && jj1<3 && mass<9.0*GeV) || ( ifl==4 && jj1<3 && mass<2.4*GeV) ) {
212  if (accept) isSpcl = true;
213  }
214 
215  // Any heavy particle other than quarks or gluons.
216  // M > 9.0GeV excludes B hadrons but includes Upsilon, W, Z, t, ...
217  if( ida>5 && ida!=21 && ida!=9 && mass>9.*GeV && accept ) isSpcl=true;
218 
219  // save the quarks
220  if (ida >= 1 && ida <= 5 && accept ) isSpcl = true;
221 
222  // save the gluons
223  if ( ida == 21 && accept ) isSpcl = true;
224 
225  // save the double charged Higgs
226  if ( (ida == 9900041 || ida == 9900042) && accept ) isSpcl = true;
227 
228  // SUSY particles -- relies on PDG codes
229  if( ida>1000000 && ida<3000000 && accept ) isSpcl = true;
230 
232  // Exclude invalid special particles
234 
235  // Monte Carlo internal particles per PDG
236  if( ida>80 && ida<101 ) isSpcl=false;
237 
238  // Particles decaying into itself
239  // This prevents documentaries from being reported twice and
240  // eliminates (if asked to) parton showers like q -> qg.
241  // But should not delete particle if child is from GEANT.
242  if( isSpcl && decayVtx ) {
243  auto dcyVtx = part->end_vertex();
244  for(const auto& child: *dcyVtx) {
245  if( child->pdg_id()==id && //> looking for parton showers or documentaries
246  HepMC::barcode(child) !=barcode && //> just to be sure that merging GEN_EVENT/G4Truth is OK
247  !HepMC::is_simulation_particle(child) //> child is not from GEANT
248  ) {
249  if ( m_includePartonShowers ) {
250  // we keep the parent particle
251  // this could be vertices of the form :
252  // q -> q + g + b + bbar(hence the outgoing quark isn't decaying:documentary)
253  // t -> t + W + b (with outgoing top being a documentary)
254  // q -> q + g (real parton shower)
255  isSpcl = true;
256  } else {
257  isSpcl = false;
258  }
259  }
260  }
261  }
262 
267  if ( ( decayVtx && m_mcVtxFilterTool->isAccepted(decayVtx) ) ||
268  ( prodVtx && m_mcVtxFilterTool->isAccepted(prodVtx) ) ) {
269  isSpcl = true;
270  }
271 
273  // Save special particles and children
275  if( !isSpcl ) continue;
276  m_barcodes.insert(barcode); // add it to list
277 
278  // Children
279  if( isSpcl && decayVtx ) {
280  for(const auto& child: *(part->end_vertex())) {
282  m_barcodes.insert(HepMC::barcode(child));// its not there already
283  }
284  }
285  }
286 
287  }
288  ATH_MSG_DEBUG("Read " << particles.size()
289  << " and selected " << m_barcodes.size() << " particles");
290 
291  return StatusCode::SUCCESS;
292 }

◆ shapeGenEvent()

StatusCode OldSpclMcFilterTool::shapeGenEvent ( McEventCollection outEvt)
protected

Build the out McEventCollection by removing all the GenParticles whose barcode is not in the list of barcodes to keep.

Remove also the dead vertices.

Definition at line 294 of file OldSpclMcFilterTool.cxx.

295 {
296  //now remove all the particles except those whose barcodes are marked
297  for ( McEventCollection::iterator evt = genAod->begin(); evt != genAod->end();++evt) {
298  std::vector<HepMC::GenParticlePtr> going_out;
299 
300 #ifdef HEPMC3
301  for ( auto & p : ((HepMC::GenEvent*)(*evt))->particles()) {
302 //AV: We modify event
303  int pBC = HepMC::barcode(p);
304  ATH_MSG_DEBUG("[pdg,bc]= " << p->pdg_id() << ", " << pBC);
305  if ( m_barcodes.count(pBC) != 0 ) continue;
306  going_out.push_back(p); // list of useless particles
307  auto pvtx = p->production_vertex();
308  auto evtx = p->end_vertex();
309  if (pvtx) pvtx->remove_particle_out(p); //remove from production vertex from useless partilcle
310  if (evtx) { // if it has end vertex, may need to move the out partilces
311  if(pvtx){ // move the partilces back
312  for (auto& pp: evtx->particles_out()) {
313  pvtx->add_particle_out(pp);
314  }
315  }
316  evtx->remove_particle_out(p); // disconnect from end vertex
317  }
318  }//> loop over particles
319 #else
320  std::list<int> evtBarcodes;
321  for ( const auto& p: **evt ) {
322  evtBarcodes.push_back( HepMC::barcode(p) );
323  }
324  for ( std::list<int>::const_iterator itrBc = evtBarcodes.begin();itrBc != evtBarcodes.end(); ++itrBc ) {
325 //AV: We modify event
326  HepMC::GenParticlePtr p = HepMC::barcode_to_particle((HepMC::GenEvent*)(*evt),*itrBc);
327  int pBC = HepMC::barcode(p);
328  ATH_MSG_DEBUG("[pdg,bc]= " << p->pdg_id() << ", " << pBC);
329  if ( m_barcodes.count(pBC) == 0 ) {
330  going_out.push_back(p); // list of useless particles
331  auto pvtx = p->production_vertex();
332  auto evtx = p->end_vertex();
333  if (pvtx) pvtx->remove_particle(p); //remove from production vertex from useless partilcle
334  if (evtx) { // if it has end vertex, may need to move the out partilces
335  if(pvtx){ // move the partilces back
336  if ( msgLvl(MSG::DEBUG) ) {
337  msg(MSG::DEBUG) << "\tin endVtx "<< endmsg;
338  }
339  while ( evtx->particles_out_const_begin() != evtx->particles_out_const_end()) {
340  HepMC::GenVertex::particles_out_const_iterator np = evtx->particles_out_const_begin();
341  pvtx->add_particle_out(*np); // note that this really is a MOVE!!! it get taken off evtx by magic
342  }
343  }//> end if [prod vertex]
344  evtx->remove_particle(p); // disconnect from end vertex
345  }//> end if [decay vertex]
346  }//> particle has to be removed
347  }//> loop over particles (via their barcode)
348 #endif
349 
350 
351 #ifdef HEPMC3
352  // there may be a bunch of vertices with no particles connected to them:
353  // ==> Get rid of them //AV: Not sure if this is needed
354  std::vector<HepMC::ConstGenVertexPtr> going_out_again;
355  for ( auto& v: (*evt)->vertices()) {
356  if ( v->particles_in().empty() && v->particles_out().empty() ){
357  going_out_again.push_back(v);
358  }
359  }//> loop over vertices
360 //HepMC3 uses smart pointers
361 #else
362  // now get rid of all dead particles
363  for ( std::vector<HepMC::GenParticle*>::iterator d = going_out.begin();
364  d != going_out.end();
365  ++d ){
366  delete *d;
367  }
368 
369  // there may be a bunch of vertices with no particles connected to them:
370  // ==> Get rid of them
371  std::vector<HepMC::GenVertex*> going_out_again;
372  for ( HepMC::GenEvent::vertex_const_iterator v = (*evt)->vertices_begin();
373  v != (*evt)->vertices_end(); ++v ) {
374  if ( (*v)->particles_in_size() == 0 && (*v)->particles_out_size() == 0 ){
375  going_out_again.push_back(*v);
376  }
377  }//> loop over vertices
378 
379  // now get rid of all dead vertices
380  for ( std::vector<HepMC::GenVertex*>::iterator d = going_out_again.begin();
381  d != going_out_again.end();
382  ++d ){
383  delete *d;
384  }
385 #endif
386 
387  }//> loop over GenEvents in McEventCollection
388 
389  // Set the signal_process_vertex to NULL if not to be recorded
390  for ( McEventCollection::iterator evt = genAod->begin(); evt != genAod->end(); ++evt) {
391 #ifdef HEPMC3
392  auto sigProcVtx = HepMC::signal_process_vertex(*evt);
393  if (!sigProcVtx) continue;
394  const int sigProcBC = HepMC::barcode(sigProcVtx);
395  bool isInColl = false;
396  for ( const auto& itrVtx: (*evt)->vertices() ) {
397  if ( sigProcBC == HepMC::barcode(itrVtx) ) {
398  isInColl = true;
399  break;
400  }
401  } //> loop over vertices
402 //AV: We don't set nullptr as signal vertex in HepMC3
403  if ( !isInColl ) {
404  (*evt)->remove_attribute("signal_process_vertex");
405  }
406 #else
407  const HepMC::GenVertex * sigProcVtx = (*evt)->signal_process_vertex();
408  if ( 0 != sigProcVtx ) {
409  const int sigProcBC = sigProcVtx->barcode();
410  bool isInColl = false;
411  for ( HepMC::GenEvent::vertex_const_iterator itrVtx = (*evt)->vertices_begin();
412  itrVtx != (*evt)->vertices_end();
413  ++itrVtx ) {
414  if ( sigProcBC == (*itrVtx)->barcode() ) {
415  isInColl = true;
416  break;
417  }
418  } //> loop over vertices
419  if ( !isInColl ) {
420  (*evt)->set_signal_process_vertex(0);
421  }
422  }//> a signal_process_vertex has been setup
423 #endif
424  }//> loop over GenEvent's
425 
426  return StatusCode::SUCCESS;
427 }

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

std::set<int> OldSpclMcFilterTool::m_barcodes
protected

List of particles (in fact their unique barcode) which have been labelled as "special".

Definition at line 103 of file OldSpclMcFilterTool.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_etaRange

DoubleProperty OldSpclMcFilterTool::m_etaRange
protected

Eta acceptance cut applied on all stable particles.

Definition at line 120 of file OldSpclMcFilterTool.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_includePartonShowers

BooleanProperty OldSpclMcFilterTool::m_includePartonShowers
protected

Switch to include or not parton showers.

Definition at line 128 of file OldSpclMcFilterTool.h.

◆ m_includeSimul

BooleanProperty OldSpclMcFilterTool::m_includeSimul
protected

Switch to include or not particles from detector simulation (Geant4)

Definition at line 124 of file OldSpclMcFilterTool.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_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_ptGamMin

DoubleProperty OldSpclMcFilterTool::m_ptGamMin
protected

Minimum threshold for transverse momentum of photons.

Definition at line 111 of file OldSpclMcFilterTool.h.

◆ m_ptMin

DoubleProperty OldSpclMcFilterTool::m_ptMin
protected

Minimum threshold for transverse momentum for all particles.

Warning: this cut is applied before Pt photon cut !

Definition at line 116 of file OldSpclMcFilterTool.h.

◆ m_removeDecayToSelf

BooleanProperty OldSpclMcFilterTool::m_removeDecayToSelf
protected

Switch to remove particles which decay into themselves (t->tg) but only for generated particles, not the ones from the Geant4 interactions.

Definition at line 137 of file OldSpclMcFilterTool.h.

◆ m_rIsol

DoubleProperty OldSpclMcFilterTool::m_rIsol
protected

deltaR isolation energy cut for electrons, muons, taus and photons

Definition at line 107 of file OldSpclMcFilterTool.h.

◆ m_tesIO

TruthHelper::GenAccessIO* OldSpclMcFilterTool::m_tesIO
protected

Pointer to a StoreGateSvc helper (Mc particle retrieval with predicates)

Definition at line 132 of file OldSpclMcFilterTool.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
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
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
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle< McEventCollection >
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
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 ...
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
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
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
OldSpclMcFilterTool::m_includeSimul
BooleanProperty m_includeSimul
Switch to include or not particles from detector simulation (Geant4)
Definition: OldSpclMcFilterTool.h:124
OldSpclMcFilterTool::m_tesIO
TruthHelper::GenAccessIO * m_tesIO
Pointer to a StoreGateSvc helper (Mc particle retrieval with predicates)
Definition: OldSpclMcFilterTool.h:132
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
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
PlotPulseshapeFromCool.np
np
Definition: PlotPulseshapeFromCool.py:64
HepMC::Print::line
void line(std::ostream &os, const GenEvent &e)
Definition: GenEvent.h:676
OldSpclMcFilterTool::m_etaRange
DoubleProperty m_etaRange
Eta acceptance cut applied on all stable particles.
Definition: OldSpclMcFilterTool.h:120
MC::isGenStable
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
Definition: HepMCHelpers.h:54
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TruthParticleFilterBaseTool::initializeTool
virtual StatusCode initializeTool()
I/O operators.
Definition: TruthParticleFilterBaseTool.h:117
isSMLepton
bool isSMLepton(const T &p)
Definition: AtlasPID.h:143
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
OldSpclMcFilterTool::m_removeDecayToSelf
BooleanProperty m_removeDecayToSelf
Switch to remove particles which decay into themselves (t->tg) but only for generated particles,...
Definition: OldSpclMcFilterTool.h:137
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
OldSpclMcFilterTool::m_barcodes
std::set< int > m_barcodes
List of particles (in fact their unique barcode) which have been labelled as "special".
Definition: OldSpclMcFilterTool.h:103
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HepMC::barcode_to_particle
GenParticle * barcode_to_particle(const GenEvent *e, int id)
Definition: GenEvent.h:628
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:342
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
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
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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
OldSpclMcFilterTool::m_ptGamMin
DoubleProperty m_ptGamMin
Minimum threshold for transverse momentum of photons.
Definition: OldSpclMcFilterTool.h:111
TruthHelper::GenAccessIO::getMC
StatusCode getMC(MCParticleCollection &mcParticles, const bool ifgen=false, const std::string &key="GEN_EVENT") const
Definition: Generators/FlowAfterburner/FlowAfterburner/GenAccessIO.h:29
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
OldSpclMcFilterTool::m_rIsol
DoubleProperty m_rIsol
deltaR isolation energy cut for electrons, muons, taus and photons
Definition: OldSpclMcFilterTool.h:107
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
OldSpclMcFilterTool::reconnectParticles
StatusCode reconnectParticles(const McEventCollection *inEvt, McEventCollection *out)
Reconnect the particles of the filtered McEventCollection.
Definition: OldSpclMcFilterTool.cxx:429
OldSpclMcFilterTool::m_ptMin
DoubleProperty m_ptMin
Minimum threshold for transverse momentum for all particles.
Definition: OldSpclMcFilterTool.h:116
TruthParticleFilterBaseTool::TruthParticleFilterBaseTool
TruthParticleFilterBaseTool()
Default constructor:
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TruthHelper::GenAccessIO
Definition: Generators/FlowAfterburner/FlowAfterburner/GenAccessIO.h:21
python.PyAthena.v
v
Definition: PyAthena.py:154
SG::WriteHandle< McEventCollection >
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
OldSpclMcFilterTool::selectSpclMcBarcodes
StatusCode selectSpclMcBarcodes()
Retrieve the GenParticles from the GenEvent object (located into the McEventCollection container),...
Definition: OldSpclMcFilterTool.cxx:140
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::EgammaHelpers::isPhoton
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
Definition: EgammaxAODHelpers.cxx:21
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
OldSpclMcFilterTool::m_includePartonShowers
BooleanProperty m_includePartonShowers
Switch to include or not parton showers.
Definition: OldSpclMcFilterTool.h:128
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
MC::isSimStable
bool isSimStable(const T &p)
Identify if the particle is considered stable at the post-detector-sim stage.
Definition: HepMCHelpers.h:57
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
OldSpclMcFilterTool::rebuildLinks
StatusCode rebuildLinks(const HepMC::GenEvent *mcEvent, HepMC::GenEvent *outEvt, const HepMC::GenParticlePtr &mcPart)
Rebuild the links between particles which were connected, eg by a long FSR chain.
Definition: OldSpclMcFilterTool.cxx:485
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
OldSpclMcFilterTool::shapeGenEvent
StatusCode shapeGenEvent(McEventCollection *outEvt)
Build the out McEventCollection by removing all the GenParticles whose barcode is not in the list of ...
Definition: OldSpclMcFilterTool.cxx:294
HepMC::signal_process_vertex
GenVertex * signal_process_vertex(const GenEvent *e)
Definition: GenEvent.h:625