Skip to content

Commit

Permalink
Merge pull request #22456 from parbol/DQMMuonDCSFLAG
Browse files Browse the repository at this point in the history
Addition of histograms to the Muon DQM
  • Loading branch information
cmsbuild committed Mar 26, 2018
2 parents 8dd78b7 + 0181e73 commit af82bc6
Show file tree
Hide file tree
Showing 11 changed files with 395 additions and 61 deletions.
1 change: 1 addition & 0 deletions DQMOffline/Configuration/python/DQMOfflineHeavyIons_cff.py
Expand Up @@ -94,6 +94,7 @@
pvMonitor.vertexLabel = cms.InputTag("hiSelectedVertex")



DQMOfflineHeavyIonsPrePOG = cms.Sequence( muonMonitors
* TrackMonDQMTier0_hi
* jetMETDQMOfflineSource
Expand Down
3 changes: 3 additions & 0 deletions DQMOffline/Configuration/python/DQMOffline_cff.py
Expand Up @@ -151,6 +151,9 @@
)
DQMOfflineLumi = cms.Sequence ( zcounting )

muonRecoAnalyzer.doMVA = cms.bool( True )
muonRecoAnalyzer_miniAOD.doMVA = cms.bool( True )

DQMOfflineMuon = cms.Sequence( dtSources *
rpcTier0Source *
cscSources *
Expand Down
4 changes: 4 additions & 0 deletions DQMOffline/Muon/interface/DiMuonHistograms.h
Expand Up @@ -83,6 +83,10 @@ class DiMuonHistograms : public DQMEDAnalyzer {
std::vector<MonitorElement*> MediumMediumMuon;
std::vector<MonitorElement*> TightTightMuon;
std::vector<MonitorElement*> SoftSoftMuon;
std::vector<MonitorElement*> LooseLooseMuonBadFrac;
std::vector<MonitorElement*> MediumMediumMuonBadFrac;
std::vector<MonitorElement*> TightTightMuonBadFrac;
std::vector<MonitorElement*> SoftSoftMuonBadFrac;

MonitorElement* test; // my test

Expand Down
6 changes: 6 additions & 0 deletions DQMOffline/Muon/interface/EfficiencyAnalyzer.h
Expand Up @@ -74,6 +74,9 @@ class EfficiencyAnalyzer : public DQMEDAnalyzer {
std::string ID_;

MonitorElement* h_passProbes_ID_pt;
MonitorElement* h_passProbes_ID_inner_pt;
MonitorElement* h_passProbes_ID_inner_eta;
MonitorElement* h_passProbes_ID_inner_phi;
MonitorElement* h_passProbes_ID_EB_pt;
MonitorElement* h_passProbes_ID_EE_pt;
MonitorElement* h_passProbes_ID_eta;
Expand Down Expand Up @@ -103,6 +106,9 @@ class EfficiencyAnalyzer : public DQMEDAnalyzer {
MonitorElement* h_allProbes_hp_eta;
MonitorElement* h_allProbes_phi;
MonitorElement* h_allProbes_ID_pt;
MonitorElement* h_allProbes_inner_pt;
MonitorElement* h_allProbes_inner_eta;
MonitorElement* h_allProbes_inner_phi;
MonitorElement* h_allProbes_EB_ID_pt;
MonitorElement* h_allProbes_EE_ID_pt;
MonitorElement* h_allProbes_ID_nVtx;
Expand Down
3 changes: 3 additions & 0 deletions DQMOffline/Muon/interface/EfficiencyPlotter.h
Expand Up @@ -73,6 +73,9 @@ class EfficiencyPlotter: public DQMEDHarvester {

// efficiency histograms
MonitorElement* h_eff_pt_ID;
MonitorElement* h_eff_inner_pt_ID;
MonitorElement* h_eff_inner_eta_ID;
MonitorElement* h_eff_inner_phi_ID;
MonitorElement* h_eff_pt_EB_ID;
MonitorElement* h_eff_pt_EE_ID;
MonitorElement* h_eff_eta_ID;
Expand Down
52 changes: 51 additions & 1 deletion DQMOffline/Muon/interface/MuonRecoAnalyzer.h
Expand Up @@ -25,6 +25,11 @@

#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include "DataFormats/BeamSpot/interface/BeamSpot.h"
#include "DataFormats/Scalers/interface/DcsStatus.h"


class MuonRecoAnalyzer : public DQMEDAnalyzer {
public:
Expand All @@ -42,15 +47,25 @@ class MuonRecoAnalyzer : public DQMEDAnalyzer {
//calculate residual & pull:
void GetRes( reco::TrackRef t1, reco::TrackRef t2, std::string par, float &res, float &pull);

//Functions needed by the SoftMuon MVA monitoring
double getDeltaR(reco::Track track1, reco::Track track2);

int getPv(int tidx, const reco::VertexCollection *vc);

private:
// ----------member data ---------------------------
MuonServiceProxy *theService;
edm::ParameterSet parameters;

edm::EDGetTokenT<edm::View<reco::Muon> > theMuonCollectionLabel_;
edm::EDGetTokenT<reco::VertexCollection> theVertexLabel_;
edm::EDGetTokenT<reco::BeamSpot> theBeamSpotLabel_;
edm::EDGetTokenT<DcsStatusCollection> dcsStatusCollection_;


// Switch for verbosity
std::string metname;
bool doMVA;

//histo binning parameters
int etaBin;
Expand Down Expand Up @@ -89,6 +104,7 @@ class MuonRecoAnalyzer : public DQMEDAnalyzer {
double tunePMin;
double tunePMax;


//the histos
MonitorElement* muReco;
// global muon
Expand All @@ -110,6 +126,40 @@ class MuonRecoAnalyzer : public DQMEDAnalyzer {
std::vector<MonitorElement*> rhAnalysis;
std::vector<MonitorElement*> muVStkSytemRotation;
std::vector<MonitorElement*> phiVsetaGlbTrack;
std::vector<MonitorElement*> phiVsetaGlbTrack_badlumi;


//Soft MVA Muon
MonitorElement * ptSoftMuonMVA;
MonitorElement * deltaRSoftMuonMVA;
MonitorElement * gNchi2SoftMuonMVA;
MonitorElement * vMuHitsSoftMuonMVA;
MonitorElement * mNuStationsSoftMuonMVA;
MonitorElement * dxyRefSoftMuonMVA;
MonitorElement * dzRefSoftMuonMVA;
MonitorElement * LWHSoftMuonMVA;
MonitorElement * valPixHitsSoftMuonMVA;
MonitorElement * innerChi2SoftMuonMVA;
MonitorElement * outerChi2SoftMuonMVA;
MonitorElement * iValFracSoftMuonMVA;
MonitorElement * segCompSoftMuonMVA;
MonitorElement * chi2LocMomSoftMuonMVA;
MonitorElement * chi2LocPosSoftMuonMVA;
MonitorElement * glbTrackTailProbSoftMuonMVA;
MonitorElement * NTrkVHitsSoftMuonMVA;
MonitorElement * kinkFinderSoftMuonMVA;
MonitorElement * vRPChitsSoftMuonMVA;
MonitorElement * glbKinkFinderSoftMuonMVA;
MonitorElement * glbKinkFinderLogSoftMuonMVA;
MonitorElement * staRelChi2SoftMuonMVA;
MonitorElement * glbDeltaEtaPhiSoftMuonMVA;
MonitorElement * trkRelChi2SoftMuonMVA;
MonitorElement * vDThitsSoftMuonMVA ;
MonitorElement * vCSChitsSoftMuonMVA;
MonitorElement * timeAtIpInOutSoftMuonMVA;
MonitorElement * timeAtIpInOutErrSoftMuonMVA;
MonitorElement * getMuonHitsPerStationSoftMuonMVA;
MonitorElement * QprodSoftMuonMVA;


MonitorElement* tunePResolution;
Expand Down
7 changes: 6 additions & 1 deletion DQMOffline/Muon/python/muonRecoAnalyzer_cfi.py
Expand Up @@ -6,7 +6,10 @@
muonRecoAnalyzer = DQMEDAnalyzer('MuonRecoAnalyzer',
MuonServiceProxy,
MuonCollection = cms.InputTag("muons"),
inputTagVertex = cms.InputTag("offlinePrimaryVertices"),
inputTagBeamSpot = cms.InputTag("offlineBeamSpot"),
IsminiAOD = cms.bool( False ),
doMVA = cms.bool( False ),
# histograms parameters
thetaBin = cms.int32(100),
thetaMin = cms.double(0.0),
Expand Down Expand Up @@ -48,8 +51,10 @@
muonRecoAnalyzer_miniAOD = DQMEDAnalyzer('MuonRecoAnalyzer',
MuonServiceProxy,
MuonCollection = cms.InputTag("slimmedMuons"),
inputTagVertex = cms.InputTag("offlinePrimaryVertices"),
inputTagBeamSpot = cms.InputTag("offlineBeamSpot"),
IsminiAOD = cms.bool( True ),

doMVA = cms.bool( False ),
# histograms parameters
thetaBin = cms.int32(100),
thetaMin = cms.double(0.0),
Expand Down
24 changes: 20 additions & 4 deletions DQMOffline/Muon/src/DiMuonHistograms.cc
Expand Up @@ -89,9 +89,15 @@ void DiMuonHistograms::bookHistograms(DQMStore::IBooker & ibooker,
TightTightMuon.push_back(ibooker.book1D("TightTightMuon"+EtaName[iEtaRegion],"InvMass_{Tight,Tight}"+EtaName[iEtaRegion], nBin[iEtaRegion], LowMassMin, LowMassMax));
MediumMediumMuon.push_back(ibooker.book1D("MediumMediumMuon"+EtaName[iEtaRegion],"InvMass_{Medium,Medium}"+EtaName[iEtaRegion],nBin[iEtaRegion], LowMassMin, LowMassMax));
LooseLooseMuon.push_back(ibooker.book1D("LooseLooseMuon"+EtaName[iEtaRegion],"InvMass_{Loose,Loose}"+EtaName[iEtaRegion], nBin[iEtaRegion], LowMassMin, LowMassMax));
//Fraction of bad hits in the tracker track to the total
TightTightMuonBadFrac.push_back(ibooker.book1D("TightTightMuonBadFrac"+EtaName[iEtaRegion],"BadFrac_{Tight,Tight}"+EtaName[iEtaRegion], 10, 0, 0.4));
MediumMediumMuonBadFrac.push_back(ibooker.book1D("MediumMediumMuonBadFrac"+EtaName[iEtaRegion],"BadFrac_{Medium,Medium}"+EtaName[iEtaRegion], 10, 0, 0.4));
LooseLooseMuonBadFrac.push_back(ibooker.book1D("LooseLooseMuonBadFrac"+EtaName[iEtaRegion],"BadFrac_{Loose,Loose}"+EtaName[iEtaRegion], 10, 0, 0.4));

// low-mass resonances
SoftSoftMuon.push_back(ibooker.book1D("SoftSoftMuon"+EtaName[iEtaRegion],"InvMass_{Soft,Soft}"+EtaName[iEtaRegion],nBin[iEtaRegion], 0.0, 55.0));
SoftSoftMuonBadFrac.push_back(ibooker.book1D("SoftSoftMuonBadFrac"+EtaName[iEtaRegion],"BadFrac_{Soft,Soft}"+EtaName[iEtaRegion], 10, 0, 0.4));

}
}

Expand Down Expand Up @@ -184,7 +190,10 @@ void DiMuonHistograms::analyze(const edm::Event & iEvent,const edm::EventSetup&
for (unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
if (InvMass > 55. && InvMass < 125.) TightTightMuon[iEtaRegion]->Fill(InvMass);
if (InvMass > 55. && InvMass < 125.) {
TightTightMuon[iEtaRegion]->Fill(InvMass);
TightTightMuonBadFrac[iEtaRegion]->Fill(muon1->innerTrack()->lost()/muon1->innerTrack()->found());
}
}
}
}
Expand All @@ -198,7 +207,10 @@ void DiMuonHistograms::analyze(const edm::Event & iEvent,const edm::EventSetup&
for (unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
if (InvMass > 55. && InvMass < 125.) MediumMediumMuon[iEtaRegion]->Fill(InvMass);
if (InvMass > 55. && InvMass < 125.) {
MediumMediumMuon[iEtaRegion]->Fill(InvMass);
MediumMediumMuonBadFrac[iEtaRegion]->Fill(muon1->innerTrack()->lost()/muon1->innerTrack()->found());
}
}
}
}
Expand All @@ -212,7 +224,10 @@ void DiMuonHistograms::analyze(const edm::Event & iEvent,const edm::EventSetup&
for (unsigned int iEtaRegion=0; iEtaRegion<3; iEtaRegion++){
if(fabs(recoCombinedGlbTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack1->eta())<EtaCutMax[iEtaRegion] &&
fabs(recoCombinedGlbTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoCombinedGlbTrack2->eta())<EtaCutMax[iEtaRegion]){
if (InvMass > 55. && InvMass < 125.) LooseLooseMuon[iEtaRegion]->Fill(InvMass);
if (InvMass > 55. && InvMass < 125.) {
LooseLooseMuon[iEtaRegion]->Fill(InvMass);
LooseLooseMuonBadFrac[iEtaRegion]->Fill(muon1->innerTrack()->lost()/muon1->innerTrack()->found());
}
}
}
}
Expand Down Expand Up @@ -291,7 +306,8 @@ void DiMuonHistograms::analyze(const edm::Event & iEvent,const edm::EventSetup&

if(fabs(recoTrack1->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack1->eta())<EtaCutMax[iEtaRegion] &&
fabs(recoTrack2->eta())>EtaCutMin[iEtaRegion] && fabs(recoTrack2->eta())<EtaCutMax[iEtaRegion]){
SoftSoftMuon[iEtaRegion]->Fill(InvMass);
SoftSoftMuon[iEtaRegion]->Fill(InvMass);
SoftSoftMuonBadFrac[iEtaRegion]->Fill(muon1->innerTrack()->lost()/muon1->innerTrack()->found());
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion DQMOffline/Muon/src/EfficiencyAnalyzer.cc
Expand Up @@ -72,6 +72,9 @@ void EfficiencyAnalyzer::bookHistograms(DQMStore::IBooker & ibooker,
ibooker.setCurrentFolder(theFolder+ID_);

h_allProbes_pt = ibooker.book1D("allProbes_pt","All Probes Pt", ptBin_, ptMin_, ptMax_);
h_allProbes_inner_pt = ibooker.book1D("allProbes_inner_pt","All Probes inner Pt", ptBin_, ptMin_, ptMax_);
h_allProbes_inner_eta = ibooker.book1D("allProbes_inner_eta","All Probes inner eta", etaBin_, etaMin_, etaMax_);
h_allProbes_inner_phi = ibooker.book1D("allProbes_inner_phi","All Probes inner phi", phiBin_, phiMin_, phiMax_);
h_allProbes_EB_pt = ibooker.book1D("allProbes_EB_pt","Barrel: all Probes Pt", ptBin_, ptMin_, ptMax_);
h_allProbes_EE_pt = ibooker.book1D("allProbes_EE_pt","Endcap: all Probes Pt", ptBin_, ptMin_, ptMax_);
h_allProbes_eta = ibooker.book1D("allProbes_eta","All Probes Eta", etaBin_, etaMin_, etaMax_);
Expand All @@ -86,6 +89,9 @@ void EfficiencyAnalyzer::bookHistograms(DQMStore::IBooker & ibooker,
h_allProbes_EE_ID_nVtx = ibooker.book1D("allProbes_EE_ID_nVtx","Endcap: All Probes (ID) nVtx", vtxBin_, vtxMin_, vtxMax_);

h_passProbes_ID_pt = ibooker.book1D("passProbes_ID_pt","ID Passing Probes Pt", ptBin_ , ptMin_ , ptMax_ );
h_passProbes_ID_inner_pt = ibooker.book1D("passProbes_ID_inner_pt","ID Passing Probes inner Pt", ptBin_, ptMin_, ptMax_);
h_passProbes_ID_inner_eta = ibooker.book1D("passProbes_ID_inner_eta","ID Passing Probes inner eta", etaBin_, etaMin_, etaMax_);
h_passProbes_ID_inner_phi = ibooker.book1D("passProbes_ID_inner_phi","ID Passing Probes inner phi", phiBin_, phiMin_, phiMax_);
h_passProbes_ID_EB_pt = ibooker.book1D("passProbes_ID_EB_pt","Barrel: ID Passing Probes Pt", ptBin_ , ptMin_ , ptMax_ );
h_passProbes_ID_EE_pt = ibooker.book1D("passProbes_ID_EE_pt","Endcap: ID Passing Probes Pt", ptBin_ , ptMin_ , ptMax_ );
h_passProbes_ID_eta = ibooker.book1D("passProbes_ID_eta","ID Passing Probes #eta", etaBin_, etaMin_, etaMax_);
Expand Down Expand Up @@ -114,7 +120,7 @@ void EfficiencyAnalyzer::bookHistograms(DQMStore::IBooker & ibooker,
h_passProbes_EB_pfIsodBID_pt = ibooker.book1D("passProbes_EB_pfIsodBID_pt","Barrel: pfIsoID Passing Probes Pt (deltaB PU correction)", ptBin_, ptMin_, ptMax_);
h_passProbes_EE_pfIsodBID_pt = ibooker.book1D("passProbes_EE_pfIsodBID_pt","Endcap: pfIsoID Passing Probes Pt (deltaB PU correction)", ptBin_, ptMin_, ptMax_);
h_passProbes_pfIsodBID_nVtx = ibooker.book1D("passProbes_pfIsodBID_nVtx", "pfIsoID Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_);
h_passProbes_EB_pfIsodBID_nVtx = ibooker.book1D("passProbes_EB_pfIsodBID_nVtx", "Barrel: pfIsoID Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_);
h_passProbes_EB_pfIsodBID_nVtx = ibooker.book1D("passProbes_EB_pfIsodBID_nVtx", "Barrel: pfIsoID Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_);
h_passProbes_EE_pfIsodBID_nVtx = ibooker.book1D("passProbes_EE_pfIsodBID_nVtx", "Endcap: pfIsoID Passing Probes nVtx (R04) (deltaB PU correction)", vtxBin_, vtxMin_, vtxMax_);

#ifdef DEBUG
Expand Down Expand Up @@ -264,6 +270,9 @@ void EfficiencyAnalyzer::analyze(const edm::Event & iEvent,const edm::EventSetup
h_allProbes_pt->Fill(muon2->pt());
h_allProbes_eta->Fill(muon2->eta());
h_allProbes_phi->Fill(muon2->phi());
h_allProbes_inner_pt->Fill(muon2->innerTrack()->innerMomentum().Rho());
h_allProbes_inner_eta->Fill(muon2->innerTrack()->innerPosition().Eta());
h_allProbes_inner_phi->Fill(muon2->innerTrack()->innerPosition().Phi());

if (isMB) h_allProbes_EB_pt->Fill(muon2->pt());
if (isME) h_allProbes_EE_pt->Fill(muon2->pt());
Expand All @@ -279,6 +288,9 @@ void EfficiencyAnalyzer::analyze(const edm::Event & iEvent,const edm::EventSetup
h_passProbes_ID_pt->Fill(muon2->pt());
h_passProbes_ID_eta->Fill(muon2->eta());
h_passProbes_ID_phi->Fill(muon2->phi());
h_passProbes_ID_inner_pt->Fill(muon2->innerTrack()->innerMomentum().Rho());
h_passProbes_ID_inner_eta->Fill(muon2->innerTrack()->innerPosition().Eta());
h_passProbes_ID_inner_phi->Fill(muon2->innerTrack()->innerPosition().Phi());

if (isMB) h_passProbes_ID_EB_pt->Fill(muon2->pt());
if (isME) h_passProbes_ID_EE_pt->Fill(muon2->pt());
Expand Down
57 changes: 57 additions & 0 deletions DQMOffline/Muon/src/EfficiencyPlotter.cc
Expand Up @@ -59,6 +59,9 @@ void EfficiencyPlotter::dqmEndJob(DQMStore::IBooker & ibooker, DQMStore::IGetter

// efficiency plot
h_eff_eta_ID = ibooker.book1D("Eff_eta_"+ID_, ID_+" Eff. vs #eta", etaBin, etaMin, etaMax);
h_eff_inner_pt_ID = ibooker.book1D("Eff_inner_pt_"+ID_, ID_+" Eff. vs pt", ptBin, ptMin, ptMax);
h_eff_inner_eta_ID = ibooker.book1D("Eff_inner_eta_"+ID_, ID_+" Eff. vs #eta", etaBin, etaMin, etaMax);
h_eff_inner_phi_ID = ibooker.book1D("Eff_inner_phi_"+ID_, ID_+" Eff. vs #phi", phiBin, phiMin, phiMax);
h_eff_hp_eta_ID = ibooker.book1D("Eff_hp_eta_"+ID_, "High Pt "+ID_+" Eff. vs #eta", etaBin, etaMin, etaMax);
h_eff_phi_ID = ibooker.book1D("Eff_phi_"+ID_, ID_+" Eff. vs #phi", phiBin, phiMin, phiMax);
h_eff_pt_ID = ibooker.book1D("Eff_pt_"+ID_, ID_+" Eff. vs Pt", ptBin, ptMin, ptMax);
Expand Down Expand Up @@ -86,6 +89,9 @@ void EfficiencyPlotter::dqmEndJob(DQMStore::IBooker & ibooker, DQMStore::IGetter

// This prevents this ME to be normalized when drawn into the GUI
h_eff_eta_ID ->setEfficiencyFlag();
h_eff_inner_eta_ID ->setEfficiencyFlag();
h_eff_inner_pt_ID ->setEfficiencyFlag();
h_eff_inner_phi_ID ->setEfficiencyFlag();
h_eff_hp_eta_ID ->setEfficiencyFlag();
h_eff_phi_ID ->setEfficiencyFlag();
h_eff_pt_ID ->setEfficiencyFlag();
Expand Down Expand Up @@ -114,6 +120,9 @@ void EfficiencyPlotter::dqmEndJob(DQMStore::IBooker & ibooker, DQMStore::IGetter

// AXIS TITLES....
h_eff_hp_eta_ID ->setAxisTitle("#eta", 1);
h_eff_inner_eta_ID ->setAxisTitle("#eta", 1);
h_eff_inner_pt_ID ->setAxisTitle("#eta", 1);
h_eff_inner_phi_ID ->setAxisTitle("#eta", 1);
h_eff_eta_ID ->setAxisTitle("#eta", 1);
h_eff_phi_ID ->setAxisTitle("#phi", 1);
h_eff_pt_ID ->setAxisTitle("p_{T} (GeV)", 1);
Expand Down Expand Up @@ -157,6 +166,54 @@ void EfficiencyPlotter::dqmEndJob(DQMStore::IBooker & ibooker, DQMStore::IGetter
h_eff_pt->Divide(h_numerator_pt, h_denominator_pt, 1., 1., "B");
}

/// --- Tight Muon efficiency vs muon inner Pt
string numpath_inner_pt = inputdir+"/passProbes_ID_inner_pt";
string denpath_inner_pt = inputdir+"/allProbes_inner_pt";

MonitorElement *Numerator_inner_pt = igetter.get(numpath_inner_pt);
MonitorElement *Denominator_inner_pt = igetter.get(denpath_inner_pt);

if (Numerator_inner_pt && Denominator_inner_pt){
TH1F *h_numerator_inner_pt = Numerator_inner_pt->getTH1F();
TH1F *h_denominator_inner_pt = Denominator_inner_pt->getTH1F();
TH1F *h_eff_inner_pt = h_eff_inner_pt_ID->getTH1F();

if (h_eff_inner_pt->GetSumw2N() == 0) h_eff_inner_pt->Sumw2();
h_eff_inner_pt->Divide(h_numerator_inner_pt, h_denominator_inner_pt, 1., 1., "B");
}

/// --- Tight Muon efficiency vs muon inner eta
string numpath_inner_eta = inputdir+"/passProbes_ID_inner_eta";
string denpath_inner_eta = inputdir+"/allProbes_inner_eta";

MonitorElement *Numerator_inner_eta = igetter.get(numpath_inner_eta);
MonitorElement *Denominator_inner_eta = igetter.get(denpath_inner_eta);

if (Numerator_inner_eta && Denominator_inner_eta){
TH1F *h_numerator_inner_eta = Numerator_inner_eta->getTH1F();
TH1F *h_denominator_inner_eta = Denominator_inner_eta->getTH1F();
TH1F *h_eff_inner_eta = h_eff_inner_eta_ID->getTH1F();

if (h_eff_inner_eta->GetSumw2N() == 0) h_eff_inner_eta->Sumw2();
h_eff_inner_eta->Divide(h_numerator_inner_eta, h_denominator_inner_eta, 1., 1., "B");
}

/// --- Tight Muon efficiency vs muon inner phi
string numpath_inner_phi = inputdir+"/passProbes_ID_inner_phi";
string denpath_inner_phi = inputdir+"/allProbes_inner_phi";

MonitorElement *Numerator_inner_phi = igetter.get(numpath_inner_phi);
MonitorElement *Denominator_inner_phi = igetter.get(denpath_inner_phi);

if (Numerator_inner_phi && Denominator_inner_phi){
TH1F *h_numerator_inner_phi = Numerator_inner_phi->getTH1F();
TH1F *h_denominator_inner_phi = Denominator_inner_phi->getTH1F();
TH1F *h_eff_inner_phi = h_eff_inner_phi_ID->getTH1F();

if (h_eff_inner_phi->GetSumw2N() == 0) h_eff_inner_phi->Sumw2();
h_eff_inner_phi->Divide(h_numerator_inner_phi, h_denominator_inner_phi, 1., 1., "B");
}

/// --- Tight Muon efficiency vs muon Pt [EB]
string numpath_EB_pt = inputdir+"/passProbes_ID_EB_pt";
string denpath_EB_pt = inputdir+"/allProbes_EB_pt";
Expand Down

0 comments on commit af82bc6

Please sign in to comment.