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

Apply to MC the pathology on gain corruption between cha0-63, 64-127, which affected 7 samples data April-July 2010. More...

#include <LArCellGainPathology.h>

Inheritance diagram for LArCellGainPathology:
Collaboration diagram for LArCellGainPathology:

Public Member Functions

 LArCellGainPathology (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
 initialize the tool
virtual StatusCode finalize () override
 finalize the tool
virtual StatusCode process (CaloCellContainer *theCellContainer, const EventContext &ctx) const override
 update theCellContainer, masking Feb with errors

Private Member Functions

void ApplyPathology (CaloCellContainer *theCont, HWIdentifier id1, HWIdentifier id, const LArOnOffIdMapping *cabling) const
 method to apply pathology between a couple of cells
CaloCellGetCell (CaloCellContainer *theCont, HWIdentifier id, const LArOnOffIdMapping *cabling) const
 method to find cell from hardware id

Private Attributes

SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
 handle to LAr cabling service
const CaloCell_IDm_calo_id
 pointers to storegateSvc and identifier helpers
const LArOnlineIDm_onlineID

Detailed Description

Apply to MC the pathology on gain corruption between cha0-63, 64-127, which affected 7 samples data April-July 2010.

Created July 29, 2010 G.Unal

Definition at line 29 of file LArCellGainPathology.h.

Constructor & Destructor Documentation

◆ LArCellGainPathology()

LArCellGainPathology::LArCellGainPathology ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 33 of file LArCellGainPathology.cxx.

37 : base_class (type, name, parent),
38 m_calo_id(nullptr),
39 m_onlineID(nullptr)
40{
41}
const LArOnlineID * m_onlineID
const CaloCell_ID * m_calo_id
pointers to storegateSvc and identifier helpers

Member Function Documentation

◆ ApplyPathology()

void LArCellGainPathology::ApplyPathology ( CaloCellContainer * theCont,
HWIdentifier id1,
HWIdentifier id,
const LArOnOffIdMapping * cabling ) const
private

method to apply pathology between a couple of cells

Definition at line 100 of file LArCellGainPathology.cxx.

101{
102
103 CaloCell* cell1 = this->GetCell(theCont, id1,cabling);
104 CaloCell* cell2 = this->GetCell(theCont, id2,cabling);
105
106 if (!cell1 || !cell2) return;
107
108 //std::cout << " cell pair " << m_onlineID->show_to_string(id1) << " " << m_onlineID->show_to_string(id2) << " " <<
109 // cell1->gain() << " " << cell2->gain() << " " << cell1->energy() << " " << cell2->energy() << std::endl;
110
111 if (cell1->gain() == cell2->gain()) return;
112
113
114 CaloGain::CaloGain newGain = cell2->gain();
115 double eratio=1;
116 if (newGain==CaloGain::LARHIGHGAIN) {
117 if (cell1->gain()==CaloGain::LARMEDIUMGAIN) eratio=0.1;
118 if (cell1->gain()==CaloGain::LARLOWGAIN) eratio=0.01;
119 }
120 if (newGain==CaloGain::LARMEDIUMGAIN) {
121 if (cell1->gain()==CaloGain::LARHIGHGAIN) eratio=10.;
122 if (cell1->gain()==CaloGain::LARLOWGAIN) eratio=0.1;
123 }
124 if (newGain==CaloGain::LARLOWGAIN) {
125 if (cell1->gain()==CaloGain::LARHIGHGAIN) eratio=100.;
126 if (cell1->gain()==CaloGain::LARMEDIUMGAIN) eratio=10.;
127 }
128 double eold = cell1->energy();
129 cell1->setEnergy(eratio*eold);
130 cell1->setGain(newGain);
131 //std::cout << " --- new gain/energy of cell1 " << cell1->gain() << " " << cell1->energy() << std::endl;
132
133}
HWIdentifier id2
double energy() const
get energy (data member)
Definition CaloCell.h:327
void setGain(CaloGain::CaloGain gain=CaloGain::INVALIDGAIN)
set gain
Definition CaloCell.h:497
virtual void setEnergy(float energy)
set energy
Definition CaloCell.h:472
CaloGain::CaloGain gain() const
get gain (data member )
Definition CaloCell.h:361
CaloCell * GetCell(CaloCellContainer *theCont, HWIdentifier id, const LArOnOffIdMapping *cabling) const
method to find cell from hardware id
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARLOWGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18
setCharge setNTRTHiThresholdHits eratio

◆ finalize()

StatusCode LArCellGainPathology::finalize ( )
overridevirtual

finalize the tool

Definition at line 62 of file LArCellGainPathology.cxx.

63{
64 return StatusCode::SUCCESS;
65}

◆ GetCell()

CaloCell * LArCellGainPathology::GetCell ( CaloCellContainer * theCont,
HWIdentifier id,
const LArOnOffIdMapping * cabling ) const
private

method to find cell from hardware id

Definition at line 135 of file LArCellGainPathology.cxx.

136{
137 CaloCell* aCell =nullptr;
138 if (cabling->isOnlineConnected(id)) {
139 Identifier id_off = cabling->cnvToIdentifier(id);
140 IdentifierHash theCellHashID = m_calo_id->calo_cell_hash(id_off);
141 int index = theCont->findIndex(theCellHashID);
142 if (index>=0) {
143 aCell = theCont->at(index);
144 }
145 }
146 return aCell;
147
148}
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
const T * at(size_type n) const
Access an element, as an rvalue.
str index
Definition DeMoScan.py:362

◆ initialize()

StatusCode LArCellGainPathology::initialize ( )
overridevirtual

initialize the tool

Definition at line 49 of file LArCellGainPathology.cxx.

50{
51 const CaloIdManager* caloIdMgr;
52 ATH_CHECK( detStore()->retrieve( caloIdMgr ) );
53 m_calo_id = caloIdMgr->getCaloCell_ID();
54
55 // translate offline ID into online ID
56 ATH_CHECK( m_cablingKey.initialize());
57 ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") );
58 return StatusCode::SUCCESS;
59
60}
#define ATH_CHECK
Evaluate an expression and check for errors.
const CaloCell_ID * getCaloCell_ID(void) const
Access to IdHelper.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
handle to LAr cabling service
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ process()

StatusCode LArCellGainPathology::process ( CaloCellContainer * theCellContainer,
const EventContext & ctx ) const
overridevirtual

update theCellContainer, masking Feb with errors

Definition at line 67 of file LArCellGainPathology.cxx.

69{
70 ATH_MSG_DEBUG (" in LArCellGainPathology::process ");
71
72 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey, ctx};
73 const LArOnOffIdMapping* cabling=*cablingHdl;
74
75// loop over all Febs
76
77 std::vector<HWIdentifier>::const_iterator feb = m_onlineID->feb_begin();
78 std::vector<HWIdentifier>::const_iterator feb_end = m_onlineID->feb_end();
79
80
81 for ( ; feb != feb_end; ++feb) {
82// for debug
83 ATH_MSG_DEBUG (" process Feb: " <<
84 feb->get_identifier32().get_compact());
85
86// get information for channel 0-63 64-127
87
88 for (int i=0;i<2;i++) {
89 int cha1 = i*64;
90 int cha2 = i*64+63;
91 HWIdentifier hwid1 = m_onlineID->channel_Id(*feb,cha1);
92 HWIdentifier hwid2 = m_onlineID->channel_Id(*feb,cha2);
93 this->ApplyPathology(theCont,hwid1,hwid2,cabling);
94 }
95 }
96
97 return StatusCode::SUCCESS;
98}
#define ATH_MSG_DEBUG(x)
void ApplyPathology(CaloCellContainer *theCont, HWIdentifier id1, HWIdentifier id, const LArOnOffIdMapping *cabling) const
method to apply pathology between a couple of cells

Member Data Documentation

◆ m_cablingKey

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

handle to LAr cabling service

Definition at line 64 of file LArCellGainPathology.h.

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

◆ m_calo_id

const CaloCell_ID* LArCellGainPathology::m_calo_id
private

pointers to storegateSvc and identifier helpers

Definition at line 68 of file LArCellGainPathology.h.

◆ m_onlineID

const LArOnlineID* LArCellGainPathology::m_onlineID
private

Definition at line 69 of file LArCellGainPathology.h.


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