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 ( 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.

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

dtor

Definition at line 21 of file ClusterFillMap.cc.

22 {
23 }

Member Function Documentation

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 26 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, and DetId::rawId().

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 }
double m_maxEnergyPerCrystal
Definition: VFillMap.h:39
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
uint32_t ID
Definition: Definitions.h:26
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
std::vector< EcalRecHit >::const_iterator const_iterator
std::map< int, int > m_IndexInRegion
Definition: VFillMap.h:40
double m_minEnergyPerCrystal
Definition: VFillMap.h:38
std::map< int, int > m_xtalRegionId
Definition: VFillMap.h:37
iterator find(key_type k)