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

#include <ZDCHitAnalysis.h>

Inheritance diagram for ZDCHitAnalysis:
Collaboration diagram for ZDCHitAnalysis:

Public Member Functions

 ZDCHitAnalysis (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ZDCHitAnalysis ()
 
virtual StatusCode initialize ()
 
virtual StatusCode execute ()
 
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

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

TH1 * m_h_zdc_photons [2][5] = {{nullptr,nullptr,nullptr,nullptr,nullptr},{nullptr,nullptr,nullptr,nullptr,nullptr}}
 Some variables. More...
 
TH1 * m_h_zdc_calibTot [2][5] = {{nullptr,nullptr,nullptr,nullptr,nullptr},{nullptr,nullptr,nullptr,nullptr,nullptr}}
 
TH1 * m_h_zdc_calibEM [2][5] = {{nullptr,nullptr,nullptr,nullptr,nullptr},{nullptr,nullptr,nullptr,nullptr,nullptr}}
 
TH1 * m_h_zdc_calibNonEM [2][5] = {{nullptr,nullptr,nullptr,nullptr,nullptr},{nullptr,nullptr,nullptr,nullptr,nullptr}}
 
std::vector< int > * m_zdc_fiber_side
 
std::vector< int > * m_zdc_fiber_mod
 
std::vector< int > * m_zdc_fiber_channel
 
std::vector< int > * m_zdc_fiber_photons
 
std::vector< int > * m_zdc_calib_side
 
std::vector< int > * m_zdc_calib_mod
 
std::vector< int > * m_zdc_calib_channel
 
std::vector< float > * m_zdc_calib_Total
 
std::vector< float > * m_zdc_calib_EM
 
std::vector< float > * m_zdc_calib_NonEM
 
TTree * m_tree
 
std::string m_ntupleFileName
 
std::string m_path
 
ServiceHandle< ITHistSvc > m_thistSvc
 
ZdcIDm_ZdcID
 
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 23 of file ZDCHitAnalysis.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

◆ ZDCHitAnalysis()

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

Definition at line 21 of file ZDCHitAnalysis.cxx.

22  : AthAlgorithm(name, pSvcLocator)
23  , m_zdc_fiber_side(0)
24  , m_zdc_fiber_mod(0)
27  , m_zdc_calib_side(0)
28  , m_zdc_calib_mod(0)
31  , m_zdc_calib_EM(0)
33  , m_tree(0)
34  , m_ntupleFileName("/ZDCHitAnalysis/")
35  , m_path("/ZDCHitAnalysis/")
36  , m_thistSvc("THistSvc", name)
37  , m_ZdcID(nullptr)
38 {
39  declareProperty("NtupleFileName", m_ntupleFileName);
40  declareProperty("HistPath", m_path);
41 }

◆ ~ZDCHitAnalysis()

ZDCHitAnalysis::~ZDCHitAnalysis ( )
inline

Definition at line 28 of file ZDCHitAnalysis.h.

28 {}

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 ZDCHitAnalysis::execute ( )
virtual

Definition at line 102 of file ZDCHitAnalysis.cxx.

102  {
103  ATH_MSG_DEBUG( "In ZDCHitAnalysis::execute()" );
104 
105  m_zdc_fiber_side->clear();
106  m_zdc_fiber_mod->clear();
107  m_zdc_fiber_channel->clear();
108  m_zdc_fiber_photons->clear();
109 
110  double photons_fiber = -1;
111  int side_fiber = -1;
112  int mod_fiber = -1;
113  int channel_fiber = -1;
114 
116  const ZDC_SimFiberHit_Collection* fiberiter = nullptr;
117  CHECK(evtStore()->retrieve(fiberiter,"ZDC_SimFiberHit_Collection"));
118  for (fiberhi=(*fiberiter).begin(); fiberhi != (*fiberiter).end(); ++fiberhi) {
119  ZDC_SimFiberHit ghit(*fiberhi);
120  Identifier id = ghit.getID();
121  photons_fiber = ghit.getNPhotons();
122  side_fiber = (m_ZdcID->side(id)==-1) ? 0 : 1;
123  mod_fiber = m_ZdcID->module(id);
124  channel_fiber = m_ZdcID->channel(id);
125 
126  m_h_zdc_photons[side_fiber][mod_fiber]->Fill(photons_fiber);
127 
128  m_zdc_fiber_side->push_back(side_fiber);
129  m_zdc_fiber_mod->push_back(mod_fiber);
130  m_zdc_fiber_channel->push_back(channel_fiber);
131  m_zdc_fiber_photons->push_back(photons_fiber);
132  }
133 
134 
135  m_zdc_calib_side->clear();
136  m_zdc_calib_mod->clear();
137  m_zdc_calib_channel->clear();
138  m_zdc_calib_Total->clear();
139  m_zdc_calib_EM->clear();
140  m_zdc_calib_NonEM->clear();
141 
142  int side_calib = -1;
143  int mod_calib = -1;
144  int channel_calib = -1;
145  float calib_eTot = -999.;
146  float calib_eEM = -999.;
147  float calib_eNonEM = -999.;
148 
149  const CaloCalibrationHitContainer* calibiter = nullptr;
150  CHECK(evtStore()->retrieve(calibiter,"ZDC_CalibrationHit"));
151  for (auto hit : *calibiter) {
152  Identifier id = hit->cellID();
153  side_calib = (m_ZdcID->side(id)==-1) ? 0 : 1;
154  mod_calib = m_ZdcID->module(id);
155  channel_calib = m_ZdcID->channel(id);
156  calib_eTot = hit->energyTotal();
157  calib_eEM = hit->energyEM();
158  calib_eNonEM = hit->energyNonEM();
159 
160  m_h_zdc_calibTot[side_calib][mod_calib]->Fill(calib_eTot);
161  m_h_zdc_calibEM[side_calib][mod_calib]->Fill(calib_eEM);
162  m_h_zdc_calibNonEM[side_calib][mod_calib]->Fill(calib_eNonEM);
163 
164  m_zdc_calib_side->push_back(side_calib);
165  m_zdc_calib_mod->push_back(mod_calib);
166  m_zdc_calib_channel->push_back(channel_calib);
167  m_zdc_calib_Total->push_back(calib_eTot);
168  m_zdc_calib_EM->push_back(calib_eEM);
169  m_zdc_calib_NonEM->push_back(calib_eNonEM);
170  }
171 
172  if (m_tree) m_tree->Fill();
173 
174  return StatusCode::SUCCESS;
175 }

◆ 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 ZDCHitAnalysis::initialize ( )
virtual

now add branches and leaves to the tree

Definition at line 43 of file ZDCHitAnalysis.cxx.

43  {
44  ATH_MSG_DEBUG( "Initializing ZDCHitAnalysis" );
45 
46  if (detStore()->retrieve( m_ZdcID ).isFailure() ) {
47  msg(MSG::ERROR) << "execute: Could not retrieve ZdcID object from the detector store" << endmsg;
48  return StatusCode::FAILURE;
49 }
50 
51  // Grab the Ntuple and histogramming service for the tree
52  CHECK(m_thistSvc.retrieve());
53 
54  for(int side : {0,1}){
55  for(int module = 0; module < 5; module++){
56  std::string name = Form("%s%d", (side==1) ? "a" : "c", module);
57  m_h_zdc_photons[side][module] = new TH1I( ("m_edep_module_" + name).c_str(), ("edep_module_" + name).c_str(), 100, 0, 20000);
59  }
60  }
61 
62  for(int side : {0,1}){
63  for(int module = 0; module < 5; module++){
64  std::string name = Form("%s%d", (side==1) ? "a" : "c", module);
65  m_h_zdc_calibTot[side][module] = new TH1D( ("m_calibTot_module_" + name).c_str(), ("calibTot_module_" + name).c_str(), 100, 1e-2, 1e7);
66  m_h_zdc_calibEM[side][module] = new TH1D( ("m_calibEM_module_" + name).c_str(), ("calibEM_module_" + name).c_str(), 100, 1e-2, 1e7);
67  m_h_zdc_calibNonEM[side][module] = new TH1D( ("m_calibNonEM_module_" + name).c_str(), ("calibNonEM_module_" + name).c_str(), 100, 1e-2, 1e7);
68 
72  }
73  }
74 
76  m_tree = new TTree("ZDC","ZDC");
77  std::string fullNtupleName = "/" + m_ntupleFileName + "/";
78  CHECK(m_thistSvc->regTree(fullNtupleName,m_tree));
79 
80  if (m_tree) {
81  m_tree->Branch("fiber_side", &m_zdc_fiber_side);
82  m_tree->Branch("fiber_mod", &m_zdc_fiber_mod);
83  m_tree->Branch("fiber_channel", &m_zdc_fiber_channel);
84  m_tree->Branch("fiber_nphotons", &m_zdc_fiber_photons);
85 
86  m_tree->Branch("calib_side", &m_zdc_calib_side);
87  m_tree->Branch("calib_mod", &m_zdc_calib_mod);
88  m_tree->Branch("calib_channel", &m_zdc_calib_channel);
89  m_tree->Branch("calib_total", &m_zdc_calib_Total);
90  m_tree->Branch("calib_em", &m_zdc_calib_EM);
91  m_tree->Branch("calib_nonem", &m_zdc_calib_NonEM);
92 
93  }
94  else {
95  ATH_MSG_ERROR("No tree found!");
96  }
97 
98  return StatusCode::SUCCESS;
99 }

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

◆ 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_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_h_zdc_calibEM

TH1* ZDCHitAnalysis::m_h_zdc_calibEM[2][5] = {{nullptr,nullptr,nullptr,nullptr,nullptr},{nullptr,nullptr,nullptr,nullptr,nullptr}}
private

Definition at line 38 of file ZDCHitAnalysis.h.

◆ m_h_zdc_calibNonEM

TH1* ZDCHitAnalysis::m_h_zdc_calibNonEM[2][5] = {{nullptr,nullptr,nullptr,nullptr,nullptr},{nullptr,nullptr,nullptr,nullptr,nullptr}}
private

Definition at line 39 of file ZDCHitAnalysis.h.

◆ m_h_zdc_calibTot

TH1* ZDCHitAnalysis::m_h_zdc_calibTot[2][5] = {{nullptr,nullptr,nullptr,nullptr,nullptr},{nullptr,nullptr,nullptr,nullptr,nullptr}}
private

Definition at line 37 of file ZDCHitAnalysis.h.

◆ m_h_zdc_photons

TH1* ZDCHitAnalysis::m_h_zdc_photons[2][5] = {{nullptr,nullptr,nullptr,nullptr,nullptr},{nullptr,nullptr,nullptr,nullptr,nullptr}}
private

Some variables.

Definition at line 36 of file ZDCHitAnalysis.h.

◆ m_ntupleFileName

std::string ZDCHitAnalysis::m_ntupleFileName
private

Definition at line 54 of file ZDCHitAnalysis.h.

◆ m_path

std::string ZDCHitAnalysis::m_path
private

Definition at line 55 of file ZDCHitAnalysis.h.

◆ m_thistSvc

ServiceHandle<ITHistSvc> ZDCHitAnalysis::m_thistSvc
private

Definition at line 56 of file ZDCHitAnalysis.h.

◆ m_tree

TTree* ZDCHitAnalysis::m_tree
private

Definition at line 53 of file ZDCHitAnalysis.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.

◆ m_zdc_calib_channel

std::vector<int>* ZDCHitAnalysis::m_zdc_calib_channel
private

Definition at line 48 of file ZDCHitAnalysis.h.

◆ m_zdc_calib_EM

std::vector<float>* ZDCHitAnalysis::m_zdc_calib_EM
private

Definition at line 50 of file ZDCHitAnalysis.h.

◆ m_zdc_calib_mod

std::vector<int>* ZDCHitAnalysis::m_zdc_calib_mod
private

Definition at line 47 of file ZDCHitAnalysis.h.

◆ m_zdc_calib_NonEM

std::vector<float>* ZDCHitAnalysis::m_zdc_calib_NonEM
private

Definition at line 51 of file ZDCHitAnalysis.h.

◆ m_zdc_calib_side

std::vector<int>* ZDCHitAnalysis::m_zdc_calib_side
private

Definition at line 46 of file ZDCHitAnalysis.h.

◆ m_zdc_calib_Total

std::vector<float>* ZDCHitAnalysis::m_zdc_calib_Total
private

Definition at line 49 of file ZDCHitAnalysis.h.

◆ m_zdc_fiber_channel

std::vector<int>* ZDCHitAnalysis::m_zdc_fiber_channel
private

Definition at line 43 of file ZDCHitAnalysis.h.

◆ m_zdc_fiber_mod

std::vector<int>* ZDCHitAnalysis::m_zdc_fiber_mod
private

Definition at line 42 of file ZDCHitAnalysis.h.

◆ m_zdc_fiber_photons

std::vector<int>* ZDCHitAnalysis::m_zdc_fiber_photons
private

Definition at line 44 of file ZDCHitAnalysis.h.

◆ m_zdc_fiber_side

std::vector<int>* ZDCHitAnalysis::m_zdc_fiber_side
private

Definition at line 41 of file ZDCHitAnalysis.h.

◆ m_ZdcID

ZdcID* ZDCHitAnalysis::m_ZdcID
private

Definition at line 57 of file ZDCHitAnalysis.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CaloCalibrationHitContainer
Definition: CaloCalibrationHitContainer.h:25
ZDCHitAnalysis::m_zdc_calib_Total
std::vector< float > * m_zdc_calib_Total
Definition: ZDCHitAnalysis.h:49
ZDCHitAnalysis::m_ntupleFileName
std::string m_ntupleFileName
Definition: ZDCHitAnalysis.h:54
ZDCHitAnalysis::m_zdc_calib_NonEM
std::vector< float > * m_zdc_calib_NonEM
Definition: ZDCHitAnalysis.h:51
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ZdcID::module
int module(const Identifier &id) const
Definition: ZdcID.h:163
ZDCHitAnalysis::m_zdc_fiber_channel
std::vector< int > * m_zdc_fiber_channel
Definition: ZDCHitAnalysis.h:43
ZDCHitAnalysis::m_h_zdc_photons
TH1 * m_h_zdc_photons[2][5]
Some variables.
Definition: ZDCHitAnalysis.h:36
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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ZDC_SimFiberHit_ConstIterator
ZDC_SimFiberHit_Collection::const_iterator ZDC_SimFiberHit_ConstIterator
Definition: ZDC_SimFiberHit_Collection.h:24
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ZDCHitAnalysis::m_ZdcID
ZdcID * m_ZdcID
Definition: ZDCHitAnalysis.h:57
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
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
TRT::Hit::side
@ side
Definition: HitInfo.h:83
python.PyAthena.module
module
Definition: PyAthena.py:131
ZDCHitAnalysis::m_h_zdc_calibTot
TH1 * m_h_zdc_calibTot[2][5]
Definition: ZDCHitAnalysis.h:37
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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
ZDCHitAnalysis::m_h_zdc_calibNonEM
TH1 * m_h_zdc_calibNonEM[2][5]
Definition: ZDCHitAnalysis.h:39
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
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
ZDCHitAnalysis::m_zdc_calib_EM
std::vector< float > * m_zdc_calib_EM
Definition: ZDCHitAnalysis.h:50
ZDCHitAnalysis::m_path
std::string m_path
Definition: ZDCHitAnalysis.h:55
ZDCHitAnalysis::m_zdc_fiber_side
std::vector< int > * m_zdc_fiber_side
Definition: ZDCHitAnalysis.h:41
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
ZDCHitAnalysis::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Definition: ZDCHitAnalysis.h:56
ZDCHitAnalysis::m_h_zdc_calibEM
TH1 * m_h_zdc_calibEM[2][5]
Definition: ZDCHitAnalysis.h:38
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ZDCHitAnalysis::m_zdc_fiber_photons
std::vector< int > * m_zdc_fiber_photons
Definition: ZDCHitAnalysis.h:44
ZDCHitAnalysis::m_zdc_calib_channel
std::vector< int > * m_zdc_calib_channel
Definition: ZDCHitAnalysis.h:48
ZDCHitAnalysis::m_zdc_calib_mod
std::vector< int > * m_zdc_calib_mod
Definition: ZDCHitAnalysis.h:47
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ZdcID::side
int side(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: ZdcID.h:157
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
ZDCHitAnalysis::m_zdc_calib_side
std::vector< int > * m_zdc_calib_side
Definition: ZDCHitAnalysis.h:46
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
ZDC_SimFiberHit
Definition: ZDC_SimFiberHit.h:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
ZDC_SimFiberHit_Collection
Definition: ZDC_SimFiberHit_Collection.h:16
ZDCHitAnalysis::m_zdc_fiber_mod
std::vector< int > * m_zdc_fiber_mod
Definition: ZDCHitAnalysis.h:42
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 >
ZDCHitAnalysis::m_tree
TTree * m_tree
Definition: ZDCHitAnalysis.h:53
ZdcID::channel
int channel(const Identifier &id) const
Definition: ZdcID.h:175
Identifier
Definition: IdentifierFieldParser.cxx:14