56 virtual void endJob()
override;
71 double etamax_,
ptmin_, massMin_, massMax_, isoMax_;
84 TH1D *h_zmm1HLTplus_mass, *h_zmmNotIsoplus_mass, *h_zmsplus_mass, *
h_zmtplus_mass;
85 TH1D *h_zmm1HLTminus_mass, *h_zmmNotIsominus_mass, *h_zmsminus_mass, *
h_zmtminus_mass;
90 vector<TH1D *> hmumu2HLTplus_eta, hmumu1HLTplus_eta, hmustaplus_eta,
hmutrackplus_eta, hmumuNotIsoplus_eta;
91 vector<TH1D *> hmumu2HLTplus_pt, hmumu1HLTplus_pt, hmustaplus_pt,
hmutrackplus_pt, hmumuNotIsoplus_pt;
92 vector<TH1D *> hmumu2HLTminus_eta, hmumu1HLTminus_eta, hmustaminus_eta,
hmutrackminus_eta, hmumuNotIsominus_eta;
93 vector<TH1D *> hmumu2HLTminus_pt, hmumu1HLTminus_pt, hmustaminus_pt,
hmutrackminus_pt, hmumuNotIsominus_pt;
117 bothMuons_(pset.getParameter<bool>(
"bothMuons")),
119 etamax_(pset.getUntrackedParameter<double>(
"etamax")),
120 ptmin_(pset.getUntrackedParameter<double>(
"ptmin")),
121 massMin_(pset.getUntrackedParameter<double>(
"zMassMin")),
122 massMax_(pset.getUntrackedParameter<double>(
"zMassMax")),
123 isoMax_(pset.getUntrackedParameter<double>(
"isomax")) {
138 cout <<
"primo" << endl;
147 double etaRangeTmp[7] = {-2.,-1.2,-0.8,0.,0.8,1.2,2.};
148 double ptRangeTmp[5] = {20.,40.,60.,80.,100.};
153 cout <<
"eta istograms creation " << endl;
156 cout <<
" bin eta plus " <<
i << endl;
161 sprintf(ap,
"zmumu2HLTplus_etaRange%d",
i);
162 sprintf(bp,
"zmumu2HLT plus mass eta Range %f to %f",range0,range1);
163 cout << ap <<
" " << bp << endl;
165 sprintf(ap,
"zmumu1HLTplus_etaRange%d",
i);
166 sprintf(bp,
"zmumu1HLT plus mass eta Range %f to %f",range0,range1);
167 cout << ap <<
" " << bp << endl;
169 sprintf(ap,
"zmustaplus_etaRange%d",
i);
170 sprintf(bp,
"zmusta plus mass eta Range %f to %f",range0,range1);
171 cout << ap <<
" " << bp << endl;
173 sprintf(ap,
"zmutrackplus_etaRange%d",
i);
174 sprintf(bp,
"zmutrack plus mass eta Range %f to %f",range0,range1);
175 cout << ap <<
" " << bp << endl;
177 sprintf(ap,
"zmumuNotIsoplus_etaRange%d",
i);
178 sprintf(bp,
"zmumuNotIso plus mass eta Range %f to %f",range0,range1);
179 cout << ap <<
" " << bp << endl;
182 cout <<
" bin eta minus " <<
i << endl;
184 sprintf(am,
"zmumu2HLTminus_etaRange%d",
i);
185 sprintf(bm,
"zmumu2HLT minus mass eta Range %f to %f",range0,range1);
186 cout << am <<
" " << bm << endl;
188 sprintf(am,
"zmumu1HLTminus_etaRange%d",
i);
189 sprintf(bm,
"zmumu1HLT minus mass eta Range %f to %f",range0,range1);
190 cout << am <<
" " << bm << endl;
192 sprintf(am,
"zmustaminus_etaRange%d",
i);
193 sprintf(bm,
"zmusta minus mass eta Range %f to %f",range0,range1);
194 cout << am <<
" " << bm << endl;
196 sprintf(am,
"zmutrackminus_etaRange%d",
i);
197 sprintf(bm,
"zmutrack minus mass eta Range %f to %f",range0,range1);
198 cout << am <<
" " << bm << endl;
200 sprintf(am,
"zmumuNotIsominus_etaRange%d",
i);
201 sprintf(bm,
"zmumuNotIso minus mass eta Range %f to %f",range0,range1);
202 cout << am <<
" " << bm << endl;
207 cout <<
"pt istograms creation " << endl;
213 cout <<
" bin pt plus " <<
i << endl;
214 char ap1[30], bp1[50];
215 sprintf(ap1,
"zmumu2HLTplus_ptRange%d",
i);
216 sprintf(bp1,
"zmumu2HLT plus mass pt Range %f to %f",range0,range1);
217 cout << ap1 <<
" " << bp1 << endl;
219 sprintf(ap1,
"zmumu1HLTplus_ptRange%d",
i);
220 sprintf(bp1,
"zmumu1HLT plus mass pt Range %f to %f",range0,range1);
221 cout << ap1 <<
" " << bp1 << endl;
223 sprintf(ap1,
"zmustaplus_ptRange%d",
i);
224 sprintf(bp1,
"zmusta plus mass pt Range %f to %f",range0,range1);
225 cout << ap1 <<
" " << bp1 << endl;
227 sprintf(ap1,
"zmutrackplus_ptRange%d",
i);
228 sprintf(bp1,
"zmutrack plus mass pt Range %f to %f",range0,range1);
229 cout << ap1 <<
" " << bp1 << endl;
231 sprintf(ap1,
"zmumuNotIsoplus_ptRange%d",
i);
232 sprintf(bp1,
"zmumuNotIso plus mass pt Range %f to %f",range0,range1);
233 cout << ap1 <<
" " << bp1 << endl;
236 cout <<
" bin pt minus " <<
i << endl;
237 char am1[30], bm1[50];
238 sprintf(am1,
"zmumu2HLTminus_ptRange%d",
i);
239 sprintf(bm1,
"zmumu2HLT minus mass pt Range %f to %f",range0,range1);
240 cout << am1 <<
" " << bm1 << endl;
242 sprintf(am1,
"zmumu1HLTminus_ptRange%d",
i);
243 sprintf(bm1,
"zmumu1HLT minus mass pt Range %f to %f",range0,range1);
244 cout << am1 <<
" " << bm1 << endl;
246 sprintf(am1,
"zmustaminus_ptRange%d",
i);
247 sprintf(bm1,
"zmusta minus mass pt Range %f to %f",range0,range1);
248 cout << am1 <<
" " << bm1 << endl;
250 sprintf(am1,
"zmutrackminus_ptRange%d",
i);
251 sprintf(bm1,
"zmutrack minus mass pt Range %f to %f",range0,range1);
252 cout << am1 <<
" " << bm1 << endl;
254 sprintf(am1,
"zmumuNotIsominus_ptRange%d",
i);
255 sprintf(bm1,
"zmumuNotIso minus mass pt Range %f to %f",range0,range1);
256 cout << am1 <<
" " << bm1 << endl;
299 bool zMuMu_found =
false;
301 if (zMuMu->size() > 0 ) {
302 for(
unsigned int i = 0;
i < zMuMu->size(); ++
i) {
309 double trkiso0 = muonDau0.
trackIso();
311 double trkiso1 = muonDau1.
trackIso();
328 bool trig0found =
false;
329 bool trig1found =
false;
330 if( mu0HLTMatches.size()>0 )
332 if( mu1HLTMatches.size()>0 )
337 bool checkOppositeCharge =
false;
338 if (charge0 != charge1) checkOppositeCharge =
true;
340 if (trig0found || trig1found) {
343 if (trig0found && trig1found) {
358 if (eta0>=range0 && eta0<range1)
363 if (eta1>=range0 && eta1<range1)
374 if (pt0>=range0pt && pt0<range1pt)
379 if (pt1>=range0pt && pt1<range1pt)
388 if (!trig0found || !trig1found) {
410 if (eta>=range0 && eta<range1)
420 if (pt>=range0 && pt<range1)
442 bool zMuSta_found =
false;
443 if (!zMuMu_found && zMuStandAlone->size() > 0 ) {
445 for(
unsigned int i = 0;
i < zMuStandAlone->size(); ++
i) {
446 const Candidate & zMuStandAloneCand = (*zMuStandAlone)[
i];
448 GenParticleRef zMuStandAloneMatch = (*zMuStandAloneMatchMap)[zMuStandAloneCandRef];
453 double trkiso0 = muonDau0.
trackIso();
455 double trkiso1 = muonDau1.
trackIso();
456 double pt0 = zMuStandAloneCand.
daughter(0)->
pt();
457 double pt1 = zMuStandAloneCand.
daughter(1)->
pt();
458 double eta0 = zMuStandAloneCand.
daughter(0)->
eta();
459 double eta1 = zMuStandAloneCand.
daughter(1)->
eta();
462 double mass = zMuStandAloneCand.
mass();
470 bool trig0found =
false;
471 bool trig1found =
false;
472 if( mu0HLTMatches.size()>0 )
474 if( mu1HLTMatches.size()>0 )
478 bool trigGlbfound =
false;
483 trigGlbfound = trig0found;
489 trigGlbfound = trig1found;
495 bool checkOppositeCharge =
false;
496 if (charge0 != charge1) checkOppositeCharge =
true;
507 if (eta>=range0 && eta<range1) {
516 if (pt>=range0 && pt<range1) {
529 if (!zMuMu_found && !zMuSta_found && zMuTrack->size() > 0 ) {
531 for(
unsigned int i = 0;
i < zMuTrack->size(); ++
i) {
532 const Candidate & zMuTrackCand = (*zMuTrack)[
i];
537 double trkiso0 = muonDau0.
trackIso();
539 double trkiso1 = trackDau1.
trackIso();
552 bool trig0found =
false;
553 if( mu0HLTMatches.size()>0 )
556 bool checkOppositeCharge =
false;
557 if (charge0 != charge1) checkOppositeCharge =
true;
568 if (eta1>=range0 && eta1<range1) {
577 if (pt1>=range0 && pt1<range1) {
593 int partId0 = dauGen0->
pdgId();
594 int partId1 = dauGen1->
pdgId();
595 int partId2 = dauGen2->
pdgId();
596 bool muplusFound=
false;
597 bool muminusFound=
false;
599 if (partId0==13 || partId1==13 || partId2==13) muminusFound=
true;
600 if (partId0==-13 || partId1==-13 || partId2==-13) muplusFound=
true;
601 if (partId0==23 || partId1==23 || partId2==23) ZFound=
true;
602 return muplusFound*muminusFound*ZFound;
607 int partId0 = dauGen0->
pdgId();
608 int partId1 = dauGen1->
pdgId();
609 int partId2 = dauGen2->
pdgId();
611 if (partId0 == ipart) {
614 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
615 ptpart = dauMuGen->
pt();
619 if (partId1 == ipart) {
622 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
623 ptpart = dauMuGen->
pt();
627 if (partId2 == ipart) {
631 ptpart = dauMuGen->
pt();
640 int partId0 = dauGen0->
pdgId();
641 int partId1 = dauGen1->
pdgId();
642 int partId2 = dauGen2->
pdgId();
644 if (partId0 == ipart) {
647 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
648 etapart = dauMuGen->
eta();
652 if (partId1 == ipart) {
655 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
656 etapart = dauMuGen->
eta();
660 if (partId2 == ipart) {
664 etapart = dauMuGen->
eta();
673 int partId0 = dauGen0->
pdgId();
674 int partId1 = dauGen1->
pdgId();
675 int partId2 = dauGen2->
pdgId();
677 if (partId0 == ipart) {
680 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
681 phipart = dauMuGen->
phi();
685 if (partId1 == ipart) {
688 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
689 phipart = dauMuGen->
phi();
693 if (partId2 == ipart) {
697 phipart = dauMuGen->
phi();
706 int partId0 = dauGen0->
pdgId();
707 int partId1 = dauGen1->
pdgId();
708 int partId2 = dauGen2->
pdgId();
710 if (partId0 == ipart) {
713 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
714 p4part = dauMuGen->
p4();
718 if (partId1 == ipart) {
721 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
722 p4part = dauMuGen->
p4();
726 if (partId2 == ipart) {
730 p4part = dauMuGen->
p4();
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
vector< TH1D * > hmumuNotIsoplus_pt
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
vector< TH1D * > hmumu1HLTplus_eta
vector< TH1D * > hmutrackplus_pt
EDGetTokenT< GenParticleMatch > zMuMuMatchMapToken_
reco::CandidateBaseRef trackMuonCandRef_
EDGetTokenT< CandidateView > muonsToken_
vector< TH1D * > hmumu2HLTplus_eta
virtual double pt() const =0
transverse momentum
#define DEFINE_FWK_MODULE(type)
vector< TH1D * > hmumu2HLTminus_eta
virtual double mass() const =0
mass
EDGetTokenT< GenParticleMatch > zMuStandAloneMatchMapToken_
virtual int status() const =0
status word
EDGetTokenT< GenParticleCollection > genParticlesToken_
vector< TH1D * > hmumuNotIsominus_eta
TH1D * h_zmmNotIsoplus_mass
bool isGlobalMuon() const
vector< TH1D * > hmumuNotIsominus_pt
std::vector< Vertex > VertexCollection
collection of Vertex objects
T * make(const Args &...args) const
make new ROOT object
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
TH1D * h_zmm1HLTplus_mass
EDGetTokenT< CandidateView > tracksToken_
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
TH1D * h_zmm1HLTminus_mass
EDGetTokenT< GenParticleMatch > zMuTrackMatchMapToken_
bool check_ifZmumu(const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
EDGetTokenT< CandidateView > zMuTrackToken_
float getParticlePhi(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
vector< TH1D * > hmutrackminus_eta
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
virtual size_type numberOfDaughters() const =0
number of daughters
edm::ValueMap< float > IsolationCollection
vector< TH1D * > hmumu1HLTplus_pt
tuple lep1
print 'MRbb(1b)',event.mr_bb
vector< TH1D * > hmustaplus_eta
TH1D * h_zmmNotIsominus_mass
vector< TH1D * > hmustaplus_pt
Abs< T >::type abs(const T &t)
vector< TH1D * > hmustaminus_eta
vector< TH1D * > hmumu2HLTplus_pt
virtual int charge() const =0
electric charge
T * make(const Args &...args) const
make new ROOT object
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
vector< TH1D * > hmutrackplus_eta
EDGetTokenT< CandidateView > zMuStandAloneToken_
vector< TH1D * > hmustaminus_pt
virtual int pdgId() const =0
PDG identifier.
float getParticleEta(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
vector< TH1D * > hmumu1HLTminus_eta
vector< TH1D * > hmumu1HLTminus_pt
Particle::LorentzVector getParticleP4(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
int nGlobalMuonsMatched_passed
EDGetTokenT< VertexCollection > primaryVerticesToken_
virtual void endJob() override
vector< TH1D * > hmumu2HLTminus_pt
vector< TH1D * > hmumuNotIsoplus_eta
EDGetTokenT< CandidateView > zMuMuToken_
float getParticlePt(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
vector< TH1D * > hmutrackminus_pt
Analysis-level muon class.
ZMuMu_efficiencyAnalyzer(const edm::ParameterSet &pset)
tuple zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
math::PtEtaPhiELorentzVectorF LorentzVector
edm::Service< TFileService > fs
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual const CandidateBaseRef & masterClone() const =0