57 void endJob()
override;
72 double etamax_,
ptmin_, massMin_, massMax_, isoMax_;
85 TH1D *h_zmm1HLTplus_mass, *h_zmmNotIsoplus_mass, *h_zmsplus_mass, *
h_zmtplus_mass;
86 TH1D *h_zmm1HLTminus_mass, *h_zmmNotIsominus_mass, *h_zmsminus_mass, *
h_zmtminus_mass;
91 vector<TH1D *> hmumu2HLTplus_eta, hmumu1HLTplus_eta, hmustaplus_eta,
hmutrackplus_eta, hmumuNotIsoplus_eta;
92 vector<TH1D *> hmumu2HLTplus_pt, hmumu1HLTplus_pt, hmustaplus_pt,
hmutrackplus_pt, hmumuNotIsoplus_pt;
93 vector<TH1D *> hmumu2HLTminus_eta, hmumu1HLTminus_eta, hmustaminus_eta,
hmutrackminus_eta, hmumuNotIsominus_eta;
94 vector<TH1D *> hmumu2HLTminus_pt, hmumu1HLTminus_pt, hmustaminus_pt,
hmutrackminus_pt, hmumuNotIsominus_pt;
118 bothMuons_(pset.getParameter<
bool>(
"bothMuons")),
120 etamax_(pset.getUntrackedParameter<double>(
"etamax")),
121 ptmin_(pset.getUntrackedParameter<double>(
"ptmin")),
122 massMin_(pset.getUntrackedParameter<double>(
"zMassMin")),
123 massMax_(pset.getUntrackedParameter<double>(
"zMassMax")),
124 isoMax_(pset.getUntrackedParameter<double>(
"isomax")) {
139 cout <<
"primo" << endl;
148 double etaRangeTmp[7] = {-2.,-1.2,-0.8,0.,0.8,1.2,2.};
149 double ptRangeTmp[5] = {20.,40.,60.,80.,100.};
154 cout <<
"eta istograms creation " << endl;
157 cout <<
" bin eta plus " <<
i << endl;
162 ap =
"zmumu2HLTplus_etaRange" + std::to_string(
i);
163 bp =
"zmumu2HLT plus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
164 cout << ap <<
" " << bp << endl;
166 ap =
"zmumu1HLTplus_etaRange" + std::to_string(
i);
167 bp =
"zmumu1HLT plus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
168 cout << ap <<
" " << bp << endl;
170 ap =
"zmustaplus_etaRange" + std::to_string(
i);
171 bp =
"zmusta plus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
172 cout << ap <<
" " << bp << endl;
173 hmustaplus_eta.push_back(etaDirectory.
make<TH1D>(ap.c_str(), bp.c_str(), 50, 0., 200.));
174 ap =
"zmutrackplus_etaRange" + std::to_string(
i);
175 bp =
"zmutrack plus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
176 cout << ap <<
" " << bp << endl;
178 ap =
"zmumuNotIsoplus_etaRange" + std::to_string(
i);
179 bp =
"zmumuNotIso plus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
180 cout << ap <<
" " << bp << endl;
183 cout <<
" bin eta minus " <<
i << endl;
185 am =
"zmumu2HLTminus_etaRange" + std::to_string(
i);
186 bm =
"zmumu2HLT minus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
187 cout << am <<
" " << bm << endl;
189 am =
"zmumu1HLTminus_etaRange" + std::to_string(
i);
190 bm =
"zmumu1HLT minus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
191 cout << am <<
" " << bm << endl;
193 am =
"zmustaminus_etaRange" + std::to_string(
i);
194 bm =
"zmusta minus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
195 cout << am <<
" " << bm << endl;
197 am =
"zmutrackminus_etaRange" + std::to_string(
i);
198 bm =
"zmutrack minus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
199 cout << am <<
" " << bm << endl;
201 am =
"zmumuNotIsominus_etaRange" + std::to_string(
i);
202 bm =
"zmumuNotIso minus mass eta Range " + std::to_string(range0) +
" to " + std::to_string(range1);
203 cout << am <<
" " << bm << endl;
208 cout <<
"pt istograms creation " << endl;
214 cout <<
" bin pt plus " <<
i << endl;
216 ap1 =
"zmumu2HLTplus_ptRange" + std::to_string(
i);
217 bp1 =
"zmumu2HLT plus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
218 cout << ap1 <<
" " << bp1 << endl;
220 ap1 =
"zmumu1HLTplus_ptRange" + std::to_string(
i);
221 bp1 =
"zmumu1HLT plus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
222 cout << ap1 <<
" " << bp1 << endl;
224 ap1 =
"zmustaplus_ptRange" + std::to_string(
i);
225 bp1 =
"zmusta plus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
226 cout << ap1 <<
" " << bp1 << endl;
227 hmustaplus_pt.push_back(ptDirectory.
make<TH1D>(ap1.c_str(), bp1.c_str(), 50, 0., 200.));
228 ap1 =
"zmutrackplus_ptRange" + std::to_string(
i);
229 bp1 =
"zmutrack plus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
230 cout << ap1 <<
" " << bp1 << endl;
231 hmutrackplus_pt.push_back(ptDirectory.
make<TH1D>(ap1.c_str(), bp1.c_str(), 100, 0., 200.));
232 ap1 =
"zmumuNotIsoplus_ptRange" + std::to_string(
i);
233 bp1 =
"zmumuNotIso plus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
234 cout << ap1 <<
" " << bp1 << endl;
237 cout <<
" bin pt minus " <<
i << endl;
239 am1 =
"zmumu2HLTminus_ptRange" + std::to_string(
i);
240 bm1 =
"zmumu2HLT minus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
241 cout << am1 <<
" " << bm1 << endl;
243 am1 =
"zmumu1HLTminus_ptRange" + std::to_string(
i);
244 bm1 =
"zmumu1HLT minus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
245 cout << am1 <<
" " << bm1 << endl;
247 am1 =
"zmustaminus_ptRange" + std::to_string(
i);
248 bm1 =
"zmusta minus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
249 cout << am1 <<
" " << bm1 << endl;
250 hmustaminus_pt.push_back(ptDirectory.
make<TH1D>(am1.c_str(), bm1.c_str(), 50, 0., 200.));
251 am1 =
"zmutrackminus_ptRange" + std::to_string(
i);
252 bm1 =
"zmutrack minus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
253 cout << am1 <<
" " << bm1 << endl;
255 am1 =
"zmumuNotIsominus_ptRange" + std::to_string(
i);
256 bm1 =
"zmumuNotIso minus mass pt Range " + std::to_string(range0) +
" to " + std::to_string(range1);
257 cout << am1 <<
" " << bm1 << endl;
300 bool zMuMu_found =
false;
302 if (!zMuMu->
empty() ) {
303 for(
unsigned int i = 0;
i < zMuMu->
size(); ++
i) {
310 double trkiso0 = muonDau0.
trackIso();
312 double trkiso1 = muonDau1.
trackIso();
329 bool trig0found =
false;
330 bool trig1found =
false;
331 if( !mu0HLTMatches.empty() )
333 if( !mu1HLTMatches.empty() )
338 bool checkOppositeCharge =
false;
339 if (charge0 != charge1) checkOppositeCharge =
true;
341 if (trig0found || trig1found) {
344 if (trig0found && trig1found) {
353 for (
unsigned int j=0;j<
etaBins;j++) {
359 if (eta0>=range0 && eta0<range1)
364 if (eta1>=range0 && eta1<range1)
371 for (
unsigned int j=0;j<
ptBins;j++) {
373 double range1pt =
ptRange[j+1];
375 if (pt0>=range0pt && pt0<range1pt)
380 if (pt1>=range0pt && pt1<range1pt)
389 if (!trig0found || !trig1found) {
407 for (
unsigned int j=0;j<
etaBins;j++) {
411 if (eta>=range0 && eta<range1)
417 for (
unsigned int j=0;j<
ptBins;j++) {
421 if (pt>=range0 && pt<range1)
443 bool zMuSta_found =
false;
444 if (!zMuMu_found && !zMuStandAlone->
empty() ) {
446 for(
unsigned int i = 0;
i < zMuStandAlone->
size(); ++
i) {
447 const Candidate & zMuStandAloneCand = (*zMuStandAlone)[
i];
449 GenParticleRef zMuStandAloneMatch = (*zMuStandAloneMatchMap)[zMuStandAloneCandRef];
454 double trkiso0 = muonDau0.
trackIso();
456 double trkiso1 = muonDau1.
trackIso();
457 double pt0 = zMuStandAloneCand.
daughter(0)->
pt();
459 double eta0 = zMuStandAloneCand.
daughter(0)->
eta();
460 double eta1 = zMuStandAloneCand.
daughter(1)->
eta();
463 double mass = zMuStandAloneCand.
mass();
471 bool trig0found =
false;
472 bool trig1found =
false;
473 if( !mu0HLTMatches.empty() )
475 if( !mu1HLTMatches.empty() )
479 bool trigGlbfound =
false;
484 trigGlbfound = trig0found;
490 trigGlbfound = trig1found;
496 bool checkOppositeCharge =
false;
497 if (charge0 != charge1) checkOppositeCharge =
true;
504 for (
unsigned int j=0;j<
etaBins;j++) {
508 if (eta>=range0 && eta<range1) {
513 for (
unsigned int j=0;j<
ptBins;j++) {
517 if (pt>=range0 && pt<range1) {
530 if (!zMuMu_found && !zMuSta_found && !zMuTrack->
empty() ) {
532 for(
unsigned int i = 0;
i < zMuTrack->
size(); ++
i) {
533 const Candidate & zMuTrackCand = (*zMuTrack)[
i];
538 double trkiso0 = muonDau0.
trackIso();
540 double trkiso1 = trackDau1.
trackIso();
553 bool trig0found =
false;
554 if( !mu0HLTMatches.empty() )
557 bool checkOppositeCharge =
false;
558 if (charge0 != charge1) checkOppositeCharge =
true;
565 for (
unsigned int j=0;j<
etaBins;j++) {
569 if (eta1>=range0 && eta1<range1) {
574 for (
unsigned int j=0;j<
ptBins;j++) {
578 if (pt1>=range0 && pt1<range1) {
594 int partId0 = dauGen0->
pdgId();
595 int partId1 = dauGen1->
pdgId();
596 int partId2 = dauGen2->
pdgId();
597 bool muplusFound=
false;
598 bool muminusFound=
false;
600 if (partId0==13 || partId1==13 || partId2==13) muminusFound=
true;
601 if (partId0==-13 || partId1==-13 || partId2==-13) muplusFound=
true;
602 if (partId0==23 || partId1==23 || partId2==23) ZFound=
true;
603 return (muplusFound && muminusFound && ZFound);
608 int partId0 = dauGen0->
pdgId();
609 int partId1 = dauGen1->
pdgId();
610 int partId2 = dauGen2->
pdgId();
612 if (partId0 == ipart) {
615 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
616 ptpart = dauMuGen->
pt();
620 if (partId1 == ipart) {
623 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
624 ptpart = dauMuGen->
pt();
628 if (partId2 == ipart) {
632 ptpart = dauMuGen->
pt();
641 int partId0 = dauGen0->
pdgId();
642 int partId1 = dauGen1->
pdgId();
643 int partId2 = dauGen2->
pdgId();
645 if (partId0 == ipart) {
648 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
649 etapart = dauMuGen->
eta();
653 if (partId1 == ipart) {
656 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
657 etapart = dauMuGen->
eta();
661 if (partId2 == ipart) {
665 etapart = dauMuGen->
eta();
674 int partId0 = dauGen0->
pdgId();
675 int partId1 = dauGen1->
pdgId();
676 int partId2 = dauGen2->
pdgId();
678 if (partId0 == ipart) {
681 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
682 phipart = dauMuGen->
phi();
686 if (partId1 == ipart) {
689 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
690 phipart = dauMuGen->
phi();
694 if (partId2 == ipart) {
698 phipart = dauMuGen->
phi();
707 int partId0 = dauGen0->
pdgId();
708 int partId1 = dauGen1->
pdgId();
709 int partId2 = dauGen2->
pdgId();
711 if (partId0 == ipart) {
714 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
715 p4part = dauMuGen->
p4();
719 if (partId1 == ipart) {
722 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
723 p4part = dauMuGen->
p4();
727 if (partId2 == ipart) {
731 p4part = dauMuGen->
p4();
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
vector< TH1D * > hmumuNotIsoplus_pt
vector< TH1D * > hmumu1HLTplus_eta
vector< TH1D * > hmutrackplus_pt
EDGetTokenT< GenParticleMatch > zMuMuMatchMapToken_
reco::CandidateBaseRef trackMuonCandRef_
EDGetTokenT< CandidateView > muonsToken_
vector< TH1D * > hmumu2HLTplus_eta
def analyze(function, filename, filter=None)
#define DEFINE_FWK_MODULE(type)
vector< TH1D * > hmumu2HLTminus_eta
EDGetTokenT< GenParticleMatch > zMuStandAloneMatchMapToken_
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
EDGetTokenT< GenParticleCollection > genParticlesToken_
vector< TH1D * > hmumuNotIsominus_eta
TH1D * h_zmmNotIsoplus_mass
def setup(process, global_tag, zero_tesla=False)
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_
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)
RefToBase< value_type > refAt(size_type i) const
vector< TH1D * > hmutrackminus_eta
virtual int status() const =0
status word
edm::ValueMap< float > IsolationCollection
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
bool isGlobalMuon() const override
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
vector< TH1D * > hmumu1HLTplus_pt
virtual int pdgId() const =0
PDG identifier.
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
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
vector< TH1D * > hmutrackplus_eta
EDGetTokenT< CandidateView > zMuStandAloneToken_
vector< TH1D * > hmustaminus_pt
float getParticleEta(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
virtual const CandidateBaseRef & masterClone() const =0
virtual double eta() const =0
momentum pseudorapidity
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
vector< TH1D * > hmumu1HLTminus_eta
virtual double pt() const =0
transverse momentum
virtual double mass() const =0
mass
vector< TH1D * > hmumu1HLTminus_pt
Particle::LorentzVector getParticleP4(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
int nGlobalMuonsMatched_passed
virtual int charge() const =0
electric charge
EDGetTokenT< VertexCollection > primaryVerticesToken_
vector< TH1D * > hmumu2HLTminus_pt
lep1
print 'MRbb(1b)',event.mr_bb
vector< TH1D * > hmumuNotIsoplus_eta
EDGetTokenT< CandidateView > zMuMuToken_
float getParticlePt(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
virtual size_type numberOfDaughters() const =0
number of daughters
vector< TH1D * > hmutrackminus_pt
virtual double phi() const =0
momentum azimuthal angle
Analysis-level muon class.
ZMuMu_efficiencyAnalyzer(const edm::ParameterSet &pset)
math::PtEtaPhiELorentzVectorF LorentzVector