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

PileUpMergeSvcp_mergeSvc
 
std::vector< bool > m_SubDetFlag
 
std::vector< std::string > m_HitContainer
 
std::vector< int > m_CaloType
 
std::string m_SubDetectors
 
std::string m_EmBarrelHitContainerName
 
std::string m_EmEndCapHitContainerName
 
std::string m_HecHitContainerName
 
std::string m_ForWardHitContainerName
 
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 19 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 24 of file LArHitMerger.cxx.

25  : AthAlgorithm(name, pSvcLocator),
26  p_mergeSvc(nullptr),
27  m_SubDetectors ("LAr_All"),
28  m_EmBarrelHitContainerName ("LArHitEMB"),
29  m_EmEndCapHitContainerName ("LArHitEMEC"),
30  m_HecHitContainerName ("LArHitHEC"),
31  m_ForWardHitContainerName ("LArHitFCAL"),
32  m_larem_id(nullptr),m_larhec_id(nullptr),m_larfcal_id(nullptr)
33 {
34  //
35  // ........ declare the private data as properties
36  //
37  declareProperty("SubDetectors",m_SubDetectors,"subdetector selection");
38  declareProperty("EmBarrelHitContainerName",m_EmBarrelHitContainerName,"Hit container name for EMB");
39  declareProperty("EmEndCapHitContainerName",m_EmEndCapHitContainerName,"Hit container name for EMEC");
40  declareProperty("HecHitContainerName",m_HecHitContainerName,"Hit container name for HEC");
41  declareProperty("ForWardHitContainerName",m_ForWardHitContainerName,"Hit container name for FCAL");
42 }

◆ ~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 165 of file LArHitMerger.cxx.

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

◆ 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 405 of file LArHitMerger.cxx.

406 {
407 //
408  ATH_MSG_DEBUG(" LArHitMerger finalize completed successfully");
409 
410 //
411  return StatusCode::SUCCESS;
412 
413 }

◆ initialize()

StatusCode LArHitMerger::initialize ( )
virtual

Definition at line 48 of file LArHitMerger.cxx.

49 {
50 //
51 // ......... make the Sub-detector flag vector
52 //
53 
54  for (int i=0; i < LArIndex::NUMDET ; i++)
55  {
56  m_SubDetFlag.push_back(false);
57  }
58 
59 //
60 // ......... make the digit container name list
61 //
62 
63  if ( m_SubDetectors == "LAr_All" )
64  {
68 
72 
76 
80  }
81  else if ( m_SubDetectors == "LAr_Em" )
82  {
86 
90  }
91  else if ( m_SubDetectors == "LAr_EmBarrel" )
92  {
96  }
97  else if ( m_SubDetectors == "LAr_EmEndCap" )
98  {
102  }
103  else if ( m_SubDetectors == "LAr_HEC" )
104  {
108  }
109  else if ( m_SubDetectors == "LAr_Fcal" )
110  {
114  }
115  else if (m_SubDetectors == "LAr_EndCap")
116  {
120 
124 
128  }
129  else
130  {
131  ATH_MSG_ERROR("Invalid SubDetector propertie");
132  return(StatusCode::FAILURE);
133  }
134 
135 
136 //
137 // locate the PileUpMergeSvc and initialize our local ptr
138 //
139  if (!(service("PileUpMergeSvc", p_mergeSvc)).isSuccess() ||
140  nullptr == p_mergeSvc) {
141  ATH_MSG_ERROR("Could not find PileUpMergeSvc");
142  return StatusCode::FAILURE;
143  }
144  else
145  {
146  ATH_MSG_INFO("PileUpMergeSvc successfully initialized");
147  }
148 
149 
150  //retrieve ID helpers
151  const CaloIdManager* caloIdMgr = nullptr;
152  StatusCode sc = detStore()->retrieve(caloIdMgr);
153  if (sc.isFailure()) {
154  ATH_MSG_ERROR("Unable to retrieve CaloIdManager from DetectoreStore");
155  return StatusCode::FAILURE;
156  }
157  m_larem_id = caloIdMgr->getEM_ID();
158  m_larhec_id = caloIdMgr->getHEC_ID();
159  m_larfcal_id = caloIdMgr->getFCAL_ID();
160 
161  return StatusCode::SUCCESS;
162 
163 }

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

std::string LArHitMerger::m_EmBarrelHitContainerName
private

Definition at line 39 of file LArHitMerger.h.

◆ m_EmEndCapHitContainerName

std::string LArHitMerger::m_EmEndCapHitContainerName
private

Definition at line 40 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

std::string LArHitMerger::m_ForWardHitContainerName
private

Definition at line 42 of file LArHitMerger.h.

◆ m_HecHitContainerName

std::string LArHitMerger::m_HecHitContainerName
private

Definition at line 41 of file LArHitMerger.h.

◆ m_HitContainer

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

Definition at line 35 of file LArHitMerger.h.

◆ m_larem_id

const LArEM_ID* LArHitMerger::m_larem_id
private

Definition at line 44 of file LArHitMerger.h.

◆ m_larfcal_id

const LArFCAL_ID* LArHitMerger::m_larfcal_id
private

Definition at line 46 of file LArHitMerger.h.

◆ m_larhec_id

const LArHEC_ID* LArHitMerger::m_larhec_id
private

Definition at line 45 of file LArHitMerger.h.

◆ m_SubDetectors

std::string LArHitMerger::m_SubDetectors
private

Definition at line 38 of file LArHitMerger.h.

◆ m_SubDetFlag

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

Definition at line 34 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.

◆ p_mergeSvc

PileUpMergeSvc* LArHitMerger::p_mergeSvc
private

Definition at line 32 of file LArHitMerger.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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:44
AthCommonDataStore< AthCommonMsg< Algorithm > >::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:45
CaloIdManager::getEM_ID
const LArEM_ID * getEM_ID(void) const
Definition: CaloIdManager.cxx:80
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
LArHitMerger::m_EmEndCapHitContainerName
std::string m_EmEndCapHitContainerName
Definition: LArHitMerger.h:40
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
LArHitMerger::m_SubDetectors
std::string m_SubDetectors
Definition: LArHitMerger.h:38
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LArHitMerger::p_mergeSvc
PileUpMergeSvc * p_mergeSvc
Definition: LArHitMerger.h:32
LArHitMerger::m_HecHitContainerName
std::string m_HecHitContainerName
Definition: LArHitMerger.h:41
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
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
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:92
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
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
LArHitMerger::m_ForWardHitContainerName
std::string m_ForWardHitContainerName
Definition: LArHitMerger.h:42
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:46
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
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:195
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:34
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
h
EMBARREL_INDEX
@ EMBARREL_INDEX
Definition: LArIndexEnum.h:8
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:35
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
AthenaHitsVector::end
const_iterator end() const
Definition: AthenaHitsVector.h:143
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
IdentifierHash
Definition: IdentifierHash.h:38
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
LArHitMerger::m_EmBarrelHitContainerName
std::string m_EmBarrelHitContainerName
Definition: LArHitMerger.h:39
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
PileUpMergeSvc::retrieveSubEvtsData
StatusCode retrieveSubEvtsData(const KEY &dataKey, TIMEDDATA &timedData)
retrieve keyed DATA objs for all sub-events and attach a time to them
ServiceHandle< ICondSvc >
LArHitMerger::m_CaloType
std::vector< int > m_CaloType
Definition: LArHitMerger.h:36