00001 #ifndef RecoEcal_EgammaCoreTools_EcalClusterLazyTools_h
00002 #define RecoEcal_EgammaCoreTools_EcalClusterLazyTools_h
00003
00014 #include "FWCore/Framework/interface/Event.h"
00015 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00016 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00017 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00018
00019 #include "FWCore/Framework/interface/ESHandle.h"
00020
00021 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
00022 #include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h"
00023 #include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbService.h"
00024 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00025 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h"
00026 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h"
00027
00028
00029 class CaloTopology;
00030 class CaloGeometry;
00031 class CaloSubdetectorTopology;
00032
00033 class EcalClusterLazyTools {
00034 public:
00035 EcalClusterLazyTools( const edm::Event &ev, const edm::EventSetup &es, edm::InputTag redEBRecHits, edm::InputTag redEERecHits,const edm::ParameterSet& config );
00036 EcalClusterLazyTools( const edm::Event &ev, const edm::EventSetup &es, edm::InputTag redEBRecHits, edm::InputTag redEERecHits);
00037 EcalClusterLazyTools( const edm::Event &ev, const edm::EventSetup &es, edm::InputTag redEBRecHits, edm::InputTag redEERecHits, edm::InputTag redESRecHits);
00038
00039 ~EcalClusterLazyTools();
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 float e1x3( const reco::BasicCluster &cluster );
00050 float e1x3( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00051
00052 float e3x1( const reco::BasicCluster &cluster );
00053 float e3x1( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00054
00055 float e1x5( const reco::BasicCluster &cluster );
00056 float e1x5( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00057
00058 float e5x1( const reco::BasicCluster &cluster );
00059 float e5x1( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00060
00061 float e2x2( const reco::BasicCluster &cluster );
00062 float e2x2( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00063
00064 float e3x2( const reco::BasicCluster &cluster );
00065 float e3x2( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00066
00067 float e3x3( const reco::BasicCluster &cluster );
00068 float e3x3( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00069
00070 float e4x4( const reco::BasicCluster &cluster );
00071 float e4x4( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00072
00073 float e5x5( const reco::BasicCluster &cluster );
00074 float e5x5( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00075
00076
00077 float e2x5Right( const reco::BasicCluster &cluster );
00078 float e2x5Right( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00079
00080 float e2x5Left( const reco::BasicCluster &cluster );
00081 float e2x5Left( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00082
00083
00084 float e2x5Top( const reco::BasicCluster &cluster );
00085 float e2x5Top( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00086
00087
00088 float e2x5Bottom( const reco::BasicCluster &cluster );
00089 float e2x5Bottom( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00090
00091
00092
00093 float e2x5Max( const reco::BasicCluster &cluster );
00094 float e2x5Max( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00095
00096 float eLeft( const reco::BasicCluster &cluster );
00097 float eLeft( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00098
00099 float eRight( const reco::BasicCluster &cluster );
00100 float eRight( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00101
00102 float eTop( const reco::BasicCluster &cluster );
00103 float eTop( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00104
00105 float eBottom( const reco::BasicCluster &cluster );
00106 float eBottom( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00107
00108 float eMax( const reco::BasicCluster &cluster );
00109 float eMax( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00110
00111 float e2nd( const reco::BasicCluster &cluster );
00112 float e2nd( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00113
00114
00115 std::pair<DetId, float> getMaximum( const reco::BasicCluster &cluster );
00116 std::pair<DetId, float> getMaximum( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00117
00118 std::vector<float> energyBasketFractionEta( const reco::BasicCluster &cluster );
00119 std::vector<float> energyBasketFractionEta( const reco::BasicCluster &cluster,std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00120
00121 std::vector<float> energyBasketFractionPhi( const reco::BasicCluster &cluster );
00122 std::vector<float> energyBasketFractionPhi( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00123
00124
00125 std::vector<float> lat( const reco::BasicCluster &cluster, bool logW = true, float w0 = 4.7 );
00126 std::vector<float> lat( const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv, bool logW = true, float w0 = 4.7 );
00127
00128
00129 std::vector<float> covariances(const reco::BasicCluster &cluster, float w0 = 4.7 );
00130 std::vector<float> covariances(const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 = 4.7 );
00131
00132
00133
00134
00135
00136
00137
00138 std::vector<float> localCovariances(const reco::BasicCluster &cluster, float w0 = 4.7);
00139 std::vector<float> localCovariances(const reco::BasicCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 = 4.7);
00140
00141 std::vector<float> scLocalCovariances(const reco::SuperCluster &cluster, float w0 = 4.7);
00142 std::vector<float> scLocalCovariances(const reco::SuperCluster &cluster, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 = 4.7);
00143
00144 double zernike20( const reco::BasicCluster &cluster, double R0 = 6.6, bool logW = true, float w0 = 4.7 );
00145 double zernike42( const reco::BasicCluster &cluster, double R0 = 6.6, bool logW = true, float w0 = 4.7 );
00146
00147
00148
00149 std::vector<DetId> matrixDetId( DetId id, int ixMin, int ixMax, int iyMin, int iyMax );
00150
00151
00152 float matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax );
00153 float matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax, std::vector<int> flagsexcl, std::vector<int> severitiesexcl, const EcalSeverityLevelAlgo *sevLv );
00154
00155
00156 float BasicClusterSeedTime(const reco::BasicCluster &cluster);
00157
00158 float BasicClusterTime(const reco::BasicCluster &cluster, const edm::Event &ev);
00159
00160 float SuperClusterSeedTime(const reco::SuperCluster &cluster);
00161
00162 float SuperClusterTime(const reco::SuperCluster &cluster, const edm::Event &ev);
00163
00164
00165 std::map<DetId, EcalRecHit> rechits_map_;
00166
00167 std::vector<float> getESHits(double X, double Y, double Z, std::map<DetId, EcalRecHit> rechits_map, const CaloGeometry* geometry, CaloSubdetectorTopology *topology_p, int row=0, int plane=1);
00168
00169 float getESShape(std::vector<float> ESHits0);
00170
00171 float eseffsirir( const reco::SuperCluster &cluster );
00172 float eseffsixix( const reco::SuperCluster &cluster );
00173 float eseffsiyiy( const reco::SuperCluster &cluster );
00174
00175
00176
00177
00178
00179 private:
00180 void getGeometry( const edm::EventSetup &es );
00181 void getTopology( const edm::EventSetup &es );
00182 void getEBRecHits( const edm::Event &ev, edm::InputTag redEBRecHits );
00183 void getEERecHits( const edm::Event &ev, edm::InputTag redEERecHits );
00184 void getESRecHits( const edm::Event &ev, edm::InputTag redESRecHits );
00185 const EcalRecHitCollection * getEcalRecHitCollection( const reco::BasicCluster &cluster );
00186
00187 const CaloGeometry *geometry_;
00188 const CaloTopology *topology_;
00189 const EcalRecHitCollection *ebRecHits_;
00190 const EcalRecHitCollection *eeRecHits_;
00191 const EcalRecHitCollection *esRecHits_;
00192
00193
00194 edm::ESHandle<EcalIntercalibConstants> ical;
00195 EcalIntercalibConstantMap icalMap;
00196 edm::ESHandle<EcalADCToGeVConstant> agc;
00197 edm::ESHandle<EcalLaserDbService> laser;
00198 void getIntercalibConstants( const edm::EventSetup &es );
00199 void getADCToGeV ( const edm::EventSetup &es );
00200 void getLaserDbService ( const edm::EventSetup &es );
00201
00202
00203
00204
00205 };
00206
00207 #endif