Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
556 changes: 374 additions & 182 deletions BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.cc

Large diffs are not rendered by default.

153 changes: 103 additions & 50 deletions BsToMuMuGammaNTuplizer/plugins/BsToMuMuGammaNTuplizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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<float> 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_;
Expand All @@ -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<reco::BeamSpot> beamSpotToken_;
edm::EDGetTokenT<reco::GenParticleCollection> genParticlesCollection_;
edm::EDGetTokenT<std::vector<reco::Photon>> gedPhotonsCollection_;
edm::EDGetTokenT<std::vector<reco::PFCandidate>> pfPhotonsCollection_;
edm::EDGetTokenT<edm::View<reco::PFCandidate>> pfPhotonsCollection_;
edm::EDGetTokenT<std::vector<reco::SuperCluster>> MustacheSCBarrelCollection_;
edm::EDGetTokenT<std::vector<reco::SuperCluster>> MustacheSCEndcapCollection_;
edm::EDGetTokenT<reco::GsfElectronCollection> gsfElectronToken_;
edm::EDGetTokenT<reco::VertexCollection> primaryVtxToken_;
edm::EDGetTokenT<edm::TriggerResults> triggerBits_;
edm::EDGetTokenT<std::vector<reco::Muon>> muonToken_;

// edm::EDGetTokenT<std::vector<CaloParticle> > caloPartToken_;
edm::EDGetTokenT<edm::SortedCollection<HBHERecHit,edm::StrictWeakOrdering<HBHERecHit>>> hbheRechitToken_;
edm::EDGetTokenT<edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit>>> ebRechitToken_;
edm::EDGetTokenT<edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit>>> eeRechitToken_;
//edm::EDGetTokenT<EcalRecHitCollection> ebRechitToken_;
// edm::EDGetTokenT<EcalRecHitCollection> eeRechitToken_;
// edm::EDGetTokenT<std::vector<reco::PFRecHit> > pfRecHitToken_;
// edm::EDGetTokenT<std::vector<reco::PFCluster> > pfClusterToken_;

// edm::ESHandle<CaloGeometry> theCaloGeometry;
//edm::ESHandle<CaloTowerConstituentsMap> towerMap_;

// input tags
//edm::InputTag genParticleSrc_;
Expand Down Expand Up @@ -295,10 +309,24 @@ class BsToMuMuGammaNTuplizer : public edm::EDAnalyzer {
// reco::GenParticle
int gen_nBs_, gen_nBsMuonM_, gen_nBsMuonP_ , gen_nBsPhoton_ ;
std::vector<double> gen_Bs_pt_, gen_Bs_energy_, gen_Bs_eta_, gen_Bs_phi_, gen_Bs_pz_, gen_Bs_pdgId_;
std::vector<double> gen_Bs_vx_, gen_Bs_vy_, gen_Bs_vz_;
std::vector<double> gen_BsMuonM_pt_, gen_BsMuonM_eta_, gen_BsMuonM_phi_;
std::vector<double> gen_BsMuonP_pt_, gen_BsMuonP_eta_, gen_BsMuonP_phi_;
std::vector<double> gen_BsPhoton_pt_, gen_BsPhoton_energy_, gen_BsPhoton_eta_, gen_BsPhoton_phi_;

Int_t nMC_;
std::vector<int> mcPID_;
std::vector<int> mcStatus_;
std::vector<float> mcVtx_x_;
std::vector<float> mcVtx_y_;
std::vector<float> mcVtx_z_;
std::vector<float> mcPt_;
std::vector<float> mcEta_;
std::vector<float> mcPhi_;
std::vector<float> mcE_;
std::vector<float> mcEt_;
std::vector<float> mcMass_;


// ### mu+ mu- variables ###
std::vector<double> mumuPt_;
Expand Down Expand Up @@ -557,6 +585,7 @@ class BsToMuMuGammaNTuplizer : public edm::EDAnalyzer {
/* supercluster info */
int nSC_;
std::vector<float> scE_;
std::vector<float> scEt_;
std::vector<float> scEta_;
std::vector<float> scPhi_;
std::vector<float> scX_;
Expand All @@ -568,44 +597,68 @@ class BsToMuMuGammaNTuplizer : public edm::EDAnalyzer {
std::vector<float> scRawEt_;
std::vector<float> scMinDrWithGsfElectornSC_;
std::vector< bool> scFoundGsfMatch_;
std::vector<float> superCluster_e5x5_;
std::vector<float> superCluster_e2x2Ratio_;
std::vector<float> superCluster_e3x3Ratio_;
std::vector<float> superCluster_eMaxRatio_;
std::vector<float> superCluster_e2ndRatio_;
std::vector<float> superCluster_eTopRatio_;
std::vector<float> superCluster_eRightRatio_;
std::vector<float> superCluster_eBottomRatio_;
std::vector<float> superCluster_eLeftRatio_;
std::vector<float> superCluster_e2x5MaxRatio_;
std::vector<float> superCluster_e2x5TopRatio_;
std::vector<float> superCluster_e2x5RightRatio_;
std::vector<float> superCluster_e2x5BottomRatio_;
std::vector<float> superCluster_e2x5LeftRatio_;
std::vector<float> superCluster_swissCross_;
std::vector<float> superCluster_r9_;
std::vector<float> superCluster_sigmaIetaIeta_;
std::vector<float> superCluster_sigmaIetaIphi_;
std::vector<float> superCluster_sigmaIphiIphi_;
std::vector<float> superCluster_full5x5_e5x5_;
std::vector<float> superCluster_full5x5_e2x2Ratio_;
std::vector<float> superCluster_full5x5_e3x3Ratio_;
std::vector<float> superCluster_full5x5_eMaxRatio_;
std::vector<float> superCluster_full5x5_e2ndRatio_;
std::vector<float> superCluster_full5x5_eTopRatio_;
std::vector<float> superCluster_full5x5_eRightRatio_;
std::vector<float> superCluster_full5x5_eBottomRatio_;
std::vector<float> superCluster_full5x5_eLeftRatio_;
std::vector<float> superCluster_full5x5_e2x5MaxRatio_;
std::vector<float> superCluster_full5x5_e2x5TopRatio_;
std::vector<float> superCluster_full5x5_e2x5RightRatio_;
std::vector<float> superCluster_full5x5_e2x5BottomRatio_;
std::vector<float> superCluster_full5x5_e2x5LeftRatio_;
std::vector<float> superCluster_full5x5_swissCross_;
std::vector<float> superCluster_full5x5_r9_;
std::vector<float> superCluster_full5x5_sigmaIetaIeta_;
std::vector<float> superCluster_full5x5_sigmaIetaIphi_;
std::vector<float> superCluster_full5x5_sigmaIphiIphi_;
std::vector<float> scE5x5_;
std::vector<float> scE2x2Ratio_;
std::vector<float> scE3x3Ratio_;
std::vector<float> scEMaxRatio_;
std::vector<float> scE2ndRatio_;
std::vector<float> scETopRatio_;
std::vector<float> scERightRatio_;
std::vector<float> scEBottomRatio_;
std::vector<float> scELeftRatio_;
std::vector<float> scE2x5MaxRatio_;
std::vector<float> scE2x5TopRatio_;
std::vector<float> scE2x5RightRatio_;
std::vector<float> scE2x5BottomRatio_;
std::vector<float> scE2x5LeftRatio_;
std::vector<float> scSwissCross_;
std::vector<float> scR9_;
std::vector<float> scSigmaIetaIeta_;
std::vector<float> scSigmaIetaIphi_;
std::vector<float> scSigmaIphiIphi_;
std::vector<float> scFull5x5_e5x5_;
std::vector<float> scFull5x5_e2x2Ratio_;
std::vector<float> scFull5x5_e3x3Ratio_;
std::vector<float> scFull5x5_eMaxRatio_;
std::vector<float> scFull5x5_e2ndRatio_;
std::vector<float> scFull5x5_eTopRatio_;
std::vector<float> scFull5x5_eRightRatio_;
std::vector<float> scFull5x5_eBottomRatio_;
std::vector<float> scFull5x5_eLeftRatio_;
std::vector<float> scFull5x5_e2x5MaxRatio_;
std::vector<float> scFull5x5_e2x5TopRatio_;
std::vector<float> scFull5x5_e2x5RightRatio_;
std::vector<float> scFull5x5_e2x5BottomRatio_;
std::vector<float> scFull5x5_e2x5LeftRatio_;
std::vector<float> scFull5x5_swissCross_;
std::vector<float> scFull5x5_r9_;
std::vector<float> scFull5x5_sigmaIetaIeta_;
std::vector<float> scFull5x5_sigmaIetaIphi_;
std::vector<float> scFull5x5_sigmaIphiIphi_;


int nhcalRechit_;
std::vector<float> hcalRechitIEta_;
std::vector<float> hcalRechitIPhi_;
std::vector<float> hcalRechitEnergy_;

std::vector<float> scPFChIso1_;
std::vector<float> scPFChIso2_;
std::vector<float> scPFChIso3_;
std::vector<float> scPFChIso4_;
std::vector<float> scPFChIso5_;

std::vector<float> scPFPhoIso1_;
std::vector<float> scPFPhoIso2_;
std::vector<float> scPFPhoIso3_;
std::vector<float> scPFPhoIso4_;
std::vector<float> scPFPhoIso5_;

std::vector<float> scPFNeuIso1_;
std::vector<float> scPFNeuIso2_;
std::vector<float> scPFNeuIso3_;
std::vector<float> scPFNeuIso4_;
std::vector<float> scPFNeuIso5_;

};

Expand Down
3 changes: 3 additions & 0 deletions BsToMuMuGammaNTuplizer/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@
<use name="roofit"/>
<use name="roofitcore"/>
<use name="boost_python"/>
<use name="DataFormats/CaloRecHit"/>
<use name="DataFormats/EcalRecHit"/>
<use name="DataFormats/DetId"/>
<flags EDM_PLUGIN="1"/>
Loading