File indexing completed on 2024-04-06 12:24:38
0001 #ifndef RecoECAL_ECALClusters_CosmicClusterAlgo_h
0002 #define RecoECAL_ECALClusters_CosmicClusterAlgo_h
0003
0004 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0005
0006 #include "DataFormats/Math/interface/Point3D.h"
0007 #include "DataFormats/Math/interface/RectangularEtaPhiRegion.h"
0008 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
0009 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0010 #include "DataFormats/EcalRecHit/interface/EcalUncalibratedRecHit.h"
0011 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0012 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
0013
0014 #include "RecoCaloTools/Navigation/interface/CaloNavigator.h"
0015 #include "RecoCaloTools/Navigation/interface/EcalBarrelNavigator.h"
0016 #include "RecoCaloTools/Navigation/interface/EcalEndcapNavigator.h"
0017 #include "Geometry/CaloTopology/interface/EcalBarrelHardcodedTopology.h"
0018 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
0019
0020
0021 #include <string>
0022 #include <vector>
0023 #include <set>
0024
0025 typedef std::map<DetId, EcalRecHit> RecHitsMap;
0026
0027 class CosmicClusterAlgo {
0028 public:
0029 enum EcalPart { barrel = 0, endcap = 1 };
0030 enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };
0031
0032 CosmicClusterAlgo() {}
0033
0034 CosmicClusterAlgo(double ebst,
0035 double ebSt,
0036 double ebDt,
0037 double ebSp,
0038 double ecst,
0039 double ecSt,
0040 double ecDt,
0041 double ecSp,
0042 const PositionCalc &posCalc,
0043 VerbosityLevel the_verbosity = pERROR)
0044 : ecalBarrelSeedThreshold(ebst),
0045 ecalBarrelSingleThreshold(ebSt),
0046 ecalBarrelSecondThreshold(ebDt),
0047 ecalBarrelSupThreshold(ebSp),
0048 ecalEndcapSeedThreshold(ecst),
0049 ecalEndcapSingleThreshold(ecSt),
0050 ecalEndcapSecondThreshold(ecDt),
0051 ecalEndcapSupThreshold(ecSp),
0052 verbosity(the_verbosity) {
0053 posCalculator_ = posCalc;
0054 }
0055
0056 virtual ~CosmicClusterAlgo() {}
0057
0058 void setVerbosity(VerbosityLevel the_verbosity) { verbosity = the_verbosity; }
0059
0060
0061 std::vector<reco::BasicCluster> makeClusters(
0062 const EcalRecHitCollection *hits,
0063 const EcalUncalibratedRecHitCollection *uncalibhits,
0064 const CaloSubdetectorGeometry *geometry,
0065 const CaloSubdetectorTopology *topology_p,
0066 const CaloSubdetectorGeometry *geometryES_p,
0067 EcalPart ecalPart,
0068 bool regional = false,
0069 const std::vector<RectangularEtaPhiRegion> ®ions = std::vector<RectangularEtaPhiRegion>());
0070
0071
0072 typedef math::XYZPoint Point;
0073
0074 private:
0075
0076 PositionCalc posCalculator_;
0077
0078
0079 double ecalBarrelSeedThreshold;
0080 double ecalBarrelSingleThreshold;
0081 double ecalBarrelSecondThreshold;
0082 double ecalBarrelSupThreshold;
0083
0084 double ecalEndcapSeedThreshold;
0085 double ecalEndcapSingleThreshold;
0086 double ecalEndcapSecondThreshold;
0087 double ecalEndcapSupThreshold;
0088
0089
0090 const EcalRecHitCollection *recHits_;
0091
0092 const EcalUncalibratedRecHitCollection *uncalibRecHits_;
0093
0094
0095 std::vector<EcalRecHit> seeds;
0096
0097
0098 std::set<DetId> used_s;
0099 std::set<DetId> canSeed_s;
0100
0101
0102
0103 bool inEB;
0104
0105
0106 std::vector<DetId> current_v9;
0107 std::vector<DetId> current_v25;
0108 std::vector<std::pair<DetId, float> > current_v25Sup;
0109
0110
0111 std::vector<reco::BasicCluster> clusters_v;
0112
0113
0114 VerbosityLevel verbosity;
0115
0116 void mainSearch(const CaloSubdetectorGeometry *geometry_p,
0117 const CaloSubdetectorTopology *topology_p,
0118 const CaloSubdetectorGeometry *geometryES_p,
0119 EcalPart ecalPart);
0120
0121
0122
0123 bool checkMaxima(CaloNavigator<DetId> &navigator);
0124
0125
0126
0127
0128 void prepareCluster(CaloNavigator<DetId> &navigator, const CaloSubdetectorGeometry *geometry);
0129
0130
0131
0132 void addCrystal(const DetId &det, const bool in9);
0133
0134
0135
0136 void makeCluster(const CaloSubdetectorGeometry *geometry_p,
0137 const CaloSubdetectorGeometry *geometryES_p,
0138 DetId seedId);
0139 };
0140
0141 #endif