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 {
29  public:
30 
31  enum EcalPart { barrel = 0, endcap = 1 };
32  enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };
33 
35  }
36 
37  CosmicClusterAlgo(double ebst, double ebSt , double ebDt, double ebSp, double ecst, double ecSt, double ecDt, double ecSp, const PositionCalc& posCalc, VerbosityLevel the_verbosity = pERROR) :
39  posCalculator_ = posCalc;
40  }
41 
43  {
44  }
45 
46  void setVerbosity(VerbosityLevel the_verbosity)
47  {
48  verbosity = the_verbosity;
49  }
50 
51  // this is the method that will start the clusterisation
52  std::vector<reco::BasicCluster> makeClusters(const EcalRecHitCollection* hits,
53  const EcalUncalibratedRecHitCollection* uncalibhits,
55  const CaloSubdetectorTopology *topology_p,
56  const CaloSubdetectorGeometry *geometryES_p,
57  EcalPart ecalPart,
58  bool regional = false,
59  const std::vector<RectangularEtaPhiRegion>& regions = std::vector<RectangularEtaPhiRegion>());
60 
63 
64  private:
65 
66  //algo to compute position of clusters
68 
69 
70  // Energy required for a seed:
75 
80 
81  // collection of all rechits
83  // collection of all uncalibrated rechits
85 
86  // The vector of seeds:
87  std::vector<EcalRecHit> seeds;
88 
89  // The set of used DetID's
90  std::set<DetId> used_s;
91  std::set<DetId> canSeed_s; // set of crystals not to be added but which can seed
92  // a new 3x3 (e.g. the outer crystals in a 5x5)
93 
94  //in EB or EE?
95  bool inEB;
96 
97  // The vector of DetId's in the cluster currently reconstructed
98  std::vector<DetId> current_v9;
99  std::vector<DetId> current_v25;
100  std::vector< std::pair<DetId, float> > current_v25Sup;
101 
102  // The vector of clusters
103  std::vector<reco::BasicCluster> clusters_v;
104 
105  // The verbosity level
107 
108  void mainSearch( const CaloSubdetectorGeometry *geometry_p,
109  const CaloSubdetectorTopology *topology_p,
110  const CaloSubdetectorGeometry *geometryES_p,
111  EcalPart ecalPart);
112 
113  // Is the crystal at the navigator position a
114  // local maxiumum in energy?
116 
117  // prepare the 5x5 taking care over which crystals
118  // are allowed to seed new clusters and which are not
119  // after the preparation is complete
121  const CaloSubdetectorGeometry *geometry);
122 
123  // Add the crystal with DetId det to the current
124  // vector of crystals if it meets certain criteria
125  void addCrystal(const DetId &det, const bool in9);
126 
127 
128 
129  // take the crystals in the current_v and build
130  // them into a BasicCluster
131  void makeCluster(const CaloSubdetectorGeometry *geometry_p,const CaloSubdetectorGeometry *geometryES_p, DetId seedId);
132 
133 
134  };
135 
136 #endif
const EcalUncalibratedRecHitCollection * uncalibRecHits_
double ecalBarrelSingleThreshold
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()
std::vector< std::pair< DetId, float > > current_v25Sup
double ecalBarrelSecondThreshold
const EcalRecHitCollection * recHits_
void prepareCluster(CaloNavigator< DetId > &navigator, const CaloSubdetectorGeometry *geometry)
std::vector< EcalRecHit > seeds
Definition: DetId.h:18
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)