CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Multi5x5ClusterAlgo.h
Go to the documentation of this file.
1 #ifndef RecoECAL_ECALClusters_Multi5x5ClusterAlgo_h
2 #define RecoECAL_ECALClusters_Multi5x5ClusterAlgo_h
3 
5 
11 
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 VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };
33 
35  }
36 
37  Multi5x5ClusterAlgo(double ebst, double ecst, std::vector<int> v_chstatus, const PositionCalc& posCalc, VerbosityLevel the_verbosity = pERROR) :
38  ecalBarrelSeedThreshold(ebst), ecalEndcapSeedThreshold(ecst), v_chstatus_(v_chstatus), verbosity(the_verbosity) {
39  posCalculator_ = posCalc;
40  std::sort( v_chstatus_.begin(), v_chstatus_.end() );
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,
55  const CaloSubdetectorTopology *topology_p,
56  const CaloSubdetectorGeometry *geometryES_p,
57  reco::CaloID::Detectors detector,
58  bool regional = false,
59  const std::vector<EcalEtaPhiRegion>& regions = std::vector<EcalEtaPhiRegion>());
60 
63 
64  private:
65 
66  //algo to compute position of clusters
68 
71 
72  // Energy required for a seed:
75 
76  // collection of all rechits
78 
79  // The vector of seeds:
80  std::vector<EcalRecHit> seeds;
81 
82  // The set of used DetID's
83  std::set<DetId> used_s;
84  std::set<DetId> canSeed_s; // set of crystals not to be added but which can seed
85  // a new 3x3 (e.g. the outer crystals in a 5x5)
86 
87 
88  // The vector of DetId's in the cluster currently reconstructed
89  std::vector<std::pair<DetId, float> > current_v;
90 
91  // The vector of clusters
92  std::vector<reco::BasicCluster> clusters_v;
93 
94  // recHit flag to be excluded from seeding
95  std::vector<int> v_chstatus_;
96 
97  // The verbosity level
99 
100  void mainSearch(const EcalRecHitCollection* hits,
101  const CaloSubdetectorGeometry *geometry_p,
102  const CaloSubdetectorTopology *topology_p,
103  const CaloSubdetectorGeometry *geometryES_p);
104 
105  // Is the crystal at the navigator position a
106  // local maxiumum in energy?
107  bool checkMaxima(CaloNavigator<DetId> &navigator,
108  const EcalRecHitCollection *hits);
109 
110  // prepare the 5x5 taking care over which crystals
111  // are allowed to seed new clusters and which are not
112  // after the preparation is complete
113  void prepareCluster(CaloNavigator<DetId> &navigator,
114  const EcalRecHitCollection *hits,
115  const CaloSubdetectorGeometry *geometry);
116 
117  // Add the crystal with DetId det to the current
118  // vector of crystals if it meets certain criteria
119  void addCrystal(const DetId &det);
120 
121 
122  // take the crystals in the current_v and build
123  // them into a BasicCluster
124  void makeCluster(const EcalRecHitCollection* hits,
125  const CaloSubdetectorGeometry *geometry_p,
126  const CaloSubdetectorGeometry *geometryES_p,
128 
129  };
130 
131 #endif
void setVerbosity(VerbosityLevel the_verbosity)
std::vector< reco::BasicCluster > makeClusters(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, reco::CaloID::Detectors detector, bool regional=false, const std::vector< EcalEtaPhiRegion > &regions=std::vector< EcalEtaPhiRegion >())
std::set< DetId > canSeed_s
const EcalRecHitCollection * recHits_
std::vector< T >::const_iterator const_iterator
std::map< DetId, EcalRecHit > RecHitsMap
Definition: HLTAlCaMonPi0.h:24
void mainSearch(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p)
std::vector< int > v_chstatus_
void prepareCluster(CaloNavigator< DetId > &navigator, const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry)
Multi5x5ClusterAlgo(double ebst, double ecst, std::vector< int > v_chstatus, const PositionCalc &posCalc, VerbosityLevel the_verbosity=pERROR)
void addCrystal(const DetId &det)
std::set< DetId > used_s
std::vector< std::pair< DetId, float > > current_v
std::vector< EcalRecHit > seeds
Definition: DetId.h:20
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
bool checkMaxima(CaloNavigator< DetId > &navigator, const EcalRecHitCollection *hits)
void makeCluster(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorGeometry *geometryES_p, const EcalRecHitCollection::const_iterator &seedIt)
ESHandle< TrackerGeometry > geometry
math::XYZPoint Point
point in the space
VerbosityLevel verbosity
reco::CaloID::Detectors detector_
The ecal region used.
std::vector< reco::BasicCluster > clusters_v