File indexing completed on 2023-10-25 09:59:27
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef RecoEgamma_PhotonIdentification_PhotonMVABasedHaloTagger_h
0009 #define RecoEgamma_PhotonIdentification_PhotonMVABasedHaloTagger_h
0010
0011 #include "FWCore/Framework/interface/Event.h"
0012 #include "FWCore/Framework/interface/EventSetup.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0015 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0016 #include "FWCore/Framework/interface/ConsumesCollector.h"
0017 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0018 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0019 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0020 #include "CondFormats/GBRForest/interface/GBRForest.h"
0021 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h"
0022 #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h"
0023 #include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h"
0024 #include "CondFormats/DataRecord/interface/EcalPFRecHitThresholdsRcd.h"
0025 #include <vector>
0026
0027 class PhotonMVABasedHaloTagger {
0028 public:
0029 PhotonMVABasedHaloTagger(const edm::ParameterSet& conf, edm::ConsumesCollector&& iC);
0030
0031 double calculateMVA(const reco::Photon* pho,
0032 const GBRForest* gbr_,
0033 const edm::Event& iEvent,
0034 const edm::EventSetup& es);
0035
0036 private:
0037 void calphoClusCoordinECAL(const CaloGeometry* geo,
0038 const reco::Photon*,
0039 const EcalPFRecHitThresholds* thresholds,
0040 const EcalRecHitCollection& ecalRecHits);
0041
0042 void calmatchedHBHECoordForBothHypothesis(const CaloGeometry* geo,
0043 const reco::Photon*,
0044 const HBHERecHitCollection& HBHERecHits);
0045
0046 void calmatchedESCoordForBothHypothesis(const CaloGeometry* geo,
0047 const reco::Photon*,
0048 const EcalRecHitCollection& ESRecHits);
0049
0050 double calAngleBetweenEEAndSubDet(int nhits, double subdetClusX, double subdetClusY, double subdetClusZ);
0051
0052 int hcalClusNhits_samedPhi_, hcalClusNhits_samedR_;
0053 int ecalClusNhits_, preshowerNhits_samedPhi_, preshowerNhits_samedR_;
0054 double hcalClusX_samedPhi_, hcalClusY_samedPhi_, hcalClusZ_samedPhi_, hcalClusX_samedR_, hcalClusY_samedR_,
0055 hcalClusZ_samedR_;
0056 double hcalClusE_samedPhi_, hcalClusE_samedR_;
0057
0058 double ecalClusX_, ecalClusY_, ecalClusZ_;
0059 double preshowerX_samedPhi_, preshowerY_samedPhi_, preshowerZ_samedPhi_, preshowerX_samedR_, preshowerY_samedR_,
0060 preshowerZ_samedR_;
0061 double ecalClusE_, preshowerE_samedPhi_, preshowerE_samedR_;
0062 double noiseThrES_;
0063
0064 EgammaHcalIsolation::arrayHB recHitEThresholdHB_;
0065 EgammaHcalIsolation::arrayHE recHitEThresholdHE_;
0066
0067 const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geometryToken_;
0068 const edm::ESGetToken<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd> ecalPFRechitThresholdsToken_;
0069 const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_;
0070
0071 edm::ESHandle<CaloGeometry> pG_;
0072 edm::EDGetTokenT<double> rhoLabel_;
0073 edm::EDGetTokenT<EcalRecHitCollection> EBecalCollection_;
0074 edm::EDGetTokenT<EcalRecHitCollection> EEecalCollection_;
0075 edm::EDGetTokenT<EcalRecHitCollection> ESCollection_;
0076 edm::EDGetTokenT<HBHERecHitCollection> HBHERecHitsCollection_;
0077
0078
0079 static constexpr float dr2Max_ECALClus_ = 0.2 * 0.2;
0080 static constexpr float rho2Min_ECALpos_ = 31 * 31;
0081 static constexpr float rho2Max_ECALpos_ = 172 * 172;
0082 static constexpr float dRho2Max_HCALClus_SamePhi_ = 26 * 26;
0083 static constexpr float dPhiMax_HCALClus_SamePhi_ = 0.15;
0084 static constexpr float dR2Max_HCALClus_SamePhi_ = 0.15 * 0.15;
0085 static constexpr float dRho2Max_ESClus_ = 2.2 * 2.2;
0086 static constexpr float dXY_ESClus_SamePhi_ = 1;
0087 static constexpr float dXY_ESClus_SamedR_ = 1;
0088 };
0089
0090 #endif