ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 More...
 
virtual StatusCode finalize () override
 finalize the tool More...
 
virtual StatusCode process (CaloCellContainer *theCellContainer, const EventContext &ctx) const override
 update theCellContainer, masking Feb with errors More...
 

Private Member Functions

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

Private Attributes

SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
 handle to LAr cabling service More...
 
const CaloCell_IDm_calo_id
 pointers to storegateSvc and identifier helpers More...
 
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 }

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 }

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

◆ 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
57  ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") );
58  return StatusCode::SUCCESS;
59 
60 }

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

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.

◆ 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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::eratio
setCharge setNTRTHiThresholdHits eratio
Definition: TrigElectron_v1.cxx:96
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
LArCellGainPathology::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
handle to LAr cabling service
Definition: LArCellGainPathology.h:64
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
index
Definition: index.py:1
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
LArOnlineID_Base::feb_begin
id_iterator feb_begin() const
Returns an iterator pointing to a feb identifier collection.
Definition: LArOnlineID_Base.cxx:1910
CaloCell::setEnergy
virtual void setEnergy(float energy)
set energy
Definition: CaloCell.cxx:136
HWIdentifier
Definition: HWIdentifier.h:13
LArCellGainPathology::ApplyPathology
void ApplyPathology(CaloCellContainer *theCont, HWIdentifier id1, HWIdentifier id, const LArOnOffIdMapping *cabling) const
method to apply pathology between a couple of cells
Definition: LArCellGainPathology.cxx:100
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
CaloIdManager
This class initializes the Calo (LAr and Tile) offline identifiers.
Definition: CaloIdManager.h:45
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:564
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArOnlineID_Base::channel_Id
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
Definition: LArOnlineID_Base.cxx:1569
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCell::setGain
void setGain(CaloGain::CaloGain gain=CaloGain::INVALIDGAIN)
set gain
Definition: CaloCell.cxx:173
LArCellGainPathology::m_calo_id
const CaloCell_ID * m_calo_id
pointers to storegateSvc and identifier helpers
Definition: LArCellGainPathology.h:68
LArOnlineID_Base::feb_end
id_iterator feb_end() const
Definition: LArOnlineID_Base.cxx:1915
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloIdManager::getCaloCell_ID
const CaloCell_ID * getCaloCell_ID(void) const
Access to IdHelper.
Definition: CaloIdManager.cxx:63
CaloCell::gain
CaloGain::CaloGain gain() const
get gain (data member )
Definition: CaloCell.h:345
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
LArCellGainPathology::GetCell
CaloCell * GetCell(CaloCellContainer *theCont, HWIdentifier id, const LArOnOffIdMapping *cabling) const
method to find cell from hardware id
Definition: LArCellGainPathology.cxx:135
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
LArCellGainPathology::m_onlineID
const LArOnlineID * m_onlineID
Definition: LArCellGainPathology.h:69
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCellContainer::findIndex
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
Definition: CaloCellContainer.cxx:363
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
IdentifierHash
Definition: IdentifierHash.h:38
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20