-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Implementation of beam halo tagger algorithm for the endcap photons #36901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b143f4b
ee342ca
9317de2
fdcfde2
f7d5e90
bb85de9
65d0aa5
c62a11d
85d62c5
5efc6f8
0f4515d
5322e33
b901548
95736cc
73220c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| /** \class PhotonMVABasedHaloTagger | ||
| * \author Shilpi Jain (University of Minnesota) | ||
| * Links to the presentation: | ||
| 1. ECAL DPG: https://indico.cern.ch/event/991261/contributions/4283096/attachments/2219229/3757719/beamHalo_31march_v1.pdf | ||
| 2. JetMET POG: https://indico.cern.ch/event/1027614/contributions/4314949/attachments/2224472/3767396/beamHalo_12April.pdf | ||
| */ | ||
|
|
||
| #ifndef RecoEgamma_PhotonIdentification_PhotonMVABasedHaloTagger_h | ||
| #define RecoEgamma_PhotonIdentification_PhotonMVABasedHaloTagger_h | ||
|
|
||
| #include "FWCore/Framework/interface/Event.h" | ||
| #include "FWCore/Framework/interface/EventSetup.h" | ||
| #include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
| #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" | ||
| #include "DataFormats/EgammaCandidates/interface/Photon.h" | ||
| #include "FWCore/Framework/interface/ConsumesCollector.h" | ||
| #include "Geometry/CaloGeometry/interface/CaloGeometry.h" | ||
| #include "Geometry/Records/interface/CaloGeometryRecord.h" | ||
| #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" | ||
| #include "CondFormats/GBRForest/interface/GBRForest.h" | ||
| #include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h" | ||
| #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h" | ||
| #include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h" | ||
| #include "CondFormats/DataRecord/interface/EcalPFRecHitThresholdsRcd.h" | ||
| #include <vector> | ||
|
|
||
| class PhotonMVABasedHaloTagger { | ||
| public: | ||
| PhotonMVABasedHaloTagger(const edm::ParameterSet& conf, edm::ConsumesCollector&& iC); | ||
|
|
||
| double calculateMVA(const reco::Photon* pho, | ||
| const GBRForest* gbr_, | ||
| const edm::Event& iEvent, | ||
| const edm::EventSetup& es); | ||
|
|
||
| private: | ||
| void calphoClusCoordinECAL(const CaloGeometry* geo, | ||
jainshilpi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const reco::Photon*, | ||
| const EcalPFRecHitThresholds* thresholds, | ||
| const EcalRecHitCollection& ecalRecHits); | ||
|
|
||
| void calmatchedHBHECoordForBothHypothesis(const CaloGeometry* geo, | ||
| const reco::Photon*, | ||
| const HBHERecHitCollection& HBHERecHits); | ||
|
|
||
| void calmatchedESCoordForBothHypothesis(const CaloGeometry* geo, | ||
| const reco::Photon*, | ||
| const EcalRecHitCollection& ESRecHits); | ||
|
|
||
| double calAngleBetweenEEAndSubDet(int nhits, double subdetClusX, double subdetClusY, double subdetClusZ); | ||
|
|
||
| int hcalClusNhits_samedPhi_, hcalClusNhits_samedR_; | ||
| int ecalClusNhits_, preshowerNhits_samedPhi_, preshowerNhits_samedR_; | ||
| double hcalClusX_samedPhi_, hcalClusY_samedPhi_, hcalClusZ_samedPhi_, hcalClusX_samedR_, hcalClusY_samedR_, | ||
| hcalClusZ_samedR_; | ||
| double hcalClusE_samedPhi_, hcalClusE_samedR_; | ||
|
|
||
| double ecalClusX_, ecalClusY_, ecalClusZ_; | ||
| double preshowerX_samedPhi_, preshowerY_samedPhi_, preshowerZ_samedPhi_, preshowerX_samedR_, preshowerY_samedR_, | ||
| preshowerZ_samedR_; | ||
| double ecalClusE_, preshowerE_samedPhi_, preshowerE_samedR_; | ||
| double noiseThrES_; | ||
|
|
||
| EgammaHcalIsolation::arrayHB recHitEThresholdHB_; | ||
| EgammaHcalIsolation::arrayHE recHitEThresholdHE_; | ||
|
|
||
| const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geometryToken_; | ||
| const edm::ESGetToken<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd> ecalPFRechitThresholdsToken_; | ||
| const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_; | ||
|
|
||
| edm::ESHandle<CaloGeometry> pG_; | ||
| edm::EDGetTokenT<double> rhoLabel_; | ||
| edm::EDGetTokenT<EcalRecHitCollection> EBecalCollection_; | ||
| edm::EDGetTokenT<EcalRecHitCollection> EEecalCollection_; | ||
| edm::EDGetTokenT<EcalRecHitCollection> ESCollection_; | ||
| edm::EDGetTokenT<HBHERecHitCollection> HBHERecHitsCollection_; | ||
|
|
||
| ///values of dR etc to cluster the hits in various sub-detectors | ||
| static constexpr float dr2Max_ECALClus_ = 0.2 * 0.2; | ||
| static constexpr float rho2Min_ECALpos_ = 31 * 31; //cm | ||
| static constexpr float rho2Max_ECALpos_ = 172 * 172; //cm | ||
| static constexpr float dRho2Max_HCALClus_SamePhi_ = 26 * 26; //cm | ||
| static constexpr float dPhiMax_HCALClus_SamePhi_ = 0.15; | ||
| static constexpr float dR2Max_HCALClus_SamePhi_ = 0.15 * 0.15; | ||
| static constexpr float dRho2Max_ESClus_ = 2.2 * 2.2; //cm | ||
| static constexpr float dXY_ESClus_SamePhi_ = 1; ///cm | ||
| static constexpr float dXY_ESClus_SamedR_ = 1; ///cm | ||
| }; | ||
|
|
||
| #endif // PhotonMVABasedHaloTagger_H | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
| from RecoEgamma.EgammaIsolationAlgos.egammaHBHERecHitThreshold_cff import egammaHBHERecHit | ||
|
|
||
| pathToHaloMVATrainingFile = "RecoEgamma/PhotonIdentification/data/beamHaloTaggerID/xgboostToTMVA_BHtagger.root" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Should be fixed now by cms-sw/cmsdist#7665 |
||
| mvaHaloVariable = cms.PSet( | ||
| #required inputs | ||
| trainingFileName = cms.FileInPath(pathToHaloMVATrainingFile), | ||
| rhoLabel = cms.InputTag("fixedGridRhoFastjetAllTmp"), | ||
| barrelEcalRecHitCollection = cms.InputTag("ecalRecHit","EcalRecHitsEB"), | ||
| endcapEcalRecHitCollection = cms.InputTag("ecalRecHit","EcalRecHitsEE"), | ||
| esRecHitCollection = cms.InputTag("ecalPreshowerRecHit","EcalRecHitsES"), | ||
| HBHERecHitsCollection = egammaHBHERecHit.hbheRecHits, | ||
| recHitEThresholdHB = egammaHBHERecHit.recHitEThresholdHB, | ||
| recHitEThresholdHE = egammaHBHERecHit.recHitEThresholdHE, | ||
| noiseThrES = cms.double(0.0) | ||
|
|
||
|
|
||
| ) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.