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

#include <HGTD_RDOAnalysis.h>

Inheritance diagram for HGTD_RDOAnalysis:
Collaboration diagram for HGTD_RDOAnalysis:

Classes

struct  SdoInfo
 

Public Member Functions

 HGTD_RDOAnalysis (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual StatusCode initialize () override final
 
virtual StatusCode execute () override final
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
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 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
 

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

bool isHSGoodParticle (HepMC::ConstGenParticlePtr particlePtr, const HepMC::GenEvent *hardScatterEvent, float min_pt_cut=1000.)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< HGTD_RDO_Containerm_inputKey {this, "CollectionName", "HGTD_RDOs", "Input HGTD RDO collection name"}
 
SG::ReadHandleKey< InDetSimDataCollectionm_inputTruthKey {this, "SDOCollectionName", "HGTD_SDO_Map", "Input HGTD SDO collection name"}
 
SG::ReadHandleKey< McEventCollectionm_inputMcEventCollectionKey {this, "McEventCollectionName", "TruthEvent", "Input McEventCollection name"}
 
const HGTD_DetectorManagerm_HGTD_Manager {}
 
Gaudi::Property< std::string > m_HGTD_Name {this, "DetectorName", "HGTD", "HGTD detector name"}
 
const HGTD_IDm_HGTD_ID {}
 
Gaudi::Property< std::string > m_HGTDID_Name {this, "PixelIDName", "HGTD_ID", "HGTD ID name"}
 
Gaudi::Property< std::string > m_histPath {this, "HistPath", "/RDOAnalysis/HGTD/", ""}
 
Gaudi::Property< std::string > m_sharedHistPath {this, "SharedHistPath", "/RDOAnalysis/histos/", ""}
 
Gaudi::Property< std::string > m_ntuplePath {this, "NtuplePath", "/RDOAnalysis/ntuples/", ""}
 
Gaudi::Property< std::string > m_ntupleName {this, "NtupleName", "HGTD", ""}
 
Gaudi::Property< bool > m_doPosition {this, "DoPosition", true, ""}
 
ServiceHandle< ITHistSvc > m_thistSvc {this, "HistSvc", "THistSvc", ""}
 
TTree * m_tree {}
 
std::vector< int > m_rdo_module_layer
 
std::vector< float > m_rdo_module_x
 
std::vector< float > m_rdo_module_y
 
std::vector< float > m_rdo_module_z
 
std::vector< float > m_rdo_hit_x
 
std::vector< float > m_rdo_hit_y
 
std::vector< float > m_rdo_hit_z
 
std::vector< float > m_rdo_hit_toa
 
std::vector< float > m_rdo_hit_sdo_toa
 
std::vector< int > m_rdo_hit_sdo_truth_category
 
DataObjIDColl m_extendedExtraObjects
 
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 30 of file HGTD_RDOAnalysis.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ HGTD_RDOAnalysis()

HGTD_RDOAnalysis::HGTD_RDOAnalysis ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 22 of file HGTD_RDOAnalysis.cxx.

23  : AthAlgorithm(name, pSvcLocator) { }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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 HGTD_RDOAnalysis::execute ( )
finaloverridevirtual

Definition at line 69 of file HGTD_RDOAnalysis.cxx.

69  {
70  ATH_MSG_DEBUG(" In HGTD_RDOAnalysis::execute()" );
71  m_rdo_module_layer.clear();
72  m_rdo_module_x.clear();
73  m_rdo_module_y.clear();
74  m_rdo_module_z.clear();
75  m_rdo_hit_x.clear();
76  m_rdo_hit_y.clear();
77  m_rdo_hit_z.clear();
78  m_rdo_hit_toa.clear();
79  m_rdo_hit_sdo_toa.clear();
81 
82  // Raw HGTD Data
84  //Adding SimMap and McEvent here for added truthMatching checks
86 
88  bool doTruthMatching = true;
89  const HepMC::GenEvent* hardScatterEvent(nullptr);
90 
91  if (mcEventCollection->size()==0){
92  ATH_MSG_WARNING("Failed to retrieve a nonzero sized truth event collection, disabling truthMatching");
93  doTruthMatching = false;
94  }
95  if(doTruthMatching) hardScatterEvent = mcEventCollection->at(0);
96 
97  if(p_RDO_cont.isValid()) {
98  // loop over RDO container
99  for ( HGTD_RDO_Container::const_iterator rdoCont_itr = p_RDO_cont->begin(); rdoCont_itr != p_RDO_cont->end(); ++rdoCont_itr ) {
100 
101  const HGTD_RDO_Collection* p_RDO_coll(*rdoCont_itr);
102  const Identifier rdoIDColl((*rdoCont_itr)->identify());
103 
104  const InDetDD::HGTD_DetectorElement *elementColl = m_HGTD_Manager->getDetectorElement(rdoIDColl);
105  InDetDD::SiLocalPosition localPosColl = elementColl->rawLocalPositionOfCell(rdoIDColl);
106  Amg::Vector3D globalPosColl = elementColl->globalPosition(localPosColl);
107 
108  m_rdo_module_x.push_back(globalPosColl[Amg::x]);
109  m_rdo_module_y.push_back(globalPosColl[Amg::y]);
110  m_rdo_module_z.push_back(globalPosColl[Amg::z]);
111 
112  m_rdo_module_layer.push_back(m_HGTD_ID->layer(rdoIDColl));
113 
114  for ( HGTD_RDO_Collection::const_iterator rdo_itr= p_RDO_coll->begin(); rdo_itr != p_RDO_coll->end(); ++rdo_itr ) {
115 
116  const Identifier rdoID((*rdo_itr)->identify());
117 
119  InDetDD::SiLocalPosition localPos_hit = rdo_element->rawLocalPositionOfCell(rdoID);
120  Amg::Vector3D globalPos_hit = rdo_element->globalPosition(localPos_hit);
121 
122  m_rdo_hit_x.push_back(globalPos_hit[Amg::x]);
123  m_rdo_hit_y.push_back(globalPos_hit[Amg::y]);
124  m_rdo_hit_z.push_back(globalPos_hit[Amg::z]);
125 
126  // Get the Time of Arrival which include the tof and the digitisation smearing of 25 ps
127  float rdo_toa = (*rdo_itr)->getTOA();
128  m_rdo_hit_toa.push_back(rdo_toa);
129 
130  // For truth matching studies we need to get the truth nature of each deposit.
131  // For each hit, there can be up to 7 deposit from different nature accessed through the SDO map.
132  if(doTruthMatching){
133  if(simDataMap.isValid()){
134  InDetSimDataCollection::const_iterator iter = (*simDataMap).find((*rdo_itr)->identify());
135  std::vector<SdoInfo> sdo_info;
136  if ( iter != (*simDataMap).end() ) {
137  const InDetSimData& sdo = iter->second;
138  const std::vector< InDetSimData::Deposit >& deposits = sdo.getdeposits();
139  for( std::vector< InDetSimData::Deposit >::const_iterator nextdeposit = deposits.begin() ; nextdeposit!=deposits.end(); ++nextdeposit) {
140  SdoInfo sdoi;
141  // The times of the deposit also include the smearing of digi of 25 ps
142  sdoi.time = nextdeposit->second;
143  const HepMcParticleLink& particleLink = nextdeposit->first;
144  if(particleLink.isValid()){
145  HepMC::ConstGenParticlePtr genPart(particleLink.cptr());
146  if(isHSGoodParticle(genPart,hardScatterEvent)) sdoi.truth = 1; // signal
147  else sdoi.truth = 2; // pile-up
148  }
149  sdo_info.push_back(sdoi);
150  }
151  } else {
152  // Secondaries are not saved in the SDO map, hence saving the TOA for them
153  SdoInfo sdoi;
154  sdoi.time = rdo_toa;
155  sdoi.truth = 3; // secondary
156  sdo_info.push_back(sdoi);
157  }
158 
159  // Only the particle that creates the first deposit is considered to be the correct particle
160  std::sort(sdo_info.begin(), sdo_info.end());
161  if (sdo_info.size() > 0) {
162  m_rdo_hit_sdo_toa.push_back(sdo_info.at(0).time);
163  m_rdo_hit_sdo_truth_category.push_back(sdo_info.at(0).truth);
164  }
165  }
166  else {
167  ATH_MSG_ERROR("No HGTD SDO map found!");
168  }
169  }
170  }
171  }
172  }
173  else {
174  ATH_MSG_ERROR("No HGTD RDO container found!");
175  }
176 
177  if (m_tree) m_tree->Fill();
178 
179  return StatusCode::SUCCESS;
180 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ initialize()

StatusCode HGTD_RDOAnalysis::initialize ( )
finaloverridevirtual

Definition at line 25 of file HGTD_RDOAnalysis.cxx.

25  {
26  ATH_MSG_DEBUG( "Initializing HGTD_RDOAnalysis" );
27 
28  // This will check that the properties were initialized
29  // properly by job configuration.
33 
34  // Grab HGTDID helper
37 
38  // Grab Ntuple and histogramming service for tree
39  ATH_CHECK(m_thistSvc.retrieve());
40 
41  m_tree = new TTree(m_ntupleName.value().c_str(), "HGTD_RDOAnalysis");
42  ATH_CHECK(m_thistSvc->regTree(m_ntuplePath.value() + m_ntupleName.value(), m_tree));
43  if (m_tree) {
44  m_tree->Branch("m_rdo_module_layer", &m_rdo_module_layer);
45  m_tree->Branch("m_rdo_module_x", &m_rdo_module_x);
46  m_tree->Branch("m_rdo_module_y", &m_rdo_module_y);
47  m_tree->Branch("m_rdo_module_z", &m_rdo_module_z);
48  m_tree->Branch("m_rdo_hit_x", &m_rdo_hit_x);
49  m_tree->Branch("m_rdo_hit_y", &m_rdo_hit_y);
50  m_tree->Branch("m_rdo_hit_z", &m_rdo_hit_z);
51  m_tree->Branch("m_rdo_hit_toa", &m_rdo_hit_toa);
52  m_tree->Branch("m_rdo_hit_sdo_toa", &m_rdo_hit_sdo_toa);
53  m_tree->Branch("m_rdo_hit_sdo_truth_category", &m_rdo_hit_sdo_truth_category);
54  } else {
55  ATH_MSG_ERROR("No tree found!");
56  }
57  /*
58  // HISTOGRAMS
59 
61  m_h_rdoID = new TH1F("h_rdoID", "rdoID", 100, 0, 10e17);
62  m_h_rdoID->StatOverflows();
63  ATH_CHECK(m_thistSvc->regHist(m_histPath + m_h_rdoID->GetName(), m_h_rdoID));
64  */
65 
66  return StatusCode::SUCCESS;
67 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ isHSGoodParticle()

bool HGTD_RDOAnalysis::isHSGoodParticle ( HepMC::ConstGenParticlePtr  particlePtr,
const HepMC::GenEvent *  hardScatterEvent,
float  min_pt_cut = 1000. 
)
private

Definition at line 182 of file HGTD_RDOAnalysis.cxx.

182  {
183  bool decision = false;
184  if( MC::isGenStable(particlePtr) and
185  isCharged(particlePtr) and
186  particlePtr->momentum().perp() >= min_pt_cut and
187  particlePtr->momentum().eta() < 4. and
188  particlePtr->parent_event() == hardScatterGenEvent)
189  decision = true;
190 
191  return decision;
192 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doPosition

Gaudi::Property<bool> HGTD_RDOAnalysis::m_doPosition {this, "DoPosition", true, ""}
private

Definition at line 62 of file HGTD_RDOAnalysis.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_HGTD_ID

const HGTD_ID* HGTD_RDOAnalysis::m_HGTD_ID {}
private

Definition at line 55 of file HGTD_RDOAnalysis.h.

◆ m_HGTD_Manager

const HGTD_DetectorManager* HGTD_RDOAnalysis::m_HGTD_Manager {}
private

Definition at line 53 of file HGTD_RDOAnalysis.h.

◆ m_HGTD_Name

Gaudi::Property<std::string> HGTD_RDOAnalysis::m_HGTD_Name {this, "DetectorName", "HGTD", "HGTD detector name"}
private

Definition at line 54 of file HGTD_RDOAnalysis.h.

◆ m_HGTDID_Name

Gaudi::Property<std::string> HGTD_RDOAnalysis::m_HGTDID_Name {this, "PixelIDName", "HGTD_ID", "HGTD ID name"}
private

Definition at line 56 of file HGTD_RDOAnalysis.h.

◆ m_histPath

Gaudi::Property<std::string> HGTD_RDOAnalysis::m_histPath {this, "HistPath", "/RDOAnalysis/HGTD/", ""}
private

Definition at line 58 of file HGTD_RDOAnalysis.h.

◆ m_inputKey

SG::ReadHandleKey<HGTD_RDO_Container> HGTD_RDOAnalysis::m_inputKey {this, "CollectionName", "HGTD_RDOs", "Input HGTD RDO collection name"}
private

Definition at line 49 of file HGTD_RDOAnalysis.h.

◆ m_inputMcEventCollectionKey

SG::ReadHandleKey<McEventCollection> HGTD_RDOAnalysis::m_inputMcEventCollectionKey {this, "McEventCollectionName", "TruthEvent", "Input McEventCollection name"}
private

Definition at line 51 of file HGTD_RDOAnalysis.h.

◆ m_inputTruthKey

SG::ReadHandleKey<InDetSimDataCollection> HGTD_RDOAnalysis::m_inputTruthKey {this, "SDOCollectionName", "HGTD_SDO_Map", "Input HGTD SDO collection name"}
private

Definition at line 50 of file HGTD_RDOAnalysis.h.

◆ m_ntupleName

Gaudi::Property<std::string> HGTD_RDOAnalysis::m_ntupleName {this, "NtupleName", "HGTD", ""}
private

Definition at line 61 of file HGTD_RDOAnalysis.h.

◆ m_ntuplePath

Gaudi::Property<std::string> HGTD_RDOAnalysis::m_ntuplePath {this, "NtuplePath", "/RDOAnalysis/ntuples/", ""}
private

Definition at line 60 of file HGTD_RDOAnalysis.h.

◆ m_rdo_hit_sdo_toa

std::vector<float> HGTD_RDOAnalysis::m_rdo_hit_sdo_toa
private

Definition at line 75 of file HGTD_RDOAnalysis.h.

◆ m_rdo_hit_sdo_truth_category

std::vector<int> HGTD_RDOAnalysis::m_rdo_hit_sdo_truth_category
private

Definition at line 76 of file HGTD_RDOAnalysis.h.

◆ m_rdo_hit_toa

std::vector<float> HGTD_RDOAnalysis::m_rdo_hit_toa
private

Definition at line 74 of file HGTD_RDOAnalysis.h.

◆ m_rdo_hit_x

std::vector<float> HGTD_RDOAnalysis::m_rdo_hit_x
private

Definition at line 71 of file HGTD_RDOAnalysis.h.

◆ m_rdo_hit_y

std::vector<float> HGTD_RDOAnalysis::m_rdo_hit_y
private

Definition at line 72 of file HGTD_RDOAnalysis.h.

◆ m_rdo_hit_z

std::vector<float> HGTD_RDOAnalysis::m_rdo_hit_z
private

Definition at line 73 of file HGTD_RDOAnalysis.h.

◆ m_rdo_module_layer

std::vector<int> HGTD_RDOAnalysis::m_rdo_module_layer
private

Definition at line 67 of file HGTD_RDOAnalysis.h.

◆ m_rdo_module_x

std::vector<float> HGTD_RDOAnalysis::m_rdo_module_x
private

Definition at line 68 of file HGTD_RDOAnalysis.h.

◆ m_rdo_module_y

std::vector<float> HGTD_RDOAnalysis::m_rdo_module_y
private

Definition at line 69 of file HGTD_RDOAnalysis.h.

◆ m_rdo_module_z

std::vector<float> HGTD_RDOAnalysis::m_rdo_module_z
private

Definition at line 70 of file HGTD_RDOAnalysis.h.

◆ m_sharedHistPath

Gaudi::Property<std::string> HGTD_RDOAnalysis::m_sharedHistPath {this, "SharedHistPath", "/RDOAnalysis/histos/", ""}
private

Definition at line 59 of file HGTD_RDOAnalysis.h.

◆ m_thistSvc

ServiceHandle<ITHistSvc> HGTD_RDOAnalysis::m_thistSvc {this, "HistSvc", "THistSvc", ""}
private

Definition at line 64 of file HGTD_RDOAnalysis.h.

◆ m_tree

TTree* HGTD_RDOAnalysis::m_tree {}
private

Definition at line 66 of file HGTD_RDOAnalysis.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
HGTD_RDOAnalysis::m_rdo_hit_x
std::vector< float > m_rdo_hit_x
Definition: HGTD_RDOAnalysis.h:71
HGTD_RDOAnalysis::m_rdo_hit_y
std::vector< float > m_rdo_hit_y
Definition: HGTD_RDOAnalysis.h:72
InDetSimData::getdeposits
const std::vector< Deposit > & getdeposits() const
Definition: InDetSimData.h:74
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
HGTD_RDOAnalysis::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: HGTD_RDOAnalysis.h:64
Amg::y
@ y
Definition: GeoPrimitives.h:35
InDetDD::HGTD_DetectorElement
Definition: HGTD_DetectorElement.h:40
HGTD_RDOAnalysis::m_ntuplePath
Gaudi::Property< std::string > m_ntuplePath
Definition: HGTD_RDOAnalysis.h:60
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
HGTD_RDOAnalysis::m_inputTruthKey
SG::ReadHandleKey< InDetSimDataCollection > m_inputTruthKey
Definition: HGTD_RDOAnalysis.h:50
HGTD_RDOAnalysis::m_ntupleName
Gaudi::Property< std::string > m_ntupleName
Definition: HGTD_RDOAnalysis.h:61
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HGTD_ID::layer
int layer(const Identifier &id) const
Definition: HGTD_ID.h:475
HGTD_RDO_Collection
Definition: HGTD_RDO_Collection.h:19
MC::isGenStable
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
Definition: HepMCHelpers.h:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
HGTD_RDOAnalysis::m_HGTD_Manager
const HGTD_DetectorManager * m_HGTD_Manager
Definition: HGTD_RDOAnalysis.h:53
HGTD_RDOAnalysis::m_tree
TTree * m_tree
Definition: HGTD_RDOAnalysis.h:66
HGTD_RDOAnalysis::m_rdo_hit_toa
std::vector< float > m_rdo_hit_toa
Definition: HGTD_RDOAnalysis.h:74
HGTD_RDOAnalysis::m_rdo_module_z
std::vector< float > m_rdo_module_z
Definition: HGTD_RDOAnalysis.h:70
Amg::z
@ z
Definition: GeoPrimitives.h:36
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HGTD_RDOAnalysis::m_HGTD_Name
Gaudi::Property< std::string > m_HGTD_Name
Definition: HGTD_RDOAnalysis.h:54
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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
Amg::x
@ x
Definition: GeoPrimitives.h:34
HGTD_RDOAnalysis::m_rdo_hit_sdo_toa
std::vector< float > m_rdo_hit_sdo_toa
Definition: HGTD_RDOAnalysis.h:75
InDetSimData
Definition: InDetSimData.h:42
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
HGTD_RDOAnalysis::m_rdo_module_x
std::vector< float > m_rdo_module_x
Definition: HGTD_RDOAnalysis.h:68
AthCommonDataStore< AthCommonMsg< Algorithm > >::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
HGTD_RDOAnalysis::isHSGoodParticle
bool isHSGoodParticle(HepMC::ConstGenParticlePtr particlePtr, const HepMC::GenEvent *hardScatterEvent, float min_pt_cut=1000.)
Definition: HGTD_RDOAnalysis.cxx:182
HGTD_RDOAnalysis::m_rdo_module_layer
std::vector< int > m_rdo_module_layer
Definition: HGTD_RDOAnalysis.h:67
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
HGTD_RDOAnalysis::m_inputMcEventCollectionKey
SG::ReadHandleKey< McEventCollection > m_inputMcEventCollectionKey
Definition: HGTD_RDOAnalysis.h:51
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
HGTD_RDOAnalysis::m_rdo_hit_z
std::vector< float > m_rdo_hit_z
Definition: HGTD_RDOAnalysis.h:73
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
HGTD_DetectorManager::getDetectorElement
InDetDD::HGTD_DetectorElement * getDetectorElement(const Identifier &id) const
access to individual elements : via Identifier
Definition: HGTD_DetectorManager.cxx:57
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
InDetDD::SolidStateDetectorElementBase::rawLocalPositionOfCell
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
Definition: SolidStateDetectorElementBase.cxx:230
a
TList * a
Definition: liststreamerinfos.cxx:10
isCharged
bool isCharged(const T &p)
Definition: AtlasPID.h:496
h
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
InDetDD::SolidStateDetectorElementBase::globalPosition
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
HGTD_RDOAnalysis::m_HGTDID_Name
Gaudi::Property< std::string > m_HGTDID_Name
Definition: HGTD_RDOAnalysis.h:56
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
HGTD_RDOAnalysis::m_rdo_module_y
std::vector< float > m_rdo_module_y
Definition: HGTD_RDOAnalysis.h:69
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
HGTD_RDOAnalysis::m_HGTD_ID
const HGTD_ID * m_HGTD_ID
Definition: HGTD_RDOAnalysis.h:55
HGTD_RDOAnalysis::m_inputKey
SG::ReadHandleKey< HGTD_RDO_Container > m_inputKey
Definition: HGTD_RDOAnalysis.h:49
HGTD_RDOAnalysis::m_rdo_hit_sdo_truth_category
std::vector< int > m_rdo_hit_sdo_truth_category
Definition: HGTD_RDOAnalysis.h:76
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >