CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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,
15  maxE, IndexReg,
16  barrelMap,endcapMap)
17 
18  {
19  }
20 
22 {
23 }
24 
25 void
26 ClusterFillMap::fillMap (const std::vector<std::pair<DetId,float> > & v1,
27  const DetId Max,
28  const EcalRecHitCollection * barrelHitsCollection,
29  const EcalRecHitCollection * endcapHitsCollection,
30  std::map<int,double> & xtlMap,
31  double & pSubtract )
32 {
33  for (std::vector<std::pair<DetId,float> >::const_iterator idsIt = v1.begin();
34  idsIt != v1.end () ;
35  ++idsIt)
36  {
37  int RegionNumber = m_xtalRegionId[Max.rawId()];
39  double dummy=0.;
40  if(idsIt->first.subdetId()==EcalBarrel)
41  {
42  itrechit=barrelHitsCollection->find(idsIt->first);
43  dummy=itrechit->energy();
44  dummy*= (*m_barrelMap)[idsIt->first];
45  }
46  if(idsIt->first.subdetId()==EcalEndcap){
47  itrechit=endcapHitsCollection->find(idsIt->first);
48  dummy=itrechit->energy();
49  dummy*= (*m_endcapMap)[idsIt->first];
50  }
51  int ID=idsIt->first.rawId();
52  if (edm::isNotFinite(dummy)) {
53  dummy=0;
54  }
55  if ( dummy < m_minEnergyPerCrystal ) continue; //return 1;
56  if ( dummy > m_maxEnergyPerCrystal ) {
57  dummy=0;
58  continue;
59  }
60  if (m_xtalRegionId[ID]==RegionNumber)
61  xtlMap[m_IndexInRegion[ID]] += dummy;
62  else pSubtract +=dummy;
63  }
64 }
65 
double m_maxEnergyPerCrystal
Definition: VFillMap.h:39
void fillMap(const std::vector< std::pair< DetId, float > > &, const DetId, const EcalRecHitCollection *, const EcalRecHitCollection *, std::map< int, double > &xtlMap, double &)
Fills the map.
uint32_t ID
Definition: Definitions.h:26
std::vector< EcalRecHit >::const_iterator const_iterator
ClusterFillMap(int, int, const std::map< int, int > &, double, double, const std::map< int, int > &, EcalIntercalibConstantMap *, EcalIntercalibConstantMap *)
ctor
std::map< int, int > m_IndexInRegion
Definition: VFillMap.h:40
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
bool isNotFinite(T x)
Definition: isFinite.h:10
double m_minEnergyPerCrystal
Definition: VFillMap.h:38
~ClusterFillMap()
dtor
std::map< int, int > m_xtalRegionId
Definition: VFillMap.h:37
Definition: DetId.h:18
iterator find(key_type k)