diff --git a/RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h b/RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h index 8b1c831e05bff..5f51c238727ad 100644 --- a/RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h +++ b/RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h @@ -24,131 +24,19 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" +#include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h" class CaloTopology; class CaloGeometry; class CaloSubdetectorTopology; -class EcalClusterLazyTools { +class EcalClusterLazyToolsBase { public: - EcalClusterLazyTools( const edm::Event &ev, const edm::EventSetup &es, edm::EDGetTokenT token1, edm::EDGetTokenT token2); - ~EcalClusterLazyTools(); - - // various energies in the matrix nxn surrounding the maximum energy crystal of the input cluster - //NOTE (29/10/08): we now use an eta/phi coordinate system rather than phi/eta - //to minmise possible screwups, for now e5x1 isnt defined all the majority of people who call it actually want e1x5 and - //it is thought it is better that their code doesnt compile rather than pick up the wrong function - //therefore in this version and later e1x5 = e5x1 in the old version - //so 1x5 is 1 crystal in eta and 5 crystals in phi - //note e3x2 does not have a definate eta/phi geometry, it takes the maximum 3x2 block containing the - //seed regardless of whether that 3 in eta or phi - float e1x3( const reco::BasicCluster &cluster ); - float e1x3( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float e3x1( const reco::BasicCluster &cluster ); - float e3x1( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float e1x5( const reco::BasicCluster &cluster ); - float e1x5( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float e5x1( const reco::BasicCluster &cluster ); - float e5x1( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float e2x2( const reco::BasicCluster &cluster ); - float e2x2( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float e3x2( const reco::BasicCluster &cluster ); - float e3x2( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float e3x3( const reco::BasicCluster &cluster ); - float e3x3( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float e4x4( const reco::BasicCluster &cluster ); - float e4x4( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float e5x5( const reco::BasicCluster &cluster ); - float e5x5( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - // energy in the 2x5 strip right of the max crystal (does not contain max crystal) - // 2 crystals wide in eta, 5 wide in phi. - float e2x5Right( const reco::BasicCluster &cluster ); - float e2x5Right( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - // energy in the 2x5 strip left of the max crystal (does not contain max crystal) - float e2x5Left( const reco::BasicCluster &cluster ); - float e2x5Left( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - // energy in the 5x2 strip above the max crystal (does not contain max crystal) - // 5 crystals wide in eta, 2 wide in phi. - float e2x5Top( const reco::BasicCluster &cluster ); - float e2x5Top( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - // energy in the 5x2 strip below the max crystal (does not contain max crystal) - float e2x5Bottom( const reco::BasicCluster &cluster ); - float e2x5Bottom( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - // energy in a 2x5 strip containing the seed (max) crystal. - // 2 crystals wide in eta, 5 wide in phi. - // it is the maximum of either (1x5left + 1x5center) or (1x5right + 1x5center) - float e2x5Max( const reco::BasicCluster &cluster ); - float e2x5Max( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - // energies in the crystal left, right, top, bottom w.r.t. to the most energetic crystal - float eLeft( const reco::BasicCluster &cluster ); - float eLeft( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float eRight( const reco::BasicCluster &cluster ); - float eRight( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float eTop( const reco::BasicCluster &cluster ); - float eTop( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - float eBottom( const reco::BasicCluster &cluster ); - float eBottom( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - // the energy of the most energetic crystal in the cluster - float eMax( const reco::BasicCluster &cluster ); - float eMax( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - // the energy of the second most energetic crystal in the cluster - float e2nd( const reco::BasicCluster &cluster ); - float e2nd( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - // get the DetId and the energy of the maximum energy crystal of the input cluster - std::pair getMaximum( const reco::BasicCluster &cluster ); - std::pair getMaximum( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - std::vector energyBasketFractionEta( const reco::BasicCluster &cluster ); - std::vector energyBasketFractionEta( const reco::BasicCluster &cluster,const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - std::vector energyBasketFractionPhi( const reco::BasicCluster &cluster ); - std::vector energyBasketFractionPhi( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); - - // return a vector v with v[0] = etaLat, v[1] = phiLat, v[2] = lat - std::vector lat( const reco::BasicCluster &cluster, bool logW = true, float w0 = 4.7 ); - std::vector lat( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, bool logW = true, float w0 = 4.7 ); - - // return a vector v with v[0] = covEtaEta, v[1] = covEtaPhi, v[2] = covPhiPhi - std::vector covariances(const reco::BasicCluster &cluster, float w0 = 4.7 ); - std::vector covariances(const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 = 4.7 ); - - // return a vector v with v[0] = covIEtaIEta, v[1] = covIEtaIPhi, v[2] = covIPhiIPhi - //this function calculates differences in eta/phi in units of crystals not global eta/phi - //this is gives better performance in the crack regions of the calorimeter but gives otherwise identical results to covariances function - //this is only defined for the barrel, it returns covariances when the cluster is in the endcap - //Warning: covIEtaIEta has been studied by egamma, but so far covIPhiIPhi hasnt been studied extensively so there could be a bug in - // the covIPhiIEta or covIPhiIPhi calculations. I dont think there is but as it hasnt been heavily used, there might be one - std::vector localCovariances(const reco::BasicCluster &cluster, float w0 = 4.7); - std::vector localCovariances(const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 = 4.7); - - std::vector scLocalCovariances(const reco::SuperCluster &cluster, float w0 = 4.7); - std::vector scLocalCovariances(const reco::SuperCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 = 4.7); - - double zernike20( const reco::BasicCluster &cluster, double R0 = 6.6, bool logW = true, float w0 = 4.7 ); - double zernike42( const reco::BasicCluster &cluster, double R0 = 6.6, bool logW = true, float w0 = 4.7 ); - - // get the detId's of a matrix centered in the maximum energy crystal = (0,0) - // the size is specified by ixMin, ixMax, iyMin, iyMax in unit of crystals - std::vector matrixDetId( DetId id, int ixMin, int ixMax, int iyMin, int iyMax ); - // get the energy deposited in a matrix centered in the maximum energy crystal = (0,0) - // the size is specified by ixMin, ixMax, iyMin, iyMax in unit of crystals - float matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax ); - float matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + EcalClusterLazyToolsBase( const edm::Event &ev, const edm::EventSetup &es, edm::EDGetTokenT token1, edm::EDGetTokenT token2); + ~EcalClusterLazyToolsBase(); + // get time of basic cluster seed crystal float BasicClusterSeedTime(const reco::BasicCluster &cluster); // error-weighted average of time from constituents of basic cluster @@ -173,7 +61,7 @@ class EcalClusterLazyTools { //std::vector severitiesexcl_; // const EcalSeverityLevelAlgo *sevLv; - private: + protected: void getGeometry( const edm::EventSetup &es ); void getTopology( const edm::EventSetup &es ); void getEBRecHits( const edm::Event &ev ); @@ -200,6 +88,518 @@ class EcalClusterLazyTools { // std::vector flagsexcl_; // std::vector severitiesexcl_; -}; + +}; // class EcalClusterLazyToolsBase + +template +class EcalClusterLazyToolsT : public EcalClusterLazyToolsBase { + public: + EcalClusterLazyToolsT( const edm::Event &ev, const edm::EventSetup &es, edm::EDGetTokenT token1, edm::EDGetTokenT token2): + EcalClusterLazyToolsBase(ev,es,token1,token2) {} + ~EcalClusterLazyToolsT() {} + + // various energies in the matrix nxn surrounding the maximum energy crystal of the input cluster + //NOTE (29/10/08): we now use an eta/phi coordinate system rather than phi/eta + //to minmise possible screwups, for now e5x1 isnt defined all the majority of people who call it actually want e1x5 and + //it is thought it is better that their code doesnt compile rather than pick up the wrong function + //therefore in this version and later e1x5 = e5x1 in the old version + //so 1x5 is 1 crystal in eta and 5 crystals in phi + //note e3x2 does not have a definate eta/phi geometry, it takes the maximum 3x2 block containing the + //seed regardless of whether that 3 in eta or phi + float e1x3( const reco::BasicCluster &cluster ); + float e1x3( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float e3x1( const reco::BasicCluster &cluster ); + float e3x1( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float e1x5( const reco::BasicCluster &cluster ); + float e1x5( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float e5x1( const reco::BasicCluster &cluster ); + float e5x1( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float e2x2( const reco::BasicCluster &cluster ); + float e2x2( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float e3x2( const reco::BasicCluster &cluster ); + float e3x2( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float e3x3( const reco::BasicCluster &cluster ); + float e3x3( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float e4x4( const reco::BasicCluster &cluster ); + float e4x4( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float e5x5( const reco::BasicCluster &cluster ); + float e5x5( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + // energy in the 2x5 strip right of the max crystal (does not contain max crystal) + // 2 crystals wide in eta, 5 wide in phi. + float e2x5Right( const reco::BasicCluster &cluster ); + float e2x5Right( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + // energy in the 2x5 strip left of the max crystal (does not contain max crystal) + float e2x5Left( const reco::BasicCluster &cluster ); + float e2x5Left( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + // energy in the 5x2 strip above the max crystal (does not contain max crystal) + // 5 crystals wide in eta, 2 wide in phi. + float e2x5Top( const reco::BasicCluster &cluster ); + float e2x5Top( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + // energy in the 5x2 strip below the max crystal (does not contain max crystal) + float e2x5Bottom( const reco::BasicCluster &cluster ); + float e2x5Bottom( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + // energy in a 2x5 strip containing the seed (max) crystal. + // 2 crystals wide in eta, 5 wide in phi. + // it is the maximum of either (1x5left + 1x5center) or (1x5right + 1x5center) + float e2x5Max( const reco::BasicCluster &cluster ); + float e2x5Max( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + // energies in the crystal left, right, top, bottom w.r.t. to the most energetic crystal + float eLeft( const reco::BasicCluster &cluster ); + float eLeft( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float eRight( const reco::BasicCluster &cluster ); + float eRight( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float eTop( const reco::BasicCluster &cluster ); + float eTop( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + float eBottom( const reco::BasicCluster &cluster ); + float eBottom( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + // the energy of the most energetic crystal in the cluster + float eMax( const reco::BasicCluster &cluster ); + float eMax( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + // the energy of the second most energetic crystal in the cluster + float e2nd( const reco::BasicCluster &cluster ); + float e2nd( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + // get the DetId and the energy of the maximum energy crystal of the input cluster + std::pair getMaximum( const reco::BasicCluster &cluster ); + std::pair getMaximum( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + std::vector energyBasketFractionEta( const reco::BasicCluster &cluster ); + std::vector energyBasketFractionEta( const reco::BasicCluster &cluster,const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + std::vector energyBasketFractionPhi( const reco::BasicCluster &cluster ); + std::vector energyBasketFractionPhi( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + + // return a vector v with v[0] = etaLat, v[1] = phiLat, v[2] = lat + std::vector lat( const reco::BasicCluster &cluster, bool logW = true, float w0 = 4.7 ); + std::vector lat( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, bool logW = true, float w0 = 4.7 ); + + // return a vector v with v[0] = covEtaEta, v[1] = covEtaPhi, v[2] = covPhiPhi + std::vector covariances(const reco::BasicCluster &cluster, float w0 = 4.7 ); + std::vector covariances(const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 = 4.7 ); + + // return a vector v with v[0] = covIEtaIEta, v[1] = covIEtaIPhi, v[2] = covIPhiIPhi + //this function calculates differences in eta/phi in units of crystals not global eta/phi + //this is gives better performance in the crack regions of the calorimeter but gives otherwise identical results to covariances function + //this is only defined for the barrel, it returns covariances when the cluster is in the endcap + //Warning: covIEtaIEta has been studied by egamma, but so far covIPhiIPhi hasnt been studied extensively so there could be a bug in + // the covIPhiIEta or covIPhiIPhi calculations. I dont think there is but as it hasnt been heavily used, there might be one + std::vector localCovariances(const reco::BasicCluster &cluster, float w0 = 4.7); + std::vector localCovariances(const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 = 4.7); + + std::vector scLocalCovariances(const reco::SuperCluster &cluster, float w0 = 4.7); + std::vector scLocalCovariances(const reco::SuperCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 = 4.7); + + double zernike20( const reco::BasicCluster &cluster, double R0 = 6.6, bool logW = true, float w0 = 4.7 ); + double zernike42( const reco::BasicCluster &cluster, double R0 = 6.6, bool logW = true, float w0 = 4.7 ); + + // get the detId's of a matrix centered in the maximum energy crystal = (0,0) + // the size is specified by ixMin, ixMax, iyMin, iyMax in unit of crystals + std::vector matrixDetId( DetId id, int ixMin, int ixMax, int iyMin, int iyMax ); + // get the energy deposited in a matrix centered in the maximum energy crystal = (0,0) + // the size is specified by ixMin, ixMax, iyMin, iyMax in unit of crystals + float matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax ); + float matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ); + +}; // class EcalClusterLazyToolsT + +template +float EcalClusterLazyToolsT::e1x3( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e1x3( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + + +template +float EcalClusterLazyToolsT::e1x3( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e1x3( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + + +template +float EcalClusterLazyToolsT::e3x1( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e3x1( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e3x1( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e3x1( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e1x5( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e1x5( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e1x5( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e1x5( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + + +template +float EcalClusterLazyToolsT::e5x1( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e5x1( cluster, getEcalRecHitCollection(cluster), topology_ ); + } + +template +float EcalClusterLazyToolsT::e5x1( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e5x1( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); + } + + +template +float EcalClusterLazyToolsT::e2x2( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e2x2( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e2x2( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e2x2( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e3x2( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e3x2( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e3x2( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e3x2( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e3x3( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e3x3( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e3x3( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e3x3( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e4x4( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e4x4( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e4x4( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e4x4( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e5x5( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e5x5( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e5x5( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e5x5( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e2x5Right( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e2x5Right( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e2x5Right( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e2x5Right( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e2x5Left( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e2x5Left( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e2x5Left( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e2x5Left( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e2x5Top( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e2x5Top( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e2x5Top( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e2x5Top( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e2x5Bottom( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e2x5Bottom( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e2x5Bottom( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e2x5Bottom( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + +// Energy in 2x5 strip containing the max crystal. +template +float EcalClusterLazyToolsT::e2x5Max( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e2x5Max( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::e2x5Max( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e2x5Max( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::eLeft( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::eLeft( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::eLeft( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::eLeft( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::eRight( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::eRight( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::eRight( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::eRight( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::eTop( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::eTop( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::eTop( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::eTop( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::eBottom( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::eBottom( cluster, getEcalRecHitCollection(cluster), topology_ ); +} + +template +float EcalClusterLazyToolsT::eBottom( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::eBottom( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::eMax( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::eMax( cluster, getEcalRecHitCollection(cluster) ); +} + +template +float EcalClusterLazyToolsT::eMax( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::eMax( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); +} + + +template +float EcalClusterLazyToolsT::e2nd( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::e2nd( cluster, getEcalRecHitCollection(cluster) ); +} + +template +float EcalClusterLazyToolsT::e2nd( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::e2nd( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); +} + +template +std::pair EcalClusterLazyToolsT::getMaximum( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::getMaximum( cluster, getEcalRecHitCollection(cluster) ); +} + +template +std::pair EcalClusterLazyToolsT::getMaximum( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::getMaximum( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); +} + + +template +std::vector EcalClusterLazyToolsT::energyBasketFractionEta( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::energyBasketFractionEta( cluster, getEcalRecHitCollection(cluster) ); +} + +template +std::vector EcalClusterLazyToolsT::energyBasketFractionEta( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::energyBasketFractionEta( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); +} + + +template +std::vector EcalClusterLazyToolsT::energyBasketFractionPhi( const reco::BasicCluster &cluster ) +{ + return EcalClusterToolsImpl::energyBasketFractionPhi( cluster, getEcalRecHitCollection(cluster) ); +} + +template +std::vector EcalClusterLazyToolsT::energyBasketFractionPhi( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::energyBasketFractionPhi( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); +} + + +template +std::vector EcalClusterLazyToolsT::lat( const reco::BasicCluster &cluster, bool logW, float w0 ) +{ + return EcalClusterToolsImpl::lat( cluster, getEcalRecHitCollection(cluster), geometry_, logW, w0 ); +} + +//template +//std::vector EcalClusterLazyToolsT::lat( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, bool logW, float w0 ) +//{ +// return EcalClusterToolsImpl::lat( cluster, getEcalRecHitCollection(cluster), geometry_,flagsexcl, severitiesexcl, sevLv, logW, w0 ); +//} + + +template +std::vector EcalClusterLazyToolsT::covariances(const reco::BasicCluster &cluster, float w0 ) +{ + return EcalClusterToolsImpl::covariances( cluster, getEcalRecHitCollection(cluster), topology_, geometry_, w0 ); +} + +template +std::vector EcalClusterLazyToolsT::covariances(const reco::BasicCluster &cluster,const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 ) +{ + return EcalClusterToolsImpl::covariances( cluster, getEcalRecHitCollection(cluster), topology_, geometry_, flagsexcl, severitiesexcl, sevLv, w0 ); +} + +template +std::vector EcalClusterLazyToolsT::localCovariances(const reco::BasicCluster &cluster, float w0 ) +{ + return EcalClusterToolsImpl::localCovariances( cluster, getEcalRecHitCollection(cluster), topology_, w0 ); +} + +template +std::vector EcalClusterLazyToolsT::localCovariances(const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 ) +{ + return EcalClusterToolsImpl::localCovariances( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv, w0 ); +} + +template +std::vector EcalClusterLazyToolsT::scLocalCovariances(const reco::SuperCluster &cluster, float w0 ) +{ + return EcalClusterToolsImpl::scLocalCovariances( cluster, getEcalRecHitCollection(cluster), topology_, w0 ); +} + +template +std::vector EcalClusterLazyToolsT::scLocalCovariances(const reco::SuperCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 ) +{ + return EcalClusterToolsImpl::scLocalCovariances( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv, w0 ); +} + +template +double EcalClusterLazyToolsT::zernike20( const reco::BasicCluster &cluster, double R0, bool logW, float w0 ) +{ + return EcalClusterToolsImpl::zernike20( cluster, getEcalRecHitCollection(cluster), geometry_, R0, logW, w0 ); +} + + +template +double EcalClusterLazyToolsT::zernike42( const reco::BasicCluster &cluster, double R0, bool logW, float w0 ) +{ + return EcalClusterToolsImpl::zernike42( cluster, getEcalRecHitCollection(cluster), geometry_, R0, logW, w0 ); +} + +template +std::vector EcalClusterLazyToolsT::matrixDetId( DetId id, int ixMin, int ixMax, int iyMin, int iyMax ) +{ + return EcalClusterToolsImpl::matrixDetId( topology_, id, ixMin, ixMax, iyMin, iyMax ); +} + +template +float EcalClusterLazyToolsT::matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax ) +{ + return EcalClusterToolsImpl::matrixEnergy( cluster, getEcalRecHitCollection(cluster), topology_, id, ixMin, ixMax, iyMin, iyMax ); +} + +template +float EcalClusterLazyToolsT::matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax,const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) +{ + return EcalClusterToolsImpl::matrixEnergy( cluster, getEcalRecHitCollection(cluster), topology_, id, ixMin, ixMax, iyMin, iyMax, flagsexcl, severitiesexcl, sevLv ); +} + +typedef EcalClusterLazyToolsT EcalClusterLazyTools; +namespace noZS { + typedef EcalClusterLazyToolsT EcalClusterLazyTools; +} + + #endif diff --git a/RecoEcal/EgammaCoreTools/src/EcalClusterLazyTools.cc b/RecoEcal/EgammaCoreTools/src/EcalClusterLazyTools.cc index 0364de036daea..a70ad2a99544c 100644 --- a/RecoEcal/EgammaCoreTools/src/EcalClusterLazyTools.cc +++ b/RecoEcal/EgammaCoreTools/src/EcalClusterLazyTools.cc @@ -22,7 +22,7 @@ #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" -EcalClusterLazyTools::EcalClusterLazyTools( const edm::Event &ev, const edm::EventSetup &es, edm::EDGetTokenT token1, edm::EDGetTokenT token2) { +EcalClusterLazyToolsBase::EcalClusterLazyToolsBase( const edm::Event &ev, const edm::EventSetup &es, edm::EDGetTokenT token1, edm::EDGetTokenT token2) { ebRHToken_ = token1; eeRHToken_ = token2; @@ -36,34 +36,34 @@ EcalClusterLazyTools::EcalClusterLazyTools( const edm::Event &ev, const edm::Eve getLaserDbService ( es ); } -EcalClusterLazyTools::~EcalClusterLazyTools() +EcalClusterLazyToolsBase::~EcalClusterLazyToolsBase() {} -void EcalClusterLazyTools::getGeometry( const edm::EventSetup &es ) { +void EcalClusterLazyToolsBase::getGeometry( const edm::EventSetup &es ) { edm::ESHandle pGeometry; es.get().get(pGeometry); geometry_ = pGeometry.product(); } -void EcalClusterLazyTools::getTopology( const edm::EventSetup &es ) { +void EcalClusterLazyToolsBase::getTopology( const edm::EventSetup &es ) { edm::ESHandle pTopology; es.get().get(pTopology); topology_ = pTopology.product(); } -void EcalClusterLazyTools::getEBRecHits( const edm::Event &ev ) { +void EcalClusterLazyToolsBase::getEBRecHits( const edm::Event &ev ) { edm::Handle< EcalRecHitCollection > pEBRecHits; ev.getByToken( ebRHToken_, pEBRecHits ); ebRecHits_ = pEBRecHits.product(); } -void EcalClusterLazyTools::getEERecHits( const edm::Event &ev ) { +void EcalClusterLazyToolsBase::getEERecHits( const edm::Event &ev ) { edm::Handle< EcalRecHitCollection > pEERecHits; ev.getByToken( eeRHToken_, pEERecHits ); eeRecHits_ = pEERecHits.product(); } -void EcalClusterLazyTools::getESRecHits( const edm::Event &ev ) { +void EcalClusterLazyToolsBase::getESRecHits( const edm::Event &ev ) { edm::Handle< EcalRecHitCollection > pESRecHits; ev.getByToken( esRHToken_, pESRecHits ); esRecHits_ = pESRecHits.product(); @@ -95,7 +95,7 @@ void EcalClusterLazyTools::getESRecHits( const edm::Event &ev ) { -void EcalClusterLazyTools::getIntercalibConstants( const edm::EventSetup &es ) +void EcalClusterLazyToolsBase::getIntercalibConstants( const edm::EventSetup &es ) { // get IC's es.get().get(ical); @@ -104,7 +104,7 @@ void EcalClusterLazyTools::getIntercalibConstants( const edm::EventSetup &es ) -void EcalClusterLazyTools::getADCToGeV( const edm::EventSetup &es ) +void EcalClusterLazyToolsBase::getADCToGeV( const edm::EventSetup &es ) { // get ADCtoGeV es.get().get(agc); @@ -112,13 +112,13 @@ void EcalClusterLazyTools::getADCToGeV( const edm::EventSetup &es ) -void EcalClusterLazyTools::getLaserDbService ( const edm::EventSetup &es ){ +void EcalClusterLazyToolsBase::getLaserDbService ( const edm::EventSetup &es ){ // transp corrections es.get().get(laser); } -const EcalRecHitCollection * EcalClusterLazyTools::getEcalRecHitCollection( const reco::BasicCluster &cluster ) +const EcalRecHitCollection * EcalClusterLazyToolsBase::getEcalRecHitCollection( const reco::BasicCluster &cluster ) { if ( cluster.size() == 0 ) { throw cms::Exception("InvalidCluster") << "The cluster has no crystals!"; @@ -136,332 +136,8 @@ const EcalRecHitCollection * EcalClusterLazyTools::getEcalRecHitCollection( cons } - -float EcalClusterLazyTools::e1x3( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e1x3( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - - -float EcalClusterLazyTools::e1x3( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e1x3( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - - -float EcalClusterLazyTools::e3x1( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e3x1( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e3x1( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e3x1( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e1x5( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e1x5( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e1x5( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e1x5( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - - -float EcalClusterLazyTools::e5x1( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e5x1( cluster, getEcalRecHitCollection(cluster), topology_ ); - } - -float EcalClusterLazyTools::e5x1( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e5x1( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); - } - - -float EcalClusterLazyTools::e2x2( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e2x2( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e2x2( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e2x2( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e3x2( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e3x2( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e3x2( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e3x2( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e3x3( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e3x3( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e3x3( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e3x3( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e4x4( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e4x4( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e4x4( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e4x4( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e5x5( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e5x5( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e5x5( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e5x5( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e2x5Right( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e2x5Right( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e2x5Right( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e2x5Right( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e2x5Left( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e2x5Left( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e2x5Left( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e2x5Left( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e2x5Top( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e2x5Top( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e2x5Top( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e2x5Top( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e2x5Bottom( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e2x5Bottom( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e2x5Bottom( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e2x5Bottom( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - -// Energy in 2x5 strip containing the max crystal. -float EcalClusterLazyTools::e2x5Max( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e2x5Max( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::e2x5Max( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e2x5Max( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::eLeft( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::eLeft( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::eLeft( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::eLeft( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::eRight( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::eRight( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::eRight( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::eRight( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::eTop( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::eTop( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::eTop( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::eTop( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::eBottom( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::eBottom( cluster, getEcalRecHitCollection(cluster), topology_ ); -} - -float EcalClusterLazyTools::eBottom( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::eBottom( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::eMax( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::eMax( cluster, getEcalRecHitCollection(cluster) ); -} - -float EcalClusterLazyTools::eMax( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::eMax( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); -} - - -float EcalClusterLazyTools::e2nd( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::e2nd( cluster, getEcalRecHitCollection(cluster) ); -} - -float EcalClusterLazyTools::e2nd( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::e2nd( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); -} - -std::pair EcalClusterLazyTools::getMaximum( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::getMaximum( cluster, getEcalRecHitCollection(cluster) ); -} - -std::pair EcalClusterLazyTools::getMaximum( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::getMaximum( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); -} - - -std::vector EcalClusterLazyTools::energyBasketFractionEta( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::energyBasketFractionEta( cluster, getEcalRecHitCollection(cluster) ); -} - -std::vector EcalClusterLazyTools::energyBasketFractionEta( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::energyBasketFractionEta( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); -} - - -std::vector EcalClusterLazyTools::energyBasketFractionPhi( const reco::BasicCluster &cluster ) -{ - return EcalClusterTools::energyBasketFractionPhi( cluster, getEcalRecHitCollection(cluster) ); -} - -std::vector EcalClusterLazyTools::energyBasketFractionPhi( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::energyBasketFractionPhi( cluster, getEcalRecHitCollection(cluster), flagsexcl, severitiesexcl, sevLv ); -} - - -std::vector EcalClusterLazyTools::lat( const reco::BasicCluster &cluster, bool logW, float w0 ) -{ - return EcalClusterTools::lat( cluster, getEcalRecHitCollection(cluster), geometry_, logW, w0 ); -} - -//std::vector EcalClusterLazyTools::lat( const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, bool logW, float w0 ) -//{ -// return EcalClusterTools::lat( cluster, getEcalRecHitCollection(cluster), geometry_,flagsexcl, severitiesexcl, sevLv, logW, w0 ); -//} - - -std::vector EcalClusterLazyTools::covariances(const reco::BasicCluster &cluster, float w0 ) -{ - return EcalClusterTools::covariances( cluster, getEcalRecHitCollection(cluster), topology_, geometry_, w0 ); -} - -std::vector EcalClusterLazyTools::covariances(const reco::BasicCluster &cluster,const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 ) -{ - return EcalClusterTools::covariances( cluster, getEcalRecHitCollection(cluster), topology_, geometry_, flagsexcl, severitiesexcl, sevLv, w0 ); -} - -std::vector EcalClusterLazyTools::localCovariances(const reco::BasicCluster &cluster, float w0 ) -{ - return EcalClusterTools::localCovariances( cluster, getEcalRecHitCollection(cluster), topology_, w0 ); -} - -std::vector EcalClusterLazyTools::localCovariances(const reco::BasicCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 ) -{ - return EcalClusterTools::localCovariances( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv, w0 ); -} - -std::vector EcalClusterLazyTools::scLocalCovariances(const reco::SuperCluster &cluster, float w0 ) -{ - return EcalClusterTools::scLocalCovariances( cluster, getEcalRecHitCollection(cluster), topology_, w0 ); -} - -std::vector EcalClusterLazyTools::scLocalCovariances(const reco::SuperCluster &cluster, const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv, float w0 ) -{ - return EcalClusterTools::scLocalCovariances( cluster, getEcalRecHitCollection(cluster), topology_, flagsexcl, severitiesexcl, sevLv, w0 ); -} - -double EcalClusterLazyTools::zernike20( const reco::BasicCluster &cluster, double R0, bool logW, float w0 ) -{ - return EcalClusterTools::zernike20( cluster, getEcalRecHitCollection(cluster), geometry_, R0, logW, w0 ); -} - - -double EcalClusterLazyTools::zernike42( const reco::BasicCluster &cluster, double R0, bool logW, float w0 ) -{ - return EcalClusterTools::zernike42( cluster, getEcalRecHitCollection(cluster), geometry_, R0, logW, w0 ); -} - -std::vector EcalClusterLazyTools::matrixDetId( DetId id, int ixMin, int ixMax, int iyMin, int iyMax ) -{ - return EcalClusterTools::matrixDetId( topology_, id, ixMin, ixMax, iyMin, iyMax ); -} - -float EcalClusterLazyTools::matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax ) -{ - return EcalClusterTools::matrixEnergy( cluster, getEcalRecHitCollection(cluster), topology_, id, ixMin, ixMax, iyMin, iyMax ); -} - -float EcalClusterLazyTools::matrixEnergy( const reco::BasicCluster &cluster, DetId id, int ixMin, int ixMax, int iyMin, int iyMax,const std::vector& flagsexcl, const std::vector& severitiesexcl, const EcalSeverityLevelAlgo *sevLv ) -{ - return EcalClusterTools::matrixEnergy( cluster, getEcalRecHitCollection(cluster), topology_, id, ixMin, ixMax, iyMin, iyMax, flagsexcl, severitiesexcl, sevLv ); -} - - // get time of basic cluster seed crystal -float EcalClusterLazyTools::BasicClusterSeedTime(const reco::BasicCluster &cluster) +float EcalClusterLazyToolsBase::BasicClusterSeedTime(const reco::BasicCluster &cluster) { const EcalRecHitCollection *recHits = getEcalRecHitCollection( cluster ); @@ -478,7 +154,7 @@ float EcalClusterLazyTools::BasicClusterSeedTime(const reco::BasicCluster &clust // error-weighted average of time from constituents of basic cluster -float EcalClusterLazyTools::BasicClusterTime(const reco::BasicCluster &cluster, const edm::Event &ev) +float EcalClusterLazyToolsBase::BasicClusterTime(const reco::BasicCluster &cluster, const edm::Event &ev) { std::vector > clusterComponents = (cluster).hitsAndFractions() ; @@ -544,7 +220,7 @@ float EcalClusterLazyTools::BasicClusterTime(const reco::BasicCluster &cluster, // get BasicClusterSeedTime of the seed basic cluser of the supercluster -float EcalClusterLazyTools::SuperClusterSeedTime(const reco::SuperCluster &cluster){ +float EcalClusterLazyToolsBase::SuperClusterSeedTime(const reco::SuperCluster &cluster){ return BasicClusterSeedTime ( (*cluster.seed()) ); @@ -552,7 +228,7 @@ float EcalClusterLazyTools::SuperClusterSeedTime(const reco::SuperCluster &clust // get BasicClusterTime of the seed basic cluser of the supercluster -float EcalClusterLazyTools::SuperClusterTime(const reco::SuperCluster &cluster, const edm::Event &ev){ +float EcalClusterLazyToolsBase::SuperClusterTime(const reco::SuperCluster &cluster, const edm::Event &ev){ return BasicClusterTime ( (*cluster.seed()) , ev); @@ -560,7 +236,7 @@ float EcalClusterLazyTools::SuperClusterTime(const reco::SuperCluster &cluster, // get Preshower effective sigmaIRIR -float EcalClusterLazyTools::eseffsirir(const reco::SuperCluster &cluster) +float EcalClusterLazyToolsBase::eseffsirir(const reco::SuperCluster &cluster) { if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.; @@ -577,7 +253,7 @@ float EcalClusterLazyTools::eseffsirir(const reco::SuperCluster &cluster) } // get Preshower effective sigmaIXIX -float EcalClusterLazyTools::eseffsixix(const reco::SuperCluster &cluster) +float EcalClusterLazyToolsBase::eseffsixix(const reco::SuperCluster &cluster) { if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.; @@ -592,7 +268,7 @@ float EcalClusterLazyTools::eseffsixix(const reco::SuperCluster &cluster) } // get Preshower effective sigmaIYIY -float EcalClusterLazyTools::eseffsiyiy(const reco::SuperCluster &cluster) +float EcalClusterLazyToolsBase::eseffsiyiy(const reco::SuperCluster &cluster) { if (!(fabs(cluster.eta()) > 1.6 && fabs(cluster.eta()) < 3.)) return 0.; @@ -607,7 +283,7 @@ float EcalClusterLazyTools::eseffsiyiy(const reco::SuperCluster &cluster) } // get Preshower Rechits -std::vector EcalClusterLazyTools::getESHits(double X, double Y, double Z, const std::map& _rechits_map, const CaloGeometry* geometry, CaloSubdetectorTopology *topology_p, int row, int plane) +std::vector EcalClusterLazyToolsBase::getESHits(double X, double Y, double Z, const std::map& _rechits_map, const CaloGeometry* geometry, CaloSubdetectorTopology *topology_p, int row, int plane) { std::map rechits_map = _rechits_map; std::vector esHits; @@ -721,7 +397,7 @@ std::vector EcalClusterLazyTools::getESHits(double X, double Y, double Z, // get Preshower hit shape -float EcalClusterLazyTools::getESShape(const std::vector& ESHits0) +float EcalClusterLazyToolsBase::getESShape(const std::vector& ESHits0) { const int nBIN = 21; float esRH[nBIN];