CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CosmicClusterAlgo.h
Go to the documentation of this file.
1 #ifndef RecoECAL_ECALClusters_CosmicClusterAlgo_h
2 #define RecoECAL_ECALClusters_CosmicClusterAlgo_h
3 
5 
12 
20 
21 // C/C++ headers
22 #include <string>
23 #include <vector>
24 #include <set>
25 
26 typedef std::map<DetId, EcalRecHit> RecHitsMap;
27 
29 {
30  public:
31 
32  enum EcalPart { barrel = 0, endcap = 1 };
33  enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };
34 
36  }
37 
38  CosmicClusterAlgo(double ebst, double ebSt , double ebDt, double ebSp, double ecst, double ecSt, double ecDt, double ecSp, const PositionCalc& posCalc, VerbosityLevel the_verbosity = pERROR) :
40  posCalculator_ = posCalc;
41  }
42 
44  {
45  }
46 
47  void setVerbosity(VerbosityLevel the_verbosity)
48  {
49  verbosity = the_verbosity;
50  }
51 
52  // this is the method that will start the clusterisation
53  std::vector<reco::BasicCluster> makeClusters(const EcalRecHitCollection* hits,
54  const EcalUncalibratedRecHitCollection* uncalibhits,
56  const CaloSubdetectorTopology *topology_p,
57  const CaloSubdetectorGeometry *geometryES_p,
58  EcalPart ecalPart,
59  bool regional = false,
60  const std::vector<EcalEtaPhiRegion>& regions = std::vector<EcalEtaPhiRegion>());
61 
64 
65  private:
66 
67  //algo to compute position of clusters
69 
70 
71  // Energy required for a seed:
76 
81 
82  // collection of all rechits
84  // collection of all uncalibrated rechits
86 
87  // The vector of seeds:
88  std::vector<EcalRecHit> seeds;
89 
90  // The set of used DetID's
91  std::set<DetId> used_s;
92  std::set<DetId> canSeed_s; // set of crystals not to be added but which can seed
93  // a new 3x3 (e.g. the outer crystals in a 5x5)
94 
95  //in EB or EE?
96  bool inEB;
97 
98  // The vector of DetId's in the cluster currently reconstructed
99  std::vector<DetId> current_v9;
100  std::vector<DetId> current_v25;
101  std::vector< std::pair<DetId, float> > current_v25Sup;
102 
103  // The vector of clusters
104  std::vector<reco::BasicCluster> clusters_v;
105 
106  // The verbosity level
108 
109  void mainSearch( const CaloSubdetectorGeometry *geometry_p,
110  const CaloSubdetectorTopology *topology_p,
111  const CaloSubdetectorGeometry *geometryES_p,
112  EcalPart ecalPart);
113 
114  // Is the crystal at the navigator position a
115  // local maxiumum in energy?
116  bool checkMaxima(CaloNavigator<DetId> &navigator);
117 
118  // prepare the 5x5 taking care over which crystals
119  // are allowed to seed new clusters and which are not
120  // after the preparation is complete
121  void prepareCluster(CaloNavigator<DetId> &navigator,
122  const CaloSubdetectorGeometry *geometry);
123 
124  // Add the crystal with DetId det to the current
125  // vector of crystals if it meets certain criteria
126  void addCrystal(const DetId &det, const bool in9);
127 
128 
129 
130  // take the crystals in the current_v and build
131  // them into a BasicCluster
132  void makeCluster(const CaloSubdetectorGeometry *geometry_p,const CaloSubdetectorGeometry *geometryES_p, DetId seedId);
133 
134 
135  };
136 
137 #endif
const EcalUncalibratedRecHitCollection * uncalibRecHits_
double ecalBarrelSingleThreshold
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)
std::map< DetId, EcalRecHit > RecHitsMap
Definition: HLTAlCaMonPi0.h:24
double ecalEndcapSingleThreshold
virtual ~CosmicClusterAlgo()
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< EcalEtaPhiRegion > &regions=std::vector< EcalEtaPhiRegion >())
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
VerbosityLevel verbosity
std::set< DetId > canSeed_s
ESHandle< TrackerGeometry > geometry
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)