ATLAS Offline Software
Loading...
Searching...
No Matches
CalibHitToCaloCell Class Reference

#include <CalibHitToCaloCell.h>

Inheritance diagram for CalibHitToCaloCell:
Collaboration diagram for CalibHitToCaloCell:

Public Member Functions

 CalibHitToCaloCell (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~CalibHitToCaloCell ()
StatusCode initialize () override
StatusCode execute () override
StatusCode finalize () override
void test_energy (Energy *)
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::string m_tileActiveHitCnt
std::string m_tileInactiveHitCnt
std::string m_tileDMHitCnt
std::string m_larInactHitCnt
std::string m_larActHitCnt
std::string m_larDMHitCnt
bool m_store_Tot
bool m_store_Vis
bool m_store_Em
bool m_store_NonEm
bool m_storeUnknown
std::string m_caloCell_Tot
std::string m_caloCell_Vis
std::string m_caloCell_Em
std::string m_caloCell_NonEm
const CaloCell_IDm_caloCell_ID {nullptr}
const CaloDM_IDm_caloDM_ID {nullptr}
std::vector< LArCell * > m_Cells_Tot
std::vector< LArCell * > m_Cells_Vis
std::vector< LArCell * > m_Cells_Em
std::vector< LArCell * > m_Cells_NonEm
int m_nchan
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 30 of file CalibHitToCaloCell.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

◆ CalibHitToCaloCell()

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

Definition at line 42 of file CalibHitToCaloCell.cxx.

43 : AthAlgorithm(name, pSvcLocator),
44 m_tileActiveHitCnt ("TileCalibHitActiveCell"),
45 m_tileInactiveHitCnt ("TileCalibHitInactiveCell"),
46 m_tileDMHitCnt ("TileCalibHitDeadMaterial"),
47 m_larInactHitCnt ("LArCalibrationHitInactive"),
48 m_larActHitCnt ("LArCalibrationHitActive"),
49 m_larDMHitCnt ("LArCalibrationHitDeadMaterial"),
50 m_store_Tot(false),
51 m_store_Vis(false),
52 m_store_Em(false),
53 m_store_NonEm(false),
54 m_storeUnknown(false),
55 m_caloCell_Tot("TotalCalibCell"), m_caloCell_Vis("VisCalibCell"),
57 m_nchan(0)
58
59// The names suggestion if one needs to have them
60//
61// m_caloCell_Em("EmCalibCell"), m_caloCell_NonEm("NonEmCalibCell")
62
63{
64 declareProperty("StoreUnknownCells", m_storeUnknown);
65
66 declareProperty("CellTotEne", m_caloCell_Tot);
67 declareProperty("CellVisEne", m_caloCell_Vis);
68 declareProperty("CellEmEne", m_caloCell_Em);
69 declareProperty("CellNonEmEne", m_caloCell_NonEm);
70}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::string m_tileActiveHitCnt
std::string m_tileInactiveHitCnt

◆ ~CalibHitToCaloCell()

CalibHitToCaloCell::~CalibHitToCaloCell ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

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

◆ evtStore()

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.

◆ execute()

StatusCode CalibHitToCaloCell::execute ( )
override

Definition at line 98 of file CalibHitToCaloCell.cxx.

99{
100 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
101 ATH_CHECK(caloMgrHandle.isValid());
102 const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
103
104 // OUTPUT CONTAINERS
105 CaloCellContainer* cnt = nullptr;
106 CaloCellContainer* cnt_1 = nullptr;
107 CaloCellContainer* cnt_2 = nullptr;
108 CaloCellContainer* cnt_3 = nullptr;
109 if(m_store_Tot) cnt = new CaloCellContainer();
110 if(m_store_Vis) cnt_1 = new CaloCellContainer();
111 if(m_store_Em) cnt_2 = new CaloCellContainer();
112 if(m_store_NonEm) cnt_3 = new CaloCellContainer();
113
114 // INPUT CONTAINERS
115 const CaloCalibrationHitContainer* tile_actHitCnt;
116 const CaloCalibrationHitContainer* tile_inactHitCnt;
117 const CaloCalibrationHitContainer* tile_dmHitCnt;
118 const CaloCalibrationHitContainer* lar_actHitCnt;
119 const CaloCalibrationHitContainer* lar_inactHitCnt;
120 const CaloCalibrationHitContainer* lar_dmHitCnt;
121
122 //retrieving input Calibhit containers
123 ATH_CHECK( evtStore()->retrieve(tile_actHitCnt, m_tileActiveHitCnt) );
124 ATH_CHECK( evtStore()->retrieve(tile_inactHitCnt, m_tileInactiveHitCnt) );
125 ATH_CHECK( evtStore()->retrieve(tile_dmHitCnt, m_tileDMHitCnt) );
126 ATH_CHECK( evtStore()->retrieve(lar_actHitCnt, m_larActHitCnt) );
127 ATH_CHECK( evtStore()->retrieve(lar_inactHitCnt, m_larInactHitCnt) );
128 ATH_CHECK( evtStore()->retrieve(lar_dmHitCnt, m_larDMHitCnt) );
129
130 ATH_MSG_DEBUG("CaloCalibrationHitContainers retrieved successfuly" );
131
132 //count
133 m_nchan=0;
134 int em_nchan=0;
135 int hec_nchan=0;
136 int fcal_nchan=0;
137 int lar_unknown_nchan=0;
138 int tile_nchan=0;
139 int tile_unknown_nchan = 0 ;
140
141 bool new_id = false;
142
143 std::vector<Identifier> ID;
144
145 //clean up CaloCell vectors
146 //for 'this' event
147 m_Cells_Tot.clear();
148 m_Cells_Vis.clear();
149 m_Cells_Em.clear();
150 m_Cells_NonEm.clear();
151
152
153 if(lar_inactHitCnt)
154 {
155 if( lar_inactHitCnt->Size() != 0 )
156 {
157 for (const CaloCalibrationHit* hit : *lar_inactHitCnt)
158 {
159 double Etot = hit->energyTotal();
160 double Eem = hit->energy(0);
161 double Enonem = hit->energy(1);
162 double Evis = Eem + Enonem;
163
164 Identifier id=hit->cellID();
165
166 //check if this ID is LAr one
167 if(m_caloCell_ID->is_lar(id))
168 {
169 const CaloDetDescrElement* caloDDE = caloDDMgr->get_element(id);
170
171 if(m_store_Tot) {
172 LArCell* calibCell = new LArCell(caloDDE, id, Etot, 0., 0, 0, CaloGain::UNKNOWNGAIN );
173 m_Cells_Tot.push_back(calibCell) ;
174 }
175
176 if(m_store_Vis) {
177 LArCell* calibCell_1 = new LArCell(caloDDE, id, Evis, 0., 0, 0, CaloGain::UNKNOWNGAIN );
178 m_Cells_Vis.push_back(calibCell_1) ;
179 }
180
181 if(m_store_Em) {
182 LArCell* calibCell_2 = new LArCell(caloDDE, id, Eem, 0., 0, 0, CaloGain::UNKNOWNGAIN );
183 m_Cells_Em.push_back(calibCell_2) ;
184 }
185
186 if(m_store_NonEm) {
187 LArCell* calibCell_3 = new LArCell(caloDDE, id, Enonem, 0., 0, 0, CaloGain::UNKNOWNGAIN );
188 m_Cells_NonEm.push_back(calibCell_3) ;
189 }
190
191 ID.push_back(id);
192 ++m_nchan;
193 }
194 //another story...
195 else
196 {
197 ATH_MSG_DEBUG( "non-LAr ID in LArInactive "
198 << id.getString() << " sub_calo " << m_caloCell_ID->sub_calo(id) );
200 {
201 ATH_MSG_DEBUG("Ianctive CalibHit doesn't respect to any LArCell - "
202 <<"create dummy LArCell to store energy " );
203
204 if(m_store_Tot) {
205 LArCell* calibCell = new LArCell();
206 calibCell->setEnergy(Etot);
207 m_Cells_Tot.push_back(calibCell) ;
208 }
209
210 if(m_store_Vis) {
211 LArCell* calibCell_1 = new LArCell();
212 calibCell_1->setEnergy(Evis);
213 m_Cells_Vis.push_back(calibCell_1) ;
214 }
215
216 if(m_store_Em) {
217 LArCell* calibCell_2 = new LArCell();
218 calibCell_2->setEnergy(Eem);
219 m_Cells_Em.push_back(calibCell_2) ;
220 }
221
222 if(m_store_NonEm) {
223 LArCell* calibCell_3 = new LArCell();
224 calibCell_3->setEnergy(Enonem);
225 m_Cells_NonEm.push_back(calibCell_3) ;
226 }
227
228 ID.push_back(id);
229 ++m_nchan;
230 }
231 }
232 }
233 }
234 }
235
236
237 if(lar_actHitCnt)
238 {
239 if( lar_actHitCnt->Size() != 0 )
240 {
241 //fix the current size of hits vector. for looping a bit later
242 int hits_vec_size = (int)ID.size() ;
243
244 for (const CaloCalibrationHit* hit : *lar_actHitCnt)
245 {
246 Identifier id=hit->cellID();
247
248 //merge inactive and active hits
249 //from the same cell together
250 for (int n=0; n!=hits_vec_size; n++)
251 {
252 if( id == ID[n] )
253 {
254 if(m_store_Tot) m_Cells_Tot[n]->add_energy(hit->energyTotal()) ;
255 if(m_store_Vis) m_Cells_Vis[n]->add_energy(hit->energy(0) + hit->energy(1)) ;
256 if(m_store_Em) m_Cells_Em[n]->add_energy(hit->energy(0)) ;
257 if(m_store_NonEm) m_Cells_NonEm[n]->add_energy(hit->energy(1)) ;
258
259 new_id = false;
260 break;
261 }
262 else
263 {
264 new_id = true;
265 }
266 }
267 if(new_id)
268 {
269 double Etot = hit->energyTotal();
270 double Eem = hit->energy(0);
271 double Enonem = hit->energy(1);
272 double Evis = Eem + Enonem;
273
274 if(m_caloCell_ID->is_lar(id))
275 {
276 const CaloDetDescrElement* caloDDE = caloDDMgr->get_element(id);
277
278 if(m_store_Tot) {
279 LArCell* calibCell = new LArCell(caloDDE, id, Etot, 0., 0, 0, CaloGain::UNKNOWNGAIN );
280 m_Cells_Tot.push_back(calibCell) ;
281 }
282
283 if(m_store_Vis) {
284 LArCell* calibCell_1 = new LArCell(caloDDE, id, Evis, 0., 0, 0, CaloGain::UNKNOWNGAIN );
285 m_Cells_Vis.push_back(calibCell_1) ;
286 }
287
288 if(m_store_Em) {
289 LArCell* calibCell_2 = new LArCell(caloDDE, id, Eem, 0., 0, 0, CaloGain::UNKNOWNGAIN );
290 m_Cells_Em.push_back(calibCell_2) ;
291 }
292
293 if(m_store_NonEm) {
294 LArCell* calibCell_3 = new LArCell(caloDDE, id, Enonem, 0., 0, 0, CaloGain::UNKNOWNGAIN );
295 m_Cells_NonEm.push_back(calibCell_3) ;
296 }
297
298 ID.push_back(id);
299 ++m_nchan;
300 }
301 //another story...
302 else
303 {
304 ATH_MSG_DEBUG( "non-LAr ID in LArActive "
305 << id.getString() << " sub_calo " << m_caloCell_ID->sub_calo(id) );
307 {
308 ATH_MSG_DEBUG("Active CalibHit doesn't respect to any LArCell - "
309 <<"create dummy LArCell to store energy " );
310
311
312 if(m_store_Tot) {
313 LArCell* calibCell = new LArCell();
314 calibCell->setEnergy(Etot);
315 m_Cells_Tot.push_back(calibCell) ;
316 }
317
318 if(m_store_Vis) {
319 LArCell* calibCell_1 = new LArCell();
320 calibCell_1->setEnergy(Evis);
321 m_Cells_Vis.push_back(calibCell_1) ;
322 }
323
324 if(m_store_Em) {
325 LArCell* calibCell_2 = new LArCell();
326 calibCell_2->setEnergy(Eem);
327 m_Cells_Em.push_back(calibCell_2) ;
328 }
329
330 if(m_store_NonEm) {
331 LArCell* calibCell_3 = new LArCell();
332 calibCell_3->setEnergy(Enonem);
333 m_Cells_NonEm.push_back(calibCell_3) ;
334 }
335
336 ID.push_back(id);
337 ++m_nchan;
338 }
339 }
340 }
341 }
342 }
343 }
344
345 //Now, put LArCells in the containers keeping
346 //the order. First goes EM, then HEC and so on
347 if(!m_Cells_Tot.empty())
348 {
349 for(int itr=0; itr!=m_nchan; itr++)
350 {
351 if(m_caloCell_ID->is_em(m_Cells_Tot[itr]->ID()))
352 {
353 if(m_store_Tot) cnt->push_back(m_Cells_Tot[itr]);
354 if(m_store_Vis) cnt_1->push_back(m_Cells_Vis[itr]);
355 if(m_store_Em) cnt_2->push_back(m_Cells_Em[itr]);
356 if(m_store_NonEm) cnt_3->push_back(m_Cells_NonEm[itr]);
357
358 ++em_nchan;
359 }
360 }
361 if(em_nchan!=0)
362 {
363 if(m_store_Tot) cnt->setHasCalo(CaloCell_ID::LAREM);
367 }
368
369 for(int itr=0; itr!=m_nchan; itr++)
370 {
371 if(m_caloCell_ID->is_hec(m_Cells_Tot[itr]->ID()))
372 {
373 if(m_store_Tot) cnt->push_back(m_Cells_Tot[itr]);
374 if(m_store_Vis) cnt_1->push_back(m_Cells_Vis[itr]);
375 if(m_store_Em) cnt_2->push_back(m_Cells_Em[itr]);
376 if(m_store_NonEm) cnt_3->push_back(m_Cells_NonEm[itr]);
377
378 ++hec_nchan;
379 }
380 }
381 if(hec_nchan!=0)
382 {
383 if(m_store_Tot) cnt->setHasCalo(CaloCell_ID::LARHEC);
387 }
388
389 for(int itr=0; itr!=m_nchan; itr++)
390 {
391 if(m_caloCell_ID->is_fcal(m_Cells_Tot[itr]->ID()))
392 {
393 if(m_store_Tot) cnt->push_back(m_Cells_Tot[itr]);
394 if(m_store_Vis) cnt_1->push_back(m_Cells_Vis[itr]);
395 if(m_store_Em) cnt_2->push_back(m_Cells_Em[itr]);
396 if(m_store_NonEm) cnt_3->push_back(m_Cells_NonEm[itr]);
397
398 ++fcal_nchan;
399 }
400 }
401 if(fcal_nchan!=0)
402 {
403 if(m_store_Tot) cnt->setHasCalo(CaloCell_ID::LARFCAL);
407 }
408
409
411 {
412 for(int itr=0; itr!=m_nchan; itr++)
413 {
414 if(!(m_caloCell_ID->is_lar(m_Cells_Tot[itr]->ID())))
415 {
416 if(m_store_Tot) cnt->push_back(m_Cells_Tot[itr]);
417 if(m_store_Vis) cnt_1->push_back(m_Cells_Vis[itr]);
418 if(m_store_Em) cnt_2->push_back(m_Cells_Em[itr]);
419 if(m_store_NonEm) cnt_3->push_back(m_Cells_NonEm[itr]);
420
421 ++lar_unknown_nchan;
422 }
423 }
424
425 if(lar_unknown_nchan!=0)
426 {
427 if(m_store_Tot) cnt->setHasCalo(CaloCell_ID::NOT_VALID);
431 }
432 }
433 }
434
435 ATH_MSG_VERBOSE("--- LAr INFO --- "<<m_nchan );
436 ATH_MSG_VERBOSE("LArCells = "<<m_nchan );
437 ATH_MSG_VERBOSE("EMCells = "<<em_nchan );
438 ATH_MSG_VERBOSE("HECCells = "<<hec_nchan );
439 ATH_MSG_VERBOSE("FCALCells = "<<fcal_nchan );
440 ATH_MSG_VERBOSE("NOT_VALID (LAr) = "<<lar_unknown_nchan );
441
442
443 if(tile_actHitCnt)
444 {
445 if( (tile_actHitCnt->Size()) != 0 )
446 {
447 for (const CaloCalibrationHit* hit : *tile_actHitCnt)
448 {
449 Identifier id=hit->cellID();
450
451 double Etot = hit->energyTotal();
452 double Eem = hit->energy(0);
453 double Enonem = hit->energy(1);
454 double Evis = Eem + Enonem;
455
456 if(m_caloCell_ID->is_tile(id))
457 {
458 const CaloDetDescrElement* caloDDE = caloDDMgr->get_element(id);
459
460 if(m_store_Tot) {
461 TileCell* calibCell = new TileCell(caloDDE, id, Etot, 0., 0, 0, CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
462 cnt->push_back(calibCell);
463 }
464
465 if(m_store_Vis) {
466 TileCell* calibCell_1 = new TileCell(caloDDE, id, Evis, 0., 0, 0, CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
467 cnt_1->push_back(calibCell_1);
468 }
469
470 if(m_store_Em) {
471 TileCell* calibCell_2 = new TileCell(caloDDE, id, Eem, 0., 0, 0, CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
472 cnt_2->push_back(calibCell_2);
473 }
474
475 if(m_store_NonEm) {
476 TileCell* calibCell_3 = new TileCell(caloDDE, id, Enonem, 0., 0, 0, CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
477 cnt_3->push_back(calibCell_3);
478 }
479
480 ID.push_back(id);
481 ++tile_nchan;
482 ++m_nchan;
483 }
484 else
485 {
486 ATH_MSG_DEBUG( "non-Tile ID in Tile "
487 << id.getString() << " sub_calo " << m_caloCell_ID->sub_calo(id) );
489 {
490 ATH_MSG_DEBUG("Active CalibHit doesn't respect to any TileCell - "
491 <<"create dummy TileCell to store energy " );
492
493 if(m_store_Tot) {
494 TileCell* calibCell = new TileCell();
495 calibCell->setEnergy(Etot);
496 cnt->push_back(calibCell);
497 }
498
499 if(m_store_Vis) {
500 TileCell* calibCell_1 = new TileCell();
501 calibCell_1->setEnergy(Evis);
502 cnt_1->push_back(calibCell_1);
503 }
504
505 if(m_store_Em) {
506 TileCell* calibCell_2 = new TileCell();
507 calibCell_2->setEnergy(Eem);
508 cnt_2->push_back(calibCell_2);
509 }
510
511 if(m_store_NonEm) {
512 TileCell* calibCell_3 = new TileCell();
513 calibCell_3->setEnergy(Enonem);
514 cnt_3->push_back(calibCell_3);
515 }
516
517 ID.push_back(id);
518 ++tile_unknown_nchan;
519 ++m_nchan;
520 }
521 }
522 }
523
524 if(tile_nchan!=0)
525 {
526 if(m_store_Tot) cnt->setHasCalo(CaloCell_ID::TILE);
530 }
531
532 if(tile_unknown_nchan!=0)
533 {
534 if( !(cnt->hasCalo(CaloCell_ID::NOT_VALID)) )
535 {
536 if(m_store_Tot) cnt->setHasCalo(CaloCell_ID::NOT_VALID);
540 }
541 }
542 }
543 }
544
545
546 if(tile_inactHitCnt)
547 {
548 if( (tile_inactHitCnt->Size()) != 0 )
549 {
550
551 for (const CaloCalibrationHit* hit : *tile_actHitCnt)
552 {
553 Identifier id=hit->cellID();
554
555 double Etot = hit->energyTotal();
556 double Eem = hit->energy(0);
557 double Enonem = hit->energy(1);
558 double Evis = Eem + Enonem;
559
560 if(m_caloCell_ID->is_tile(id))
561 {
562 const CaloDetDescrElement* caloDDE = caloDDMgr->get_element(id);
563
564 if(m_store_Tot) {
565 TileCell* calibCell = new TileCell(caloDDE, id, Etot, 0., 0, 0, CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
566 cnt->push_back(calibCell);
567 }
568
569 if(m_store_Vis) {
570 TileCell* calibCell_1 = new TileCell(caloDDE, id, Evis, 0., 0, 0, CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
571 cnt_1->push_back(calibCell_1);
572 }
573
574 if(m_store_Em) {
575 TileCell* calibCell_2 = new TileCell(caloDDE, id, Eem, 0., 0, 0, CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
576 cnt_2->push_back(calibCell_2);
577 }
578
579 if(m_store_NonEm) {
580 TileCell* calibCell_3 = new TileCell(caloDDE, id, Enonem, 0., 0, 0, CaloGain::UNKNOWNGAIN, 0.0, 0.0 );
581 cnt_3->push_back(calibCell_3);
582 }
583
584 ID.push_back(id);
585 ++tile_nchan;
586 ++m_nchan;
587 }
588 else
589 {
590 ATH_MSG_DEBUG( "non-Tile ID in Tile "
591 << id.getString() << " sub_calo " << m_caloCell_ID->sub_calo(id) );
593 {
594 ATH_MSG_DEBUG("Inactive CalibHit doesn't respect to any TileCell - "
595 <<"create dummy TileCell to store energy " );
596
597 if(m_store_Tot) {
598 TileCell* calibCell = new TileCell();
599 calibCell->setEnergy(Etot);
600 cnt->push_back(calibCell);
601 }
602
603 if(m_store_Vis) {
604 TileCell* calibCell_1 = new TileCell();
605 calibCell_1->setEnergy(Evis);
606 cnt_1->push_back(calibCell_1);
607 }
608
609 if(m_store_Em) {
610 TileCell* calibCell_2 = new TileCell();
611 calibCell_2->setEnergy(Eem);
612 cnt_2->push_back(calibCell_2);
613 }
614
615 if(m_store_NonEm) {
616 TileCell* calibCell_3 = new TileCell();
617 calibCell_3->setEnergy(Enonem);
618 cnt_3->push_back(calibCell_3);
619 }
620
621 ID.push_back(id);
622 ++tile_unknown_nchan;
623 ++m_nchan;
624 }
625 }
626 }
627
628 if(tile_nchan!=0)
629 {
630 if(m_store_Tot) cnt->setHasCalo(CaloCell_ID::TILE);
634 }
635
636 if(tile_unknown_nchan!=0)
637 {
638 if( !(cnt->hasCalo(CaloCell_ID::NOT_VALID)) )
639 {
640 if(m_store_Tot) cnt->setHasCalo(CaloCell_ID::NOT_VALID);
644 }
645 }
646 }
647 }
648
649 ATH_MSG_VERBOSE("--- TILE INFO --- "<<m_nchan );
650 ATH_MSG_VERBOSE("TileCells = "<<tile_nchan );
651 ATH_MSG_VERBOSE("NOT_VALID (Tile) = "<<tile_unknown_nchan );
652 ATH_MSG_VERBOSE("ALL CELLS = "<<m_nchan );
653
654
655/* UNDER DEVELOPING... UNDER DEVELOPING... UNDER DEVELOPING...
656
657 if( (dmHitCnt->Size()) != 0 )
658 {
659 CaloCalibrationHitContainer::const_iterator it = dmHitCnt->begin();
660 CaloCalibrationHitContainer::const_iterator end = dmHitCnt->end();
661
662 for(; it != end; it++)
663 {
664 Identifier id=(*it)->cellID();
665 ++m_dm_nchan;
666 }
667 }
668*/
669
670
671
673// cnt->updateCaloIterators();
674// cnt->order();
675
676
677 //Record CaloCellContainer-s in the StoreGate.
678 //Check the containers name, if it was declared
679 //then record it.
680 if(m_store_Tot) ATH_CHECK( evtStore()->record(cnt, m_caloCell_Tot, false) );
681 if(m_store_Vis) ATH_CHECK( evtStore()->record(cnt_1, m_caloCell_Vis, false) );
682 if(m_store_Em) ATH_CHECK( evtStore()->record(cnt_2, m_caloCell_Em, false) );
683 if(m_store_NonEm) ATH_CHECK( evtStore()->record(cnt_3, m_caloCell_NonEm, false) );
684
685 ID.clear();
686
687 ATH_MSG_DEBUG("execute() completed successfully" );
688 return StatusCode::SUCCESS;
689}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
std::vector< Identifier > ID
CaloCalibrationHitContainer
const CaloCell_ID * m_caloCell_ID
std::vector< LArCell * > m_Cells_Vis
std::vector< LArCell * > m_Cells_Tot
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
std::vector< LArCell * > m_Cells_NonEm
std::vector< LArCell * > m_Cells_Em
void push_back(CaloCell *)
reimplementation of const push_back
void setHasCalo(const CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
virtual void setEnergy(float energy)
set energy
Definition CaloCell.h:472
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
virtual void setEnergy(float ene) override final
set total energy, reset eneDiff to zero (final override of CaloCell method)
Definition TileCell.cxx:123
@ UNKNOWNGAIN
Definition CaloGain.h:21
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

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

◆ finalize()

StatusCode CalibHitToCaloCell::finalize ( )
override

Definition at line 693 of file CalibHitToCaloCell.cxx.

694{
695 ATH_MSG_INFO("finalize() successfully" );
696 return StatusCode::SUCCESS;
697}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode CalibHitToCaloCell::initialize ( )
override

Definition at line 78 of file CalibHitToCaloCell.cxx.

79{
80 // retrieve ID helpers from det store
81 ATH_MSG_INFO("initialisation ID helpers" );
82
85 ATH_CHECK( m_caloMgrKey.initialize() );
86
87 m_store_Tot = !m_caloCell_Tot.empty();
88 m_store_Vis = !m_caloCell_Vis.empty();
89 m_store_Em = !m_caloCell_Em.empty();
91
92 ATH_MSG_INFO("initialisation completed" );
93 return StatusCode::SUCCESS;
94}
const ServiceHandle< StoreGateSvc > & detStore() const
const CaloDM_ID * m_caloDM_ID

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

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ 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();
384 }
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)

◆ 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 {
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, AthHistogramAlgorithm, and PyAthena::Alg.

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}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

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

◆ test_energy()

void CalibHitToCaloCell::test_energy ( Energy * energy)

Definition at line 701 of file CalibHitToCaloCell.cxx.

702{
703 ATH_MSG_INFO( "Total = "<<(*energy)[0] <<" | "
704 << "Visible = "<<(*energy)[1] <<" | "
705 << "Em = "<<(*energy)[2] <<" | "
706 << "NonEm = "<<(*energy)[3] );
707}

◆ 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_caloCell_Em

std::string CalibHitToCaloCell::m_caloCell_Em
private

Definition at line 60 of file CalibHitToCaloCell.h.

◆ m_caloCell_ID

const CaloCell_ID* CalibHitToCaloCell::m_caloCell_ID {nullptr}
private

Definition at line 63 of file CalibHitToCaloCell.h.

63{nullptr};

◆ m_caloCell_NonEm

std::string CalibHitToCaloCell::m_caloCell_NonEm
private

Definition at line 61 of file CalibHitToCaloCell.h.

◆ m_caloCell_Tot

std::string CalibHitToCaloCell::m_caloCell_Tot
private

Definition at line 58 of file CalibHitToCaloCell.h.

◆ m_caloCell_Vis

std::string CalibHitToCaloCell::m_caloCell_Vis
private

Definition at line 59 of file CalibHitToCaloCell.h.

◆ m_caloDM_ID

const CaloDM_ID* CalibHitToCaloCell::m_caloDM_ID {nullptr}
private

Definition at line 64 of file CalibHitToCaloCell.h.

64{nullptr};

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> CalibHitToCaloCell::m_caloMgrKey
private
Initial value:
{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }

Definition at line 73 of file CalibHitToCaloCell.h.

73 { this
74 , "CaloDetDescrManager"
75 , "CaloDetDescrManager"
76 , "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_Cells_Em

std::vector<LArCell*> CalibHitToCaloCell::m_Cells_Em
private

Definition at line 68 of file CalibHitToCaloCell.h.

◆ m_Cells_NonEm

std::vector<LArCell*> CalibHitToCaloCell::m_Cells_NonEm
private

Definition at line 69 of file CalibHitToCaloCell.h.

◆ m_Cells_Tot

std::vector<LArCell*> CalibHitToCaloCell::m_Cells_Tot
private

Definition at line 66 of file CalibHitToCaloCell.h.

◆ m_Cells_Vis

std::vector<LArCell*> CalibHitToCaloCell::m_Cells_Vis
private

Definition at line 67 of file CalibHitToCaloCell.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_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_larActHitCnt

std::string CalibHitToCaloCell::m_larActHitCnt
private

Definition at line 49 of file CalibHitToCaloCell.h.

◆ m_larDMHitCnt

std::string CalibHitToCaloCell::m_larDMHitCnt
private

Definition at line 50 of file CalibHitToCaloCell.h.

◆ m_larInactHitCnt

std::string CalibHitToCaloCell::m_larInactHitCnt
private

Definition at line 48 of file CalibHitToCaloCell.h.

◆ m_nchan

int CalibHitToCaloCell::m_nchan
private

Definition at line 71 of file CalibHitToCaloCell.h.

◆ m_store_Em

bool CalibHitToCaloCell::m_store_Em
private

Definition at line 54 of file CalibHitToCaloCell.h.

◆ m_store_NonEm

bool CalibHitToCaloCell::m_store_NonEm
private

Definition at line 55 of file CalibHitToCaloCell.h.

◆ m_store_Tot

bool CalibHitToCaloCell::m_store_Tot
private

Definition at line 52 of file CalibHitToCaloCell.h.

◆ m_store_Vis

bool CalibHitToCaloCell::m_store_Vis
private

Definition at line 53 of file CalibHitToCaloCell.h.

◆ m_storeUnknown

bool CalibHitToCaloCell::m_storeUnknown
private

Definition at line 56 of file CalibHitToCaloCell.h.

◆ m_tileActiveHitCnt

std::string CalibHitToCaloCell::m_tileActiveHitCnt
private

Definition at line 45 of file CalibHitToCaloCell.h.

◆ m_tileDMHitCnt

std::string CalibHitToCaloCell::m_tileDMHitCnt
private

Definition at line 47 of file CalibHitToCaloCell.h.

◆ m_tileInactiveHitCnt

std::string CalibHitToCaloCell::m_tileInactiveHitCnt
private

Definition at line 46 of file CalibHitToCaloCell.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: