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 ()
virtual StatusCode initialize () override
virtual StatusCode execute () override
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 {"TileCalibHitActiveCell"}
std::string m_tileInactiveHitCnt {"TileCalibHitInactiveCell"}
std::string m_tileDMHitCnt {"TileCalibHitDeadMaterial"}
std::string m_larInactHitCnt {"LArCalibrationHitInactive"}
std::string m_larActHitCnt {"LArCalibrationHitActive"}
std::string m_larDMHitCnt {"LArCalibrationHitDeadMaterial"}
bool m_store_Tot {false}
bool m_store_Vis {false}
bool m_store_Em {false}
bool m_store_NonEm {false}
Gaudi::Property< bool > m_storeUnknown {this, "StoreUnknownCells", false}
Gaudi::Property< std::string > m_caloCell_Tot {this, "CellTotEne", "TotalCalibCell"}
Gaudi::Property< std::string > m_caloCell_Vis {this, "CellVisEne", "VisCalibCell"}
Gaudi::Property< std::string > m_caloCell_Em {this, "CellEmEne", ""}
Gaudi::Property< std::string > m_caloCell_NonEm {this, "CellNonEmEne", ""}
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 {0}
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 27 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{
45}
AthAlgorithm()
Default constructor:

◆ ~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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

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

Definition at line 70 of file CalibHitToCaloCell.cxx.

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

◆ 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

◆ initialize()

StatusCode CalibHitToCaloCell::initialize ( )
overridevirtual

Definition at line 50 of file CalibHitToCaloCell.cxx.

51{
52 // retrieve ID helpers from det store
53 ATH_MSG_INFO("initialisation ID helpers" );
54
55 ATH_CHECK( detStore()->retrieve(m_caloCell_ID) );
56 ATH_CHECK( detStore()->retrieve(m_caloDM_ID) );
57 ATH_CHECK( m_caloMgrKey.initialize() );
58
59 m_store_Tot = !m_caloCell_Tot.empty();
60 m_store_Vis = !m_caloCell_Vis.empty();
61 m_store_Em = !m_caloCell_Em.empty();
63
64 ATH_MSG_INFO("initialisation completed" );
65 return StatusCode::SUCCESS;
66}
#define ATH_MSG_INFO(x)
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.

◆ 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

Gaudi::Property<std::string> CalibHitToCaloCell::m_caloCell_Em {this, "CellEmEne", ""}
private

Definition at line 54 of file CalibHitToCaloCell.h.

54{this, "CellEmEne", ""};

◆ m_caloCell_ID

const CaloCell_ID* CalibHitToCaloCell::m_caloCell_ID {nullptr}
private

Definition at line 57 of file CalibHitToCaloCell.h.

57{nullptr};

◆ m_caloCell_NonEm

Gaudi::Property<std::string> CalibHitToCaloCell::m_caloCell_NonEm {this, "CellNonEmEne", ""}
private

Definition at line 55 of file CalibHitToCaloCell.h.

55{this, "CellNonEmEne", ""};

◆ m_caloCell_Tot

Gaudi::Property<std::string> CalibHitToCaloCell::m_caloCell_Tot {this, "CellTotEne", "TotalCalibCell"}
private

Definition at line 52 of file CalibHitToCaloCell.h.

52{this, "CellTotEne", "TotalCalibCell"};

◆ m_caloCell_Vis

Gaudi::Property<std::string> CalibHitToCaloCell::m_caloCell_Vis {this, "CellVisEne", "VisCalibCell"}
private

Definition at line 53 of file CalibHitToCaloCell.h.

53{this, "CellVisEne", "VisCalibCell"};

◆ m_caloDM_ID

const CaloDM_ID* CalibHitToCaloCell::m_caloDM_ID {nullptr}
private

Definition at line 58 of file CalibHitToCaloCell.h.

58{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 67 of file CalibHitToCaloCell.h.

67 { this
68 , "CaloDetDescrManager"
69 , "CaloDetDescrManager"
70 , "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_Cells_Em

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

Definition at line 62 of file CalibHitToCaloCell.h.

◆ m_Cells_NonEm

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

Definition at line 63 of file CalibHitToCaloCell.h.

◆ m_Cells_Tot

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

Definition at line 60 of file CalibHitToCaloCell.h.

◆ m_Cells_Vis

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

Definition at line 61 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 {"LArCalibrationHitActive"}
private

Definition at line 42 of file CalibHitToCaloCell.h.

42{"LArCalibrationHitActive"};

◆ m_larDMHitCnt

std::string CalibHitToCaloCell::m_larDMHitCnt {"LArCalibrationHitDeadMaterial"}
private

Definition at line 43 of file CalibHitToCaloCell.h.

43{"LArCalibrationHitDeadMaterial"};

◆ m_larInactHitCnt

std::string CalibHitToCaloCell::m_larInactHitCnt {"LArCalibrationHitInactive"}
private

Definition at line 41 of file CalibHitToCaloCell.h.

41{"LArCalibrationHitInactive"};

◆ m_nchan

int CalibHitToCaloCell::m_nchan {0}
private

Definition at line 65 of file CalibHitToCaloCell.h.

65{0};

◆ m_store_Em

bool CalibHitToCaloCell::m_store_Em {false}
private

Definition at line 47 of file CalibHitToCaloCell.h.

47{false};

◆ m_store_NonEm

bool CalibHitToCaloCell::m_store_NonEm {false}
private

Definition at line 48 of file CalibHitToCaloCell.h.

48{false};

◆ m_store_Tot

bool CalibHitToCaloCell::m_store_Tot {false}
private

Definition at line 45 of file CalibHitToCaloCell.h.

45{false};

◆ m_store_Vis

bool CalibHitToCaloCell::m_store_Vis {false}
private

Definition at line 46 of file CalibHitToCaloCell.h.

46{false};

◆ m_storeUnknown

Gaudi::Property<bool> CalibHitToCaloCell::m_storeUnknown {this, "StoreUnknownCells", false}
private

Definition at line 50 of file CalibHitToCaloCell.h.

50{this, "StoreUnknownCells", false};

◆ m_tileActiveHitCnt

std::string CalibHitToCaloCell::m_tileActiveHitCnt {"TileCalibHitActiveCell"}
private

Definition at line 38 of file CalibHitToCaloCell.h.

38{"TileCalibHitActiveCell"};

◆ m_tileDMHitCnt

std::string CalibHitToCaloCell::m_tileDMHitCnt {"TileCalibHitDeadMaterial"}
private

Definition at line 40 of file CalibHitToCaloCell.h.

40{"TileCalibHitDeadMaterial"};

◆ m_tileInactiveHitCnt

std::string CalibHitToCaloCell::m_tileInactiveHitCnt {"TileCalibHitInactiveCell"}
private

Definition at line 39 of file CalibHitToCaloCell.h.

39{"TileCalibHitInactiveCell"};

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