ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::L1CaloCells2TriggerTowers Class Referencefinal

#include <L1CaloCells2TriggerTowers.h>

Inheritance diagram for LVL1::L1CaloCells2TriggerTowers:

Public Member Functions

 L1CaloCells2TriggerTowers (const std::string &name)
 Create a proper constructor for Athena.
virtual ~L1CaloCells2TriggerTowers ()
 destructor
 L1CaloCells2TriggerTowers ()=delete
 delete the big 4
 L1CaloCells2TriggerTowers (const L1CaloCells2TriggerTowers &rhs)=delete
 L1CaloCells2TriggerTowers (L1CaloCells2TriggerTowers &&rhs)=delete
L1CaloCells2TriggerTowersoperator= (const L1CaloCells2TriggerTowers &rhs)=delete
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function.
virtual StatusCode finalize () override
virtual bool initCaloCellsTriggerTowers (const CaloCellContainer &cellContainer) override
 Declare the interface that the class provides.
virtual bool initLArDigitsTriggerTowers (const LArDigitContainer &larDigitContainer) override
virtual bool initTileDigitsTriggerTowers (const TileDigitsContainer &tileDigitsContainer) override
virtual std::vector< const CaloCell * > caloCells (const Identifier &ttId) const override
virtual std::vector< std::vector< const CaloCell * > > caloCellsByLayer (const Identifier &ttId) const override
virtual std::vector< int > layerNames (const Identifier &ttID) const override
virtual int layerNames (const CaloCell *cell) const override
virtual float energy (const std::vector< const CaloCell * > &cells) const override
virtual float et (const std::vector< const CaloCell * > &cells) const override
virtual float energy (const Identifier &ttId) const override
virtual float et (const Identifier &ttId) const override
virtual std::vector< double > samples (const Identifier &ttId) const override
virtual std::vector< const LArDigit * > larDigits (const Identifier &ttId) const override
virtual std::vector< const TileDigits * > tileDigits (const Identifier &ttId) const override
virtual void dumpCaloCells () const override
virtual void dumpCaloCells (const Identifier &ttId) const override
virtual void dumpDigits (const Identifier &ttId) const override
virtual void dumpLArDigits (const Identifier &ttId) const override
virtual void dumpLArDigits () const override
virtual void dumpTileDigits (const Identifier &ttId) const override
virtual void dumpTileDigits () const override
virtual void print () const
 Print the state of the tool.
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 sysInitialize () override
 Perform system initialization for an algorithm.
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
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

virtual float calcEnergyOrEt (const std::vector< const CaloCell * > &cells, const unsigned int mode) const override
virtual void reset () override
virtual void resetCaloCells () override
virtual void resetLArDigits () override
virtual void resetTileDigits () override
virtual void dump (const std::vector< const CaloCell * > &vCells) const override
virtual void dump (const std::vector< const LArDigit * > &vCells) const override
virtual void dump (const std::vector< const TileDigits * > &vCells) const override
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

const CaloLVL1_IDm_lvl1Helper
const TileIDm_tileID
const CaloCell_IDm_caloCellHelper
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
ToolHandle< LVL1::IL1CaloMatchCell2Towerm_cellMatch { this, "L1CaloMatchCell2Tower", "LVL1::L1CaloMatchCell2Tower", "L1CaloMatchCell2Tower" }
ToolHandle< CaloTriggerTowerServicem_ttSvc { this, "CaloTriggerTowerService", "CaloTriggerTowerService"}
const TileCablingServicem_tileCablingService
bool m_bInitialized
bool m_bLArDigitsInitialized
bool m_bTileDigitsInitialized
std::map< unsigned int, std::vector< const CaloCell * > > m_mTTCaloCells
std::map< unsigned int, std::vector< const LArDigit * > > m_mTTLArDigits
std::map< unsigned int, std::vector< const TileDigits * > > m_mTTTileDigits
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 52 of file L1CaloCells2TriggerTowers.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ L1CaloCells2TriggerTowers() [1/4]

LVL1::L1CaloCells2TriggerTowers::L1CaloCells2TriggerTowers ( const std::string & name)

Create a proper constructor for Athena.

constructor

Definition at line 9 of file L1CaloCells2TriggerTowers.cxx.

◆ ~L1CaloCells2TriggerTowers()

virtual LVL1::L1CaloCells2TriggerTowers::~L1CaloCells2TriggerTowers ( )
inlinevirtual

destructor

Definition at line 61 of file L1CaloCells2TriggerTowers.h.

61{}

◆ L1CaloCells2TriggerTowers() [2/4]

LVL1::L1CaloCells2TriggerTowers::L1CaloCells2TriggerTowers ( )
delete

delete the big 4

◆ L1CaloCells2TriggerTowers() [3/4]

LVL1::L1CaloCells2TriggerTowers::L1CaloCells2TriggerTowers ( const L1CaloCells2TriggerTowers & rhs)
delete

◆ L1CaloCells2TriggerTowers() [4/4]

LVL1::L1CaloCells2TriggerTowers::L1CaloCells2TriggerTowers ( L1CaloCells2TriggerTowers && rhs)
delete

Member Function Documentation

◆ calcEnergyOrEt()

float LVL1::L1CaloCells2TriggerTowers::calcEnergyOrEt ( const std::vector< const CaloCell * > & cells,
const unsigned int mode ) const
overrideprotectedvirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 107 of file L1CaloCells2TriggerTowers.cxx.

107 {
108 float energy(0.),et(0.),GeV(1000.0);
109 if(cells.size()!=0) {
110 typedef std::vector<const CaloCell*>::const_iterator Itr;
111
112 for(Itr i=cells.begin();i!=cells.end();++i) {
113 Identifier Id((*i)->ID());
114 float cellEnergy(0.0);
115 // Tile cells
116 if(m_caloCellHelper->is_tile(Id)) {
117 int section = m_caloCellHelper->section(Id);
118 int sample = m_caloCellHelper->sample(Id);
119
120 if( (section==1 || section==2) && sample==2) { //D-cells, except D4
121 cellEnergy+=(*i)->energy()*0.5;
122
123 } else {
124 cellEnergy+=(*i)->energy();
125 }
126
127 // LArg cells
128 } else {
129 cellEnergy+=(*i)->energy(); // sampling weights between layers in TBB ?
130 }
131 if(mode == 0){energy += cellEnergy;}
132 if(mode == 1){et += cellEnergy/cosh((*i)->eta());}
133 }
134 }
135 if(mode == 0){return energy / GeV;}
136 if(mode == 1){return et / GeV;}
137 return energy / GeV;
138 }
void section(const std::string &sec)
virtual float et(const std::vector< const CaloCell * > &cells) const override
virtual float energy(const std::vector< const CaloCell * > &cells) const override

◆ caloCells()

std::vector< const CaloCell * > LVL1::L1CaloCells2TriggerTowers::caloCells ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 22 of file L1CaloCells2TriggerTowers.cxx.

22 {
23
24 std::map<unsigned int, std::vector<const CaloCell*> >::const_iterator it = m_mTTCaloCells.find(ttId.get_identifier32().get_compact());
25 if(it!=m_mTTCaloCells.end()) {
26 return it->second;
27
28 } else {
29 return std::vector<const CaloCell*>();
30 }
31 }
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
std::map< unsigned int, std::vector< const CaloCell * > > m_mTTCaloCells

◆ caloCellsByLayer()

std::vector< std::vector< const CaloCell * > > LVL1::L1CaloCells2TriggerTowers::caloCellsByLayer ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 34 of file L1CaloCells2TriggerTowers.cxx.

34 {
35 const std::vector<const CaloCell*> vCells(this->caloCells(ttId));
36 std::vector<std::vector<const CaloCell*> > ccByLayer;
37 std::vector<const CaloCell*> cc;
38 int caloSampleInUse(-10); // start this varibale with unrealistic value
39 bool firstCell(true);
40 if(vCells.size()!=0) {
41 std::vector<const CaloCell*>::const_iterator itCells = vCells.begin();
42 for(;itCells!=vCells.end();++itCells) {
43 Identifier Id((*itCells)->ID());
44
45 if(firstCell == true){caloSampleInUse = m_caloCellHelper->calo_sample(Id);firstCell = false;}
46 int currentCaloSample = m_caloCellHelper->calo_sample(Id);
47 if( caloSampleInUse != currentCaloSample ){
48 ccByLayer.push_back(cc);
49 cc.clear();
50 caloSampleInUse = currentCaloSample;
51 }
52 cc.push_back(*itCells);
53 }
54 ccByLayer.push_back(std::move(cc));
55 }
56
57 return ccByLayer;
58 }
virtual std::vector< const CaloCell * > caloCells(const Identifier &ttId) const override

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ dump() [1/3]

void LVL1::L1CaloCells2TriggerTowers::dump ( const std::vector< const CaloCell * > & vCells) const
overrideprotectedvirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 493 of file L1CaloCells2TriggerTowers.cxx.

493 {
494
495
496 ATH_MSG_INFO("ncells: "<< vCells.size());
497 std::vector<const CaloCell*>::const_iterator itCells = vCells.begin();
498 for(;itCells!=vCells.end();++itCells) {
499 Identifier Id = (*itCells)->ID();
500
501 if(m_caloCellHelper->is_tile(Id)) {
502 int section = m_caloCellHelper->section(Id);
503 int side = m_caloCellHelper->side(Id);
504 int module = m_caloCellHelper->module(Id);
505 int tower = m_caloCellHelper->tower(Id);
506 int sample = m_caloCellHelper->sample(Id);
507 ATH_MSG_INFO(" * tile - section: "<<section << ", side: "<<side<< ", module: "<<module<< ", tower: "<<tower<< ", sample: "<<sample<<" - eta: "<< (*itCells)->eta()<<", phi: "<< (*itCells)->phi()<< ", E:" << (*itCells)->energy() );
508
509 } else if (m_caloCellHelper->is_fcal(Id)) {
510 //needd fcal case
511 int pos_neg = m_caloCellHelper->pos_neg(Id);
512 int module = m_caloCellHelper->sampling(Id);
513 int eta = m_caloCellHelper->eta(Id);
514 int phi = m_caloCellHelper->phi(Id);
515 ATH_MSG_INFO(" * fcal - pos_neg_z: "<<pos_neg<< ", module: "<<module<<", ieta: "<<eta<< ", iphi: "<<phi<<" - eta: "<< (*itCells)->eta()<<", phi: "<< (*itCells)->phi()<< ", E:" << (*itCells)->energy() );
516
517 } else {
518 int pos_neg = m_caloCellHelper->pos_neg(Id);
519 int sampling = m_caloCellHelper->sampling(Id);
520 int region = m_caloCellHelper->region(Id);
521 int eta = m_caloCellHelper->eta(Id);
522 int phi = m_caloCellHelper->phi(Id);
523 ATH_MSG_INFO(" * larg - pos_neg_z: "<<pos_neg<< ", sampling: "<<sampling<< ", region: "<<region<< ", ieta: "<<eta<< ", iphi: "<<phi<<" - eta: "<< (*itCells)->eta()<<", phi: "<< (*itCells)->phi()<< ", E:" << (*itCells)->energy() );
524 }
525 }
526 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_INFO(x)

◆ dump() [2/3]

void LVL1::L1CaloCells2TriggerTowers::dump ( const std::vector< const LArDigit * > & vCells) const
overrideprotectedvirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 528 of file L1CaloCells2TriggerTowers.cxx.

528 {
529
530 SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey);
531
532 ATH_MSG_INFO( "ncells: "<< vLArDigits.size() );
533 std::vector<const LArDigit*>::const_iterator itLArDigits = vLArDigits.begin();
534 for(;itLArDigits!=vLArDigits.end();++itLArDigits) {
535
536 const LArDigit* larDigit= *itLArDigits;
537 HWIdentifier hwId = larDigit->channelID();
538 Identifier larDigitID = cabling->cnvToIdentifier(hwId);
539
540 ATH_MSG_INFO( "pos_neg: " << m_caloCellHelper->pos_neg(larDigitID)<<", sampling: "<< m_caloCellHelper->sampling(larDigitID)<<", region: "<< m_caloCellHelper->region(larDigitID)<<", eta: "<< m_caloCellHelper->eta(larDigitID)<<", phi: "<< m_caloCellHelper->phi(larDigitID) );
541 std::vector<short> vADC= larDigit->samples();
542 std::vector<short>::const_iterator it_sample = vADC.begin();
543 for(;it_sample!=vADC.end();++it_sample) std::cout<< *it_sample<<" ";
544 std::cout<<std::endl;
545 }
546 }
const std::vector< short > & samples() const
Definition LArDigit.h:78
const HWIdentifier & channelID() const
Definition LArDigit.h:69
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey

◆ dump() [3/3]

void LVL1::L1CaloCells2TriggerTowers::dump ( const std::vector< const TileDigits * > & vCells) const
overrideprotectedvirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 588 of file L1CaloCells2TriggerTowers.cxx.

588 {
589
590 ATH_MSG_INFO( "ncells: "<< vTileDigits.size() );
591 std::vector<const TileDigits*>::const_iterator itTileDigits = vTileDigits.begin();
592 for(;itTileDigits!=vTileDigits.end();++itTileDigits) {
593
594 const TileDigits* tileDigit= *itTileDigits;
595 Identifier tileDigitID = tileDigit->identify();
596
597 int section = m_caloCellHelper->section(tileDigitID);
598 int side = m_caloCellHelper->side(tileDigitID);
599 int module = m_caloCellHelper->module(tileDigitID);
600 int tower = m_caloCellHelper->tower(tileDigitID);
601 int sample = m_caloCellHelper->sample(tileDigitID);
602 ATH_MSG_INFO( "section: "<<section << ", side: "<<side<< ", module: "<<module<< ", tower: "<<tower<< ", sample: "<<sample );
603 std::vector<double> vADC = tileDigit->get_digits();
604 std::vector<double>::const_iterator it_sample = vADC.begin();
605 for(;it_sample!=vADC.end();++it_sample){
606 ATH_MSG_INFO(" --> "<< *it_sample);
607 ATH_MSG_INFO(" ");
608 }
609 }
610 }
std::vector< double > get_digits(void) const
Definition TileDigits.h:65
Identifier identify(void) const
Definition TileRawData.h:52

◆ dumpCaloCells() [1/2]

void LVL1::L1CaloCells2TriggerTowers::dumpCaloCells ( ) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 478 of file L1CaloCells2TriggerTowers.cxx.

478 {
479
480
481 ATH_MSG_INFO("dumping TT->CaloCells: "<< m_mTTCaloCells.size());
482 std::map<unsigned int, std::vector<const CaloCell*> >::const_iterator it = m_mTTCaloCells.begin();
483 for(;it!=m_mTTCaloCells.end();++it) {
484 Identifier ttId(it->first);
485
486 ATH_MSG_INFO("Trigger Tower: " << ttId.get_compact() <<" - "<< m_lvl1Helper->pos_neg_z(ttId)<<" "<<m_lvl1Helper->sampling(ttId)<<" "<<m_lvl1Helper->region(ttId)<<" "<<m_lvl1Helper->eta(ttId)<<" "<<m_lvl1Helper->phi(ttId)<<" "<<m_lvl1Helper->layer(ttId)<<" - E: "<< this->energy(ttId) );
487
488 std::vector<const CaloCell*> vCells = it->second;
489 this->dump(vCells);
490 }
491 }
virtual void dump(const std::vector< const CaloCell * > &vCells) const override

◆ dumpCaloCells() [2/2]

void LVL1::L1CaloCells2TriggerTowers::dumpCaloCells ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 463 of file L1CaloCells2TriggerTowers.cxx.

463 {
464
465 std::map<unsigned int, std::vector<const CaloCell*> >::const_iterator it = m_mTTCaloCells.find(ttId.get_identifier32().get_compact());
466 if(it!=m_mTTCaloCells.end()) {
467
468 ATH_MSG_INFO("Trigger Tower: " << ttId.get_compact() <<" - "<< m_lvl1Helper->pos_neg_z(ttId)<<" "<<m_lvl1Helper->sampling(ttId)<<" "<<m_lvl1Helper->region(ttId)<<" "<<m_lvl1Helper->eta(ttId)<<" "<<m_lvl1Helper->phi(ttId)<<" "<<m_lvl1Helper->layer(ttId)<<" - E: "<< this->energy(ttId) );
469
470 std::vector<const CaloCell*> vCells = it->second;
471 this->dump(vCells);
472
473 } else {
474 ATH_MSG_INFO("No trigger tower with Id="<< ttId.get_compact() <<" found.");
475 }
476 }
value_type get_compact() const
Get the compact id.

◆ dumpDigits()

void LVL1::L1CaloCells2TriggerTowers::dumpDigits ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 548 of file L1CaloCells2TriggerTowers.cxx.

548 {
549
550 // if Tile
551 if (m_lvl1Helper->is_tile(ttId)) {
552 this->dumpTileDigits(ttId);
553
554 //LArg cells
555 } else {
556 this->dumpLArDigits(ttId);
557 }
558 }
virtual void dumpTileDigits() const override
virtual void dumpLArDigits() const override

◆ dumpLArDigits() [1/2]

void LVL1::L1CaloCells2TriggerTowers::dumpLArDigits ( ) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 574 of file L1CaloCells2TriggerTowers.cxx.

574 {
575
576 ATH_MSG_INFO( "dumping TT->LArDigits: "<< m_mTTLArDigits.size() );
577 std::map<unsigned int, std::vector<const LArDigit*> >::const_iterator it = m_mTTLArDigits.begin();
578 for(;it!=m_mTTLArDigits.end();++it) {
579 Identifier ttId(it->first);
580
581 ATH_MSG_INFO( "Trigger Tower: " << ttId.get_compact() <<" - "<< m_lvl1Helper->pos_neg_z(ttId)<<" "<<m_lvl1Helper->sampling(ttId)<<" "<<m_lvl1Helper->region(ttId)<<" "<<m_lvl1Helper->eta(ttId)<<" "<<m_lvl1Helper->phi(ttId)<<" "<<m_lvl1Helper->layer(ttId)<<" - E: "<< this->energy(ttId) );
582 std::vector<const LArDigit*> vLArDigits = it->second;
583 this->dump(vLArDigits);
584 }
585 }
std::map< unsigned int, std::vector< const LArDigit * > > m_mTTLArDigits

◆ dumpLArDigits() [2/2]

void LVL1::L1CaloCells2TriggerTowers::dumpLArDigits ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 561 of file L1CaloCells2TriggerTowers.cxx.

561 {
562
563 std::map<unsigned int, std::vector<const LArDigit*> >::const_iterator it = m_mTTLArDigits.find(ttId.get_identifier32().get_compact());
564 if(it!=m_mTTLArDigits.end()) {
565
566 ATH_MSG_INFO( "Trigger Tower: " << ttId.get_compact() <<" - "<< m_lvl1Helper->pos_neg_z(ttId)<<" "<<m_lvl1Helper->sampling(ttId)<<" "<<m_lvl1Helper->region(ttId)<<" "<<m_lvl1Helper->eta(ttId)<<" "<<m_lvl1Helper->phi(ttId)<<" "<<m_lvl1Helper->layer(ttId)<<" - E: "<< this->energy(ttId) );
567 std::vector<const LArDigit*> vLArDigits = it->second;
568 this->dump(vLArDigits);
569 } else {
570 ATH_MSG_INFO( "No trigger tower with Id="<< ttId.get_compact() <<" found." );
571 }
572 }

◆ dumpTileDigits() [1/2]

void LVL1::L1CaloCells2TriggerTowers::dumpTileDigits ( ) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 625 of file L1CaloCells2TriggerTowers.cxx.

625 {
626 ATH_MSG_INFO( "dumping TT->TileDigits: "<< m_mTTTileDigits.size() );
627 std::map<unsigned int, std::vector<const TileDigits*> >::const_iterator it = m_mTTTileDigits.begin();
628 for(;it!=m_mTTTileDigits.end();++it) {
629 Identifier ttId(it->first);
630
631 ATH_MSG_INFO( "Trigger Tower: " << ttId.get_compact() <<" - "<< m_lvl1Helper->pos_neg_z(ttId)<<" "<<m_lvl1Helper->sampling(ttId)<<" "<<m_lvl1Helper->region(ttId)<<" "<<m_lvl1Helper->eta(ttId)<<" "<<m_lvl1Helper->phi(ttId)<<" "<<m_lvl1Helper->layer(ttId)<<" - E: "<< this->energy(ttId) );
632 std::vector<const TileDigits*> vTileDigits = it->second;
633 this->dump(vTileDigits);
634 }
635 }
std::map< unsigned int, std::vector< const TileDigits * > > m_mTTTileDigits

◆ dumpTileDigits() [2/2]

void LVL1::L1CaloCells2TriggerTowers::dumpTileDigits ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 612 of file L1CaloCells2TriggerTowers.cxx.

612 {
613
614 std::map<unsigned int, std::vector<const TileDigits*> >::const_iterator it = m_mTTTileDigits.find(ttId.get_identifier32().get_compact());
615 if(it!=m_mTTTileDigits.end()) {
616
617 ATH_MSG_INFO( "Trigger Tower: " << ttId.get_compact() <<" - "<< m_lvl1Helper->pos_neg_z(ttId)<<" "<<m_lvl1Helper->sampling(ttId)<<" "<<m_lvl1Helper->region(ttId)<<" "<<m_lvl1Helper->eta(ttId)<<" "<<m_lvl1Helper->phi(ttId)<<" "<<m_lvl1Helper->layer(ttId)<<" - E: "<< this->energy(ttId) );
618 std::vector<const TileDigits*> vTileDigits = it->second;
619 this->dump(vTileDigits);
620 } else {
621 ATH_MSG_INFO( "No trigger tower with Id="<< ttId.get_compact() <<" found." );
622 }
623 }

◆ energy() [1/2]

float LVL1::L1CaloCells2TriggerTowers::energy ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 98 of file L1CaloCells2TriggerTowers.cxx.

98 {
99 return this->energy( this->caloCells(ttId) );
100 }

◆ energy() [2/2]

float LVL1::L1CaloCells2TriggerTowers::energy ( const std::vector< const CaloCell * > & cells) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 85 of file L1CaloCells2TriggerTowers.cxx.

85 {
86 // mode : 0 == Energy, 1 == Et
87 unsigned int mode(0);
88 return this->calcEnergyOrEt(cells,mode);
89 }
virtual float calcEnergyOrEt(const std::vector< const CaloCell * > &cells, const unsigned int mode) const override

◆ et() [1/2]

float LVL1::L1CaloCells2TriggerTowers::et ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 102 of file L1CaloCells2TriggerTowers.cxx.

102 {
103 return this->et( this->caloCells(ttId) );
104 }

◆ et() [2/2]

float LVL1::L1CaloCells2TriggerTowers::et ( const std::vector< const CaloCell * > & cells) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 92 of file L1CaloCells2TriggerTowers.cxx.

92 {
93 // mode : 0 == Energy, 1 == Et
94 unsigned int mode(1);
95 return this->calcEnergyOrEt(cells,mode);
96 }

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ finalize()

StatusCode LVL1::L1CaloCells2TriggerTowers::finalize ( )
overridevirtual

Definition at line 179 of file L1CaloCells2TriggerTowers.cxx.

179 {
180 return StatusCode::SUCCESS;
181 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::TEvent, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::TEvent, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ initCaloCellsTriggerTowers()

bool LVL1::L1CaloCells2TriggerTowers::initCaloCellsTriggerTowers ( const CaloCellContainer & cellContainer)
overridevirtual

Declare the interface that the class provides.

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 183 of file L1CaloCells2TriggerTowers.cxx.

183 {
184
185 SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey);
186
187 this->resetCaloCells();
188
189 std::vector<Identifier>::const_iterator it_towerId = m_lvl1Helper->tower_begin();
190 std::vector<Identifier>::const_iterator it_towerEnd = m_lvl1Helper->tower_end();
191
192 // loop on online channels
193 for(; it_towerId!=it_towerEnd;++it_towerId){
194 m_mTTCaloCells[(*it_towerId).get_identifier32().get_compact()].reserve(60);
195 }
196
197 CaloCellContainer::const_iterator itCell = cellContainer.begin();
198 for (;itCell!=cellContainer.end();++itCell){
199
200 const CaloCell * caloCell= *itCell;
201 const Identifier invalidId(0);
202 Identifier ttId1;
203 Identifier ttId2;
204
205 m_cellMatch->matchCell2Tower(**cabling, caloCell, ttId1, ttId2);
206
207 if (ttId1 != invalidId) {
208 m_mTTCaloCells[ttId1.get_identifier32().get_compact()].push_back(caloCell);
209 }
210 if (ttId2 != invalidId) { // Tile D cells match to two towers
211 m_mTTCaloCells[ttId2.get_identifier32().get_compact()].push_back(caloCell);
212 }
213
214 } // end loop on calo cells
215
216 m_bInitialized = true;
217 return m_bInitialized;
218 }
static const ITkStripOnlineId invalidId
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
ToolHandle< LVL1::IL1CaloMatchCell2Tower > m_cellMatch

◆ initialize()

StatusCode LVL1::L1CaloCells2TriggerTowers::initialize ( void )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 143 of file L1CaloCells2TriggerTowers.cxx.

143 {
144 ATH_MSG_INFO("Initialize LVL1::L1CaloCells2TriggerTowers");
145
146 ATH_CHECK( m_cellMatch.retrieve() );
147
149
150 const CaloIdManager* caloMgr = nullptr;
151 sc = detStore()->retrieve(caloMgr);
152 if(sc.isFailure()){ATH_MSG_ERROR("Failed to load CaloMgr");return sc;}
153
154 m_caloCellHelper = caloMgr->getCaloCell_ID();
155 if (!m_caloCellHelper) {
156 ATH_MSG_ERROR("Could not access CaloCell_ID helper");
157 return StatusCode::FAILURE;
158 }
159
160 // Get LVL1 idhelper from detector store and add to mgr
161 const CaloLVL1_ID* lvl1_id = 0;
162 sc = detStore()->retrieve(lvl1_id, "CaloLVL1_ID");
163 if(sc.isFailure()){ATH_MSG_ERROR("Failed to get CaloLVL1_ID");return sc;}
164 m_lvl1Helper = static_cast<const CaloLVL1_ID*> (lvl1_id);
165
166 sc = detStore()->retrieve(m_tileID, "TileID") ;
167 if(sc.isFailure()){ATH_MSG_ERROR("Failed to get Tile_ID");return sc;}
168
169 //Retrieve cabling & tt services
170 ATH_CHECK( m_ttSvc.retrieve() );
171
173
174 ATH_CHECK( m_cablingKey.initialize() );
175
176 return sc;
177 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
static Double_t sc
const ServiceHandle< StoreGateSvc > & detStore() const
const CaloCell_ID * getCaloCell_ID(void) const
Access to IdHelper.
ToolHandle< CaloTriggerTowerService > m_ttSvc
static const TileCablingService * getInstance()
get pointer to service instance
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ initLArDigitsTriggerTowers()

bool LVL1::L1CaloCells2TriggerTowers::initLArDigitsTriggerTowers ( const LArDigitContainer & larDigitContainer)
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 220 of file L1CaloCells2TriggerTowers.cxx.

220 {
221
222 this->resetLArDigits();
223
224 SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey);
225
226 std::vector<Identifier>::const_iterator it_towerId = m_lvl1Helper->tower_begin();
227 std::vector<Identifier>::const_iterator it_towerEnd = m_lvl1Helper->tower_end();
228
229 // loop on online channels
230 for(; it_towerId!=it_towerEnd;++it_towerId){
231 m_mTTLArDigits[(*it_towerId).get_identifier32().get_compact()].reserve(60);
232 }
233
234 LArDigitContainer::const_iterator itLArDigit = larDigitContainer.begin();
235 for (;itLArDigit!=larDigitContainer.end();++itLArDigit){
236
237 const LArDigit * larDigit= *itLArDigit;
238 const HWIdentifier larDigitChannelID = larDigit->channelID();
239
240 if(cabling->isOnlineConnected(larDigitChannelID)) {
241 // convert HWID to ID
242 Identifier larDigitID = cabling->cnvToIdentifier(larDigitChannelID);
243
244 //whichTTID ttId returns a layer_id, not a tower_id !
245 const Identifier layerId(m_ttSvc->whichTTID(larDigitID));
246
247 // We are not calling here m_ttSvc->is_in_lvl1(cellId) but use directly its code for a performance reason
248 // By doing so we save a redundant and costly call to m_ttSvc->whichTTID()
249 bool lvl1(true);
250 if(m_caloCellHelper->is_em_barrel(larDigitID)) {
251 int samp=m_caloCellHelper->sampling(larDigitID);
252 if(samp==0) {
253 int eta=m_caloCellHelper->eta(larDigitID);
254 if(eta==60) {
255 lvl1 = false ;
256 }
257 }
258 } else {
259 if(m_lvl1Helper->is_hec(layerId)) {
260 int layer(m_lvl1Helper->layer(layerId));
261 if(layer == 3){
262 lvl1 = false ;
263 }
264 }
265 }
266
267 if(lvl1) { //there are 1216 LArg Cells that are not part of lvl1
268 //whichTTID ttId returns a layer_id, not a tower_id !
269 // As we don't want the layer information embedded in the identifier, we recreate a tower Id
270 const Identifier ttId = m_lvl1Helper->tower_id( m_lvl1Helper->pos_neg_z(layerId), m_lvl1Helper->sampling(layerId), m_lvl1Helper->region(layerId), m_lvl1Helper->eta(layerId), m_lvl1Helper->phi(layerId));
271 m_mTTLArDigits[ttId.get_identifier32().get_compact()].push_back(larDigit);
272 }
273 }
274 } // end loop on calo cells
275
278 }
@ layer
Definition HitInfo.h:79

◆ initTileDigitsTriggerTowers()

bool LVL1::L1CaloCells2TriggerTowers::initTileDigitsTriggerTowers ( const TileDigitsContainer & tileDigitsContainer)
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 280 of file L1CaloCells2TriggerTowers.cxx.

280 {
281
282 this->resetTileDigits();
283
284
285 std::vector<Identifier>::const_iterator it_towerId = m_lvl1Helper->tower_begin();
286 std::vector<Identifier>::const_iterator it_towerEnd = m_lvl1Helper->tower_end();
287
288 // loop on online channels
289 for(; it_towerId!=it_towerEnd;++it_towerId){
290 m_mTTTileDigits[(*it_towerId).get_identifier32().get_compact()].reserve(8);
291 }
292
293 TileDigitsContainer::const_iterator collItr = tileDigitsContainer.begin();
294 TileDigitsContainer::const_iterator lastColl = tileDigitsContainer.end();
295
296 for(; collItr!=lastColl; ++collItr) {
297
298 TileDigitsCollection::const_iterator digitsItr=(*collItr)->begin();
299 TileDigitsCollection::const_iterator lastDigits=(*collItr)->end();
300
301 if (digitsItr!=lastDigits) {
302 for(; digitsItr!=lastDigits; ++digitsItr) {
303
304 const TileDigits* tileDigit = *digitsItr;
305 const Identifier tileDigitID = tileDigit->cell_ID(); // return a cell_id (up to sampling info; pmt & adc set to 0)
306
307 if (m_caloCellHelper->is_tile(tileDigitID)) {
308
309 int section = m_tileID->section(tileDigitID);
310 int sample = m_tileID->sample(tileDigitID);
311
312 // gap detector - D4 & C10 cells
313 // both pmt of D4 belong to the same TT
314 if(section==3 && (sample==1 || sample==2) ) {
315 Identifier ttId = m_tileCablingService->cell2tt_id(tileDigitID);
316 m_mTTTileDigits[ttId.get_identifier32().get_compact()].push_back(tileDigit);
317
318 // barrel & ext. barrel - D cells
319 } else if( (section==1 || section==2) && sample==2) {
320
321 // special treatment of D-cells
322 // each pmt is affected to a different trigger tower
323 // each D-CaloCell is then added to 2 TT. This must ne taken into account when computing the TT energy
324 // from the CaloCells by dividing the D-cell energy by 2.
325 Identifier lTTId = m_tileCablingService->pmt2tt_id(m_tileID->pmt_id(tileDigitID, 0));
326 m_mTTTileDigits[lTTId.get_identifier32().get_compact()].push_back(tileDigit);
327
328 Identifier rTTId = m_tileCablingService->pmt2tt_id(m_tileID->pmt_id(tileDigitID, 1));
329 m_mTTTileDigits[rTTId.get_identifier32().get_compact()].push_back(tileDigit);
330
331 // barrel & ext. barrel - A & BC cells
332 } else if( (section==1 || section==2) && (sample==0 || sample==1) ) {
333 Identifier ttId = m_tileCablingService->cell2tt_id(tileDigitID);
334 m_mTTTileDigits[ttId.get_identifier32().get_compact()].push_back(tileDigit);
335 }
336 }
337 }
338 }
339 }
340
343
344 return true;
345 }
Identifier cell_ID(void) const

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ larDigits()

std::vector< const LArDigit * > LVL1::L1CaloCells2TriggerTowers::larDigits ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 371 of file L1CaloCells2TriggerTowers.cxx.

371 {
372
373 std::map<unsigned int, std::vector<const LArDigit*> >::const_iterator it = m_mTTLArDigits.find(ttId.get_identifier32().get_compact());
374 if(it!=m_mTTLArDigits.end()) {
375 return it->second;
376
377 } else {
378 return std::vector<const LArDigit*>();
379 }
380 }

◆ layerNames() [1/2]

int LVL1::L1CaloCells2TriggerTowers::layerNames ( const CaloCell * cell) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 80 of file L1CaloCells2TriggerTowers.cxx.

80 {
81 return m_caloCellHelper->calo_sample( cell->ID() );
82 }

◆ layerNames() [2/2]

std::vector< int > LVL1::L1CaloCells2TriggerTowers::layerNames ( const Identifier & ttID) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 61 of file L1CaloCells2TriggerTowers.cxx.

61 {
62 const std::vector<const CaloCell*> vCells(this->caloCells(ttId));
63 std::vector<int> layers;
64 int caloSampleInUse(-10); // start this varibale with unrealistic value
65 if(vCells.size()!=0) {
66 std::vector<const CaloCell*>::const_iterator itCells = vCells.begin();
67 for(;itCells!=vCells.end();++itCells) {
68 Identifier Id((*itCells)->ID());
69
70 int currentCaloSample = m_caloCellHelper->calo_sample(Id);
71 if( caloSampleInUse != currentCaloSample ){
72 layers.push_back(currentCaloSample);
73 caloSampleInUse = currentCaloSample;
74 }
75 }
76 }
77 return layers;
78 }
layers(flags, cells_name, *args, **kw)
Here we define wrapper functions to set up all of the standard corrections.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ operator=()

L1CaloCells2TriggerTowers & LVL1::L1CaloCells2TriggerTowers::operator= ( const L1CaloCells2TriggerTowers & rhs)
delete

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ print()

◆ 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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ reset()

void LVL1::L1CaloCells2TriggerTowers::reset ( )
overrideprotectedvirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 349 of file L1CaloCells2TriggerTowers.cxx.

349 {
350 this->resetCaloCells();
351 this->resetLArDigits();
352 this->resetTileDigits();
353 }

◆ resetCaloCells()

void LVL1::L1CaloCells2TriggerTowers::resetCaloCells ( )
overrideprotectedvirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 355 of file L1CaloCells2TriggerTowers.cxx.

355 {
356 m_bInitialized = false;
357 m_mTTCaloCells.clear();
358 }

◆ resetLArDigits()

void LVL1::L1CaloCells2TriggerTowers::resetLArDigits ( )
overrideprotectedvirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 360 of file L1CaloCells2TriggerTowers.cxx.

360 {
362 m_mTTLArDigits.clear();
363 }

◆ resetTileDigits()

void LVL1::L1CaloCells2TriggerTowers::resetTileDigits ( )
overrideprotectedvirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 365 of file L1CaloCells2TriggerTowers.cxx.

365 {
367 m_mTTTileDigits.clear();
368 }

◆ samples()

std::vector< double > LVL1::L1CaloCells2TriggerTowers::samples ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 395 of file L1CaloCells2TriggerTowers.cxx.

395 {
396
397 if (m_lvl1Helper->is_tile(ttId)) {
398
399 std::vector<const TileDigits*> vTileDigits(this->tileDigits(ttId));
400
401 std::vector<double> vADCSum;
402 int nSum=0;
403
404 std::vector<const TileDigits*>::const_iterator it_digit = vTileDigits.begin();
405 for(;it_digit!=vTileDigits.end();++it_digit) {
406
407 std::vector<double> vADC((*it_digit)->get_digits());
408
409 int adcSize(vADC.size());
410 if(vADCSum.size()==0) vADCSum.resize(adcSize);
411
412 for(int i=0;i<adcSize;++i) {
413 vADCSum[i]+=vADC[i];
414 }
415 ++nSum;
416 }
417
418 std::vector<double>::iterator it_adc = vADCSum.begin();
419 if(nSum > 0){
420 const double inv_nSum = 1. / static_cast<double> (nSum);
421 for(;it_adc!=vADCSum.end();++it_adc){
422 (*it_adc) *= inv_nSum;
423 }
424 }
425
426 return vADCSum;
427
428 //LArg cells
429 } else {
430 //log<<MSG::INFO<<"is_lar"<<endmsg;
431 std::vector<const LArDigit*> vLArDigits(this->larDigits(ttId));
432
433 std::vector<double> vADCSum;
434 int nSum=0;
435
436 std::vector<const LArDigit*>::const_iterator it_digit = vLArDigits.begin();
437 for(;it_digit!=vLArDigits.end();++it_digit) {
438
439 std::vector<short> vADC((*it_digit)->samples());
440
441 int adcSize(vADC.size());
442 if(vADCSum.size()==0) vADCSum.resize(adcSize);
443
444 for(int i=0;i<adcSize;++i) {
445 vADCSum[i]+=vADC[i];
446 }
447 ++nSum;
448 }
449
450 std::vector<double>::iterator it_adc = vADCSum.begin();
451 if(nSum > 0){
452 const double inv_nSum = 1. / static_cast<double> (nSum);
453 for(;it_adc!=vADCSum.end();++it_adc){
454 (*it_adc) *= inv_nSum;
455 }
456 }
457
458 return vADCSum;
459 }
460 }
virtual std::vector< const LArDigit * > larDigits(const Identifier &ttId) const override
virtual std::vector< const TileDigits * > tileDigits(const Identifier &ttId) const override

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ tileDigits()

std::vector< const TileDigits * > LVL1::L1CaloCells2TriggerTowers::tileDigits ( const Identifier & ttId) const
overridevirtual

Implements LVL1::IL1CaloCells2TriggerTowers.

Definition at line 382 of file L1CaloCells2TriggerTowers.cxx.

382 {
383
384 std::map<unsigned int, std::vector<const TileDigits*> >::const_iterator it = m_mTTTileDigits.find(ttId.get_identifier32().get_compact());
385 if(it!=m_mTTTileDigits.end()) {
386 return it->second;
387
388 } else {
389 return std::vector<const TileDigits*>();
390 }
391 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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_bInitialized

bool LVL1::L1CaloCells2TriggerTowers::m_bInitialized
private

Definition at line 134 of file L1CaloCells2TriggerTowers.h.

◆ m_bLArDigitsInitialized

bool LVL1::L1CaloCells2TriggerTowers::m_bLArDigitsInitialized
private

Definition at line 135 of file L1CaloCells2TriggerTowers.h.

◆ m_bTileDigitsInitialized

bool LVL1::L1CaloCells2TriggerTowers::m_bTileDigitsInitialized
private

Definition at line 136 of file L1CaloCells2TriggerTowers.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LVL1::L1CaloCells2TriggerTowers::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 125 of file L1CaloCells2TriggerTowers.h.

126{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_caloCellHelper

const CaloCell_ID* LVL1::L1CaloCells2TriggerTowers::m_caloCellHelper
private

Definition at line 122 of file L1CaloCells2TriggerTowers.h.

◆ m_cellMatch

ToolHandle<LVL1::IL1CaloMatchCell2Tower> LVL1::L1CaloCells2TriggerTowers::m_cellMatch { this, "L1CaloMatchCell2Tower", "LVL1::L1CaloMatchCell2Tower", "L1CaloMatchCell2Tower" }
private

Definition at line 127 of file L1CaloCells2TriggerTowers.h.

128{ this, "L1CaloMatchCell2Tower", "LVL1::L1CaloMatchCell2Tower", "L1CaloMatchCell2Tower" };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_lvl1Helper

const CaloLVL1_ID* LVL1::L1CaloCells2TriggerTowers::m_lvl1Helper
private

Definition at line 120 of file L1CaloCells2TriggerTowers.h.

◆ m_mTTCaloCells

std::map<unsigned int, std::vector<const CaloCell*> > LVL1::L1CaloCells2TriggerTowers::m_mTTCaloCells
private

Definition at line 139 of file L1CaloCells2TriggerTowers.h.

◆ m_mTTLArDigits

std::map<unsigned int, std::vector<const LArDigit*> > LVL1::L1CaloCells2TriggerTowers::m_mTTLArDigits
private

Definition at line 140 of file L1CaloCells2TriggerTowers.h.

◆ m_mTTTileDigits

std::map<unsigned int, std::vector<const TileDigits*> > LVL1::L1CaloCells2TriggerTowers::m_mTTTileDigits
private

Definition at line 141 of file L1CaloCells2TriggerTowers.h.

◆ m_tileCablingService

const TileCablingService* LVL1::L1CaloCells2TriggerTowers::m_tileCablingService
private

Definition at line 132 of file L1CaloCells2TriggerTowers.h.

◆ m_tileID

const TileID* LVL1::L1CaloCells2TriggerTowers::m_tileID
private

Definition at line 121 of file L1CaloCells2TriggerTowers.h.

◆ m_ttSvc

ToolHandle<CaloTriggerTowerService> LVL1::L1CaloCells2TriggerTowers::m_ttSvc { this, "CaloTriggerTowerService", "CaloTriggerTowerService"}
private

Definition at line 129 of file L1CaloCells2TriggerTowers.h.

130{ this, "CaloTriggerTowerService", "CaloTriggerTowerService"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: