CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CaloMiscalibMapEcal Class Reference

#include <CaloMiscalibMapEcal.h>

Inheritance diagram for CaloMiscalibMapEcal:
CaloMiscalibMap

Public Member Functions

virtual void addCell (const DetId &cell, float scaling_factor)
 
 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 18 of file CaloMiscalibMapEcal.h.

Constructor & Destructor Documentation

CaloMiscalibMapEcal::CaloMiscalibMapEcal ( )
inline

Definition at line 20 of file CaloMiscalibMapEcal.h.

20  {
21 }

Member Function Documentation

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

Implements CaloMiscalibMap.

Definition at line 60 of file CaloMiscalibMapEcal.h.

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

61 {
62 map_.setValue(cell.rawId(),scaling_factor);
63 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
void setValue(const uint32_t id, const Item &item)
EcalIntercalibConstants map_
const EcalIntercalibConstants& CaloMiscalibMapEcal::get ( void  )
inline
void CaloMiscalibMapEcal::prefillMap ( )
inline

Definition at line 23 of file CaloMiscalibMapEcal.h.

References 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 CaloMiscalibTools::CaloMiscalibTools(), CaloMiscalibToolsMC::CaloMiscalibToolsMC(), InvRingCalib::duringLoop(), ZeeCalibration::duringLoop(), CaloMiscalibToolsMC::produce(), and CaloMiscalibTools::produce().

23  {
24 
25 
26  for(int iEta=-EBDetId::MAX_IETA; iEta<=EBDetId::MAX_IETA ;++iEta) {
27  if(iEta==0) continue;
28  for(int iPhi=EBDetId::MIN_IPHI; iPhi<=EBDetId::MAX_IPHI; ++iPhi) {
29 
30  try
31  {
32  EBDetId ebdetid(iEta,iPhi);
33  map_.setValue(ebdetid.rawId(),1.0);
34  }
35  catch (...)
36  {
37  }
38  }
39  }
40 
41  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
42  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
43  try
44  {
45  EEDetId eedetidpos(iX,iY,1);
46  map_.setValue(eedetidpos.rawId(),1.0);
47  EEDetId eedetidneg(iX,iY,-1);
48  map_.setValue(eedetidneg.rawId(),1.0);
49  }
50  catch (...)
51  {
52  }
53  }
54  }
55 
56 
57 }
static const int MIN_IPHI
Definition: EBDetId.h:143
static const int IX_MIN
Definition: EEDetId.h:295
static const int IY_MIN
Definition: EEDetId.h:299
void setValue(const uint32_t id, const Item &item)
static const int IX_MAX
Definition: EEDetId.h:303
static const int MAX_IPHI
Definition: EBDetId.h:145
static const int MAX_IETA
Definition: EBDetId.h:144
EcalIntercalibConstants map_
static const int IY_MAX
Definition: EEDetId.h:307
void CaloMiscalibMapEcal::print ( void  )
inline

Definition at line 65 of file CaloMiscalibMapEcal.h.

References gather_cfg::cout, EcalCondObjectContainer< T >::find(), 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().

Referenced by CaloMiscalibTools::produce(), and CaloMiscalibToolsMC::produce().

66  {
67 
68  int icount=0;
69  for(int iEta=-EBDetId::MAX_IETA; iEta<=EBDetId::MAX_IETA ;++iEta) {
70  if(iEta==0) continue;
71  for(int iPhi=EBDetId::MIN_IPHI; iPhi<=EBDetId::MAX_IPHI; ++iPhi) {
72  if (EBDetId::validDetId(iEta,iPhi))
73  {
74  EBDetId ebdetid(iEta,iPhi);
75  EcalIntercalibConstantMap::const_iterator icalit= map_.find(ebdetid.rawId());
76  EcalIntercalibConstant icalconst;
77  icalconst = (*icalit);
78 
79  icount++;
80  if(icount%230==0){
81  std::cout<< "here is value for chan eta/phi "<<iEta<<"/"<<iPhi<<"="<<icalconst<<std::endl;}
82  }
83  }
84  }
85  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
86  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
87  if (EEDetId::validDetId(iX,iY,1))
88  {
89  EEDetId eedetidpos(iX,iY,1);
90  EcalIntercalibConstantMap::const_iterator icalit= map_.find(eedetidpos.rawId());
91  EcalIntercalibConstant icalconst;
92  icalconst = (*icalit);
93 
94  EEDetId eedetidneg(iX,iY,-1);
95  EcalIntercalibConstantMap::const_iterator icalit2= map_.find(eedetidneg.rawId());
96  EcalIntercalibConstant icalconst2;
97  icalconst2 = (*icalit2);
98 
99 
100  icount++;
101  if(icount%230==0){
102 
103  std::cout<< "here is value for chan x/y "<<iX<<"/"<<iY<<" pos side is ="<<icalconst<< " and neg side is= "<< icalconst2<<std::endl;}
104 
105  }
106  }
107  }
108 
109 }
static const int MIN_IPHI
Definition: EBDetId.h:143
static const int IX_MIN
Definition: EEDetId.h:295
static const int IY_MIN
Definition: EEDetId.h:299
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:125
static const int IX_MAX
Definition: EEDetId.h:303
static const int MAX_IPHI
Definition: EBDetId.h:145
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:249
std::vector< Item >::const_iterator const_iterator
static const int MAX_IETA
Definition: EBDetId.h:144
const_iterator find(uint32_t rawId) const
tuple cout
Definition: gather_cfg.py:121
EcalIntercalibConstants map_
static const int IY_MAX
Definition: EEDetId.h:307
float EcalIntercalibConstant

Member Data Documentation

const CaloSubdetectorGeometry* CaloMiscalibMapEcal::geometry
private
EcalIntercalibConstants CaloMiscalibMapEcal::map_
private

Definition at line 117 of file CaloMiscalibMapEcal.h.

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