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

#include <LArHitMerger.h>

Inheritance diagram for LArHitMerger:
Collaboration diagram for LArHitMerger:

Public Member Functions

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

ServiceHandle< PileUpMergeSvcm_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc"}
 
std::vector< bool > m_SubDetFlag
 
std::vector< std::string > m_HitContainer
 
std::vector< int > m_CaloType
 
StringProperty m_SubDetectors {this, "SubDetectors", "LAr_All", "subdetector selection"}
 
StringProperty m_EmBarrelHitContainerName {this, "EmBarrelHitContainerName", "LArHitEMB", "Hit container name for EMB"}
 
StringProperty m_EmEndCapHitContainerName {this, "EmEndCapHitContainerName", "LArHitEMEC", "Hit container name for EMEC"}
 
StringProperty m_HecHitContainerName {this, "HecHitContainerName", "LArHitHEC", "Hit container name for HEC"}
 
StringProperty m_ForWardHitContainerName {this, "ForWardHitContainerName", "LArHitFCAL", "Hit container name for FCAL"}
 
const LArEM_IDm_larem_id {}
 
const LArHEC_IDm_larhec_id {}
 
const LArFCAL_IDm_larfcal_id {}
 
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 20 of file LArHitMerger.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

◆ LArHitMerger()

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

Definition at line 21 of file LArHitMerger.cxx.

22  : AthAlgorithm(name, pSvcLocator)
23 {
24 }

◆ ~LArHitMerger()

LArHitMerger::~LArHitMerger ( )
default

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

Definition at line 138 of file LArHitMerger.cxx.

139 {
140 
141  std::vector<double> eCells_EM;
142  std::vector<double> eCells_HEC;
143  std::vector<double> eCells_FCAL;
144 
145  unsigned int ncells_em = m_larem_id->channel_hash_max();
146  unsigned int ncells_hec = m_larhec_id->channel_hash_max();
147  unsigned int ncells_fcal = m_larfcal_id->channel_hash_max();
148 
149  ATH_MSG_INFO(" ncells " << ncells_em << " " << ncells_hec << " " << ncells_fcal);
150 
152  eCells_EM.resize(ncells_em,0.);
154  eCells_HEC.resize(ncells_hec,0.);
156  eCells_FCAL.resize(ncells_fcal,0.);
157 
158 //
159 // ....... create the new LAr Hit containers
160 //
161  LArHitContainer* larhit_emb=nullptr;
162  LArHitContainer* larhit_emec=nullptr;
163  LArHitContainer* larhit_hec=nullptr;
164  LArHitContainer* larhit_fcal=nullptr;
165 
166  StatusCode sc;
167 
169  larhit_emb = new LArHitContainer();
170  sc = evtStore()->record(larhit_emb,m_EmBarrelHitContainerName);
171  if (sc.isFailure()) {
172  ATH_MSG_ERROR(" cannot record LArHitEMB container ");
173  return sc;
174  }
175  }
177  larhit_emec = new LArHitContainer();
178  sc = evtStore()->record(larhit_emec,m_EmEndCapHitContainerName);
179  if (sc.isFailure()) {
180  ATH_MSG_ERROR(" cannot record LArHitEMEC container ");
181  return sc;
182  }
183  }
184 
186  larhit_hec = new LArHitContainer();
187  sc = evtStore()->record(larhit_hec,m_HecHitContainerName);
188  if (sc.isFailure()) {
189  ATH_MSG_ERROR("cannot record LArHitHEC container ");
190  return sc;
191  }
192  }
194  larhit_fcal = new LArHitContainer();
195  sc = evtStore()->record(larhit_fcal,m_ForWardHitContainerName);
196  if (sc.isFailure()) {
197  ATH_MSG_ERROR("cannot record LArHitEMEC container ");
198  return sc;
199  }
200  }
201 
202 //
203 // ............ loop over the wanted hit containers
204 //
205  int nhit_tot=0;
206 
207  for (unsigned int iHitContainer=0;iHitContainer<m_HitContainer.size();iHitContainer++)
208  {
209 
210  ATH_MSG_DEBUG(" asking for: " << m_HitContainer[iHitContainer]);
211 
212  int ical=0;
213  if (m_CaloType[iHitContainer] == LArIndex::EMBARREL_INDEX ||
214  m_CaloType[iHitContainer] == LArIndex::EMENDCAP_INDEX)
215  {
216  ical=1;
217  }
218  else if (m_CaloType[iHitContainer] == LArIndex::HADENDCAP_INDEX)
219  {
220  ical=2;
221  }
222  else if (m_CaloType[iHitContainer] == LArIndex::FORWARD_INDEX)
223  {
224  ical=3;
225  }
226  else
227  {
228  ATH_MSG_ERROR("unknown calo type ! " );
229  return StatusCode::FAILURE;
230  }
231 
232  typedef PileUpMergeSvc::TimedList<LArHitContainer>::type TimedHitContList;
233  TimedHitContList hitContList;
234 //
235 // retrieve list of pairs (time,container) from PileUp service
236 
237  if (!(m_mergeSvc->retrieveSubEvtsData(m_HitContainer[iHitContainer]
238  ,hitContList).isSuccess()) && hitContList.empty()) {
239  ATH_MSG_ERROR(" Could not fill TimedHitContList" );
240  return StatusCode::FAILURE;
241  }
242 
243 // loop over this list
244  TimedHitContList::iterator iFirstCont(hitContList.begin());
245  TimedHitContList::iterator iEndCont(hitContList.end());
246  while (iFirstCont != iEndCont) {
247 // get LArHitContainer for this subevent
248  const LArHitContainer& firstCont = *(iFirstCont->second);
249 // Loop over cells in this LArHitContainer
250  LArHitContainer::const_iterator f_cell=firstCont.begin();
251  LArHitContainer::const_iterator l_cell=firstCont.end();
252 
253  while (f_cell != l_cell) {
254  double energy = (*f_cell)->energy();
255  Identifier cellId = (*f_cell)->cellID();
256  ++f_cell;
257  nhit_tot++;
258  IdentifierHash idHash;
259  if (ical==1) {
260  idHash=m_larem_id->channel_hash(cellId);
261  if (idHash<ncells_em) eCells_EM[idHash] += energy;
262  }
263  else if(ical==2) {
264  idHash=m_larhec_id->channel_hash(cellId);
265  if (idHash<ncells_hec) eCells_HEC[idHash] += energy;
266  }
267  else if(ical==3) {
268  idHash=m_larfcal_id->channel_hash(cellId);
269  if (idHash<ncells_fcal) eCells_FCAL[idHash] += energy;
270  }
271  } // loop over hits
272  ++iFirstCont;
273  } // loop over subevent list
274 
275  } // .... end of loop over containers
276 
277  ATH_MSG_INFO(" total number of hits found " << nhit_tot);
278 
279 
280  double time=0.;
281 
283  int nhit=0;
284  for (unsigned int i=0;i<ncells_em;i++) {
285  IdentifierHash idHash = i;
286  Identifier cellId = m_larem_id->channel_id(idHash);
287  double energy = eCells_EM[i];
288  if (energy>1e-6) {
290  LArHit* hit = new LArHit(cellId,energy,time);
291  hit->finalize();
292  larhit_emb->push_back(hit);
293  nhit++;
294  }
296  LArHit* hit = new LArHit(cellId,energy,time);
297  hit->finalize();
298  larhit_emec->push_back(hit);
299  nhit++;
300  }
301  }
302  }
303  ATH_MSG_INFO(" Number of hits filled in LArHitEM containers " << nhit);
304  }
305 
307  int nhit=0;
308  for (unsigned int i=0;i<ncells_hec;i++) {
309  IdentifierHash idHash = i;
310  Identifier cellId = m_larhec_id->channel_id(idHash);
311  double energy = eCells_HEC[i];
312  if (energy>1e-6) {
313  LArHit* hit = new LArHit(cellId,energy,time);
314  hit->finalize();
315  larhit_hec->push_back(hit);
316  nhit++;
317  }
318  }
319  ATH_MSG_INFO(" Number of hits filled in LArHitHEC container " << nhit);
320  }
321 
323  int nhit=0;
324  for (unsigned int i=0;i<ncells_fcal;i++) {
325  IdentifierHash idHash = i;
326  Identifier cellId = m_larfcal_id->channel_id(idHash);
327  double energy = eCells_FCAL[i];
328  if (energy>1e-6) {
329  LArHit* hit = new LArHit(cellId,energy,time);
330  hit->finalize();
331  larhit_fcal->push_back(hit);
332  nhit++;
333  }
334  }
335  ATH_MSG_INFO(" Number of hits filled in LArHitFCAL container " << nhit);
336  }
337 
338 
339 
340  // lock container in StoreGate
341  if (larhit_emb) {
342  sc = evtStore()->setConst(larhit_emb);
343  if (sc.isFailure()) {
344  ATH_MSG_ERROR(" Cannot lock LArHitContainer ");
345  return(StatusCode::FAILURE);
346  }
347  }
348 
349  if (larhit_emec) {
350  sc = evtStore()->setConst(larhit_emec);
351  if (sc.isFailure()) {
352  ATH_MSG_ERROR(" Cannot lock LArHitContainer ");
353  return(StatusCode::FAILURE);
354  }
355  }
356 
357  if (larhit_hec) {
358  sc = evtStore()->setConst(larhit_hec);
359  if (sc.isFailure()) {
360  ATH_MSG_ERROR(" Cannot lock LArHitContainer ");
361  return(StatusCode::FAILURE);
362  }
363  }
364 
365  if (larhit_fcal) {
366  sc = evtStore()->setConst(larhit_fcal);
367  if (sc.isFailure()) {
368  ATH_MSG_ERROR(" Cannot lock LArHitContainer ");
369  return(StatusCode::FAILURE);
370  }
371  }
372 
373 
374  return StatusCode::SUCCESS;
375 
376 }

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

◆ finalize()

StatusCode LArHitMerger::finalize ( )
virtual

Definition at line 378 of file LArHitMerger.cxx.

379 {
380 //
381  ATH_MSG_DEBUG(" LArHitMerger finalize completed successfully");
382 
383 //
384  return StatusCode::SUCCESS;
385 
386 }

◆ initialize()

StatusCode LArHitMerger::initialize ( )
virtual

Definition at line 27 of file LArHitMerger.cxx.

28 {
29 //
30 // ......... make the Sub-detector flag vector
31 //
32 
33  for (int i=0; i < LArIndex::NUMDET ; i++)
34  {
35  m_SubDetFlag.push_back(false);
36  }
37 
38 //
39 // ......... make the digit container name list
40 //
41 
42  if ( m_SubDetectors == "LAr_All" )
43  {
47 
51 
55 
59  }
60  else if ( m_SubDetectors == "LAr_Em" )
61  {
65 
69  }
70  else if ( m_SubDetectors == "LAr_EmBarrel" )
71  {
75  }
76  else if ( m_SubDetectors == "LAr_EmEndCap" )
77  {
81  }
82  else if ( m_SubDetectors == "LAr_HEC" )
83  {
87  }
88  else if ( m_SubDetectors == "LAr_Fcal" )
89  {
93  }
94  else if (m_SubDetectors == "LAr_EndCap")
95  {
99 
103 
107  }
108  else
109  {
110  ATH_MSG_ERROR("Invalid SubDetector propertie");
111  return(StatusCode::FAILURE);
112  }
113 
114 
115 //
116 // locate the PileUpMergeSvc and initialize our local ptr
117 //
118  ATH_CHECK(m_mergeSvc.retrieve());
119  ATH_MSG_DEBUG("PileUpMergeSvc successfully initialized");
120 
121 
122 
123  //retrieve ID helpers
124  const CaloIdManager* caloIdMgr = nullptr;
125  StatusCode sc = detStore()->retrieve(caloIdMgr);
126  if (sc.isFailure()) {
127  ATH_MSG_ERROR("Unable to retrieve CaloIdManager from DetectoreStore");
128  return StatusCode::FAILURE;
129  }
130  m_larem_id = caloIdMgr->getEM_ID();
131  m_larhec_id = caloIdMgr->getHEC_ID();
132  m_larfcal_id = caloIdMgr->getFCAL_ID();
133 
134  return StatusCode::SUCCESS;
135 
136 }

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

std::vector<int> LArHitMerger::m_CaloType
private

Definition at line 37 of file LArHitMerger.h.

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

StringProperty LArHitMerger::m_EmBarrelHitContainerName {this, "EmBarrelHitContainerName", "LArHitEMB", "Hit container name for EMB"}
private

Definition at line 40 of file LArHitMerger.h.

◆ m_EmEndCapHitContainerName

StringProperty LArHitMerger::m_EmEndCapHitContainerName {this, "EmEndCapHitContainerName", "LArHitEMEC", "Hit container name for EMEC"}
private

Definition at line 41 of file LArHitMerger.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_ForWardHitContainerName

StringProperty LArHitMerger::m_ForWardHitContainerName {this, "ForWardHitContainerName", "LArHitFCAL", "Hit container name for FCAL"}
private

Definition at line 43 of file LArHitMerger.h.

◆ m_HecHitContainerName

StringProperty LArHitMerger::m_HecHitContainerName {this, "HecHitContainerName", "LArHitHEC", "Hit container name for HEC"}
private

Definition at line 42 of file LArHitMerger.h.

◆ m_HitContainer

std::vector<std::string> LArHitMerger::m_HitContainer
private

Definition at line 36 of file LArHitMerger.h.

◆ m_larem_id

const LArEM_ID* LArHitMerger::m_larem_id {}
private

Definition at line 45 of file LArHitMerger.h.

◆ m_larfcal_id

const LArFCAL_ID* LArHitMerger::m_larfcal_id {}
private

Definition at line 47 of file LArHitMerger.h.

◆ m_larhec_id

const LArHEC_ID* LArHitMerger::m_larhec_id {}
private

Definition at line 46 of file LArHitMerger.h.

◆ m_mergeSvc

ServiceHandle<PileUpMergeSvc> LArHitMerger::m_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc"}
private

Definition at line 33 of file LArHitMerger.h.

◆ m_SubDetectors

StringProperty LArHitMerger::m_SubDetectors {this, "SubDetectors", "LAr_All", "subdetector selection"}
private

Definition at line 39 of file LArHitMerger.h.

◆ m_SubDetFlag

std::vector<bool> LArHitMerger::m_SubDetFlag
private

Definition at line 35 of file LArHitMerger.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:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
EMENDCAP_INDEX
@ EMENDCAP_INDEX
Definition: LArIndexEnum.h:9
FORWARD_INDEX
@ FORWARD_INDEX
Definition: LArIndexEnum.h:11
CaloIDHelper::channel_hash_max
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
LArHitMerger::m_larem_id
const LArEM_ID * m_larem_id
Definition: LArHitMerger.h:45
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArHit::finalize
void finalize()
The method to be called at the end of event by SD.
Definition: LArHit.h:143
LArHitMerger::m_larhec_id
const LArHEC_ID * m_larhec_id
Definition: LArHitMerger.h:46
CaloIdManager::getEM_ID
const LArEM_ID * getEM_ID(void) const
Definition: CaloIdManager.cxx:80
LArHitMerger::m_SubDetectors
StringProperty m_SubDetectors
Definition: LArHitMerger.h:39
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
LArFCAL_Base_ID::channel_hash
IdentifierHash channel_hash(Identifier channelId) const
Convert a connected channel (cell) Identifier to a hash code.
LArHitContainer
Hit collection.
Definition: LArHitContainer.h:26
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LArEM_Base_ID::channel_id
Identifier channel_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
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
AthenaHitsVector< LArHit >::const_iterator
boost::transform_iterator< make_const, typename CONT::const_iterator > const_iterator
Definition: AthenaHitsVector.h:58
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
PileUpMergeSvc::TimedList::type
std::list< value_t > type
type of the collection of timed data object
Definition: PileUpMergeSvc.h:75
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
NUMDET
@ NUMDET
Definition: LArIndexEnum.h:12
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
LArEM_Base_ID::channel_hash
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
CaloIdManager::getHEC_ID
const LArHEC_ID * getHEC_ID(void) const
Definition: CaloIdManager.cxx:95
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
AthenaHitsVector::push_back
void push_back(T *t)
Definition: AthenaHitsVector.h:153
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloIdManager
This class initializes the Calo (LAr and Tile) offline identifiers.
Definition: CaloIdManager.h:45
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:85
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
LArFCAL_Base_ID::channel_id
Identifier channel_id(const ExpandedIdentifier &exp_id) const
cell identifier for a channel from ExpandedIdentifier
CaloIdManager::getFCAL_ID
const LArFCAL_ID * getFCAL_ID(void) const
Definition: CaloIdManager.cxx:85
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LArHitMerger::m_larfcal_id
const LArFCAL_ID * m_larfcal_id
Definition: LArHitMerger.h:47
LArHEC_Base_ID::channel_hash
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
LArHitContainer
LArHitContainer
Definition: LArSimEventTPCnv.cxx:28
HADENDCAP_INDEX
@ HADENDCAP_INDEX
Definition: LArIndexEnum.h:10
LArHitMerger::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
Definition: LArHitMerger.h:33
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:221
LArHitMerger::m_EmEndCapHitContainerName
StringProperty m_EmEndCapHitContainerName
Definition: LArHitMerger.h:41
LArHEC_Base_ID::channel_id
Identifier channel_id(const ExpandedIdentifier &exp_id) const
channel identifier for a channel from ExpandedIdentifier
LArHit
Class to store hit energy and time in LAr cell from G4 simulation.
Definition: LArHit.h:25
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
LArHitMerger::m_SubDetFlag
std::vector< bool > m_SubDetFlag
Definition: LArHitMerger.h:35
a
TList * a
Definition: liststreamerinfos.cxx:10
h
LArHitMerger::m_ForWardHitContainerName
StringProperty m_ForWardHitContainerName
Definition: LArHitMerger.h:43
EMBARREL_INDEX
@ EMBARREL_INDEX
Definition: LArIndexEnum.h:8
LArHitMerger::m_HecHitContainerName
StringProperty m_HecHitContainerName
Definition: LArHitMerger.h:42
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
LArEM_Base_ID::is_em_barrel
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArHitMerger::m_HitContainer
std::vector< std::string > m_HitContainer
Definition: LArHitMerger.h:36
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
AthenaHitsVector::end
const_iterator end() const
Definition: AthenaHitsVector.h:143
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArHitMerger::m_EmBarrelHitContainerName
StringProperty m_EmBarrelHitContainerName
Definition: LArHitMerger.h:40
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthenaHitsVector::begin
const_iterator begin() const
Definition: AthenaHitsVector.h:139
LArEM_Base_ID::is_em_endcap
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
LArHitMerger::m_CaloType
std::vector< int > m_CaloType
Definition: LArHitMerger.h:37
Identifier
Definition: IdentifierFieldParser.cxx:14