Go to the documentation of this file.00001 #ifndef RecoECAL_ECALClusters_Multi5x5ClusterAlgo_h
00002 #define RecoECAL_ECALClusters_Multi5x5ClusterAlgo_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/EcalDetId/interface/EBDetId.h"
00010 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00011
00012 #include "RecoCaloTools/Navigation/interface/CaloNavigator.h"
00013 #include "RecoCaloTools/Navigation/interface/EcalBarrelNavigator.h"
00014 #include "RecoCaloTools/Navigation/interface/EcalEndcapNavigator.h"
00015 #include "Geometry/CaloTopology/interface/EcalBarrelHardcodedTopology.h"
00016 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
00017 #include "RecoEcal/EgammaCoreTools/interface/EcalEtaPhiRegion.h"
00018 #include "RecoEcal/EgammaCoreTools/interface/EcalRecHitLess.h"
00019 #include "DataFormats/CaloRecHit/interface/CaloID.h"
00020
00021
00022 #include <string>
00023 #include <vector>
00024 #include <set>
00025
00026 typedef std::map<DetId, EcalRecHit> RecHitsMap;
00027
00028 class Multi5x5ClusterAlgo
00029 {
00030 public:
00031
00032 enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };
00033
00034 Multi5x5ClusterAlgo() {
00035 }
00036
00037 Multi5x5ClusterAlgo(double ebst, double ecst, std::vector<int> v_chstatus, const PositionCalc& posCalc, VerbosityLevel the_verbosity = pERROR) :
00038 ecalBarrelSeedThreshold(ebst), ecalEndcapSeedThreshold(ecst), v_chstatus_(v_chstatus), verbosity(the_verbosity) {
00039 posCalculator_ = posCalc;
00040 std::sort( v_chstatus_.begin(), v_chstatus_.end() );
00041 }
00042
00043 virtual ~Multi5x5ClusterAlgo()
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 CaloSubdetectorGeometry *geometry,
00055 const CaloSubdetectorTopology *topology_p,
00056 const CaloSubdetectorGeometry *geometryES_p,
00057 reco::CaloID::Detectors detector,
00058 bool regional = false,
00059 const std::vector<EcalEtaPhiRegion>& regions = std::vector<EcalEtaPhiRegion>());
00060
00062 typedef math::XYZPoint Point;
00063
00064 private:
00065
00066
00067 PositionCalc posCalculator_;
00068
00070 reco::CaloID::Detectors detector_;
00071
00072
00073 double ecalBarrelSeedThreshold;
00074 double ecalEndcapSeedThreshold;
00075
00076
00077 const EcalRecHitCollection *recHits_;
00078
00079
00080 std::vector<EcalRecHit> seeds;
00081
00082
00083 std::set<DetId> used_s;
00084 std::set<DetId> canSeed_s;
00085
00086
00087
00088
00089 std::vector<std::pair<DetId, float> > current_v;
00090
00091
00092 std::vector<reco::BasicCluster> clusters_v;
00093
00094
00095 std::vector<int> v_chstatus_;
00096
00097
00098 VerbosityLevel verbosity;
00099
00100 void mainSearch(const EcalRecHitCollection* hits,
00101 const CaloSubdetectorGeometry *geometry_p,
00102 const CaloSubdetectorTopology *topology_p,
00103 const CaloSubdetectorGeometry *geometryES_p);
00104
00105
00106
00107 bool checkMaxima(CaloNavigator<DetId> &navigator,
00108 const EcalRecHitCollection *hits);
00109
00110
00111
00112
00113 void prepareCluster(CaloNavigator<DetId> &navigator,
00114 const EcalRecHitCollection *hits,
00115 const CaloSubdetectorGeometry *geometry);
00116
00117
00118
00119 void addCrystal(const DetId &det);
00120
00121
00122
00123
00124 void makeCluster(const EcalRecHitCollection* hits,
00125 const CaloSubdetectorGeometry *geometry_p,
00126 const CaloSubdetectorGeometry *geometryES_p,
00127 const EcalRecHitCollection::const_iterator &seedIt);
00128
00129 };
00130
00131 #endif