CMS 3D CMS Logo

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