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