diff --git a/ElectroWeakAnalysis/ZMuMu/plugins/ZMuMu_radiative_analysis.cc b/ElectroWeakAnalysis/ZMuMu/plugins/ZMuMu_radiative_analysis.cc index bee42d5a448d4..8e72481b3d910 100644 --- a/ElectroWeakAnalysis/ZMuMu/plugins/ZMuMu_radiative_analysis.cc +++ b/ElectroWeakAnalysis/ZMuMu/plugins/ZMuMu_radiative_analysis.cc @@ -41,7 +41,7 @@ #include #include "TH1.h" //#include "TH2.h" -//#include "TH3.h" +#include "TH3.h" using namespace edm; @@ -63,10 +63,12 @@ class ZMuMu_Radiative_analyzer : public edm::EDAnalyzer { TH1D *h_zMuSamass_FSR,*h_zMuSamass_no_FSR; TH1D *h_zMuTkmass_FSR,*h_zMuTkmass_no_FSR; TH1D *h_Iso_,*h_Iso_FSR_ ; - + TH3D *h_Iso_3D_, *h_Iso_FSR_3D_; + TH1D *h_trackProbe_eta_no_FSR, *h_trackProbe_pt_no_FSR, *h_staProbe_eta_no_FSR, *h_staProbe_pt_no_FSR, *h_ProbeOk_eta_no_FSR, *h_ProbeOk_pt_no_FSR; + TH1D *h_trackProbe_eta_FSR, *h_trackProbe_pt_FSR, *h_staProbe_eta_FSR, *h_staProbe_pt_FSR, *h_ProbeOk_eta_FSR, *h_ProbeOk_pt_FSR; //boolean - bool FSR_mu, FSR_tk, FSR_mu0, FSR_mu1; - + bool FSR_mu, FSR_tk, FSR_mu0, FSR_mu1; + bool trig0found, trig1found; //counter int zmmcounter , zmscounter, zmtcounter; }; @@ -98,7 +100,25 @@ ZMuMu_Radiative_analyzer::ZMuMu_Radiative_analyzer(const ParameterSet& pset) : h_zMuTkmass_FSR= fs->make("h_zMuTkmass_FRS","Invariant Z mass distribution",200,0,200); h_zMuTkmass_no_FSR= fs->make("h_zMuTkmass_no_FSR","Invariant Z mass distribution",200,0,200); h_Iso_= fs->make("h_iso","Isolation distribution of muons without FSR",100,0,20); - h_Iso_FSR_= fs->make("h_iso_FSR_","Isolation distribution of muons with FSR ",100,0,20); + h_Iso_FSR_= fs->make("h_iso_FSR","Isolation distribution of muons with FSR ",100,0,20); + h_Iso_3D_= fs->make("h_iso_3D","Isolation distribution of muons without FSR",100,20,100,100,-2.0,2.0,100,0,20); + h_Iso_FSR_3D_= fs->make("h_iso_FSR_3D","Isolation distribution of muons with FSR ",100,20,100,100,-2.0,2.0,100,0,20); + + h_trackProbe_eta_no_FSR = fs->make("trackProbeEta_no_FSR","Eta of tracks",100,-2.0,2.0); + h_trackProbe_pt_no_FSR = fs->make("trackProbePt_no_FSR","Pt of tracks",100,0,100); + h_staProbe_eta_no_FSR = fs->make("standAloneProbeEta_no_FSR","Eta of standAlone",100,-2.0,2.0); + h_staProbe_pt_no_FSR = fs->make("standAloneProbePt_no_FSR","Pt of standAlone",100,0,100); + h_ProbeOk_eta_no_FSR = fs->make("probeOkEta_no_FSR","Eta of probe Ok",100,-2.0,2.0); + h_ProbeOk_pt_no_FSR = fs->make("probeOkPt_no_FSR","Pt of probe ok",100,0,100); + + h_trackProbe_eta_FSR = fs->make("trackProbeEta_FSR","Eta of tracks",100,-2.0,2.0); + h_trackProbe_pt_FSR = fs->make("trackProbePt_FSR","Pt of tracks",100,0,100); + h_staProbe_eta_FSR = fs->make("standAloneProbeEta_FSR","Eta of standAlone",100,-2.0,2.0); + h_staProbe_pt_FSR = fs->make("standAloneProbePt_FSR","Pt of standAlone",100,0,100); + h_ProbeOk_eta_FSR = fs->make("probeOkEta_FSR","Eta of probe Ok",100,-2.0,2.0); + h_ProbeOk_pt_FSR = fs->make("probeOkPt_FSR","Pt of probe ok",100,0,100); + + } @@ -156,13 +176,25 @@ void ZMuMu_Radiative_analyzer::analyze(const Event& event, const EventSetup& set double Tracker_isovalue_mu0 = mu0TrackIso->sumWithin(dRTrk_,vetos_mu0); double Tracker_isovalue_mu1 = mu1TrackIso->sumWithin(dRTrk_,vetos_mu1); - + + //trigger study + trig0found = false; + trig1found = false; + const std::vector & trig0 =mu0.triggerMatches();//vector of triggerPrimitive + const std::vector & trig1 =mu1.triggerMatches(); + for (unsigned int j=0; jmother(); - const Candidate * motherMu1 = muMc1->mother(); int num_dau_muon0 = motherMu0->numberOfDaughters(); + const Candidate * motherMu1 = muMc1->mother(); int num_dau_muon1 = motherMu1->numberOfDaughters(); cout<<" muone0"<Fill(eta0); + h_trackProbe_pt_FSR->Fill(pt0); + h_staProbe_eta_FSR->Fill(eta0); + h_staProbe_pt_FSR->Fill(pt0); + h_ProbeOk_eta_FSR->Fill(eta0); + h_ProbeOk_pt_FSR->Fill(pt0); + }else{ + cout<<"end doesn't FSR"<Fill(eta0); + h_trackProbe_pt_no_FSR->Fill(pt0); + h_staProbe_eta_no_FSR->Fill(eta0); + h_staProbe_pt_no_FSR->Fill(pt0); + h_ProbeOk_eta_no_FSR->Fill(eta0); + h_ProbeOk_pt_no_FSR->Fill(pt0); + } + if(FSR_mu0){ + h_Iso_FSR_->Fill(Tracker_isovalue_mu0); + h_Iso_FSR_3D_->Fill(pt0,eta0,Tracker_isovalue_mu0); + } + else{ + h_Iso_->Fill(Tracker_isovalue_mu0); + h_Iso_3D_->Fill(pt0,eta0,Tracker_isovalue_mu0); + } + } + if (!trig1found) { // check efficiency of muon1 not imposing the trigger on it + cout<<"muon 1 isn't triggered"<Fill(eta1); + h_staProbe_eta_FSR->Fill(eta1); + h_trackProbe_pt_FSR->Fill(pt1); + h_staProbe_pt_FSR->Fill(pt1); + h_ProbeOk_eta_FSR->Fill(eta1); + h_ProbeOk_pt_FSR->Fill(pt1); + }else{ + cout<<"and doesn't FSR"<Fill(eta1); + h_staProbe_eta_no_FSR->Fill(eta1); + h_trackProbe_pt_no_FSR->Fill(pt1); + h_staProbe_pt_no_FSR->Fill(pt1); + h_ProbeOk_eta_no_FSR->Fill(eta1); + h_ProbeOk_pt_no_FSR->Fill(pt1); + } + if(FSR_mu1){ + h_Iso_FSR_->Fill(Tracker_isovalue_mu1); + h_Iso_FSR_3D_->Fill(pt1,eta1,Tracker_isovalue_mu1); + }else{ + h_Iso_->Fill(Tracker_isovalue_mu1); + h_Iso_3D_->Fill(pt1,eta1,Tracker_isovalue_mu1); + } + } }// end MC match }//end of cuts }// end loop on ZMuMu cand @@ -201,10 +286,10 @@ void ZMuMu_Radiative_analyzer::analyze(const Event& event, const EventSetup& set const Candidate & zMuSaCand = (*zMuSa)[i]; //the candidate CandidateBaseRef zMuSaCandRef = zMuSa->refAt(i); - - - CandidateBaseRef dau0 = zMuSaCand.daughter(0)->masterClone(); - CandidateBaseRef dau1 = zMuSaCand.daughter(1)->masterClone(); + const Candidate * lep0 =zMuSaCand.daughter(0); + const Candidate * lep1 =zMuSaCand.daughter(1); + CandidateBaseRef dau0 = lep0->masterClone(); + CandidateBaseRef dau1 = lep1->masterClone(); const pat::Muon& mu0 = dynamic_cast(*dau0);//cast in patMuon const pat::Muon& mu1 = dynamic_cast(*dau1); @@ -216,10 +301,10 @@ void ZMuMu_Radiative_analyzer::analyze(const Event& event, const EventSetup& set if(pt0>20 && pt1 > 20 && abs(eta0)<2 && abs(eta1)<2 && zmass > 20 && zmass < 200){ GenParticleRef zMuSaMatch = (*zMuSaMatchMap)[zMuSaCandRef]; if(zMuSaMatch.isNonnull()) { // ZMuSa matched - cout<<" Zmumu cuts && matched" <sumWithin(dRTrk_,vetos_mu0); double Tracker_isovalue_mu1 = mu1TrackIso->sumWithin(dRTrk_,vetos_mu1); + // HLT match (check just dau0 the global) + const std::vector & trig0 =mu0.triggerMatches();//vector of triggerPrimitive + const std::vector & trig1 =mu1.triggerMatches(); + trig0found = false; + trig1found = false; + for (unsigned int j=0; jFill(Tracker_isovalue_mu1); - else h_Iso_->Fill(Tracker_isovalue_mu0); + cout<<" muone1"<sumWithin(dRTrk_,vetos_tk); //MonteCarlo Study - const reco::GenParticle * muMc0 = mu0.genLepton(); const reco::GenParticle * muMc1 = mu1.genParticle() ; const Candidate * motherMu0 = muMc0->mother(); @@ -355,10 +479,27 @@ void ZMuMu_Radiative_analyzer::analyze(const Event& event, const EventSetup& set else cout<<" dau[0] pdg ID = "<daughter(0)->pdgId()<