CMS 3D CMS Logo

CosmicClusterAlgo.h
Go to the documentation of this file.
1 #ifndef RecoECAL_ECALClusters_CosmicClusterAlgo_h
2 #define RecoECAL_ECALClusters_CosmicClusterAlgo_h
3 
5 
13 
19 
20 // C/C++ headers
21 #include <string>
22 #include <vector>
23 #include <set>
24 
25 typedef std::map<DetId, EcalRecHit> RecHitsMap;
26 
28 public:
29  enum EcalPart { barrel = 0, endcap = 1 };
30  enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };
31 
33 
34  CosmicClusterAlgo(double ebst,
35  double ebSt,
36  double ebDt,
37  double ebSp,
38  double ecst,
39  double ecSt,
40  double ecDt,
41  double ecSp,
42  const PositionCalc &posCalc,
43  VerbosityLevel the_verbosity = pERROR)
52  verbosity(the_verbosity) {
53  posCalculator_ = posCalc;
54  }
55 
56  virtual ~CosmicClusterAlgo() {}
57 
58  void setVerbosity(VerbosityLevel the_verbosity) { verbosity = the_verbosity; }
59 
60  // this is the method that will start the clusterisation
61  std::vector<reco::BasicCluster> makeClusters(
63  const EcalUncalibratedRecHitCollection *uncalibhits,
65  const CaloSubdetectorTopology *topology_p,
66  const CaloSubdetectorGeometry *geometryES_p,
67  EcalPart ecalPart,
68  bool regional = false,
69  const std::vector<RectangularEtaPhiRegion> &regions = std::vector<RectangularEtaPhiRegion>());
70 
73 
74 private:
75  //algo to compute position of clusters
77 
78  // Energy required for a seed:
83 
88 
89  // collection of all rechits
91  // collection of all uncalibrated rechits
93 
94  // The vector of seeds:
95  std::vector<EcalRecHit> seeds;
96 
97  // The set of used DetID's
98  std::set<DetId> used_s;
99  std::set<DetId> canSeed_s; // set of crystals not to be added but which can seed
100  // a new 3x3 (e.g. the outer crystals in a 5x5)
101 
102  //in EB or EE?
103  bool inEB;
104 
105  // The vector of DetId's in the cluster currently reconstructed
106  std::vector<DetId> current_v9;
107  std::vector<DetId> current_v25;
108  std::vector<std::pair<DetId, float> > current_v25Sup;
109 
110  // The vector of clusters
111  std::vector<reco::BasicCluster> clusters_v;
112 
113  // The verbosity level
115 
116  void mainSearch(const CaloSubdetectorGeometry *geometry_p,
117  const CaloSubdetectorTopology *topology_p,
118  const CaloSubdetectorGeometry *geometryES_p,
119  EcalPart ecalPart);
120 
121  // Is the crystal at the navigator position a
122  // local maxiumum in energy?
124 
125  // prepare the 5x5 taking care over which crystals
126  // are allowed to seed new clusters and which are not
127  // after the preparation is complete
129 
130  // Add the crystal with DetId det to the current
131  // vector of crystals if it meets certain criteria
132  void addCrystal(const DetId &det, const bool in9);
133 
134  // take the crystals in the current_v and build
135  // them into a BasicCluster
136  void makeCluster(const CaloSubdetectorGeometry *geometry_p,
137  const CaloSubdetectorGeometry *geometryES_p,
138  DetId seedId);
139 };
140 
141 #endif
const EcalUncalibratedRecHitCollection * uncalibRecHits_
double ecalBarrelSingleThreshold
std::vector< std::pair< DetId, float > > current_v25Sup
std::vector< reco::BasicCluster > makeClusters(const EcalRecHitCollection *hits, const EcalUncalibratedRecHitCollection *uncalibhits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, EcalPart ecalPart, bool regional=false, const std::vector< RectangularEtaPhiRegion > &regions=std::vector< RectangularEtaPhiRegion >())
std::vector< DetId > current_v9
std::vector< reco::BasicCluster > clusters_v
void mainSearch(const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, EcalPart ecalPart)
double ecalEndcapSingleThreshold
virtual ~CosmicClusterAlgo()
double ecalBarrelSecondThreshold
const EcalRecHitCollection * recHits_
void prepareCluster(CaloNavigator< DetId > &navigator, const CaloSubdetectorGeometry *geometry)
std::vector< EcalRecHit > seeds
Definition: DetId.h:17
double ecalEndcapSecondThreshold
void makeCluster(const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorGeometry *geometryES_p, DetId seedId)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< DetId > current_v25
std::map< DetId, EcalRecHit > RecHitsMap
VerbosityLevel verbosity
std::set< DetId > canSeed_s
void addCrystal(const DetId &det, const bool in9)
math::XYZPoint Point
point in the space
bool checkMaxima(CaloNavigator< DetId > &navigator)
void setVerbosity(VerbosityLevel the_verbosity)
PositionCalc posCalculator_
std::set< DetId > used_s
CosmicClusterAlgo(double ebst, double ebSt, double ebDt, double ebSp, double ecst, double ecSt, double ecDt, double ecSp, const PositionCalc &posCalc, VerbosityLevel the_verbosity=pERROR)