CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HybridClusterAlgo.h
Go to the documentation of this file.
1 #ifndef RecoEcal_EgammaClusterAlgos_HybridClusterAlgo_h
2 #define RecoEcal_EgammaClusterAlgos_HybridClusterAlgo_h
3 
19 
20 
22 
23 #include <vector>
24 #include <set>
25 
27 
28 //Less than operator for sorting EcalRecHits according to energy.
29 struct less_mag : public std::binary_function<EcalRecHit, EcalRecHit, bool> {
30  bool operator()(EcalRecHit x, EcalRecHit y) { return x.energy() > y.energy() ; }
31 };
32 
34 {
35  private:
36  //Quick typedef for position calculation.
38 
39  //Thresholds for seeds.
40  double eb_st;
41 
42  //Number of steps in phi that the Hybrid algorithm will take
43  //when clustering. Remember, uses phiSteps_ in positive direction
44  //and then phiSteps_ in negative direction.
45  int phiSteps_;
46 
47  // et in 25
48  double et25(EcalBarrelNavigator &navigator,
49  const EcalRecHitCollection *hits,
51  // ratio Et/e
52  double e2Et(EcalBarrelNavigator &navigator,
53  const EcalRecHitCollection *hits,
55 
56 
58 
59  //Threshold for basic cluster.
60  double eThres_;
61  double eThresA_;
62  double eThresB_;
63 
64  //Threshold for becoming a sub-peak in the supercluster.
65  double Eseed;
66 
67  //Coefficient to increase Eseed as a function of 5x5
68  double Xi;
69 
70  //Increase Eseed as a function of et_5x5 (othwewise it's e_5x5)
71  bool UseEtForXi;
72 
73  //Threshold for adding the additional two 'wing' cells to domino.
74  double Ewing;
75 
76  // do dynamic phi road
78 
79  // do dynamic ethres
81 
82  //Map of DetId, RecHit relationship. EcalRecHit knows what DetId it is,
83  //but DetId doesn't know what EcalRecHit it is.
84  // std::map<DetId, EcalRecHit> rechits_m;
85 
86  // colection of all rechits
88 
89  // topology
91 
92  // SuperClusterShapeAlgo* SCShape_;
93 
94  //Set of DetIds that have already been used.
95  std::set<DetId> useddetids;
96 
97  // The vector of seeds:
98  std::vector<EcalRecHit> seeds;
99 
100  //The vector of seed clusters:
101  std::vector<reco::BasicCluster> seedClus_;
102 
103  //Map of basicclusters and what supercluster they will belong to.
104  std::map<int, std::vector<reco::BasicCluster> > clustered_;
105 
106  //algo to calulate position of clusters
108 
109  // channels not to be used for seeding
110  std::vector<int> v_chstatus_;
111 
112  // severity levels to discriminate against
113  std::vector<int> v_severitylevel_;
116 
118  std::set<DetId> excludedCrys_;
119 
120  public:
121 
122  //The default constructor
124 
125  //The real constructor
126  HybridClusterAlgo(double eb_str,
127  int step,
128  double ethres,
129  double eseed,
130  double xi,
131  bool useEtForXi,
132  double ewing,
133  std::vector<int> v_chstatus,
134  const PositionCalc& posCalculator,
135  bool dynamicEThres = false,
136  double eThresA = 0,
137  double eThresB = 0.1,
138  std::vector<int> severityToExclude=std::vector<int>(999),
139  //double severityRecHitThreshold=0.08,
140  //int severitySpikeId=1,
141  //double severitySpikeThreshold=0,
142  bool excludeFromCluster=false
143  );
144 // const edm::ParameterSet &bremRecoveryPset,
145 
146  // destructor
148  {
149  if (dynamicPhiRoad_) delete phiRoadAlgo_;
150  delete topo_;
151  // delete SCShape_;
152  }
153 
154  void setDynamicPhiRoad(const edm::ParameterSet &bremRecoveryPset)
155  {
156  dynamicPhiRoad_ = true;
157  phiRoadAlgo_ = new BremRecoveryPhiRoadAlgo(bremRecoveryPset);
158  }
159 
160  //Hand over the map, the geometry, and I'll hand you back clusters.
163  reco::BasicClusterCollection &basicClusters,
164  const EcalSeverityLevelAlgo * sevLv,
165  bool regional = false,
166  const std::vector<EcalEtaPhiRegion>& regions = std::vector<EcalEtaPhiRegion>()
167  );
168 
169  //Make superclusters from the references to the BasicClusters in the event.
171 
172  //The routine doing the real work.
173  void mainSearch(const EcalRecHitCollection* hits, const CaloSubdetectorGeometry * geometry);
174 
175  //Make dominos for the hybrid method.
176  double makeDomino(EcalBarrelNavigator &navigator, std::vector <EcalRecHit> &cells);
177 
178 };
179 
180 #endif
double e2Et(EcalBarrelNavigator &navigator, const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry)
list step
Definition: launcher.py:15
double et25(EcalBarrelNavigator &navigator, const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry)
EcalBarrelHardcodedTopology * topo_
void mainSearch(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry)
std::map< int, std::vector< reco::BasicCluster > > clustered_
double makeDomino(EcalBarrelNavigator &navigator, std::vector< EcalRecHit > &cells)
PositionCalc posCalculator_
std::vector< EcalRecHit > seeds
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
float energy() const
Definition: CaloRecHit.h:19
reco::SuperClusterCollection makeSuperClusters(const reco::CaloClusterPtrVector &)
BremRecoveryPhiRoadAlgo * phiRoadAlgo_
std::vector< int > v_chstatus_
std::set< DetId > useddetids
void setDynamicPhiRoad(const edm::ParameterSet &bremRecoveryPset)
std::set< DetId > excludedCrys_
math::XYZPoint Point
std::vector< int > v_severitylevel_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
ESHandle< TrackerGeometry > geometry
const EcalRecHitCollection * recHits_
bool operator()(EcalRecHit x, EcalRecHit y)
x
Definition: VDTMath.h:216
std::vector< reco::BasicCluster > seedClus_
void makeClusters(const EcalRecHitCollection *, const CaloSubdetectorGeometry *geometry, reco::BasicClusterCollection &basicClusters, const EcalSeverityLevelAlgo *sevLv, bool regional=false, const std::vector< EcalEtaPhiRegion > &regions=std::vector< EcalEtaPhiRegion >())