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
00033 Multi5x5ClusterAlgo() {
00034 }
00035
00036 Multi5x5ClusterAlgo(double ebst, double ecst, std::vector<int> v_chstatus, const PositionCalc& posCalc) :
00037 ecalBarrelSeedThreshold(ebst), ecalEndcapSeedThreshold(ecst), v_chstatus_(v_chstatus) {
00038 posCalculator_ = posCalc;
00039 std::sort( v_chstatus_.begin(), v_chstatus_.end() );
00040 }
00041
00042 virtual ~Multi5x5ClusterAlgo()
00043 {
00044 }
00045
00046
00047
00048 std::vector<reco::BasicCluster> makeClusters(const EcalRecHitCollection* hits,
00049 const CaloSubdetectorGeometry *geometry,
00050 const CaloSubdetectorTopology *topology_p,
00051 const CaloSubdetectorGeometry *geometryES_p,
00052 reco::CaloID::Detectors detector,
00053 bool regional = false,
00054 const std::vector<EcalEtaPhiRegion>& regions = std::vector<EcalEtaPhiRegion>());
00055
00057 typedef math::XYZPoint Point;
00058
00059 private:
00060
00061
00062 PositionCalc posCalculator_;
00063
00065 reco::CaloID::Detectors detector_;
00066
00067
00068 double ecalBarrelSeedThreshold;
00069 double ecalEndcapSeedThreshold;
00070
00071
00072 const EcalRecHitCollection *recHits_;
00073
00074
00075 std::vector<EcalRecHit> seeds;
00076
00077
00078 std::set<DetId> used_s;
00079 std::set<DetId> canSeed_s;
00080
00081
00082
00083
00084 std::vector<std::pair<DetId, float> > current_v;
00085
00086
00087 std::vector<reco::BasicCluster> clusters_v;
00088
00089
00090 std::vector<int> v_chstatus_;
00091
00092 void mainSearch(const EcalRecHitCollection* hits,
00093 const CaloSubdetectorGeometry *geometry_p,
00094 const CaloSubdetectorTopology *topology_p,
00095 const CaloSubdetectorGeometry *geometryES_p);
00096
00097
00098
00099 bool checkMaxima(CaloNavigator<DetId> &navigator,
00100 const EcalRecHitCollection *hits);
00101
00102
00103
00104
00105 void prepareCluster(CaloNavigator<DetId> &navigator,
00106 const EcalRecHitCollection *hits,
00107 const CaloSubdetectorGeometry *geometry);
00108
00109
00110
00111 void addCrystal(const DetId &det);
00112
00113
00114
00115
00116 void makeCluster(const EcalRecHitCollection* hits,
00117 const CaloSubdetectorGeometry *geometry_p,
00118 const CaloSubdetectorGeometry *geometryES_p,
00119 const EcalRecHitCollection::const_iterator &seedIt);
00120
00121 };
00122
00123 #endif