CMS 3D CMS Logo

List of all members | Public Member Functions
ClusterFillMap Class Reference

#include <ClusterFillMap.h>

Inheritance diagram for ClusterFillMap:
VFillMap

Public Member Functions

 ClusterFillMap (int, int, const std::map< int, int > &, double, double, const std::map< int, int > &, EcalIntercalibConstantMap *, EcalIntercalibConstantMap *)
 ctor More...
 
void fillMap (const std::vector< std::pair< DetId, float > > &, const DetId, const EcalRecHitCollection *, const EcalRecHitCollection *, std::map< int, double > &xtlMap, double &) override
 Fills the map. More...
 
 ~ClusterFillMap () 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...
 

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 ClusterFillMap.h.

Constructor & Destructor Documentation

◆ ClusterFillMap()

ClusterFillMap::ClusterFillMap ( 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 ClusterFillMap.cc.

14  : VFillMap(WindowX, WindowY, xtalReg, minE, maxE, IndexReg, barrelMap, endcapMap)
15 
16 {}
VFillMap(int, int, const std::map< int, int > &, double, double, const std::map< int, int > &, EcalIntercalibConstantMap *, EcalIntercalibConstantMap *)
ctor
Definition: VFillMap.cc:3

◆ ~ClusterFillMap()

ClusterFillMap::~ClusterFillMap ( )
override

dtor

Definition at line 18 of file ClusterFillMap.cc.

18 {}

Member Function Documentation

◆ fillMap()

void ClusterFillMap::fillMap ( const std::vector< std::pair< DetId, float > > &  v1,
const DetId  Max,
const EcalRecHitCollection barrelHitsCollection,
const EcalRecHitCollection endcapHitsCollection,
std::map< int, double > &  xtlMap,
double &  pSubtract 
)
overridevirtual

Fills the map.

Implements VFillMap.

Definition at line 20 of file ClusterFillMap.cc.

References EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::find(), edm::isNotFinite(), VFillMap::m_IndexInRegion, VFillMap::m_maxEnergyPerCrystal, VFillMap::m_minEnergyPerCrystal, VFillMap::m_xtalRegionId, METSkim_cff::Max, and trackerHitRTTI::vector.

25  {
26  for (std::vector<std::pair<DetId, float> >::const_iterator idsIt = v1.begin(); idsIt != v1.end(); ++idsIt) {
27  int RegionNumber = m_xtalRegionId[Max.rawId()];
29  double dummy = 0.;
30  if (idsIt->first.subdetId() == EcalBarrel) {
31  itrechit = barrelHitsCollection->find(idsIt->first);
32  dummy = itrechit->energy();
33  dummy *= (*m_barrelMap)[idsIt->first];
34  } else if (idsIt->first.subdetId() == EcalEndcap) {
35  itrechit = endcapHitsCollection->find(idsIt->first);
36  dummy = itrechit->energy();
37  dummy *= (*m_endcapMap)[idsIt->first];
38  }
39  if (edm::isNotFinite(dummy)) {
40  dummy = 0;
41  }
43  continue; //return 1;
45  continue;
46  }
47  int ID = idsIt->first.rawId();
48  if (m_xtalRegionId[ID] == RegionNumber)
49  xtlMap[m_IndexInRegion[ID]] += dummy;
50  else
51  pSubtract += dummy;
52  }
53 }
double m_maxEnergyPerCrystal
Definition: VFillMap.h:38
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
uint32_t ID
Definition: Definitions.h:24
std::vector< EcalRecHit >::const_iterator const_iterator
std::map< int, int > m_IndexInRegion
Definition: VFillMap.h:39
double m_minEnergyPerCrystal
Definition: VFillMap.h:37
iterator find(key_type k)
std::map< int, int > m_xtalRegionId
Definition: VFillMap.h:36