00001 #ifndef RecoEcal_EgammaClusterAlgos_HybridClusterAlgo_h
00002 #define RecoEcal_EgammaClusterAlgos_HybridClusterAlgo_h
00003
00004 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00005 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
00006 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00007 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00008 #include "RecoCaloTools/Navigation/interface/EcalBarrelNavigator.h"
00009 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00010 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00011 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00012 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00013 #include "FWCore/Framework/interface/ESHandle.h"
00014 #include "RecoEcal/EgammaCoreTools/interface/EcalEtaPhiRegion.h"
00015 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
00016 #include "RecoEcal/EgammaCoreTools/interface/BremRecoveryPhiRoadAlgo.h"
00017 #include "RecoEcal/EgammaCoreTools/interface/SuperClusterShapeAlgo.h"
00018
00019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00020
00021 #include <vector>
00022 #include <set>
00023
00024
00025 struct less_mag : public std::binary_function<EcalRecHit, EcalRecHit, bool> {
00026 bool operator()(EcalRecHit x, EcalRecHit y) { return x.energy() > y.energy() ; }
00027 };
00028
00029 class HybridClusterAlgo
00030 {
00031 private:
00032
00033 typedef math::XYZPoint Point;
00034
00035
00036 double eb_st;
00037
00038
00039
00040
00041 int phiSteps_;
00042
00043
00044 double et25(EcalBarrelNavigator &navigator,
00045 const EcalRecHitCollection *hits,
00046 const CaloSubdetectorGeometry *geometry);
00047
00048
00049 BremRecoveryPhiRoadAlgo *phiRoadAlgo_;
00050
00051
00052 double eThres_;
00053 double eThresA_;
00054 double eThresB_;
00055
00056
00057 double Eseed;
00058
00059
00060 double Ewing;
00061
00062
00063 bool dynamicPhiRoad_;
00064
00065
00066 bool dynamicEThres_;
00067
00068
00069
00070
00071
00072
00073 const EcalRecHitCollection *recHits_;
00074
00075
00076
00077 const CaloSubdetectorGeometry* geometry;
00078
00079
00080
00081
00082 std::set<DetId> useddetids;
00083
00084
00085 std::vector<EcalRecHit> seeds;
00086
00087
00088 std::vector<reco::BasicCluster> seedClus_;
00089
00090
00091 std::map<int, std::vector<reco::BasicCluster> > clustered_;
00092
00093
00094 int debugLevel_;
00095
00096
00097 PositionCalc posCalculator_;
00098
00099 public:
00100 enum DebugLevel { pDEBUG = 0, pINFO = 1, pERROR = 2 };
00101
00102
00103 HybridClusterAlgo(){ }
00104
00105
00106 HybridClusterAlgo(double eb_str,
00107 int step,
00108 double eseed,
00109 double ewing,
00110 double ethres,
00111 const PositionCalc& posCalculator,
00112
00113 bool dynamicEThres = false,
00114 double eThresA = 0,
00115 double eThresB = 0.1,
00116
00117 DebugLevel debugLevel = pINFO);
00118
00119
00120 ~HybridClusterAlgo()
00121 {
00122 if (dynamicPhiRoad_) delete phiRoadAlgo_;
00123
00124 }
00125
00126 void setDynamicPhiRoad(const edm::ParameterSet &bremRecoveryPset)
00127 {
00128 dynamicPhiRoad_ = true;
00129 phiRoadAlgo_ = new BremRecoveryPhiRoadAlgo(bremRecoveryPset);
00130 }
00131
00132
00133 void makeClusters(const EcalRecHitCollection*,
00134 const CaloSubdetectorGeometry * geometry,
00135 reco::BasicClusterCollection &basicClusters,
00136 bool regional = false,
00137 const std::vector<EcalEtaPhiRegion>& regions = std::vector<EcalEtaPhiRegion>());
00138
00139
00140 reco::SuperClusterCollection makeSuperClusters(const reco::BasicClusterRefVector&);
00141
00142
00143 void mainSearch(const EcalRecHitCollection* hits, const CaloSubdetectorGeometry * geometry);
00144
00145
00146 double makeDomino(EcalBarrelNavigator &navigator, std::vector <EcalRecHit> &cells);
00147
00148 };
00149
00150 #endif