CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
MatrixFillMap Class Reference

#include <MatrixFillMap.h>

Inheritance diagram for MatrixFillMap:
VFillMap

Public Member Functions

void fillMap (const std::vector< std::pair< DetId, float > > &, const DetId, const EcalRecHitCollection *, const EcalRecHitCollection *, std::map< int, double > &xtlMap, double &) override
 The Map filler. More...
 
 MatrixFillMap (int, int, const std::map< int, int > &, double, double, const std::map< int, int > &, EcalIntercalibConstantMap *, EcalIntercalibConstantMap *)
 ctor More...
 
 ~MatrixFillMap () override
 dtor More...
 
- Public Member Functions inherited from VFillMap
 VFillMap (int, int, const std::map< int, int > &, double, double, const std::map< int, int > &, EcalIntercalibConstantMap *, EcalIntercalibConstantMap *)
 ctor More...
 
virtual ~VFillMap ()
 dtor More...
 

Private Member Functions

void fillEBMap (EBDetId, const EcalRecHitCollection *, std::map< int, double > &, int, double &)
 takes care of the Barrel More...
 
void fillEEMap (EEDetId, const EcalRecHitCollection *, std::map< int, double > &, int, double &)
 takes care of the Endcap More...
 

Additional Inherited Members

- Public Attributes inherited from VFillMap
EcalIntercalibConstantMapm_barrelMap
 
EcalIntercalibConstantMapm_endcapMap
 
std::map< int, int > m_IndexInRegion
 
double m_maxEnergyPerCrystal
 
double m_minEnergyPerCrystal
 
int m_recoWindowSidex
 
int m_recoWindowSidey
 
std::map< int, int > m_xtalRegionId
 

Detailed Description

Definition at line 7 of file MatrixFillMap.h.

Constructor & Destructor Documentation

◆ MatrixFillMap()

MatrixFillMap::MatrixFillMap ( int  WindowX,
int  WindowY,
const std::map< int, int > &  xtalReg,
double  minE,
double  maxE,
const std::map< int, int > &  IndexReg,
EcalIntercalibConstantMap barrelMap,
EcalIntercalibConstantMap endcapMap 
)

ctor

Definition at line 6 of file MatrixFillMap.cc.

14  :
15 
16  VFillMap(WindowX, WindowY, xtalReg, minE, maxE, IndexReg, barrelMap, endcapMap) {}

◆ ~MatrixFillMap()

MatrixFillMap::~MatrixFillMap ( )
override

dtor

Definition at line 18 of file MatrixFillMap.cc.

18 {}

Member Function Documentation

◆ fillEBMap()

void MatrixFillMap::fillEBMap ( EBDetId  EBmax,
const EcalRecHitCollection barrelHitsCollection,
std::map< int, double > &  EBRegionMap,
int  EBNumberOfRegion,
double &  pSubtract 
)
private

takes care of the Barrel

Definition at line 35 of file MatrixFillMap.cc.

39  {
40  int curr_eta;
41  int curr_phi;
42  //reads the hits in a recoWindowSide^2 wide region around the MOX
43  for (int ii = 0; ii < m_recoWindowSidex; ++ii)
44  for (int ij = 0; ij < m_recoWindowSidey; ++ij) {
45  curr_eta = EBmax.ieta() + ii - (m_recoWindowSidex / 2);
46  curr_phi = EBmax.iphi() + ij - (m_recoWindowSidey / 2);
47  //skips if the xtals matrix falls over the border
48  if (abs(curr_eta) > 85)
49  continue;
50  //Couples with the zero gap in the barrel eta index
51  if (curr_eta * EBmax.ieta() <= 0) {
52  if (EBmax.ieta() > 0)
53  curr_eta--;
54  else
55  curr_eta++;
56  } // JUMP over 0
57  //The following 2 couples with the ciclicity of the phiIndex
58  if (curr_phi < 1)
59  curr_phi += 360;
60  if (curr_phi >= 360)
61  curr_phi -= 360;
62  //checks if the detId is valid
63  if (EBDetId::validDetId(curr_eta, curr_phi)) {
64  EBDetId det = EBDetId(curr_eta, curr_phi, EBDetId::ETAPHIMODE);
65  int ID = det.rawId();
66  //finds the hit corresponding to the cell
67  EcalRecHitCollection::const_iterator curr_recHit = barrelHitsCollection->find(det);
68  double dummy = 0;
69  dummy = curr_recHit->energy();
70  //checks if the reading of the xtal is in a sensible range
71  if (edm::isNotFinite(dummy)) {
72  dummy = 0;
73  }
75  continue;
77  continue;
78  //corrects the energy with the calibration coeff of the ring
79  dummy *= (*m_barrelMap)[det];
80  //sums the energy of the xtal to the appropiate ring
81  if (m_xtalRegionId[ID] == EBNumberOfRegion)
82  EBRegionMap[m_IndexInRegion[ID]] += dummy;
83  //adds the reading to pSubtract when part of the matrix is outside the region
84  else
85  pSubtract += dummy;
86  }
87  }
88 }

References funct::abs(), EBDetId::ETAPHIMODE, edm::SortedCollection< T, SORT >::find(), EBDetId::ieta(), cuy::ii, EBDetId::iphi(), edm::isNotFinite(), VFillMap::m_IndexInRegion, VFillMap::m_maxEnergyPerCrystal, VFillMap::m_minEnergyPerCrystal, VFillMap::m_recoWindowSidex, VFillMap::m_recoWindowSidey, VFillMap::m_xtalRegionId, DetId::rawId(), and EBDetId::validDetId().

Referenced by fillMap().

◆ fillEEMap()

void MatrixFillMap::fillEEMap ( EEDetId  EEmax,
const EcalRecHitCollection endcapHitsCollection,
std::map< int, double > &  EExtlMap,
int  EENumberOfRegion,
double &  pSubtract 
)
private

takes care of the Endcap

Definition at line 90 of file MatrixFillMap.cc.

94  {
95  int curr_x;
96  int curr_y;
97  for (int ii = 0; ii < m_recoWindowSidex; ++ii)
98  for (int ij = 0; ij < m_recoWindowSidey; ++ij) {
99  //Works as fillEBMap
100  curr_x = EEmax.ix() - m_recoWindowSidex / 2 + ii;
101  curr_y = EEmax.iy() - m_recoWindowSidey / 2 + ij;
102  if (EEDetId::validDetId(curr_x, curr_y, EEmax.zside())) {
103  EEDetId det = EEDetId(curr_x, curr_y, EEmax.zside(), EEDetId::XYMODE);
104  EcalRecHitCollection::const_iterator curr_recHit = endcapHitsCollection->find(det);
105  double dummy = curr_recHit->energy();
106  if (edm::isNotFinite(dummy)) {
107  dummy = 0;
108  }
110  continue;
112  continue;
113  }
114  dummy *= (*m_endcapMap)[det];
115  int ID = det.rawId();
116  if (m_xtalRegionId[ID] == EENumberOfRegion)
117  EExtlMap[m_IndexInRegion[ID]] += dummy;
118  else
119  pSubtract += dummy;
120  }
121  }
122 }

References edm::SortedCollection< T, SORT >::find(), cuy::ii, edm::isNotFinite(), EEDetId::ix(), EEDetId::iy(), VFillMap::m_IndexInRegion, VFillMap::m_maxEnergyPerCrystal, VFillMap::m_minEnergyPerCrystal, VFillMap::m_recoWindowSidex, VFillMap::m_recoWindowSidey, VFillMap::m_xtalRegionId, DetId::rawId(), EEDetId::validDetId(), EEDetId::XYMODE, and EEDetId::zside().

Referenced by fillMap().

◆ fillMap()

void MatrixFillMap::fillMap ( const std::vector< std::pair< DetId, float > > &  ,
const  DetId,
const EcalRecHitCollection ,
const EcalRecHitCollection ,
std::map< int, double > &  xtlMap,
double &   
)
overridevirtual

The Map filler.

Implements VFillMap.

Definition at line 20 of file MatrixFillMap.cc.

25  {
26  if (Max.subdetId() == EcalBarrel) {
27  EBDetId EBMax = Max;
28  fillEBMap(EBMax, barrelHitsCollection, xtlMap, m_xtalRegionId[Max.rawId()], pSubtract);
29  } else if (Max.subdetId() == EcalEndcap) {
30  EEDetId EEMax = Max;
31  fillEEMap(EEMax, endcapHitsCollection, xtlMap, m_xtalRegionId[Max.rawId()], pSubtract);
32  }
33 }

References EcalBarrel, EcalEndcap, fillEBMap(), fillEEMap(), VFillMap::m_xtalRegionId, and Max().

HLT_FULL_cff.maxE
maxE
Definition: HLT_FULL_cff.py:13661
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
EBDetId
Definition: EBDetId.h:17
VFillMap::m_minEnergyPerCrystal
double m_minEnergyPerCrystal
Definition: VFillMap.h:37
VFillMap::m_xtalRegionId
std::map< int, int > m_xtalRegionId
Definition: VFillMap.h:36
EEDetId::ix
int ix() const
Definition: EEDetId.h:77
EcalBarrel
Definition: EcalSubdetector.h:10
VFillMap::m_recoWindowSidex
int m_recoWindowSidex
Definition: VFillMap.h:34
VFillMap::m_IndexInRegion
std::map< int, int > m_IndexInRegion
Definition: VFillMap.h:39
EEDetId::zside
int zside() const
Definition: EEDetId.h:71
EEDetId
Definition: EEDetId.h:14
EcalEndcap
Definition: EcalSubdetector.h:10
EBDetId::ETAPHIMODE
static const int ETAPHIMODE
Definition: EBDetId.h:158
align::ID
uint32_t ID
Definition: Definitions.h:24
VFillMap::VFillMap
VFillMap(int, int, const std::map< int, int > &, double, double, const std::map< int, int > &, EcalIntercalibConstantMap *, EcalIntercalibConstantMap *)
ctor
Definition: VFillMap.cc:3
Max
T Max(T a, T b)
Definition: MathUtil.h:44
EEDetId::iy
int iy() const
Definition: EEDetId.h:83
EBDetId::validDetId
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
MatrixFillMap::fillEEMap
void fillEEMap(EEDetId, const EcalRecHitCollection *, std::map< int, double > &, int, double &)
takes care of the Endcap
Definition: MatrixFillMap.cc:90
edm::SortedCollection::find
iterator find(key_type k)
Definition: SortedCollection.h:240
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
MatrixFillMap::fillEBMap
void fillEBMap(EBDetId, const EcalRecHitCollection *, std::map< int, double > &, int, double &)
takes care of the Barrel
Definition: MatrixFillMap.cc:35
EEDetId::XYMODE
static const int XYMODE
Definition: EEDetId.h:335
VFillMap::m_maxEnergyPerCrystal
double m_maxEnergyPerCrystal
Definition: VFillMap.h:38
EEDetId::validDetId
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
EBDetId::iphi
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
VFillMap::m_recoWindowSidey
int m_recoWindowSidey
Definition: VFillMap.h:35
dummy
Definition: DummySelector.h:38
cuy.ii
ii
Definition: cuy.py:589