Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:59:27

0001 /** \class PhotonMVABasedHaloTagger
0002  *   \author Shilpi Jain (University of Minnesota)
0003  * Links to the presentation: 
0004  1. ECAL DPG: https://indico.cern.ch/event/991261/contributions/4283096/attachments/2219229/3757719/beamHalo_31march_v1.pdf
0005  2. JetMET POG: https://indico.cern.ch/event/1027614/contributions/4314949/attachments/2224472/3767396/beamHalo_12April.pdf
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   ///values of dR etc to cluster the hits in various sub-detectors
0079   static constexpr float dr2Max_ECALClus_ = 0.2 * 0.2;
0080   static constexpr float rho2Min_ECALpos_ = 31 * 31;            //cm
0081   static constexpr float rho2Max_ECALpos_ = 172 * 172;          //cm
0082   static constexpr float dRho2Max_HCALClus_SamePhi_ = 26 * 26;  //cm
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;  //cm
0086   static constexpr float dXY_ESClus_SamePhi_ = 1;       ///cm
0087   static constexpr float dXY_ESClus_SamedR_ = 1;        ///cm
0088 };
0089 
0090 #endif  // PhotonMVABasedHaloTagger_H