Go to the documentation of this file.00001 #ifndef RecoECAL_ECALClusters_CosmicClusterAlgo_h
00002 #define RecoECAL_ECALClusters_CosmicClusterAlgo_h
00003
00004 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00005
00006 #include "DataFormats/Math/interface/Point3D.h"
00007 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00008 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00009 #include "DataFormats/EcalRecHit/interface/EcalUncalibratedRecHit.h"
00010 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00011 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00012
00013 #include "RecoCaloTools/Navigation/interface/CaloNavigator.h"
00014 #include "RecoCaloTools/Navigation/interface/EcalBarrelNavigator.h"
00015 #include "RecoCaloTools/Navigation/interface/EcalEndcapNavigator.h"
00016 #include "Geometry/CaloTopology/interface/EcalBarrelHardcodedTopology.h"
00017 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
00018 #include "RecoEcal/EgammaCoreTools/interface/EcalEtaPhiRegion.h"
00019 #include "RecoEcal/EgammaCoreTools/interface/EcalRecHitLess.h"
00020
00021
00022 #include <string>
00023 #include <vector>
00024 #include <set>
00025
00026 typedef std::map<DetId, EcalRecHit> RecHitsMap;
00027
00028 class CosmicClusterAlgo
00029 {
00030 public:
00031
00032 enum EcalPart { barrel = 0, endcap = 1 };
00033 enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };
00034
00035 CosmicClusterAlgo() {
00036 }
00037
00038 CosmicClusterAlgo(double ebst, double ebSt , double ebDt, double ebSp, double ecst, double ecSt, double ecDt, double ecSp, const PositionCalc& posCalc, VerbosityLevel the_verbosity = pERROR) :
00039 ecalBarrelSeedThreshold(ebst), ecalBarrelSingleThreshold(ebSt), ecalBarrelSecondThreshold(ebDt), ecalBarrelSupThreshold(ebSp), ecalEndcapSeedThreshold(ecst), ecalEndcapSingleThreshold(ecSt), ecalEndcapSecondThreshold(ecDt), ecalEndcapSupThreshold(ecSp), verbosity(the_verbosity) {
00040 posCalculator_ = posCalc;
00041 }
00042
00043 virtual ~CosmicClusterAlgo()
00044 {
00045 }
00046
00047 void setVerbosity(VerbosityLevel the_verbosity)
00048 {
00049 verbosity = the_verbosity;
00050 }
00051
00052
00053 std::vector<reco::BasicCluster> makeClusters(const EcalRecHitCollection* hits,
00054 const EcalUncalibratedRecHitCollection* uncalibhits,
00055 const CaloSubdetectorGeometry *geometry,
00056 const CaloSubdetectorTopology *topology_p,
00057 const CaloSubdetectorGeometry *geometryES_p,
00058 EcalPart ecalPart,
00059 bool regional = false,
00060 const std::vector<EcalEtaPhiRegion>& regions = std::vector<EcalEtaPhiRegion>());
00061
00063 typedef math::XYZPoint Point;
00064
00065 private:
00066
00067
00068 PositionCalc posCalculator_;
00069
00070
00071
00072 double ecalBarrelSeedThreshold;
00073 double ecalBarrelSingleThreshold;
00074 double ecalBarrelSecondThreshold;
00075 double ecalBarrelSupThreshold;
00076
00077 double ecalEndcapSeedThreshold;
00078 double ecalEndcapSingleThreshold;
00079 double ecalEndcapSecondThreshold;
00080 double ecalEndcapSupThreshold;
00081
00082
00083 const EcalRecHitCollection *recHits_;
00084
00085 const EcalUncalibratedRecHitCollection *uncalibRecHits_;
00086
00087
00088 std::vector<EcalRecHit> seeds;
00089
00090
00091 std::set<DetId> used_s;
00092 std::set<DetId> canSeed_s;
00093
00094
00095
00096 bool inEB;
00097
00098
00099 std::vector<DetId> current_v9;
00100 std::vector<DetId> current_v25;
00101 std::vector< std::pair<DetId, float> > current_v25Sup;
00102
00103
00104 std::vector<reco::BasicCluster> clusters_v;
00105
00106
00107 VerbosityLevel verbosity;
00108
00109 void mainSearch( const CaloSubdetectorGeometry *geometry_p,
00110 const CaloSubdetectorTopology *topology_p,
00111 const CaloSubdetectorGeometry *geometryES_p,
00112 EcalPart ecalPart);
00113
00114
00115
00116 bool checkMaxima(CaloNavigator<DetId> &navigator);
00117
00118
00119
00120
00121 void prepareCluster(CaloNavigator<DetId> &navigator,
00122 const CaloSubdetectorGeometry *geometry);
00123
00124
00125
00126 void addCrystal(const DetId &det, const bool in9);
00127
00128
00129
00130
00131
00132 void makeCluster(const CaloSubdetectorGeometry *geometry_p,const CaloSubdetectorGeometry *geometryES_p, DetId seedId);
00133
00134
00135 };
00136
00137 #endif