diff --git a/.gitignore b/.gitignore index 8641217..f87eec4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,11 @@ PhotonAnalyzer/python/__init__.pyc BsMMGAnalysis/BsToMuMuGammaNTuplizer/test/*.root *.py~ *.txt~ +PhotonAnalyzer/python/__init__.pyc BsToMuMuGammaNTuplizer/test/crab.log BsToMuMuGammaNTuplizer/test/crab_projects/ +BsToMuMuGammaNTuplizer/test/dump.C +BsToMuMuGammaNTuplizer/test/aodContent.C +BsToMuMuGammaNTuplizer/test/config_dump.C +BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.cc_v1 Test/MiniAnalyzer/python/__init__.py diff --git a/BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.cc b/BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.cc index 2ade9c5..092acee 100644 --- a/BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.cc +++ b/BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.cc @@ -26,7 +26,6 @@ #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" -#include "DataFormats/EcalDetId/interface/EEDetId.h" #include "DataFormats/GsfTrackReco/interface/GsfTrack.h" #include "DataFormats/Math/interface/deltaR.h" #include "DataFormats/MuonReco/interface/MuonSelectors.h" @@ -69,7 +68,6 @@ #include "DataFormats/EcalRecHit/interface/EcalRecHit.h" #include "DataFormats/EgammaCandidates/interface/Conversion.h" #include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/HIPhotonIsolation.h" #include "DataFormats/EgammaCandidates/interface/Photon.h" #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" #include "DataFormats/HepMCCandidate/interface/GenParticle.h" @@ -91,47 +89,43 @@ #include "BsMMGAnalysis/BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.h" #include "BsMMGAnalysis/BsToMuMuGammaNTuplizer/interface/Utils.h" #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" +#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" +#include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h" +#include "RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h" +#include "Geometry/CaloTopology/interface/CaloTowerConstituentsMap.h" #include - +#include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" +#include "RecoEgamma/EgammaIsolationAlgos/interface/EGHcalRecHitSelector.h" +#include "BsMMGAnalysis/BsToMuMuGammaNTuplizer/plugins/pfIsoCalculator.h" BsToMuMuGammaNTuplizer::BsToMuMuGammaNTuplizer(const edm::ParameterSet& iConfig) : doGenParticles_(iConfig.getParameter("doGenParticles")), + doFlatPt_(iConfig.getParameter("doFlatPt")), doMuons_(iConfig.getParameter("doMuons")), doPhotons_(iConfig.getParameter("doPhotons")), doPFPhotons_(iConfig.getParameter("doPFPhotons")), doSuperClusters_(iConfig.getParameter("doSuperClusters")), - doHLT(iConfig.getParameter("doHLT")) - - //genParticleSrc_(iConfig.getUntrackedParameter("genParticleSrc")), - //gedPhotonSrc_(iConfig.getUntrackedParameter("gedPhotonSrc")), - //pfPhotonSrc_(iConfig.getUntrackedParameter("pfPhotonSrc")), - //MustacheSCBarrelSrc_(iConfig.getParameter("MustacheSCBarrelSrc")), - //MustacheSCEndcapSrc_(iConfig.getParameter("MustacheSCEndcapSrc")) + doHLT(iConfig.getParameter("doHLT")), + Run2_2018_(iConfig.getParameter("Run2_2018")) { Utility= new Utils(); - if(doMuons_) muonToken_ = consumes(iConfig.getParameter("muons")); //caloPartToken_ = consumes >(iConfig.getParameter("caloParticleCollection")); if(doPhotons_) gedPhotonsCollection_ = consumes>(iConfig.getUntrackedParameter("gedPhotonSrc")); - if(doPFPhotons_){ - pfPhotonsCollection_ = consumes>(iConfig.getUntrackedParameter("pfPhotonSrc")); - // pfRecHitToken_ = consumes >(iConfig.getParameter("pfRechitCollection")); - // pfClusterToken_ = consumes >(iConfig.getParameter("pfClusterCollection")); - } + pfPhotonsCollection_ = consumes>(iConfig.getUntrackedParameter("pfPhotonSrc")); if(doSuperClusters_){ MustacheSCBarrelCollection_ = consumes>(iConfig.getParameter("MustacheSCBarrelSrc")); MustacheSCEndcapCollection_ = consumes>(iConfig.getParameter("MustacheSCEndcapSrc")); gsfElectronToken_ = consumes(iConfig.getParameter("GsfElectronSrc")); + hbheRechitToken_ = consumes>>(iConfig.getParameter("hbheRechitCollection")); ebRechitToken_ = consumes>>(iConfig.getParameter("ebRechitCollection")); eeRechitToken_ = consumes>>(iConfig.getParameter("eeRechitCollection")); - //ebRechitToken_ = consumes(iConfig.getParameter("ebRechitCollection")); - //eeRechitToken_ = consumes(iConfig.getParameter("eeRechitCollection")); } if(doHLT) { @@ -241,6 +235,9 @@ BsToMuMuGammaNTuplizer::BsToMuMuGammaNTuplizer(const edm::ParameterSet& iConfig) theTree->Branch("gen_Bs_eta" ,&gen_Bs_eta_); theTree->Branch("gen_Bs_phi" ,&gen_Bs_phi_); theTree->Branch("gen_Bs_pz" ,&gen_Bs_pz_); + theTree->Branch("gen_Bs_vx" ,&gen_Bs_vx_); + theTree->Branch("gen_Bs_vy" ,&gen_Bs_vy_); + theTree->Branch("gen_Bs_vz" ,&gen_Bs_vz_); theTree->Branch("gen_Bs_pdgId" ,&gen_Bs_pdgId_); theTree->Branch("gen_nBsMuonM" ,&gen_nBsMuonM_); @@ -259,6 +256,20 @@ BsToMuMuGammaNTuplizer::BsToMuMuGammaNTuplizer(const edm::ParameterSet& iConfig) theTree->Branch("gen_BsPhoton_eta" ,&gen_BsPhoton_eta_); theTree->Branch("gen_BsPhoton_phi" ,&gen_BsPhoton_phi_); + if(doFlatPt_){ + theTree->Branch("nMC", &nMC_); + theTree->Branch("mcPID", &mcPID_); + theTree->Branch("mcStatus", &mcStatus_); + theTree->Branch("mcVtx_x", &mcVtx_x_); + theTree->Branch("mcVtx_y", &mcVtx_y_); + theTree->Branch("mcVtx_z", &mcVtx_z_); + theTree->Branch("mcPt", &mcPt_); + theTree->Branch("mcEta", &mcEta_); + theTree->Branch("mcPhi", &mcPhi_); + theTree->Branch("mcE", &mcE_); + theTree->Branch("mcEt", &mcEt_); + theTree->Branch("mcMass", &mcMass_); + } } if(doMuons_){ @@ -508,6 +519,7 @@ BsToMuMuGammaNTuplizer::BsToMuMuGammaNTuplizer(const edm::ParameterSet& iConfig) if (doSuperClusters_) { theTree->Branch("nSC", &nSC_); theTree->Branch("scE", &scE_); + theTree->Branch("scEt", &scEt_); theTree->Branch("scRawE", &scRawE_); theTree->Branch("scEta", &scEta_); theTree->Branch("scPhi", &scPhi_); @@ -520,44 +532,68 @@ BsToMuMuGammaNTuplizer::BsToMuMuGammaNTuplizer(const edm::ParameterSet& iConfig) theTree->Branch("scMinDrWithGsfElectornSC_", &scMinDrWithGsfElectornSC_); theTree->Branch("scFoundGsfMatch_" , &scFoundGsfMatch_); - theTree->Branch("superCluster_e5x5", &superCluster_e5x5_); - theTree->Branch("superCluster_e2x2Ratio", &superCluster_e2x2Ratio_); - theTree->Branch("superCluster_e3x3Ratio", &superCluster_e3x3Ratio_); - theTree->Branch("superCluster_eMaxRatio", &superCluster_eMaxRatio_); - theTree->Branch("superCluster_e2ndRatio", &superCluster_e2ndRatio_); - theTree->Branch("superCluster_eTopRatio", &superCluster_eTopRatio_); - theTree->Branch("superCluster_eRightRatio", &superCluster_eRightRatio_); - theTree->Branch("superCluster_eBottomRatio", &superCluster_eBottomRatio_); - theTree->Branch("superCluster_eLeftRatio", &superCluster_eLeftRatio_); - theTree->Branch("superCluster_e2x5MaxRatio", &superCluster_e2x5MaxRatio_); - theTree->Branch("superCluster_e2x5TopRatio", &superCluster_e2x5TopRatio_); - theTree->Branch("superCluster_e2x5RightRatio", &superCluster_e2x5RightRatio_); - theTree->Branch("superCluster_e2x5BottomRatio", &superCluster_e2x5BottomRatio_); - theTree->Branch("superCluster_e2x5LeftRatio", &superCluster_e2x5LeftRatio_); - theTree->Branch("superCluster_swissCross", &superCluster_swissCross_); - theTree->Branch("superCluster_r9", &superCluster_r9_); - theTree->Branch("superCluster_sigmaIetaIeta", &superCluster_sigmaIetaIeta_); - theTree->Branch("superCluster_sigmaIetaIphi", &superCluster_sigmaIetaIphi_); - theTree->Branch("superCluster_sigmaIphiIphi", &superCluster_sigmaIphiIphi_); - theTree->Branch("superCluster_full5x5_e5x5", &superCluster_full5x5_e5x5_); - theTree->Branch("superCluster_full5x5_e2x2Ratio", &superCluster_full5x5_e2x2Ratio_); - theTree->Branch("superCluster_full5x5_e3x3Ratio", &superCluster_full5x5_e3x3Ratio_); - theTree->Branch("superCluster_full5x5_eMaxRatio", &superCluster_full5x5_eMaxRatio_); - theTree->Branch("superCluster_full5x5_e2ndRatio", &superCluster_full5x5_e2ndRatio_); - theTree->Branch("superCluster_full5x5_eTopRatio", &superCluster_full5x5_eTopRatio_); - theTree->Branch("superCluster_full5x5_eRightRatio", &superCluster_full5x5_eRightRatio_); - theTree->Branch("superCluster_full5x5_eBottomRatio", &superCluster_full5x5_eBottomRatio_); - theTree->Branch("superCluster_full5x5_eLeftRatio", &superCluster_full5x5_eLeftRatio_); - theTree->Branch("superCluster_full5x5_e2x5MaxRatio", &superCluster_full5x5_e2x5MaxRatio_); - theTree->Branch("superCluster_full5x5_e2x5TopRatio", &superCluster_full5x5_e2x5TopRatio_); - theTree->Branch("superCluster_full5x5_e2x5RightRatio", &superCluster_full5x5_e2x5RightRatio_); - theTree->Branch("superCluster_full5x5_e2x5BottomRatio", &superCluster_full5x5_e2x5BottomRatio_); - theTree->Branch("superCluster_full5x5_e2x5LeftRatio", &superCluster_full5x5_e2x5LeftRatio_); - theTree->Branch("superCluster_full5x5_swissCross", &superCluster_full5x5_swissCross_); - theTree->Branch("superCluster_full5x5_r9", &superCluster_full5x5_r9_); - theTree->Branch("superCluster_full5x5_sigmaIetaIeta", &superCluster_full5x5_sigmaIetaIeta_); - theTree->Branch("superCluster_full5x5_sigmaIetaIphi", &superCluster_full5x5_sigmaIetaIphi_); - theTree->Branch("superCluster_full5x5_sigmaIphiIphi", &superCluster_full5x5_sigmaIphiIphi_); + theTree->Branch("scE5x5", &scE5x5_); + theTree->Branch("scE2x2Ratio", &scE2x2Ratio_); + theTree->Branch("scE3x3Ratio", &scE3x3Ratio_); + theTree->Branch("scEMaxRatio", &scEMaxRatio_); + theTree->Branch("scE2ndRatio", &scE2ndRatio_); + theTree->Branch("scETopRatio", &scETopRatio_); + theTree->Branch("scERightRatio", &scERightRatio_); + theTree->Branch("scEBottomRatio", &scEBottomRatio_); + theTree->Branch("scELeftRatio", &scELeftRatio_); + theTree->Branch("scE2x5MaxRatio", &scE2x5MaxRatio_); + theTree->Branch("scE2x5TopRatio", &scE2x5TopRatio_); + theTree->Branch("scE2x5RightRatio", &scE2x5RightRatio_); + theTree->Branch("scE2x5BottomRatio", &scE2x5BottomRatio_); + theTree->Branch("scE2x5LeftRatio", &scE2x5LeftRatio_); + theTree->Branch("scSwissCross", &scSwissCross_); + theTree->Branch("scR9", &scR9_); + theTree->Branch("scSigmaIetaIeta", &scSigmaIetaIeta_); + theTree->Branch("scSigmaIetaIphi", &scSigmaIetaIphi_); + theTree->Branch("scSigmaIphiIphi", &scSigmaIphiIphi_); + theTree->Branch("scFull5x5_e5x5", &scFull5x5_e5x5_); + theTree->Branch("scFull5x5_e2x2Ratio", &scFull5x5_e2x2Ratio_); + theTree->Branch("scFull5x5_e3x3Ratio", &scFull5x5_e3x3Ratio_); + theTree->Branch("scFull5x5_eMaxRatio", &scFull5x5_eMaxRatio_); + theTree->Branch("scFull5x5_e2ndRatio", &scFull5x5_e2ndRatio_); + theTree->Branch("scFull5x5_eTopRatio", &scFull5x5_eTopRatio_); + theTree->Branch("scFull5x5_eRightRatio", &scFull5x5_eRightRatio_); + theTree->Branch("scFull5x5_eBottomRatio", &scFull5x5_eBottomRatio_); + theTree->Branch("scFull5x5_eLeftRatio", &scFull5x5_eLeftRatio_); + theTree->Branch("scFull5x5_e2x5MaxRatio", &scFull5x5_e2x5MaxRatio_); + theTree->Branch("scFull5x5_e2x5TopRatio", &scFull5x5_e2x5TopRatio_); + theTree->Branch("scFull5x5_e2x5RightRatio", &scFull5x5_e2x5RightRatio_); + theTree->Branch("scFull5x5_e2x5BottomRatio", &scFull5x5_e2x5BottomRatio_); + theTree->Branch("scFull5x5_e2x5LeftRatio", &scFull5x5_e2x5LeftRatio_); + theTree->Branch("scFull5x5_swissCross", &scFull5x5_swissCross_); + theTree->Branch("scFull5x5_r9", &scFull5x5_r9_); + theTree->Branch("scFull5x5_sigmaIetaIeta", &scFull5x5_sigmaIetaIeta_); + theTree->Branch("scFull5x5_sigmaIetaIphi", &scFull5x5_sigmaIetaIphi_); + theTree->Branch("scFull5x5_sigmaIphiIphi", &scFull5x5_sigmaIphiIphi_); + + theTree->Branch("nhcalRechit", &nhcalRechit_); + theTree->Branch("hcalRechitIEta", &hcalRechitIEta_); + theTree->Branch("hcalRechitIPhi", &hcalRechitIPhi_); + theTree->Branch("hcalRechitEnergy", &hcalRechitEnergy_); + + theTree->Branch("scPFChIso1", &scPFChIso1_); + theTree->Branch("scPFChIso2", &scPFChIso2_); + theTree->Branch("scPFChIso3", &scPFChIso3_); + theTree->Branch("scPFChIso4", &scPFChIso4_); + theTree->Branch("scPFChIso5", &scPFChIso5_); + + theTree->Branch("scPFPhoIso1", &scPFPhoIso1_); + theTree->Branch("scPFPhoIso2", &scPFPhoIso2_); + theTree->Branch("scPFPhoIso3", &scPFPhoIso3_); + theTree->Branch("scPFPhoIso4", &scPFPhoIso4_); + theTree->Branch("scPFPhoIso5", &scPFPhoIso5_); + + theTree->Branch("scPFNeuIso1", &scPFNeuIso1_); + theTree->Branch("scPFNeuIso2", &scPFNeuIso2_); + theTree->Branch("scPFNeuIso3", &scPFNeuIso3_); + theTree->Branch("scPFNeuIso4", &scPFNeuIso4_); + theTree->Branch("scPFNeuIso5", &scPFNeuIso5_); + } } @@ -634,6 +670,9 @@ BsToMuMuGammaNTuplizer::analyze(const edm::Event& iEvent, const edm::EventSetup& gen_Bs_eta_.clear() ; gen_Bs_phi_.clear() ; gen_Bs_pz_.clear() ; + gen_Bs_vx_.clear() ; + gen_Bs_vy_.clear() ; + gen_Bs_vz_.clear() ; gen_Bs_pdgId_.clear(); gen_BsMuonM_pt_.clear() ; gen_BsMuonM_eta_.clear() ; @@ -645,7 +684,22 @@ BsToMuMuGammaNTuplizer::analyze(const edm::Event& iEvent, const edm::EventSetup& gen_BsPhoton_energy_.clear() ; gen_BsPhoton_eta_.clear() ; gen_BsPhoton_phi_.clear(); - } + + if(doFlatPt_){ + nMC_ = 0; + mcPID_ .clear(); + mcStatus_ .clear(); + mcVtx_x_ .clear(); + mcVtx_y_ .clear(); + mcVtx_z_ .clear(); + mcPt_ .clear(); + mcEta_ .clear(); + mcPhi_ .clear(); + mcE_ .clear(); + mcEt_ .clear(); + mcMass_ .clear(); + } + } if(doMuons_){ nMuM_ = 0; @@ -721,9 +775,7 @@ BsToMuMuGammaNTuplizer::analyze(const edm::Event& iEvent, const edm::EventSetup& mum_PFIsolationR04_sumNeutralHadronEtHighThreshold_.clear(); mum_PFIsolationR04_sumPhotonEtHighThreshold_.clear(); mum_PFIsolationR04_sumPUPt_.clear(); - - - + mupHighPurity_.clear(); mupPt_.clear(); mupEta_.clear(); @@ -898,6 +950,7 @@ BsToMuMuGammaNTuplizer::analyze(const edm::Event& iEvent, const edm::EventSetup& if (doSuperClusters_) { nSC_ = 0; scE_ .clear(); + scEt_ .clear(); scRawE_ .clear(); scEta_ .clear(); scPhi_ .clear(); @@ -910,44 +963,68 @@ BsToMuMuGammaNTuplizer::analyze(const edm::Event& iEvent, const edm::EventSetup& scMinDrWithGsfElectornSC_.clear(); scFoundGsfMatch_.clear(); - superCluster_e5x5_.clear(); - superCluster_e2x2Ratio_.clear(); - superCluster_e3x3Ratio_.clear(); - superCluster_eMaxRatio_.clear(); - superCluster_e2ndRatio_.clear(); - superCluster_eTopRatio_.clear(); - superCluster_eRightRatio_.clear(); - superCluster_eBottomRatio_.clear(); - superCluster_eLeftRatio_.clear(); - superCluster_e2x5MaxRatio_.clear(); - superCluster_e2x5TopRatio_.clear(); - superCluster_e2x5RightRatio_.clear(); - superCluster_e2x5BottomRatio_.clear(); - superCluster_e2x5LeftRatio_.clear(); - superCluster_swissCross_.clear(); - superCluster_r9_.clear(); - superCluster_sigmaIetaIeta_.clear(); - superCluster_sigmaIetaIphi_.clear(); - superCluster_sigmaIphiIphi_.clear(); - superCluster_full5x5_e5x5_.clear(); - superCluster_full5x5_e2x2Ratio_.clear(); - superCluster_full5x5_e3x3Ratio_.clear(); - superCluster_full5x5_eMaxRatio_.clear(); - superCluster_full5x5_e2ndRatio_.clear(); - superCluster_full5x5_eTopRatio_.clear(); - superCluster_full5x5_eRightRatio_.clear(); - superCluster_full5x5_eBottomRatio_.clear(); - superCluster_full5x5_eLeftRatio_.clear(); - superCluster_full5x5_e2x5MaxRatio_.clear(); - superCluster_full5x5_e2x5TopRatio_.clear(); - superCluster_full5x5_e2x5RightRatio_.clear(); - superCluster_full5x5_e2x5BottomRatio_.clear(); - superCluster_full5x5_e2x5LeftRatio_.clear(); - superCluster_full5x5_swissCross_.clear(); - superCluster_full5x5_r9_.clear(); - superCluster_full5x5_sigmaIetaIeta_.clear(); - superCluster_full5x5_sigmaIetaIphi_.clear(); - superCluster_full5x5_sigmaIphiIphi_.clear(); + scE5x5_.clear(); + scE2x2Ratio_.clear(); + scE3x3Ratio_.clear(); + scEMaxRatio_.clear(); + scE2ndRatio_.clear(); + scETopRatio_.clear(); + scERightRatio_.clear(); + scEBottomRatio_.clear(); + scELeftRatio_.clear(); + scE2x5MaxRatio_.clear(); + scE2x5TopRatio_.clear(); + scE2x5RightRatio_.clear(); + scE2x5BottomRatio_.clear(); + scE2x5LeftRatio_.clear(); + scSwissCross_.clear(); + scR9_.clear(); + scSigmaIetaIeta_.clear(); + scSigmaIetaIphi_.clear(); + scSigmaIphiIphi_.clear(); + scFull5x5_e5x5_.clear(); + scFull5x5_e2x2Ratio_.clear(); + scFull5x5_e3x3Ratio_.clear(); + scFull5x5_eMaxRatio_.clear(); + scFull5x5_e2ndRatio_.clear(); + scFull5x5_eTopRatio_.clear(); + scFull5x5_eRightRatio_.clear(); + scFull5x5_eBottomRatio_.clear(); + scFull5x5_eLeftRatio_.clear(); + scFull5x5_e2x5MaxRatio_.clear(); + scFull5x5_e2x5TopRatio_.clear(); + scFull5x5_e2x5RightRatio_.clear(); + scFull5x5_e2x5BottomRatio_.clear(); + scFull5x5_e2x5LeftRatio_.clear(); + scFull5x5_swissCross_.clear(); + scFull5x5_r9_.clear(); + scFull5x5_sigmaIetaIeta_.clear(); + scFull5x5_sigmaIetaIphi_.clear(); + scFull5x5_sigmaIphiIphi_.clear(); + + nhcalRechit_ =0; + hcalRechitIEta_.clear(); + hcalRechitIPhi_.clear(); + hcalRechitEnergy_.clear(); + + scPFChIso1_ .clear(); + scPFChIso2_ .clear(); + scPFChIso3_ .clear(); + scPFChIso4_ .clear(); + scPFChIso5_ .clear(); + + scPFPhoIso1_ .clear(); + scPFPhoIso2_ .clear(); + scPFPhoIso3_ .clear(); + scPFPhoIso4_ .clear(); + scPFPhoIso5_ .clear(); + + scPFNeuIso1_ .clear(); + scPFNeuIso2_ .clear(); + scPFNeuIso3_ .clear(); + scPFNeuIso4_ .clear(); + scPFNeuIso5_ .clear(); + } run_ = iEvent.id().run(); @@ -957,8 +1034,6 @@ BsToMuMuGammaNTuplizer::analyze(const edm::Event& iEvent, const edm::EventSetup& // Get magnetic field - edm::ESHandle bFieldHandle; - iSetup.get().get(bFieldHandle); // Get BeamSpot edm::Handle beamSpotH; iEvent.getByToken(beamSpotToken_, beamSpotH); @@ -992,7 +1067,8 @@ BsToMuMuGammaNTuplizer::analyze(const edm::Event& iEvent, const edm::EventSetup& beamspot_beamWidthY_ = beamSpot.BeamWidthY(); ; beamspot_beamWidthX_error_ = beamSpot.BeamWidthXError(); ; beamspot_beamWidthY_error_ = beamSpot.BeamWidthXError(); ; - + + reco::Vertex pv(math::XYZPoint(0, 0, -999), math::Error<3>::type()); for(auto& aVertex : *primaryVertexCollection){ if( not aVertex.isValid() ) continue; @@ -1018,9 +1094,7 @@ BsToMuMuGammaNTuplizer::analyze(const edm::Event& iEvent, const edm::EventSetup& primaryVertex_chi2_ .push_back( aVertex.chi2() ); primaryVertex_normalizedChi2_ .push_back( aVertex.normalizedChi2() ); - - - + pv = aVertex; nPrimaryVertex_++; } // loop over primary vertex collection @@ -1033,7 +1107,7 @@ BsToMuMuGammaNTuplizer::analyze(const edm::Event& iEvent, const edm::EventSetup& if (doMuons_) fillMuons(iEvent, iSetup); if (doPhotons_) fillPhotons(iEvent, iSetup); if (doPFPhotons_) fillPFPhotons(iEvent, iSetup); - if (doSuperClusters_) fillSC(iEvent, iSetup); + if (doSuperClusters_) fillSC(iEvent, iSetup, pv); theTree->Fill(); } @@ -1045,8 +1119,25 @@ void BsToMuMuGammaNTuplizer::fillGenParticles(const edm::Event& iEvent) edm::Handle genParticleCollection; iEvent.getByToken(genParticlesCollection_, genParticleCollection); + + if(doFlatPt_){ + for (auto p = genParticleCollection->begin(); p != genParticleCollection->end(); ++p) { + mcPID_ .push_back(p->pdgId()); + mcStatus_.push_back(p->status()); + mcVtx_x_ .push_back(p->vx()); + mcVtx_y_ .push_back(p->vy()); + mcVtx_z_ .push_back(p->vz()); + mcPt_ .push_back(p->pt()); + mcEta_ .push_back(p->eta()); + mcPhi_ .push_back(p->phi()); + mcE_ .push_back(p->energy()); + mcEt_ .push_back(p->et()); + mcMass_ .push_back(p->mass()); + nMC_++; + } + } //if flat pT - int phoMul(-1),muMMul(-1),muPMul(-1); + int phoMul(-1),muMMul(-1),muPMul(-1); for(auto& aBsMeson : *genParticleCollection){ @@ -1092,6 +1183,9 @@ void BsToMuMuGammaNTuplizer::fillGenParticles(const edm::Event& iEvent) gen_Bs_eta_.push_back(aBsMeson.eta()); gen_Bs_phi_.push_back(aBsMeson.phi()); gen_Bs_pz_.push_back(aBsMeson.pz()); + gen_Bs_vx_.push_back(aBsMeson.vx()); + gen_Bs_vy_.push_back(aBsMeson.vy()); + gen_Bs_vz_.push_back(aBsMeson.vz()); gen_Bs_pdgId_.push_back(aBsMeson.pdgId()); gen_nBs_++; @@ -1553,10 +1647,11 @@ void BsToMuMuGammaNTuplizer::fillPhotons(const edm::Event& e, const edm::EventSe edm::Handle>> recHitsEE; e.getByToken(eeRechitToken_, recHitsEE); - EcalClusterLazyTools lazyTool (e, es, ebRechitToken_, eeRechitToken_); - noZS::EcalClusterLazyTools lazyToolnoZS(e, es, ebRechitToken_, eeRechitToken_); - - // loop over photons + EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_(consumesCollector()); + EcalClusterLazyTools lazyTool (e,ecalClusterToolsESGetTokens_.get(es), ebRechitToken_, eeRechitToken_); + noZS::EcalClusterLazyTools lazyToolnoZS(e,ecalClusterToolsESGetTokens_.get(es), ebRechitToken_, eeRechitToken_); + + // loop over photons for (auto pho = gedPhotonsHandle->begin(); pho != gedPhotonsHandle->end(); ++pho) { phoE_ .push_back(pho->energy()); phoEt_ .push_back(pho->et()); @@ -1609,30 +1704,21 @@ void BsToMuMuGammaNTuplizer::fillPhotons(const edm::Event& e, const edm::EventSe ///////////////////////////////SATURATED/UNSATURATED ///from ggFlash//// DetId seed = (pho->superCluster()->seed()->hitsAndFractions())[0].first; bool isBarrel = seed.subdetId() == EcalBarrel; - const EcalRecHitCollection * rechits = (isBarrel?lazyTool.getEcalEBRecHitCollection():lazyTool.getEcalEERecHitCollection()); - - EcalRecHitCollection::const_iterator theSeedHit = rechits->find(seed); - if (theSeedHit != rechits->end()) { - //std::cout<<"(*theSeedHit).time()"<<(*theSeedHit).time()<<"seed energy: "<<(*theSeedHit).energy()<seed())->energy()); + + nPho_++; } // photons loop } void BsToMuMuGammaNTuplizer::fillPFPhotons(const edm::Event& e, const edm::EventSetup& es) { // Fills tree branches with photons. - edm::Handle > pfPhotonsHandle; + edm::Handle > pfPhotonsHandle; e.getByToken(pfPhotonsCollection_, pfPhotonsHandle); // loop over photons @@ -1649,19 +1735,17 @@ void BsToMuMuGammaNTuplizer::fillPFPhotons(const edm::Event& e, const edm::Event } -void BsToMuMuGammaNTuplizer::fillSC(edm::Event const& e, const edm::EventSetup& es) { +void BsToMuMuGammaNTuplizer::fillSC(edm::Event const& e, const edm::EventSetup& es, reco::Vertex& pv) { edm::Handle barrelSCHandle; e.getByToken(MustacheSCBarrelCollection_, barrelSCHandle); - + edm::Handle endcapSCHandle; e.getByToken(MustacheSCEndcapCollection_, endcapSCHandle); edm::Handle gsfElectronHandle; e.getByToken(gsfElectronToken_, gsfElectronHandle); - edm::Handle>> recHitsEB; - //edm::Handle recHitsEB; e.getByToken(ebRechitToken_, recHitsEB); if (!recHitsEB.isValid()) { std::cerr << "Analyze --> recHitsEB not found" << std::endl; @@ -1669,13 +1753,24 @@ void BsToMuMuGammaNTuplizer::fillSC(edm::Event const& e, const edm::EventSetup& } edm::Handle>> recHitsEE; - //edm::Handle recHitsEE; e.getByToken(eeRechitToken_, recHitsEE); if (!recHitsEE.isValid()) { std::cerr << "Analyze --> recHitsEE not found" << std::endl; return; } - + + edm::Handle>> recHitsHBHE; + e.getByToken(hbheRechitToken_, recHitsHBHE); + if (!recHitsHBHE.isValid()) { + std::cerr << "Analyze --> recHitsHBHE not found" << std::endl; + return; + } + edm::ESHandle theCaloGeometry; + es.get().get(theCaloGeometry); + edm::ESHandle towerMap_; + es.get().get(towerMap_); + + locCov_.clear(); full5x5_locCov_.clear(); // for(const auto& iSuperCluster : *(superClusterEB.product())){ @@ -1684,12 +1779,12 @@ void BsToMuMuGammaNTuplizer::fillSC(edm::Event const& e, const edm::EventSetup& for (auto const& sc : scs) { //if(abs(sc.eta())>2.4)continue; // - edm::ESHandle caloTopology; es.get().get(caloTopology); - const CaloTopology* topology = caloTopology.product(); - + const CaloTopology* topology = caloTopology.product(); + scE_.push_back(sc.correctedEnergy()); + scEt_.push_back(sc.correctedEnergy()/cosh(sc.eta())); scRawE_.push_back(sc.rawEnergy()); scRawEt_.push_back(sc.rawEnergy()/cosh(sc.eta())); scEta_.push_back(sc.eta()); @@ -1704,66 +1799,120 @@ void BsToMuMuGammaNTuplizer::fillSC(edm::Event const& e, const edm::EventSetup& showerShapes_.clear(); if(abs(sc.eta()) <= 1.442)showerShapes_ = getShowerShapes(&caloBC, &(*(recHitsEB.product())), topology); if(abs(sc.eta()) >= 1.566)showerShapes_ = getShowerShapes(&caloBC, &(*(recHitsEE.product())), topology); - superCluster_e5x5_.push_back(reduceFloat(showerShapes_[0],nBits_)); - superCluster_e2x2Ratio_.push_back(reduceFloat(showerShapes_[1],nBits_)); - superCluster_e3x3Ratio_.push_back(reduceFloat(showerShapes_[2],nBits_)); - superCluster_eMaxRatio_.push_back(reduceFloat(showerShapes_[3],nBits_)); - superCluster_e2ndRatio_.push_back(reduceFloat(showerShapes_[4],nBits_)); - superCluster_eTopRatio_.push_back(reduceFloat(showerShapes_[5],nBits_)); - superCluster_eRightRatio_.push_back(reduceFloat(showerShapes_[6],nBits_)); - superCluster_eBottomRatio_.push_back(reduceFloat(showerShapes_[7],nBits_)); - superCluster_eLeftRatio_.push_back(reduceFloat(showerShapes_[8],nBits_)); - superCluster_e2x5MaxRatio_.push_back(reduceFloat(showerShapes_[9],nBits_)); - superCluster_e2x5TopRatio_.push_back(reduceFloat(showerShapes_[10],nBits_)); - superCluster_e2x5RightRatio_.push_back(reduceFloat(showerShapes_[11],nBits_)); - superCluster_e2x5BottomRatio_.push_back(reduceFloat(showerShapes_[12],nBits_)); - superCluster_e2x5LeftRatio_.push_back(reduceFloat(showerShapes_[13],nBits_)); - superCluster_swissCross_.push_back(reduceFloat(showerShapes_[14],nBits_)); - superCluster_r9_.push_back(reduceFloat(showerShapes_[2]*showerShapes_[0]/sc.rawEnergy(),nBits_)); - superCluster_sigmaIetaIeta_.push_back(reduceFloat(showerShapes_[16],nBits_)); - superCluster_sigmaIetaIphi_.push_back(reduceFloat(showerShapes_[17],nBits_)); - superCluster_sigmaIphiIphi_.push_back(reduceFloat(showerShapes_[18],nBits_)); - superCluster_full5x5_e5x5_.push_back(reduceFloat(showerShapes_[19],nBits_)); - superCluster_full5x5_e2x2Ratio_.push_back(reduceFloat(showerShapes_[20],nBits_)); - superCluster_full5x5_e3x3Ratio_.push_back(reduceFloat(showerShapes_[21],nBits_)); - superCluster_full5x5_eMaxRatio_.push_back(reduceFloat(showerShapes_[22],nBits_)); - superCluster_full5x5_e2ndRatio_.push_back(reduceFloat(showerShapes_[23],nBits_)); - superCluster_full5x5_eTopRatio_.push_back(reduceFloat(showerShapes_[24],nBits_)); - superCluster_full5x5_eRightRatio_.push_back(reduceFloat(showerShapes_[25],nBits_)); - superCluster_full5x5_eBottomRatio_.push_back(reduceFloat(showerShapes_[26],nBits_)); - superCluster_full5x5_eLeftRatio_.push_back(reduceFloat(showerShapes_[27],nBits_)); - superCluster_full5x5_e2x5MaxRatio_.push_back(reduceFloat(showerShapes_[28],nBits_)); - superCluster_full5x5_e2x5TopRatio_.push_back(reduceFloat(showerShapes_[29],nBits_)); - superCluster_full5x5_e2x5RightRatio_.push_back(reduceFloat(showerShapes_[30],nBits_)); - superCluster_full5x5_e2x5BottomRatio_.push_back(reduceFloat(showerShapes_[31],nBits_)); - superCluster_full5x5_e2x5LeftRatio_.push_back(reduceFloat(showerShapes_[32],nBits_)); - superCluster_full5x5_swissCross_.push_back(reduceFloat(showerShapes_[33],nBits_)); - superCluster_full5x5_r9_.push_back(reduceFloat(showerShapes_[21]*showerShapes_[19]/sc.rawEnergy(),nBits_)); - superCluster_full5x5_sigmaIetaIeta_.push_back(reduceFloat(showerShapes_[35],nBits_)); - superCluster_full5x5_sigmaIetaIphi_.push_back(reduceFloat(showerShapes_[36],nBits_)); - superCluster_full5x5_sigmaIphiIphi_.push_back(reduceFloat(showerShapes_[37],nBits_)); + scE5x5_.push_back(reduceFloat(showerShapes_[0],nBits_)); + scE2x2Ratio_.push_back(reduceFloat(showerShapes_[1],nBits_)); + scE3x3Ratio_.push_back(reduceFloat(showerShapes_[2],nBits_)); + scEMaxRatio_.push_back(reduceFloat(showerShapes_[3],nBits_)); + scE2ndRatio_.push_back(reduceFloat(showerShapes_[4],nBits_)); + scETopRatio_.push_back(reduceFloat(showerShapes_[5],nBits_)); + scERightRatio_.push_back(reduceFloat(showerShapes_[6],nBits_)); + scEBottomRatio_.push_back(reduceFloat(showerShapes_[7],nBits_)); + scELeftRatio_.push_back(reduceFloat(showerShapes_[8],nBits_)); + scE2x5MaxRatio_.push_back(reduceFloat(showerShapes_[9],nBits_)); + scE2x5TopRatio_.push_back(reduceFloat(showerShapes_[10],nBits_)); + scE2x5RightRatio_.push_back(reduceFloat(showerShapes_[11],nBits_)); + scE2x5BottomRatio_.push_back(reduceFloat(showerShapes_[12],nBits_)); + scE2x5LeftRatio_.push_back(reduceFloat(showerShapes_[13],nBits_)); + scSwissCross_.push_back(reduceFloat(showerShapes_[14],nBits_)); + scR9_.push_back(reduceFloat(showerShapes_[2]*showerShapes_[0]/sc.rawEnergy(),nBits_)); + scSigmaIetaIeta_.push_back(reduceFloat(showerShapes_[16],nBits_)); + scSigmaIetaIphi_.push_back(reduceFloat(showerShapes_[17],nBits_)); + scSigmaIphiIphi_.push_back(reduceFloat(showerShapes_[18],nBits_)); + scFull5x5_e5x5_.push_back(reduceFloat(showerShapes_[19],nBits_)); + scFull5x5_e2x2Ratio_.push_back(reduceFloat(showerShapes_[20],nBits_)); + scFull5x5_e3x3Ratio_.push_back(reduceFloat(showerShapes_[21],nBits_)); + scFull5x5_eMaxRatio_.push_back(reduceFloat(showerShapes_[22],nBits_)); + scFull5x5_e2ndRatio_.push_back(reduceFloat(showerShapes_[23],nBits_)); + scFull5x5_eTopRatio_.push_back(reduceFloat(showerShapes_[24],nBits_)); + scFull5x5_eRightRatio_.push_back(reduceFloat(showerShapes_[25],nBits_)); + scFull5x5_eBottomRatio_.push_back(reduceFloat(showerShapes_[26],nBits_)); + scFull5x5_eLeftRatio_.push_back(reduceFloat(showerShapes_[27],nBits_)); + scFull5x5_e2x5MaxRatio_.push_back(reduceFloat(showerShapes_[28],nBits_)); + scFull5x5_e2x5TopRatio_.push_back(reduceFloat(showerShapes_[29],nBits_)); + scFull5x5_e2x5RightRatio_.push_back(reduceFloat(showerShapes_[30],nBits_)); + scFull5x5_e2x5BottomRatio_.push_back(reduceFloat(showerShapes_[31],nBits_)); + scFull5x5_e2x5LeftRatio_.push_back(reduceFloat(showerShapes_[32],nBits_)); + scFull5x5_swissCross_.push_back(reduceFloat(showerShapes_[33],nBits_)); + scFull5x5_r9_.push_back(reduceFloat(showerShapes_[21]*showerShapes_[19]/sc.rawEnergy(),nBits_)); + scFull5x5_sigmaIetaIeta_.push_back(reduceFloat(showerShapes_[35],nBits_)); + scFull5x5_sigmaIetaIphi_.push_back(reduceFloat(showerShapes_[36],nBits_)); + scFull5x5_sigmaIphiIphi_.push_back(reduceFloat(showerShapes_[37],nBits_)); ++nSC_; double dRmin=1e9; bool foundGsfEleMatch=false; + //std::cout << e.id().event() << " electron size:" << gsfElectronHandle->size() << std::endl; for(auto const& ele : *gsfElectronHandle) { + //std::cout << " electron size:" << ele.size() << std::endl; auto dr=deltaR(*(ele.superCluster()),sc); dRmin = dreta() << " SC eta:" << sc.eta() << " dr:" << dr << std::endl; + + //if( &( *(ele.superCluster()) ) == &sc) + /// { + // foundGsfEleMatch=true; + // break; + // } } - if(gsfElectronHandle->size()<1) + // std::cout << e.id().event() << " ** drmin:" << dRmin << std::endl; + // if(gsfElectronHandle->size()<1) + if(dRmin<0.01) { - dRmin=-0.333; + foundGsfEleMatch=true; } - + scMinDrWithGsfElectornSC_.push_back(dRmin); scFoundGsfMatch_.push_back(foundGsfEleMatch); - + + // fill H/E variable + const reco::CaloCluster &seedCluster = *sc.seed(); + DetId seedId = seedCluster.seed() ; + // if( seedId.det() == DetId::Forward ) return; + + CaloTowerDetId towerId(towerMap_->towerOf(seedId)); + int seedHcalIEta = towerId.ieta(); + int seedHcalIPhi = towerId.iphi(); + // std::cout << e.id().event() << " Seed ID" << seedHcalIEta << std::endl; + + + + for (auto& hcalrh : e.get(hbheRechitToken_) ) { + int dIEtaAbs = std::abs(calDIEta(seedHcalIEta, hcalrh.id().ieta())); + int dIPhiAbs = std::abs(calDIPhi(seedHcalIPhi, hcalrh.id().iphi())); + +// std::cout << e.id().event() << " Seed IEta" << seedHcalIEta << " SeedIPhi" << seedHcalIPhi << " dEta:" << dIEtaAbs << " dPhi:" << dIPhiAbs << std::endl; +// std::cout << e.id().event() << " HCAL energy" << hcalrh.energy() << std::endl; + + if ( (dIEtaAbs <= maxDIEta_) && (dIPhiAbs <= maxDIPhi_) && (hcalrh.energy()>getMinEnergyHCAL_(hcalrh.id()) ) ) { + hcalRechitIEta_.push_back(hcalrh.id().ieta()); + hcalRechitIPhi_.push_back(hcalrh.id().iphi()); + hcalRechitEnergy_.push_back(hcalrh.energy()); + + nhcalRechit_++; + + } + } // HCAL rec hits + + pfIsoCalculator pfIso(e, pfPhotonsCollection_, pv.position()); + + scPFChIso1_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h, 0.1, 0.02, 0.)); + scPFChIso2_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h, 0.2, 0.02, 0.)); + scPFChIso3_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h, 0.3, 0.02, 0.)); + scPFChIso4_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h, 0.4, 0.02, 0.)); + scPFChIso5_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h, 0.5, 0.02, 0.)); + + scPFPhoIso1_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::gamma, 0.1, 0.02, 0.)); + scPFPhoIso2_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::gamma, 0.2, 0.02, 0.)); + scPFPhoIso3_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::gamma, 0.3, 0.02, 0.)); + scPFPhoIso4_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::gamma, 0.4, 0.02, 0.)); + scPFPhoIso5_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::gamma, 0.5, 0.02, 0.)); + + scPFNeuIso1_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h0, 0.1, 0.0, 0.)); + scPFNeuIso2_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h0, 0.2, 0.0, 0.)); + scPFNeuIso3_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h0, 0.3, 0.0, 0.)); + scPFNeuIso4_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h0, 0.4, 0.0, 0.)); + scPFNeuIso5_ .push_back(pfIso.getPfIso(sc, reco::PFCandidate::h0, 0.5, 0.0, 0.)); } // supercluster loop } } @@ -1943,6 +2092,49 @@ float BsToMuMuGammaNTuplizer::reduceFloat(float val, int bits) else return MiniFloatConverter::reduceMantissaToNbitsRounding(val,bits); } +int BsToMuMuGammaNTuplizer::calDIPhi(int iPhi1, int iPhi2) { + int dPhi = iPhi1 - iPhi2; + if (dPhi > 72 / 2) + dPhi -= 72; + else if (dPhi < -72 / 2) + dPhi += 72; + return dPhi; +} + +int BsToMuMuGammaNTuplizer::calDIEta(int iEta1, int iEta2) { + int dEta = iEta1 - iEta2; + if (iEta1 * iEta2 < 0) { //-ve to +ve transistion and no crystal at zero + if (dEta < 0) + dEta++; + else + dEta--; + } + return dEta; +} +float BsToMuMuGammaNTuplizer::getMinEnergyHCAL_(HcalDetId id) const { + if ( (id.subdetId() == HcalBarrel) ) { + if ( (Run2_2018_ == 1) ) + return 0.7; + else if ( (Run2_2018_ == 0) ) { //means Run3 + if (id.depth() == 1) + return 0.1; + else if (id.depth() == 2) + return 0.2; + else + return 0.3; + } + else //neither 2018 , nor Run3, not supported + return 9999.0; + } + + else if (id.subdetId() == HcalEndcap) { + if (id.depth() == 1) + return 0.1; + else + return 0.2; + } else + return 9999.0; +} //define this as a plug-in DEFINE_FWK_MODULE(BsToMuMuGammaNTuplizer); diff --git a/BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.h b/BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.h index f3b793f..621ecd1 100644 --- a/BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.h +++ b/BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.h @@ -31,6 +31,7 @@ #include "DataFormats/Common/interface/ValueMap.h" #include "DataFormats/Common/interface/View.h" #include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" #include "DataFormats/EgammaCandidates/interface/Conversion.h" #include "DataFormats/EgammaCandidates/interface/GsfElectron.h" #include "DataFormats/EgammaCandidates/interface/HIPhotonIsolation.h" @@ -52,8 +53,14 @@ #include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h" #include "FWCore/Common/interface/TriggerNames.h" - - +#include "Geometry/CaloTopology/interface/CaloTowerConstituentsMap.h" +#include "Geometry/CaloTopology/interface/CaloTopology.h" +#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" +#include "Geometry/Records/interface/CaloTopologyRecord.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "Geometry/CaloEventSetup/plugins/CaloTopologyBuilder.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" @@ -167,13 +174,20 @@ class BsToMuMuGammaNTuplizer : public edm::EDAnalyzer { void fillMuons (const edm::Event&, const edm::EventSetup&); void fillPhotons (const edm::Event&, const edm::EventSetup&); void fillPFPhotons (const edm::Event&, const edm::EventSetup&); - void fillSC (const edm::Event&, const edm::EventSetup&); + void fillSC (const edm::Event&, const edm::EventSetup&, reco::Vertex& pv); void fillHLT (edm::Event const& ); std::vector getShowerShapes(reco::CaloCluster* caloBC, const EcalRecHitCollection* recHits, const CaloTopology *topology); float reduceFloat(float val, int bits); - + static int calDIEta(int iEta1, int iEta2); + static int calDIPhi(int iPhi1, int iPhi2); + float getMinEnergyHCAL_(HcalDetId id) const; + + int maxDIEta_=5; + int maxDIPhi_=5; + // switches bool doGenParticles_; + bool doFlatPt_; bool doMuons_; bool doPhotons_; bool doPFPhotons_; @@ -182,26 +196,26 @@ class BsToMuMuGammaNTuplizer : public edm::EDAnalyzer { bool doHLT; bool doBsToMuMuGamma; bool doCompression_; - + bool Run2_2018_ ; // Now two options are supported, Run2_2018 and Run3 + // ----------member data --------------------------- edm::EDGetTokenT beamSpotToken_; edm::EDGetTokenT genParticlesCollection_; edm::EDGetTokenT> gedPhotonsCollection_; - edm::EDGetTokenT> pfPhotonsCollection_; + edm::EDGetTokenT> pfPhotonsCollection_; edm::EDGetTokenT> MustacheSCBarrelCollection_; edm::EDGetTokenT> MustacheSCEndcapCollection_; edm::EDGetTokenT gsfElectronToken_; edm::EDGetTokenT primaryVtxToken_; edm::EDGetTokenT triggerBits_; edm::EDGetTokenT> muonToken_; - - // edm::EDGetTokenT > caloPartToken_; + + edm::EDGetTokenT>> hbheRechitToken_; edm::EDGetTokenT>> ebRechitToken_; edm::EDGetTokenT>> eeRechitToken_; - //edm::EDGetTokenT ebRechitToken_; - // edm::EDGetTokenT eeRechitToken_; - // edm::EDGetTokenT > pfRecHitToken_; - // edm::EDGetTokenT > pfClusterToken_; + + // edm::ESHandle theCaloGeometry; + //edm::ESHandle towerMap_; // input tags //edm::InputTag genParticleSrc_; @@ -295,10 +309,24 @@ class BsToMuMuGammaNTuplizer : public edm::EDAnalyzer { // reco::GenParticle int gen_nBs_, gen_nBsMuonM_, gen_nBsMuonP_ , gen_nBsPhoton_ ; std::vector gen_Bs_pt_, gen_Bs_energy_, gen_Bs_eta_, gen_Bs_phi_, gen_Bs_pz_, gen_Bs_pdgId_; + std::vector gen_Bs_vx_, gen_Bs_vy_, gen_Bs_vz_; std::vector gen_BsMuonM_pt_, gen_BsMuonM_eta_, gen_BsMuonM_phi_; std::vector gen_BsMuonP_pt_, gen_BsMuonP_eta_, gen_BsMuonP_phi_; std::vector gen_BsPhoton_pt_, gen_BsPhoton_energy_, gen_BsPhoton_eta_, gen_BsPhoton_phi_; + Int_t nMC_; + std::vector mcPID_; + std::vector mcStatus_; + std::vector mcVtx_x_; + std::vector mcVtx_y_; + std::vector mcVtx_z_; + std::vector mcPt_; + std::vector mcEta_; + std::vector mcPhi_; + std::vector mcE_; + std::vector mcEt_; + std::vector mcMass_; + // ### mu+ mu- variables ### std::vector mumuPt_; @@ -557,6 +585,7 @@ class BsToMuMuGammaNTuplizer : public edm::EDAnalyzer { /* supercluster info */ int nSC_; std::vector scE_; + std::vector scEt_; std::vector scEta_; std::vector scPhi_; std::vector scX_; @@ -568,44 +597,68 @@ class BsToMuMuGammaNTuplizer : public edm::EDAnalyzer { std::vector scRawEt_; std::vector scMinDrWithGsfElectornSC_; std::vector< bool> scFoundGsfMatch_; - std::vector superCluster_e5x5_; - std::vector superCluster_e2x2Ratio_; - std::vector superCluster_e3x3Ratio_; - std::vector superCluster_eMaxRatio_; - std::vector superCluster_e2ndRatio_; - std::vector superCluster_eTopRatio_; - std::vector superCluster_eRightRatio_; - std::vector superCluster_eBottomRatio_; - std::vector superCluster_eLeftRatio_; - std::vector superCluster_e2x5MaxRatio_; - std::vector superCluster_e2x5TopRatio_; - std::vector superCluster_e2x5RightRatio_; - std::vector superCluster_e2x5BottomRatio_; - std::vector superCluster_e2x5LeftRatio_; - std::vector superCluster_swissCross_; - std::vector superCluster_r9_; - std::vector superCluster_sigmaIetaIeta_; - std::vector superCluster_sigmaIetaIphi_; - std::vector superCluster_sigmaIphiIphi_; - std::vector superCluster_full5x5_e5x5_; - std::vector superCluster_full5x5_e2x2Ratio_; - std::vector superCluster_full5x5_e3x3Ratio_; - std::vector superCluster_full5x5_eMaxRatio_; - std::vector superCluster_full5x5_e2ndRatio_; - std::vector superCluster_full5x5_eTopRatio_; - std::vector superCluster_full5x5_eRightRatio_; - std::vector superCluster_full5x5_eBottomRatio_; - std::vector superCluster_full5x5_eLeftRatio_; - std::vector superCluster_full5x5_e2x5MaxRatio_; - std::vector superCluster_full5x5_e2x5TopRatio_; - std::vector superCluster_full5x5_e2x5RightRatio_; - std::vector superCluster_full5x5_e2x5BottomRatio_; - std::vector superCluster_full5x5_e2x5LeftRatio_; - std::vector superCluster_full5x5_swissCross_; - std::vector superCluster_full5x5_r9_; - std::vector superCluster_full5x5_sigmaIetaIeta_; - std::vector superCluster_full5x5_sigmaIetaIphi_; - std::vector superCluster_full5x5_sigmaIphiIphi_; + std::vector scE5x5_; + std::vector scE2x2Ratio_; + std::vector scE3x3Ratio_; + std::vector scEMaxRatio_; + std::vector scE2ndRatio_; + std::vector scETopRatio_; + std::vector scERightRatio_; + std::vector scEBottomRatio_; + std::vector scELeftRatio_; + std::vector scE2x5MaxRatio_; + std::vector scE2x5TopRatio_; + std::vector scE2x5RightRatio_; + std::vector scE2x5BottomRatio_; + std::vector scE2x5LeftRatio_; + std::vector scSwissCross_; + std::vector scR9_; + std::vector scSigmaIetaIeta_; + std::vector scSigmaIetaIphi_; + std::vector scSigmaIphiIphi_; + std::vector scFull5x5_e5x5_; + std::vector scFull5x5_e2x2Ratio_; + std::vector scFull5x5_e3x3Ratio_; + std::vector scFull5x5_eMaxRatio_; + std::vector scFull5x5_e2ndRatio_; + std::vector scFull5x5_eTopRatio_; + std::vector scFull5x5_eRightRatio_; + std::vector scFull5x5_eBottomRatio_; + std::vector scFull5x5_eLeftRatio_; + std::vector scFull5x5_e2x5MaxRatio_; + std::vector scFull5x5_e2x5TopRatio_; + std::vector scFull5x5_e2x5RightRatio_; + std::vector scFull5x5_e2x5BottomRatio_; + std::vector scFull5x5_e2x5LeftRatio_; + std::vector scFull5x5_swissCross_; + std::vector scFull5x5_r9_; + std::vector scFull5x5_sigmaIetaIeta_; + std::vector scFull5x5_sigmaIetaIphi_; + std::vector scFull5x5_sigmaIphiIphi_; + + + int nhcalRechit_; + std::vector hcalRechitIEta_; + std::vector hcalRechitIPhi_; + std::vector hcalRechitEnergy_; + + std::vector scPFChIso1_; + std::vector scPFChIso2_; + std::vector scPFChIso3_; + std::vector scPFChIso4_; + std::vector scPFChIso5_; + + std::vector scPFPhoIso1_; + std::vector scPFPhoIso2_; + std::vector scPFPhoIso3_; + std::vector scPFPhoIso4_; + std::vector scPFPhoIso5_; + + std::vector scPFNeuIso1_; + std::vector scPFNeuIso2_; + std::vector scPFNeuIso3_; + std::vector scPFNeuIso4_; + std::vector scPFNeuIso5_; }; diff --git a/BsToMuMuGammaNTuplizer/plugins/BuildFile.xml b/BsToMuMuGammaNTuplizer/plugins/BuildFile.xml index 843041b..e950c58 100644 --- a/BsToMuMuGammaNTuplizer/plugins/BuildFile.xml +++ b/BsToMuMuGammaNTuplizer/plugins/BuildFile.xml @@ -48,4 +48,7 @@ + + + diff --git a/BsToMuMuGammaNTuplizer/plugins/pfIsoCalculator.cc b/BsToMuMuGammaNTuplizer/plugins/pfIsoCalculator.cc new file mode 100644 index 0000000..c0ab9a2 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/plugins/pfIsoCalculator.cc @@ -0,0 +1,198 @@ +#include "DataFormats/Math/interface/deltaPhi.h" + +#include "BsMMGAnalysis/BsToMuMuGammaNTuplizer/plugins/pfIsoCalculator.h" + +pfIsoCalculator::pfIsoCalculator(const edm::Event &iEvent, + const edm::EDGetTokenT > pfCandidates_, + const math::XYZPoint& pv) +{ + iEvent.getByToken(pfCandidates_, candidatesView); + + vtx_ = pv; +} + +// copied from https://github.com/cms-sw/cmssw/blob/master/RecoEgamma/PhotonIdentification/plugins/PhotonIDValueMapProducer.cc#L26 +template +bool pfIsoCalculator::isInFootprint(const T& footprint, + const edm::Ptr& candidate) +{ + for (auto& it : footprint) { + if (it.key() == candidate.key()) + return true; + } + return false; +} + +double pfIsoCalculator::getPfIso(const reco::Photon& photon, int pfId, + double r1, double r2, double threshold, + double jWidth, int footprintRemoval, const std::vector& particlesInIsoMap) +{ + double photonEta = photon.eta(); + double photonPhi = photon.phi(); + double totalEt = 0; + + if (footprintRemoval == pfIsoCalculator::removeSCenergy) { + totalEt -= (photon.superCluster()->rawEnergy() / std::cosh(photon.superCluster()->eta())); + } + + for (auto pf = candidatesView->begin(); pf != candidatesView->end(); ++pf) { + if ( pf->particleId() != pfId ) continue; + double pfEta = pf->eta(); + double pfPhi = pf->phi(); + + double dEta = std::abs(photonEta - pfEta); + double dPhi = reco::deltaPhi(pfPhi, photonPhi); + double dR2 = dEta*dEta + dPhi*dPhi; + double pfPt = pf->pt(); + + if (footprintRemoval == pfIsoCalculator::removePFcand) { + // remove the photon itself and associated PF candidates + if ( pf->superClusterRef() == photon.superCluster() ) { + continue; + } + edm::Ptr candPtr(candidatesView, pf - candidatesView->begin()); + if ( isInFootprint(particlesInIsoMap, candPtr) ) { + continue; + } + } + + if(pf->particleId() == reco::PFCandidate::h){ + float dz = std::abs(pf->vz() - vtx_.z()); + if (dz > 0.2) continue; + double dxy = ((vtx_.x() - pf->vx())*pf->py() + (pf->vy() - vtx_.y())*pf->px()) / pf->pt(); + if (std::abs(dxy) > 0.1) continue; + } + + // Jurassic Cone ///// + if (dR2 > r1 *r1) continue; + if (dR2 < r2 * r2) continue; + if (std::abs(dEta) < jWidth) continue; + if (pfPt < threshold) continue; + totalEt += pfPt; + } + + return totalEt; +} + +double pfIsoCalculator::getPfIsoSubUE(const reco::Photon& photon, int pfId, + double r1, double r2, double threshold, + double jWidth, int footprintRemoval, const std::vector& particlesInIsoMap, bool excludeCone) +{ + double photonEta = photon.eta(); + double photonPhi = photon.phi(); + double totalEt = 0; + + if (footprintRemoval == pfIsoCalculator::removeSCenergy) { + totalEt -= (photon.superCluster()->rawEnergy() / std::cosh(photon.superCluster()->eta())); + } + + for (auto pf = candidatesView->begin(); pf != candidatesView->end(); ++pf) { + if ( pf->particleId() != pfId ) continue; + double pfEta = pf->eta(); + double pfPhi = pf->phi(); + + double dEta = std::abs(photonEta - pfEta); + if (dEta > r1) continue; + if (dEta < jWidth) continue; + + if (footprintRemoval == pfIsoCalculator::removePFcand) { + // remove the photon itself and associated PF candidates + if ( pf->superClusterRef() == photon.superCluster() ) { + continue; + } + edm::Ptr candPtr(candidatesView, pf - candidatesView->begin()); + if ( isInFootprint(particlesInIsoMap, candPtr) ) { + continue; + } + } + + if(pf->particleId() == reco::PFCandidate::h){ + float dz = std::abs(pf->vz() - vtx_.z()); + if (dz > 0.2) continue; + double dxy = ((vtx_.x() - pf->vx())*pf->py() + (pf->vy() - vtx_.y())*pf->px()) / pf->pt(); + if (std::abs(dxy) > 0.1) continue; + } + + double dPhi = reco::deltaPhi(pfPhi, photonPhi); + double dR2 = dEta*dEta + dPhi*dPhi; + double pfPt = pf->pt(); + + // Jurassic Cone ///// + if (dR2 < r2 * r2) continue; + if (pfPt < threshold) continue; + totalEt += pfPt; + } + + double areaStrip = 4*M_PI*(r1-jWidth); // strip area over which UE is estimated + double areaCone = M_PI*r1*r1; // area inside which isolation is to be applied + if (jWidth > 0) { + // calculate overlap area between disk with radius r2 and rectangle of width jwidth + double angTmp = std::acos(jWidth / r1); + double lenTmp = std::sqrt(r1*r1 - jWidth*jWidth) * 2; + double areaTwoTriangles = lenTmp * jWidth; + double areaTwoArcs = (M_PI - 2*angTmp) * r1 * r1; + areaCone -= (areaTwoTriangles + areaTwoArcs); + } + + double areaInnerCone = 0; + if (r2 > jWidth) { + areaInnerCone = M_PI*r2*r2; + if (jWidth > 0) { + double angTmp = std::acos(jWidth / r2); + double lenTmp = std::sqrt(r2*r2 - jWidth*jWidth) * 2; + double areaTwoTriangles = lenTmp * jWidth; + double areaTwoArcs = (M_PI - 2*angTmp) * r2 * r2; + areaInnerCone -= (areaTwoTriangles + areaTwoArcs); + } + } + areaStrip -= areaInnerCone; + areaCone -= areaInnerCone; + + double coneEt = getPfIso(photon, pfId, r1, r2, threshold, jWidth, footprintRemoval, particlesInIsoMap); + double ueEt = totalEt; + double ueArea = areaStrip; + if (excludeCone) { + ueEt = totalEt - coneEt; + ueArea = areaStrip - areaCone; + } + + return coneEt - ueEt * (areaCone / ueArea); +} + +double pfIsoCalculator::getPfIso(const reco::SuperCluster& sc, int pfId, + double r1, double r2, double threshold) +{ + double scEta = sc.eta(); + double scPhi = sc.phi(); + double totalEt = 0.; + + //totalEt -= (sc.rawEnergy() / std::cosh(sc.eta())); + + for (auto pf = candidatesView->begin(); pf != candidatesView->end(); ++pf) { + if ( pf->particleId() != pfId ) continue; + double pfEta = pf->eta(); + double pfPhi = pf->phi(); + + double dEta = std::abs(scEta - pfEta); + double dPhi = reco::deltaPhi(pfPhi, scPhi); + double dR2 = dEta*dEta + dPhi*dPhi; + double pfPt = pf->pt(); + + + if (pf->particleId() == reco::PFCandidate::h) { + float dz = std::abs(pf->vz() - vtx_.z()); + if (dz > 0.2) continue; + double dxy = ((vtx_.x() - pf->vx())*pf->py() + (pf->vy() - vtx_.y())*pf->px()) / pf->pt(); + if (std::abs(dxy) > 0.1) continue; + } + + // inside the cone size + if (dR2 > r1 * r1) continue; + if (dR2 < r2 * r2) continue; + if (pfPt < threshold) continue; + totalEt += pfPt; + + } + + return totalEt; +} diff --git a/BsToMuMuGammaNTuplizer/plugins/pfIsoCalculator.h b/BsToMuMuGammaNTuplizer/plugins/pfIsoCalculator.h new file mode 100644 index 0000000..bc58624 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/plugins/pfIsoCalculator.h @@ -0,0 +1,37 @@ +#ifndef pfIsoCalculator_h +#define pfIsoCalculator_h + +#include "DataFormats/EgammaCandidates/interface/Photon.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Utilities/interface/EDGetToken.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" + +class pfIsoCalculator +{ + public: + pfIsoCalculator(const edm::Event &iEvent, const edm::EDGetTokenT > pfCandidates, const math::XYZPoint& pv); + + template + bool isInFootprint(const T& footprint, const edm::Ptr& candidate); + + double getPfIso(const reco::Photon& photon, int pfId, double r1=0.4, double r2=0.00, double threshold=0, double jWidth=0.0, int footprintRemoval = 0, const std::vector& particlesInIsoMap = {}); + double getPfIsoSubUE(const reco::Photon& photon, int pfId, double r1=0.4, double r2=0.00, double threshold=0, double jWidth=0.0, int footprintRemoval = 0, const std::vector& particlesInIsoMap = {}, bool excludeCone = false); + double getPfIso(const reco::SuperCluster& sc, int pfId, double r1=0.4, double r2=0.00, double threshold=0); + + enum footprintOptions { + noRemoval=0, + removePFcand, // remove PF candidates in the isolation map + removeSCenergy, // remove SC raw transverse energy + }; + + private: + edm::Handle > candidatesView; + reco::Vertex::Point vtx_; +}; + +#endif diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_DoublePi0_DIGIRAW.py b/BsToMuMuGammaNTuplizer/test/crabConfig_DoublePi0_DIGIRAW.py new file mode 100644 index 0000000..fb48418 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_DoublePi0_DIGIRAW.py @@ -0,0 +1,25 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'DoublePi0FlatPt1To20_DIGIRAW_Run2018_correctEta' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'DIGIToRaw_noPU2018_cfg.py' +#config.Data.outputPrimaryDataset = 'SinglePhotonFlatPt1To20_DIGIRAW_Run2018' +config.Data.inputDBS = 'phys03' +config.JobType.allowUndistributedCMSSW = True +#config.JobType.numCores = 8 +config.Data.inputDataset ='/DoublePi0FlatPt1To20_GENSIM_Run2018_correctEta/rchudasa-crab_DoublePi0FlatPt1To20_GENSIM_Run2018_correctEta-fd99b7ab52e8e7d9d9b1e36213873f36/USER' + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_cep/ntuples' +config.Data.outLFNDirBase = '/store/user/rchudasa/BsMMG_2018UL' +config.Data.publication = True +config.Site.storageSite = 'T2_IN_TIFR' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_emptyBx.py b/BsToMuMuGammaNTuplizer/test/crabConfig_emptyBx.py new file mode 100644 index 0000000..f69dc57 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_emptyBx.py @@ -0,0 +1,30 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_EmptyBX_onlySCInfo' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +config.JobType.allowUndistributedCMSSW = True + + +config.Data.inputDataset ='/EmptyBX/Run2018D-PromptReco-v2/AOD' +#config.Data.lumiMask = "/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions18/HI/PromptReco/Cert_326381-327564_HI_PromptReco_Collisions18_JSON.txt" +#config.Data.lumiMask = "/afs/cern.ch/work/r/rchudasa/private/hiforest_1034/CMSSW_10_3_4/src/HeavyIonsAnalysis/PhotonAnalysis/test/crab_projects/crab_ntuples_data/results/notFinishedLumis.json" #with seed info run on 13 Apr 2021 and unfinished jobs on 15th Apr 2021 +#config.Data.lumiMask = "/afs/cern.ch/work/j/jniedzie/private/lbl_ntuplizer/CMSSW_10_3_4/src/HeavyIonsAnalysis/PhotonAnalysis/test/crab_projects/crab_ntuples_data_lbl/results/notFinishedLumis.json" +config.Data.splitting = 'FileBased' +#config.Data.runRange = '326381-327564' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/HIForward_Reco/ntuples/ntuples_data/' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco/' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_EmptyBX_onlySCInfo' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_flatElectron.py b/BsToMuMuGammaNTuplizer/test/crabConfig_flatElectron.py new file mode 100644 index 0000000..da1a77e --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_flatElectron.py @@ -0,0 +1,27 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_flatElectron_pfIso' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +config.Data.inputDBS = 'phys03' +config.Data.inputDataset ='/DoubleElectronFlatPt1To20_GENSIM_Run2018/rchudasa-crab_DoubleElectronFlatPt1To20_RecoAOD_Run2018-648c701074ba72c4e16eb15dae8f7a8f/USER' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_flatElectron_pfIso' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_flatPhoton.py b/BsToMuMuGammaNTuplizer/test/crabConfig_flatPhoton.py new file mode 100644 index 0000000..53307a6 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_flatPhoton.py @@ -0,0 +1,27 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_flatPhoton_genInfo' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +config.Data.inputDBS = 'phys03' +config.Data.inputDataset ='/SinglePhotonFlatPt1To20_GENSIM_Run2018/rchudasa-crab_SinglePhotonFlatPt1To20_default_RecoAOD_Run2018-648c701074ba72c4e16eb15dae8f7a8f/USER' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_flatPhoton_genInfo' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_flatPi0.py b/BsToMuMuGammaNTuplizer/test/crabConfig_flatPi0.py new file mode 100644 index 0000000..c540af2 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_flatPi0.py @@ -0,0 +1,27 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_flatPi0_pfIso' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +config.Data.inputDBS = 'phys03' +config.Data.inputDataset ='/DoublePi0FlatPt1To20_GENSIM_Run2018_correctEta/rchudasa-crab_DoublePi0FlatPt1To20_RecoAOD_Run2018_correctEta-648c701074ba72c4e16eb15dae8f7a8f/USER' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_flatPi0_pfIso' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_120to170.py b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_120to170.py new file mode 100644 index 0000000..c390cb5 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_120to170.py @@ -0,0 +1,28 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_QCDEmEnriched_Pt120to170' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +#config.Data.inputDBS = 'phys03' +config.Data.inputDBS = 'global' +config.Data.inputDataset ='/QCD_Pt-120to170_EMEnriched_TuneCP5_13TeV_pythia8/RunIISummer19UL18RECO-106X_upgrade2018_realistic_v11_L1v1-v2/AODSIM' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_QCDEmEnriched_Pt120to170' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_15to20.py b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_15to20.py new file mode 100644 index 0000000..dcd9ded --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_15to20.py @@ -0,0 +1,28 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_QCDPt15to20' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +#config.Data.inputDBS = 'phys03' +config.Data.inputDBS = 'global' +config.Data.inputDataset ='/QCD_Pt-15to20_EMEnriched_TuneCP5_13TeV_pythia8/RunIISummer19UL18RECO-106X_upgrade2018_realistic_v11_L1v1-v1/AODSIM' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_QCDPt15to20' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_170to300.py b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_170to300.py new file mode 100644 index 0000000..fb69bf6 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_170to300.py @@ -0,0 +1,28 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_QCDEmEnriched_Pt170to300' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +#config.Data.inputDBS = 'phys03' +config.Data.inputDBS = 'global' +config.Data.inputDataset ='/QCD_Pt-170to300_EMEnriched_TuneCP5_13TeV_pythia8/RunIISummer19UL18RECO-106X_upgrade2018_realistic_v11_L1v1-v2/AODSIM' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_QCDEmEnriched_Pt170to300' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_20to30.py b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_20to30.py new file mode 100644 index 0000000..c7422bc --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_20to30.py @@ -0,0 +1,28 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_QCDEmEnriched_Pt20to30' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +#config.Data.inputDBS = 'phys03' +config.Data.inputDBS = 'global' +config.Data.inputDataset ='/QCD_Pt-20to30_EMEnriched_TuneCP5_13TeV_pythia8/RunIISummer19UL18RECO-106X_upgrade2018_realistic_v11_L1v1-v1/AODSIM' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_QCDEmEnriched_Pt20to30' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_30to50.py b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_30to50.py new file mode 100644 index 0000000..a95a6da --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_30to50.py @@ -0,0 +1,28 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_QCDEmEnriched_Pt30to50' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +#config.Data.inputDBS = 'phys03' +config.Data.inputDBS = 'global' +config.Data.inputDataset ='/QCD_Pt-30to50_EMEnriched_TuneCP5_13TeV_pythia8/RunIISummer19UL18RECO-106X_upgrade2018_realistic_v11_L1v1-v2/AODSIM' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_QCDEmEnriched_Pt30to50' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_50to80.py b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_50to80.py new file mode 100644 index 0000000..63facf4 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_50to80.py @@ -0,0 +1,28 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_QCDEmEnriched_Pt50to80' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +#config.Data.inputDBS = 'phys03' +config.Data.inputDBS = 'global' +config.Data.inputDataset ='/QCD_Pt-50to80_EMEnriched_TuneCP5_13TeV_pythia8/RunIISummer19UL18RECO-106X_upgrade2018_realistic_v11_L1v1-v2/AODSIM' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_QCDEmEnriched_Pt50to80' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_80to120.py b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_80to120.py new file mode 100644 index 0000000..b899df7 --- /dev/null +++ b/BsToMuMuGammaNTuplizer/test/crabConfig_qcdEmEnriched_80to120.py @@ -0,0 +1,28 @@ +from CRABClient.UserUtilities import config +config = config() + +#config.section_('General') +config.General.requestName = 'ntuples_defaultReco_QCDEmEnriched_Pt80to120' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +#config.section_('JobType') +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ntuplize_AOD.py' +config.JobType.maxMemoryMB = 4000 +#config.Data.inputDBS = 'phys03' +config.Data.inputDBS = 'global' +config.Data.inputDataset ='/QCD_Pt-80to120_EMEnriched_TuneCP5_13TeV_pythia8/RunIISummer19UL18RECO-106X_upgrade2018_realistic_v11_L1v1-v2/AODSIM' + +config.JobType.allowUndistributedCMSSW = True + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 + +#config.Data.outLFNDirBase = '/store/group/phys_diffraction/lbyl_2018/mc_lbl/ntuples' +config.Data.outLFNDirBase = '/store/group/phys_heavyions/rchudasa/lowPT_photonReco' +config.Data.allowNonValidInputDataset = True +config.Data.publication = False +config.Data.outputDatasetTag = 'ntuples_defaultReco_QCDEmEnriched_Pt80to120' +config.Site.storageSite = 'T2_CH_CERN' diff --git a/BsToMuMuGammaNTuplizer/test/ntuplize_AOD.py b/BsToMuMuGammaNTuplizer/test/ntuplize_AOD.py index b0b47c7..c25038c 100644 --- a/BsToMuMuGammaNTuplizer/test/ntuplize_AOD.py +++ b/BsToMuMuGammaNTuplizer/test/ntuplize_AOD.py @@ -6,14 +6,27 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -#process.GlobalTag.globaltag = cms.string('106X_upgrade2018_realistic_v15_L1v1') -process.GlobalTag.globaltag = cms.string('102X_upgrade2018_realistic_v15') -process.MessageLogger.cerr.FwkReport.reportEvery = 1 +process.load("Geometry.CaloEventSetup.CaloTopology_cfi"); +process.load("Geometry.CaloEventSetup.CaloGeometry_cfi"); +process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi"); +process.load("Configuration.Geometry.GeometryECALHCAL_cff") +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('PhysicsTools.HepMCCandAlgos.genParticles_cfi') +process.load("Geometry.HcalEventSetup.CaloTowerTopology_cfi") +process.load("Configuration.Geometry.GeometryExtended2017_cff") +process.load("Configuration.Geometry.GeometryExtended2017Reco_cff") +process.load("RecoJets.Configuration.CaloTowersES_cfi") +process.load("Geometry.HcalEventSetup.hcalTopologyIdeal_cfi") + +process.GlobalTag.globaltag = cms.string('106X_upgrade2018_realistic_v15_L1v1') +#process.GlobalTag.globaltag = cms.string('102X_upgrade2018_realistic_v15') + +process.MessageLogger.cerr.FwkReport.reportEvery = 500 #process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(20) ) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) -#process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(200) ) +#process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10000) ) process.options = cms.untracked.PSet( numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1), numberOfConcurrentRuns = cms.untracked.uint32(1), @@ -34,11 +47,21 @@ #'file:/eos/user/a/athachay/workarea/data/BsToMuMuGamma/RunIIAutumn18DRPremix/BsToMuMuGamma_BMuonFilter_SoftQCDnonD_TuneCP5_13TeV-evtgen-pythia8/AODSIM/102X_upgrade2018_realistic_v15-v1/606765BD-9BB4-9741-925C-A0C69B933039.root', # 'file:/afs/cern.ch/work/a/athachay/public/BsToMuMuGamma/RunIIAutumn18DRPremix/BsToMuMuGamma_BMuonFilter_SoftQCDnonD_TuneCP5_13TeV-evtgen-pythia8/AODSIM/102X_upgrade2018_realistic_v15-v1/606765BD-9BB4-9741-925C-A0C69B933039.root', #'file:DoublePhotonGun/DoublePhoton0To40FlatPtAODSIM_HI_Reco_1.root', - 'file:/afs/cern.ch/work/r/rchudasa/private/bsmumu/Run2_analysis/CMSSW_10_6_20/src/BsMMGAnalysis/PhotonAnalyzer/test/AEFD418A-0A8D-414C-A8AC-86EE20287BDF.root' - ) + #'file:/afs/cern.ch/work/r/rchudasa/private/bsmumu/Run2_analysis/CMSSW_10_6_20/src/BsMMGAnalysis/PhotonAnalyzer/test/AEFD418A-0A8D-414C-A8AC-86EE20287BDF.root' + 'file:/eos/cms/store/group/phys_heavyions/rchudasa/lowPT_photonReco/SinglePhotonFlatPt1To20_GENSIM_Run2018/crab_SinglePhotonFlatPt1To20_default_RecoAOD_Run2018/210504_050451/0000/AODSIM_3.root' + #'root://se01.indiacms.res.in//store/user/rchudasa/BsMMG_2018UL/DoubleElectronFlatPt1To20_GENSIM_Run2018/crab_DoubleElectronFlatPt1To20_RecoAOD_Run2018/210816_180704/0000/AODSIM_1.root' + #'file:EmptyBx_pp_2018_0B87F849-1E7B-A54C-AE8D-17C6D4549317.root' + #'file:/afs/cern.ch/work/r/rchudasa/private/bsmumu/Run2_analysis/CMSSW_10_6_20/src/mcProduction/AODSIM_pion.root' + #'/store/group/phys_heavyions/rchudasa/lowPT_photonReco/DoublePi0FlatPt1To20_GENSIM_Run2018_correctEta/crab_DoublePi0FlatPt1To20_RecoAOD_Run2018_correctEta/210908_093218/0000/AODSIM_pion_1.root' + ) ) process.TFileService = cms.Service("TFileService", - fileName = cms.string("muonNtuplizer.root") + #fileName = cms.string("muonNtuplizer.root") + #fileName = cms.string("flatPtPhoton_ntuple_pfIso.root") + #fileName = cms.string("flatPtElectron_ntuple_pfIso.root") + #fileName = cms.string("flatPtPi0_ntuple_pfIso.root") + #fileName = cms.string("emptyBX_ntuple_pfIso.root") + fileName = cms.string("qcd_EmEnriched_ntuples.root") ) @@ -72,13 +95,15 @@ dimuon_maxLStoBS = cms.untracked.double(1e5), dimuon_maxDCAMuMu = cms.untracked.double(1e5), dimuon_maxCosAlphaToBS = cms.untracked.double(1e5), - doHLT = cms.bool(True), + doHLT = cms.bool(False), doGenParticles = cms.bool(True), - doMuons = cms.bool(True), + doFlatPt = cms.bool(True), + doMuons = cms.bool(False), doPhotons = cms.bool(True), doPFPhotons = cms.bool(True), - PFPhoton_minPt = cms.untracked.double(2.0), + PFPhoton_minPt = cms.untracked.double(0.0), doSuperClusters = cms.bool(True), + Run2_2018 = cms.bool(True), genParticles = cms.InputTag("genParticles"), gedPhotonSrc = cms.untracked.InputTag("gedPhotons"), pfPhotonSrc = cms.untracked.InputTag("particleFlow"), @@ -89,16 +114,18 @@ "HLT_DoubleMu4_Mass3p8_DZ_PFHT350_v8"), HLTResult = cms.InputTag("TriggerResults","","HLT"), verbose = cms.bool(False), - doBsToMuMuGamma = cms.bool(True), + doBsToMuMuGamma = cms.bool(False), isMC = cms.bool(True), #caloParticleCollection = cms.InputTag("mix","MergedCaloTruth"), + hbheRechitCollection = cms.InputTag("reducedHcalRecHits","hbhereco","RECO"), ebRechitCollection = cms.InputTag("reducedEcalRecHitsEB","","RECO"), eeRechitCollection = cms.InputTag("reducedEcalRecHitsEE","","RECO"), pfRechitCollection = cms.InputTag("particleFlowRecHitECAL","","RECO"), - #pfClusterCollection = cms.InputTag("particleFlowClusterECAL","","RECO"), + #pfClusterCollection = cms.InputTag("particleFlowClusterECAL","","RECO"), doCompression = cms.bool(True), #do the compression of floats nBits = cms.int32(23), #nbits for float compression (<=23) ) -process.p = cms.Path(process.decayfilter*process.Ntuples) +#process.p = cms.Path(process.decayfilter*process.Ntuples) +process.p = cms.Path(process.Ntuples) diff --git a/PhotonAnalyzer/python/__init__.pyc b/PhotonAnalyzer/python/__init__.pyc index 3495209..c3a3175 100644 Binary files a/PhotonAnalyzer/python/__init__.pyc and b/PhotonAnalyzer/python/__init__.pyc differ diff --git a/PhotonAnalyzer/test/runAODPhotonAnalyzerBsMMG.py b/PhotonAnalyzer/test/runAODPhotonAnalyzerBsMMG.py new file mode 100644 index 0000000..c8daa25 --- /dev/null +++ b/PhotonAnalyzer/test/runAODPhotonAnalyzerBsMMG.py @@ -0,0 +1,31 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process('Demo') + +process.load('FWCore.MessageService.MessageLogger_cfi') +process.MessageLogger.cerr.FwkReport.reportEvery = 500 + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100000) ) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + 'file:/afs/cern.ch/work/r/rchudasa/private/bsmumu/Run2_analysis/CMSSW_10_6_20/src/BsMMGAnalysis/PhotonAnalyzer/test/AEFD418A-0A8D-414C-A8AC-86EE20287BDF.root' + ) +) +process.TFileService = cms.Service("TFileService", + fileName = cms.string("photon_BsToMuMuGamma_Run2018_default_reco.root")) + + +process.demo = cms.EDAnalyzer("PhotonAnalyzer", + doGenParticles = cms.bool(True), + doPhotons = cms.bool(True), + doPFPhotons = cms.bool(True), + doSuperClusters = cms.bool(True), + genParticleSrc = cms.untracked.InputTag("genParticles"), + gedPhotonSrc = cms.untracked.InputTag("gedPhotons"), + pfPhotonSrc = cms.untracked.InputTag("particleFlow"), + MustacheSCBarrelSrc= cms.InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALBarrel"), + MustacheSCEndcapSrc= cms.InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALEndcapWithPreshower") +) + +process.p = cms.Path(process.demo)