49 virtual void endJob()
override;
60 double etamax_,
ptmin_, massMin_, massMax_, isoMax_;
109 using namespace reco;
115 zMuMu_(pset.getParameter<
InputTag>(
"zMuMu")),
116 zMuMuMatchMap_(pset.getParameter<
InputTag>(
"zMuMuMatchMap")),
117 zMuStandAlone_(pset.getParameter<
InputTag>(
"zMuStandAlone")),
118 zMuStandAloneMatchMap_(pset.getParameter<
InputTag>(
"zMuStandAloneMatchMap")),
119 zMuTrack_(pset.getParameter<
InputTag>(
"zMuTrack")),
120 zMuTrackMatchMap_(pset.getParameter<
InputTag>(
"zMuTrackMatchMap")),
121 muons_(pset.getParameter<
InputTag>(
"muons")),
123 genParticles_(pset.getParameter<
InputTag>(
"genParticles" ) ),
124 primaryVertices_(pset.getParameter<
InputTag>(
"primaryVertices" ) ),
126 bothMuons_(pset.getParameter<bool>(
"bothMuons")),
128 etamax_(pset.getUntrackedParameter<double>(
"etamax")),
129 ptmin_(pset.getUntrackedParameter<double>(
"ptmin")),
130 massMin_(pset.getUntrackedParameter<double>(
"zMassMin")),
131 massMax_(pset.getUntrackedParameter<double>(
"zMassMax")),
132 isoMax_(pset.getUntrackedParameter<double>(
"isomax")) {
139 h_muon_vz = fs->
make<TH1D>(
"muonVz",
"z vertex of muons",50,-20.,20.);
141 h_dimuon_vz = fs->
make<TH1D>(
"dimuonVz",
"z vertex of dimuon",50,-20.,20.);
194 event.getByLabel(
zMuMu_, zMuMu);
199 event.getByLabel(
muons_, muons);
200 event.getByLabel(
tracks_, tracks);
214 bool zMuMu_found =
false;
217 if (zMuMu->size() > 0 ) {
219 for(
unsigned int i = 0;
i < zMuMu->size(); ++
i) {
226 double trkiso0 = muonDau0.
trackIso();
228 double trkiso1 = muonDau1.
trackIso();
236 float d0signed_mu0 = (*mu0TrkRef).dxy();
237 float d0signed_mu0_respectToPV= (*mu0TrkRef).dxy( primaryVertices->begin()->position() );
238 float vz_mu0_respectToPV= (*mu0TrkRef).dz( primaryVertices->begin()->position() );
241 float d0signed_mu1 = (*mu1TrkRef).dxy();
242 float d0signed_mu1_respectToPV= (*mu1TrkRef).dxy( primaryVertices->begin()->position() );
243 float vz_mu1_respectToPV= (*mu1TrkRef).dz( primaryVertices->begin()->position() );
256 double mass = zMuMuCand.
mass();
264 bool trig0found =
false;
265 bool trig1found =
false;
266 if( mu0HLTMatches.size()>0 )
268 if( mu1HLTMatches.size()>0 )
295 if (trkiso0<isoMax_ && trkiso1>=
isoMax_) {
311 bool zMuSta_found =
false;
312 if (!zMuMu_found && zMuStandAlone->size() > 0 ) {
314 for(
unsigned int i = 0;
i < zMuStandAlone->size(); ++
i) {
315 const Candidate & zMuStandAloneCand = (*zMuStandAlone)[
i];
317 GenParticleRef zMuStandAloneMatch = (*zMuStandAloneMatchMap)[zMuStandAloneCandRef];
322 double trkiso0 = muonDau0.
trackIso();
324 double trkiso1 = muonDau1.
trackIso();
329 float d0signed_mu0 = (*mu0TrkRef).dxy();
330 float d0signed_mu0_respectToPV= (*mu0TrkRef).dxy( primaryVertices->begin()->position() );
331 float vz_mu0_respectToPV= (*mu0TrkRef).dz( primaryVertices->begin()->position() );
334 float d0signed_mu1 = (*mu1TrkRef).dxy();
335 float d0signed_mu1_respectToPV= (*mu1TrkRef).dxy( primaryVertices->begin()->position() );
336 float vz_mu1_respectToPV= (*mu1TrkRef).dz( primaryVertices->begin()->position() );
338 double pt0 = zMuStandAloneCand.
daughter(0)->
pt();
339 double pt1 = zMuStandAloneCand.
daughter(1)->
pt();
340 double eta0 = zMuStandAloneCand.
daughter(0)->
eta();
341 double eta1 = zMuStandAloneCand.
daughter(1)->
eta();
342 double mass = zMuStandAloneCand.
mass();
350 bool trig0found =
false;
351 bool trig1found =
false;
352 if( mu0HLTMatches.size()>0 )
354 if( mu1HLTMatches.size()>0 )
358 bool trigfound =
false;
380 if (!zMuMu_found && !zMuSta_found && zMuTrack->size() > 0 ) {
382 for(
unsigned int i = 0;
i < zMuTrack->size(); ++
i) {
383 const Candidate & zMuTrackCand = (*zMuTrack)[
i];
388 double trkiso0 = muonDau0.
trackIso();
390 double trkiso1 = trackDau1.
trackIso();
395 float d0signed_mu0 = (*mu0TrkRef).dxy();
396 float d0signed_mu0_respectToPV= (*mu0TrkRef).dxy( primaryVertices->begin()->position() );
397 float vz_mu0_respectToPV= (*mu0TrkRef).dz( primaryVertices->begin()->position() );
400 float d0signed_mu1 = (*mu1TrkRef).dxy();
401 float d0signed_mu1_respectToPV= (*mu1TrkRef).dxy( primaryVertices->begin()->position() );
402 float vz_mu1_respectToPV= (*mu1TrkRef).dz( primaryVertices->begin()->position() );
410 double mass = zMuTrackCand.
mass();
416 bool trig0found =
false;
417 if( mu0HLTMatches.size()>0 )
439 int partId0 = dauGen0->
pdgId();
440 int partId1 = dauGen1->
pdgId();
441 int partId2 = dauGen2->
pdgId();
442 bool muplusFound=
false;
443 bool muminusFound=
false;
445 if (partId0==13 || partId1==13 || partId2==13) muminusFound=
true;
446 if (partId0==-13 || partId1==-13 || partId2==-13) muplusFound=
true;
447 if (partId0==23 || partId1==23 || partId2==23) ZFound=
true;
448 return muplusFound*muminusFound*ZFound;
453 int partId0 = dauGen0->
pdgId();
454 int partId1 = dauGen1->
pdgId();
455 int partId2 = dauGen2->
pdgId();
457 if (partId0 == ipart) {
460 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
461 ptpart = dauMuGen->
pt();
465 if (partId1 == ipart) {
468 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
469 ptpart = dauMuGen->
pt();
473 if (partId2 == ipart) {
477 ptpart = dauMuGen->
pt();
486 int partId0 = dauGen0->
pdgId();
487 int partId1 = dauGen1->
pdgId();
488 int partId2 = dauGen2->
pdgId();
490 if (partId0 == ipart) {
493 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
494 etapart = dauMuGen->
eta();
498 if (partId1 == ipart) {
501 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
502 etapart = dauMuGen->
eta();
506 if (partId2 == ipart) {
510 etapart = dauMuGen->
eta();
519 int partId0 = dauGen0->
pdgId();
520 int partId1 = dauGen1->
pdgId();
521 int partId2 = dauGen2->
pdgId();
523 if (partId0 == ipart) {
526 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
527 phipart = dauMuGen->
phi();
531 if (partId1 == ipart) {
534 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
535 phipart = dauMuGen->
phi();
539 if (partId2 == ipart) {
543 phipart = dauMuGen->
phi();
552 int partId0 = dauGen0->
pdgId();
553 int partId1 = dauGen1->
pdgId();
554 int partId2 = dauGen2->
pdgId();
556 if (partId0 == ipart) {
559 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
560 p4part = dauMuGen->
p4();
564 if (partId1 == ipart) {
567 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
568 p4part = dauMuGen->
p4();
572 if (partId2 == ipart) {
576 p4part = dauMuGen->
p4();
TH1D * h_zmumuSele_muon_d0signed_respectToPV
TH1D * h_zmumuNotIsoSele_muonNotIso_d0signed
float getParticlePt(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
TH1D * h_zmustaSele_sta_d0signed
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
edm::InputTag zMuStandAloneMatchMap_
const std::vector< reco::PFCandidatePtr > & tracks_
virtual float mass() const =0
mass
TH1D * h_zmumuNotIsoSele_muonIso_d0signed
virtual float eta() const =0
momentum pseudorapidity
bool check_ifZmumu(const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
#define DEFINE_FWK_MODULE(type)
TH1D * h_zmutrackSele_track_vz_respectToPV
TH1D * h_zmumuNotIsoSele_dimuon_vz
virtual int status() const =0
status word
float getParticleEta(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
bool isGlobalMuon() const
virtual float phi() const =0
momentum azimuthal angle
T * make(const Args &...args) const
make new ROOT object
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
TH1D * h_zmustaSele_muon_vz
TH1D * h_zmumuSele_dimuon_vz
TH1D * h_zmustaSele_muon_vz_respectToPV
TH1D * h_zmutrackSele_track_d0signed
TH1D * h_zmutrackSele_muon_d0signed
TH1D * h_zmumuNotIsoSele_muonIso_vz
TH1D * h_zmutrackSele_track_d0signed_respectToPV
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
TH1D * h_zmumuNotIsoSele_muonNotIso_d0signed_respectToPV
TH1D * h_zmumuSele_muon_vz_respectToPV
virtual size_type numberOfDaughters() const =0
number of daughters
edm::InputTag zMuTrackMatchMap_
virtual float pt() const =0
transverse momentum
TH1D * h_zmumuSele_muon_d0signed
edm::ValueMap< float > IsolationCollection
TH1D * h_muon_vz_respectToPV
TH1D * h_zmumuNotIsoSele_muonIso_d0signed_respectToPV
virtual void endJob() override
TH1D * h_zmustaSele_muon_d0signed
edm::InputTag zMuStandAlone_
TH1D * h_zmustaSele_sta_d0signed_respectToPV
edm::InputTag genParticles_
TH1D * h_zmutrackSele_muon_vz_respectToPV
Abs< T >::type abs(const T &t)
Particle::LorentzVector getParticleP4(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
TH1D * h_zmumuNotIsoSele_muonNotIso_vz_respectToPV
virtual reco::TrackRef track() const
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
TH1D * h_zmustaSele_sta_vz_respectToPV
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
virtual double vz() const
z coordinate of vertex position
virtual int pdgId() const =0
PDG identifier.
TH1D * h_zmumuNotIsoSele_muonNotIso_vz
reco::CandidateBaseRef trackMuonCandRef_
TH1D * h_zmustaSele_muon_d0signed_respectToPV
edm::InputTag zMuMuMatchMap_
ZMuMu_vtxAnalyzer(const edm::ParameterSet &pset)
TH1D * h_zmumuNotIsoSele_muonIso_vz_respectToPV
TH1D * h_muon_d0signed_respectToPV
TH1D * h_zmustaSele_sta_vz
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
TH1D * h_zmutrackSele_muon_d0signed_respectToPV
edm::InputTag primaryVertices_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
float getParticlePhi(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
Analysis-level muon class.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
TH1D * h_zmumuSele_muon_vz
tuple zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
reco::TrackRef track() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
TH1D * h_zmutrackSele_track_vz
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
TH1D * h_zmutrackSele_muon_vz
virtual const CandidateBaseRef & masterClone() const =0