CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CaloMiscalibMapEcal Class Reference

#include <CaloMiscalibMapEcal.h>

Inheritance diagram for CaloMiscalibMapEcal:
CaloMiscalibMap

Public Member Functions

void addCell (const DetId &cell, float scaling_factor) override
 
 CaloMiscalibMapEcal ()
 
const EcalIntercalibConstantsget ()
 
void prefillMap ()
 
void print ()
 
- Public Member Functions inherited from CaloMiscalibMap
 CaloMiscalibMap ()
 
virtual ~CaloMiscalibMap ()
 

Private Attributes

const CaloSubdetectorGeometrygeometry
 
EcalIntercalibConstants map_
 

Detailed Description

Definition at line 15 of file CaloMiscalibMapEcal.h.

Constructor & Destructor Documentation

◆ CaloMiscalibMapEcal()

CaloMiscalibMapEcal::CaloMiscalibMapEcal ( )
inline

Definition at line 17 of file CaloMiscalibMapEcal.h.

17 {}

Member Function Documentation

◆ addCell()

void CaloMiscalibMapEcal::addCell ( const DetId cell,
float  scaling_factor 
)
inlineoverridevirtual

Implements CaloMiscalibMap.

Definition at line 45 of file CaloMiscalibMapEcal.h.

References map_, DetId::rawId(), and EcalCondObjectContainer< T >::setValue().

45 { map_.setValue(cell.rawId(), scaling_factor); }
void setValue(const uint32_t id, const Item &item)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalIntercalibConstants map_

◆ get()

const EcalIntercalibConstants& CaloMiscalibMapEcal::get ( )
inline

◆ prefillMap()

void CaloMiscalibMapEcal::prefillMap ( )
inline

Definition at line 19 of file CaloMiscalibMapEcal.h.

References L1TowerCalibrationProducer_cfi::iEta, EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, map_, EBDetId::MAX_IETA, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, DetId::rawId(), and EcalCondObjectContainer< T >::setValue().

Referenced by InvRingCalib::duringLoop(), and ZeeCalibration::duringLoop().

19  {
20  for (int iEta = -EBDetId::MAX_IETA; iEta <= EBDetId::MAX_IETA; ++iEta) {
21  if (iEta == 0)
22  continue;
23  for (int iPhi = EBDetId::MIN_IPHI; iPhi <= EBDetId::MAX_IPHI; ++iPhi) {
24  try {
25  EBDetId ebdetid(iEta, iPhi);
26  map_.setValue(ebdetid.rawId(), 1.0);
27  } catch (...) {
28  }
29  }
30  }
31 
32  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
33  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
34  try {
35  EEDetId eedetidpos(iX, iY, 1);
36  map_.setValue(eedetidpos.rawId(), 1.0);
37  EEDetId eedetidneg(iX, iY, -1);
38  map_.setValue(eedetidneg.rawId(), 1.0);
39  } catch (...) {
40  }
41  }
42  }
43  }
static const int MIN_IPHI
Definition: EBDetId.h:135
static const int IX_MIN
Definition: EEDetId.h:290
static const int IY_MIN
Definition: EEDetId.h:294
void setValue(const uint32_t id, const Item &item)
static const int IX_MAX
Definition: EEDetId.h:298
static const int MAX_IPHI
Definition: EBDetId.h:137
static const int MAX_IETA
Definition: EBDetId.h:136
EcalIntercalibConstants map_
static const int IY_MAX
Definition: EEDetId.h:302

◆ print()

void CaloMiscalibMapEcal::print ( void  )
inline

Definition at line 47 of file CaloMiscalibMapEcal.h.

References gather_cfg::cout, EcalCondObjectContainer< T >::find(), L1TowerCalibrationProducer_cfi::iEta, EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, map_, EBDetId::MAX_IETA, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, DetId::rawId(), EBDetId::validDetId(), and EEDetId::validDetId().

47  {
48  int icount = 0;
49  for (int iEta = -EBDetId::MAX_IETA; iEta <= EBDetId::MAX_IETA; ++iEta) {
50  if (iEta == 0)
51  continue;
52  for (int iPhi = EBDetId::MIN_IPHI; iPhi <= EBDetId::MAX_IPHI; ++iPhi) {
53  if (EBDetId::validDetId(iEta, iPhi)) {
54  EBDetId ebdetid(iEta, iPhi);
55  EcalIntercalibConstantMap::const_iterator icalit = map_.find(ebdetid.rawId());
56  EcalIntercalibConstant icalconst;
57  icalconst = (*icalit);
58 
59  icount++;
60  if (icount % 230 == 0) {
61  std::cout << "here is value for chan eta/phi " << iEta << "/" << iPhi << "=" << icalconst << std::endl;
62  }
63  }
64  }
65  }
66  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
67  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
68  if (EEDetId::validDetId(iX, iY, 1)) {
69  EEDetId eedetidpos(iX, iY, 1);
70  EcalIntercalibConstantMap::const_iterator icalit = map_.find(eedetidpos.rawId());
71  EcalIntercalibConstant icalconst;
72  icalconst = (*icalit);
73 
74  EEDetId eedetidneg(iX, iY, -1);
75  EcalIntercalibConstantMap::const_iterator icalit2 = map_.find(eedetidneg.rawId());
76  EcalIntercalibConstant icalconst2;
77  icalconst2 = (*icalit2);
78 
79  icount++;
80  if (icount % 230 == 0) {
81  std::cout << "here is value for chan x/y " << iX << "/" << iY << " pos side is =" << icalconst
82  << " and neg side is= " << icalconst2 << std::endl;
83  }
84  }
85  }
86  }
87  }
static const int MIN_IPHI
Definition: EBDetId.h:135
static const int IX_MIN
Definition: EEDetId.h:290
static const int IY_MIN
Definition: EEDetId.h:294
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
const_iterator find(uint32_t rawId) const
static const int IX_MAX
Definition: EEDetId.h:298
static const int MAX_IPHI
Definition: EBDetId.h:137
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
std::vector< Item >::const_iterator const_iterator
static const int MAX_IETA
Definition: EBDetId.h:136
EcalIntercalibConstants map_
static const int IY_MAX
Definition: EEDetId.h:302
float EcalIntercalibConstant

Member Data Documentation

◆ geometry

const CaloSubdetectorGeometry* CaloMiscalibMapEcal::geometry
private

Definition at line 93 of file CaloMiscalibMapEcal.h.

◆ map_

EcalIntercalibConstants CaloMiscalibMapEcal::map_
private

Definition at line 92 of file CaloMiscalibMapEcal.h.

Referenced by addCell(), get(), prefillMap(), and print().