49 virtual void endJob()
override;
60 double etamax_,
ptmin_, massMin_, massMax_, isoMax_;
73 TH1D *h_zmm1HLTplus_mass, *h_zmmNotIsoplus_mass, *h_zmsplus_mass, *
h_zmtplus_mass;
74 TH1D *h_zmm1HLTminus_mass, *h_zmmNotIsominus_mass, *h_zmsminus_mass, *
h_zmtminus_mass;
79 vector<TH1D *> hmumu2HLTplus_eta, hmumu1HLTplus_eta, hmustaplus_eta,
hmutrackplus_eta, hmumuNotIsoplus_eta;
80 vector<TH1D *> hmumu2HLTplus_pt, hmumu1HLTplus_pt, hmustaplus_pt,
hmutrackplus_pt, hmumuNotIsoplus_pt;
81 vector<TH1D *> hmumu2HLTminus_eta, hmumu1HLTminus_eta, hmustaminus_eta,
hmutrackminus_eta, hmumuNotIsominus_eta;
82 vector<TH1D *> hmumu2HLTminus_pt, hmumu1HLTminus_pt, hmustaminus_pt,
hmutrackminus_pt, hmumuNotIsominus_pt;
106 zMuMu_(pset.getParameter<
InputTag>(
"zMuMu")),
107 zMuMuMatchMap_(pset.getParameter<
InputTag>(
"zMuMuMatchMap")),
108 zMuStandAlone_(pset.getParameter<
InputTag>(
"zMuStandAlone")),
109 zMuStandAloneMatchMap_(pset.getParameter<
InputTag>(
"zMuStandAloneMatchMap")),
110 zMuTrack_(pset.getParameter<
InputTag>(
"zMuTrack")),
111 zMuTrackMatchMap_(pset.getParameter<
InputTag>(
"zMuTrackMatchMap")),
112 muons_(pset.getParameter<
InputTag>(
"muons")),
114 genParticles_(pset.getParameter<
InputTag>(
"genParticles" ) ),
115 primaryVertices_(pset.getParameter<
InputTag>(
"primaryVertices" ) ),
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;
277 event.getByLabel(
zMuMu_, zMuMu);
282 event.getByLabel(
muons_, muons);
283 event.getByLabel(
tracks_, tracks);
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();
320 double mass = zMuMuCand.
mass();
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();
546 double mass = zMuTrackCand.
mass();
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();
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
const std::vector< reco::PFCandidatePtr > & tracks_
virtual float mass() const =0
mass
vector< TH1D * > hmutrackplus_pt
reco::CandidateBaseRef trackMuonCandRef_
vector< TH1D * > hmumu2HLTplus_eta
virtual float eta() const =0
momentum pseudorapidity
#define DEFINE_FWK_MODULE(type)
vector< TH1D * > hmumu2HLTminus_eta
virtual int status() const =0
status word
vector< TH1D * > hmumuNotIsominus_eta
edm::InputTag zMuMuMatchMap_
TH1D * h_zmmNotIsoplus_mass
bool isGlobalMuon() const
virtual float phi() const =0
momentum azimuthal angle
vector< TH1D * > hmumuNotIsominus_pt
T * make(const Args &...args) const
make new ROOT object
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
TH1D * h_zmm1HLTplus_mass
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
TH1D * h_zmm1HLTminus_mass
bool check_ifZmumu(const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
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
virtual float pt() const =0
transverse momentum
edm::ValueMap< float > IsolationCollection
vector< TH1D * > hmumu1HLTplus_pt
vector< TH1D * > hmustaplus_eta
edm::InputTag primaryVertices_
edm::InputTag zMuTrackMatchMap_
edm::InputTag genParticles_
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
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)
edm::InputTag zMuStandAloneMatchMap_
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
vector< TH1D * > hmumu1HLTminus_eta
edm::InputTag zMuStandAlone_
vector< TH1D * > hmumu1HLTminus_pt
Particle::LorentzVector getParticleP4(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
int nGlobalMuonsMatched_passed
virtual void endJob() override
vector< TH1D * > hmumu2HLTminus_pt
vector< TH1D * > hmumuNotIsoplus_eta
float getParticlePt(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
vector< TH1D * > hmutrackminus_pt
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Analysis-level muon class.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
ZMuMu_efficiencyAnalyzer(const edm::ParameterSet &pset)
tuple zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual const CandidateBaseRef & masterClone() const =0