CMS 3D CMS Logo

ClusterFillMap.cc
Go to the documentation of this file.
5 
7  int WindowY,
8  const std::map<int, int>& xtalReg,
9  double minE,
10  double maxE,
11  const std::map<int, int>& IndexReg,
12  EcalIntercalibConstantMap* barrelMap,
13  EcalIntercalibConstantMap* endcapMap)
14  : VFillMap(WindowX, WindowY, xtalReg, minE, maxE, IndexReg, barrelMap, endcapMap)
15 
16 {}
17 
19 
20 void ClusterFillMap::fillMap(const std::vector<std::pair<DetId, float> >& v1,
21  const DetId Max,
22  const EcalRecHitCollection* barrelHitsCollection,
23  const EcalRecHitCollection* endcapHitsCollection,
24  std::map<int, double>& xtlMap,
25  double& pSubtract) {
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  }
35  if (idsIt->first.subdetId() == EcalEndcap) {
36  itrechit = endcapHitsCollection->find(idsIt->first);
37  dummy = itrechit->energy();
38  dummy *= (*m_endcapMap)[idsIt->first];
39  }
40  int ID = idsIt->first.rawId();
41  if (edm::isNotFinite(dummy)) {
42  dummy = 0;
43  }
45  continue; //return 1;
47  dummy = 0;
48  continue;
49  }
50  if (m_xtalRegionId[ID] == RegionNumber)
51  xtlMap[m_IndexInRegion[ID]] += dummy;
52  else
53  pSubtract += dummy;
54  }
55 }
HLT_FULL_cff.maxE
maxE
Definition: HLT_FULL_cff.py:13731
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.h
EEDetId.h
edm::SortedCollection< EcalRecHit >
VFillMap::m_minEnergyPerCrystal
double m_minEnergyPerCrystal
Definition: VFillMap.h:37
VFillMap::m_xtalRegionId
std::map< int, int > m_xtalRegionId
Definition: VFillMap.h:36
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
EcalBarrel
Definition: EcalSubdetector.h:10
DetId
Definition: DetId.h:17
VFillMap::m_IndexInRegion
std::map< int, int > m_IndexInRegion
Definition: VFillMap.h:39
ClusterFillMap::~ClusterFillMap
~ClusterFillMap() override
dtor
Definition: ClusterFillMap.cc:18
ClusterFillMap.h
ClusterFillMap::ClusterFillMap
ClusterFillMap(int, int, const std::map< int, int > &, double, double, const std::map< int, int > &, EcalIntercalibConstantMap *, EcalIntercalibConstantMap *)
ctor
Definition: ClusterFillMap.cc:6
EcalEndcap
Definition: EcalSubdetector.h:10
align::ID
uint32_t ID
Definition: Definitions.h:24
VFillMap
Definition: VFillMap.h:12
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
Max
T Max(T a, T b)
Definition: MathUtil.h:44
ClusterFillMap::fillMap
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.
Definition: ClusterFillMap.cc:20
edm::SortedCollection::find
iterator find(key_type k)
Definition: SortedCollection.h:240
isFinite.h
VFillMap::m_maxEnergyPerCrystal
double m_maxEnergyPerCrystal
Definition: VFillMap.h:38
dummy
Definition: DummySelector.h:38