CMS 3D CMS Logo

MuScleFitMuonSelector.cc
Go to the documentation of this file.
5 
6 const double MuScleFitMuonSelector::mMu2 = 0.011163612;
7 const unsigned int MuScleFitMuonSelector::motherPdgIdArray[] = {23, 100553, 100553, 553, 100443, 443};
8 
10  const reco::Candidate* tempMuon = status3Muon;
11  // bool lastCopy = (static_cast<const reco::GenParticle*>(tempMuon))->isLastCopy(); // isLastCopy() likely not enough robust
12  bool isPromptFinalState = static_cast<const reco::GenParticle*>(tempMuon)
13  ->isPromptFinalState(); // pre-CMSSW_74X code: int status = tempStatus1Muon->status();
14  while (tempMuon == nullptr || tempMuon->numberOfDaughters() != 0) {
15  if (isPromptFinalState)
16  break; // pre-CMSSW_74X code: if (status == 1) break;
17  //std::vector<const reco::Candidate*> daughters;
18  for (unsigned int i = 0; i < tempMuon->numberOfDaughters(); ++i) {
19  if (tempMuon->daughter(i)->pdgId() == tempMuon->pdgId()) {
20  tempMuon = tempMuon->daughter(i);
21  isPromptFinalState = static_cast<const reco::GenParticle*>(tempMuon)
22  ->isPromptFinalState(); // pre-CMSSW_74X code: status = tempStatus1Muon->status();
23  break;
24  } else
25  continue;
26  } //for loop
27  } //while loop
28 
29  return tempMuon;
30 }
31 
33  const reco::Candidate* tempMuon = status3Muon;
34  bool lastCopy = static_cast<const reco::GenParticle*>(tempMuon)
35  ->isLastCopyBeforeFSR(); // pre-CMSSW_74X code: int status = tempStatus1Muon->status();
36  while (tempMuon == nullptr || tempMuon->numberOfDaughters() != 0) {
37  if (lastCopy)
38  break; // pre-CMSSW_74X code: if (status == 3) break;
39  //std::vector<const reco::Candidate*> daughters;
40  for (unsigned int i = 0; i < tempMuon->numberOfDaughters(); ++i) {
41  if (tempMuon->daughter(i)->pdgId() == tempMuon->pdgId()) {
42  tempMuon = tempMuon->daughter(i);
43  lastCopy = static_cast<const reco::GenParticle*>(tempMuon)
44  ->isLastCopyBeforeFSR(); // pre-CMSSW_74X code: status = tempStatus1Muon->status();
45  break;
46  } else
47  continue;
48  } //for loop
49  } //while loop
50 
51  return tempMuon;
52 }
53 
55  reco::TrackRef iTrack = aMuon->innerTrack();
56  const reco::HitPattern& p = iTrack->hitPattern();
57 
58  reco::TrackRef gTrack = aMuon->globalTrack();
59  const reco::HitPattern& q = gTrack->hitPattern();
60 
61  return ( //isMuonInAccept(aMuon) &&// no acceptance cuts!
62  iTrack->found() > 11 && gTrack->chi2() / gTrack->ndof() < 20.0 && q.numberOfValidMuonHits() > 0 &&
63  iTrack->chi2() / iTrack->ndof() < 4.0 && aMuon->muonID("TrackerMuonArbitrated") &&
64  aMuon->muonID("TMLastStationAngTight") && p.pixelLayersWithMeasurement() > 1 &&
65  std::abs(iTrack->dxy()) < 3.0 && //should be done w.r.t. PV!
66  std::abs(iTrack->dz()) < 15.0 //should be done w.r.t. PV!
67  );
68 }
69 
71  reco::TrackRef iTrack = aMuon->innerTrack();
72  const reco::HitPattern& p = iTrack->hitPattern();
73 
74  return ( //isMuonInAccept(aMuon) // no acceptance cuts!
75  iTrack->found() > 11 && iTrack->chi2() / iTrack->ndof() < 4.0 && aMuon->muonID("TrackerMuonArbitrated") &&
76  aMuon->muonID("TMLastStationAngTight") && p.pixelLayersWithMeasurement() > 1 &&
77  std::abs(iTrack->dxy()) < 3.0 && //should be done w.r.t. PV!
78  std::abs(iTrack->dz()) < 15.0 //should be done w.r.t. PV!
79  );
80 }
81 
82 // Note that at this level we save all the information. Events for which no suitable muon pair is found
83 // are removed from the tree (together with the gen and sim information) at a later stage.
84 // It would be better to remove them directly at this point.
86  std::vector<MuScleFitMuon>& muons,
87  std::vector<GenMuonPair>& genPair,
88  std::vector<std::pair<lorentzVector, lorentzVector> >& simPair,
91  event.getByLabel("onia2MuMuPatTrkTrk", collAll);
92  if (!collAll.isValid()) {
93  edm::LogWarning("MuScleFitUtils") << "J/psi not present in event!";
94  }
95  std::vector<const pat::Muon*> collMuSel;
96 
97  //================onia cuts===========================/
98 
99  if (muonType_ <= -1 && PATmuons_) {
100  std::vector<const pat::CompositeCandidate*> collSelGG;
101  std::vector<const pat::CompositeCandidate*> collSelGT;
102  std::vector<const pat::CompositeCandidate*> collSelTT;
103  if (collAll.isValid()) {
104  for (std::vector<pat::CompositeCandidate>::const_iterator it = collAll->begin(); it != collAll->end(); ++it) {
105  const pat::CompositeCandidate* cand = &(*it);
106  // cout << "Now checking candidate of type " << theJpsiCat << " with pt = " << cand->pt() << endl;
107  const pat::Muon* muon1 = dynamic_cast<const pat::Muon*>(cand->daughter("muon1"));
108  const pat::Muon* muon2 = dynamic_cast<const pat::Muon*>(cand->daughter("muon2"));
109 
110  if ((muon1->charge() * muon2->charge()) > 0)
111  continue;
112  // global + global?
113  if (muon1->isGlobalMuon() && muon2->isGlobalMuon()) {
114  if (selGlobalMuon(muon1) && selGlobalMuon(muon2) && cand->userFloat("vProb") > 0.001) {
115  collSelGG.push_back(cand);
116  continue;
117  }
118  }
119  // global + tracker? (x2)
120  if (muon1->isGlobalMuon() && muon2->isTrackerMuon()) {
121  if (selGlobalMuon(muon1) && selTrackerMuon(muon2) && cand->userFloat("vProb") > 0.001) {
122  collSelGT.push_back(cand);
123  continue;
124  }
125  }
126  if (muon2->isGlobalMuon() && muon1->isTrackerMuon()) {
127  if (selGlobalMuon(muon2) && selTrackerMuon(muon1) && cand->userFloat("vProb") > 0.001) {
128  collSelGT.push_back(cand);
129  continue;
130  }
131  }
132  // tracker + tracker?
133  if (muon1->isTrackerMuon() && muon2->isTrackerMuon()) {
134  if (selTrackerMuon(muon1) && selTrackerMuon(muon2) && cand->userFloat("vProb") > 0.001) {
135  collSelTT.push_back(cand);
136  continue;
137  }
138  }
139  }
140  }
141  // Split them in independent collections if using muonType_ == -2, -3 or -4. Take them all if muonType_ == -1.
142  std::vector<reco::Track> tracks;
143  if (!collSelGG.empty()) {
144  //CHECK THAT THEY ARE ORDERED BY PT !!!!!!!!!!!!!!!!!!!!!!!
145  const pat::Muon* muon1 = dynamic_cast<const pat::Muon*>(collSelGG[0]->daughter("muon1"));
146  const pat::Muon* muon2 = dynamic_cast<const pat::Muon*>(collSelGG[0]->daughter("muon2"));
147  if (muonType_ == -1 || muonType_ == -2) {
148  tracks.push_back(*(muon1->innerTrack()));
149  tracks.push_back(*(muon2->innerTrack()));
150  collMuSel.push_back(muon1);
151  collMuSel.push_back(muon2);
152  }
153  } else if (collSelGG.empty() && !collSelGT.empty()) {
154  //CHECK THAT THEY ARE ORDERED BY PT !!!!!!!!!!!!!!!!!!!!!!!
155  const pat::Muon* muon1 = dynamic_cast<const pat::Muon*>(collSelGT[0]->daughter("muon1"));
156  const pat::Muon* muon2 = dynamic_cast<const pat::Muon*>(collSelGT[0]->daughter("muon2"));
157  if (muonType_ == -1 || muonType_ == -3) {
158  tracks.push_back(*(muon1->innerTrack()));
159  tracks.push_back(*(muon2->innerTrack()));
160  collMuSel.push_back(muon1);
161  collMuSel.push_back(muon2);
162  }
163  } else if (collSelGG.empty() && collSelGT.empty() && !collSelTT.empty()) {
164  //CHECK THAT THEY ARE ORDERED BY PT !!!!!!!!!!!!!!!!!!!!!!!
165  const pat::Muon* muon1 = dynamic_cast<const pat::Muon*>(collSelTT[0]->daughter("muon1"));
166  const pat::Muon* muon2 = dynamic_cast<const pat::Muon*>(collSelTT[0]->daughter("muon2"));
167  if (muonType_ == -1 || muonType_ == -4) {
168  tracks.push_back(*(muon1->innerTrack()));
169  tracks.push_back(*(muon2->innerTrack()));
170  collMuSel.push_back(muon1);
171  collMuSel.push_back(muon2);
172  }
173  }
174  if (tracks.size() != 2 && !tracks.empty()) {
175  std::cout << "ERROR strange number of muons selected by onia cuts!" << std::endl;
176  abort();
177  }
179  } else if ((muonType_ < 4 && muonType_ >= 0) || muonType_ >= 10) { // Muons (glb,sta,trk)
180  std::vector<reco::Track> tracks;
181  if (PATmuons_ == true) {
183  event.getByLabel(muonLabel_, allMuons);
184  if (muonType_ == 0) {
185  // Take directly the muon
187  } else {
188  for (std::vector<pat::Muon>::const_iterator muon = allMuons->begin(); muon != allMuons->end(); ++muon) {
189  //std::cout<<"pat muon is global "<<muon->isGlobalMuon()<<std::endl;
191  }
193  }
194  } else {
196  event.getByLabel(muonLabel_, allMuons);
197  if (muonType_ == 0) {
198  // Take directly the muon
200  } else {
201  for (std::vector<reco::Muon>::const_iterator muon = allMuons->begin(); muon != allMuons->end(); ++muon) {
203  }
205  }
206  }
207  } else if (muonType_ == 4) { //CaloMuons
209  event.getByLabel(muonLabel_, caloMuons);
210  std::vector<reco::Track> tracks;
211  for (std::vector<reco::CaloMuon>::const_iterator muon = caloMuons->begin(); muon != caloMuons->end(); ++muon) {
212  tracks.push_back(*(muon->track()));
213  }
215  }
216 
217  else if (muonType_ == 5) { // Inner tracker tracks
219  event.getByLabel(muonLabel_, tracks);
221  }
222  plotter->fillRec(muons);
223 
224  // Generation and simulation part
225  if (speedup_ == false) {
226  if (PATmuons_) {
227  // EM 2015.04.02 temporary fix to run on MINIAODSIM (which contains PAT muons) but not the "onia2MuMuPatTrkTrk" collection
228  // selectGeneratedMuons(collAll, collMuSel, genPair, plotter);
229  selectGenSimMuons(event, genPair, simPair, plotter);
230  } else {
231  selectGenSimMuons(event, genPair, simPair, plotter);
232  }
233  }
234 }
235 
238  const std::vector<const pat::Muon*>& collMuSel,
239  std::vector<GenMuonPair>& genPair,
241  reco::GenParticleCollection genPatParticles{};
242 
243  //explicitly for JPsi but can be adapted!!!!!
244  for (std::vector<pat::CompositeCandidate>::const_iterator it = collAll->begin(); it != collAll->end(); ++it) {
245  reco::GenParticleRef genJpsi = it->genParticleRef();
246  bool isMatched = (genJpsi.isAvailable() && genJpsi->pdgId() == 443);
247  if (isMatched) {
248  genPatParticles.push_back(*genJpsi.get());
249  }
250  }
251 
252  if (collMuSel.size() == 2) {
253  reco::GenParticleRef genMu1 = collMuSel[0]->genParticleRef();
254  reco::GenParticleRef genMu2 = collMuSel[1]->genParticleRef();
255  bool isMuMatched = (genMu1.isAvailable() && genMu2.isAvailable() && genMu1->pdgId() * genMu2->pdgId() == -169);
256  if (isMuMatched) {
257  genPatParticles.push_back(*genMu1.get());
258  genPatParticles.push_back(*genMu2.get());
259 
260  unsigned int motherId = 0;
261  if (genMu1->mother() != nullptr) {
262  motherId = genMu1->mother()->pdgId();
263  }
264  if (genMu1->pdgId() == 13)
265  genPair.push_back(GenMuonPair(genMu1.get()->p4(), genMu2.get()->p4(), motherId));
266  else
267  // genPair.push_back(std::make_pair(genMu2.get()->p4(),genMu1.get()->p4()) );
268  genPair.push_back(GenMuonPair(genMu2.get()->p4(), genMu1.get()->p4(), motherId));
269 
270  plotter->fillGen(genPatParticles, true);
271 
272  if (debug_ > 0)
273  std::cout << "Found genParticles in PAT" << std::endl;
274  } else {
275  std::cout << "No recomuon selected so no access to generated info" << std::endl;
276  // Fill it in any case, otherwise it will not be in sync with the event number
277  // genPair.push_back( std::make_pair( lorentzVector(0.,0.,0.,0.), lorentzVector(0.,0.,0.,0.) ) );
278  genPair.push_back(GenMuonPair(lorentzVector(0., 0., 0., 0.), lorentzVector(0., 0., 0., 0.), 0));
279  }
280  } else {
281  std::cout << "No recomuon selected so no access to generated info" << std::endl;
282  // Fill it in any case, otherwise it will not be in sync with the event number
283  // genPair.push_back( std::make_pair( lorentzVector(0.,0.,0.,0.), lorentzVector(0.,0.,0.,0.) ) );
284  genPair.push_back(GenMuonPair(lorentzVector(0., 0., 0., 0.), lorentzVector(0., 0., 0., 0.), 0));
285  }
286  if (debug_ > 0) {
287  std::cout << "genParticles:" << std::endl;
288  // std::cout << genPair.back().first << " , " << genPair.back().second << std::endl;
289  std::cout << genPair.back().mu1 << " , " << genPair.back().mu2 << std::endl;
290  }
291 }
292 
294  std::vector<GenMuonPair>& genPair,
295  std::vector<std::pair<lorentzVector, lorentzVector> >& simPair,
297  // Find and store in histograms the generated and simulated resonance and muons
298  // ----------------------------------------------------------------------------
301 
302  // Fill gen information only in the first loop
303  bool ifHepMC = false;
304 
305  event.getByLabel(genParticlesName_, evtMC);
306  event.getByLabel(genParticlesName_, genParticles);
307  if (evtMC.isValid()) {
308  genPair.push_back(findGenMuFromRes(evtMC.product()));
309  plotter->fillGen(*evtMC, sherpa_);
310  ifHepMC = true;
311  if (debug_ > 0)
312  std::cout << "Found hepMC" << std::endl;
313  } else if (genParticles.isValid()) {
314  genPair.push_back(findGenMuFromRes(genParticles.product()));
315  plotter->fillGen(*genParticles);
316  if (debug_ > 0)
317  std::cout << "Found genParticles" << std::endl;
318  } else {
319  std::cout << "ERROR "
320  << "non generation info and speedup true!!!!!!!!!!!!" << std::endl;
321  // Fill it in any case, otherwise it will not be in sync with the event number
322  // genPair.push_back( std::make_pair( lorentzVector(0.,0.,0.,0.), lorentzVector(0.,0.,0.,0.) ) );
323  genPair.push_back(GenMuonPair(lorentzVector(0., 0., 0., 0.), lorentzVector(0., 0., 0., 0.), 0));
324  }
325  if (debug_ > 0) {
326  std::cout << "genParticles:" << std::endl;
327  std::cout << genPair.back().mu1 << " , " << genPair.back().mu2 << std::endl;
328  }
329  selectSimulatedMuons(event, ifHepMC, evtMC, simPair, plotter);
330 }
331 
333  const bool ifHepMC,
335  std::vector<std::pair<lorentzVector, lorentzVector> >& simPair,
338  bool simTracksFound = false;
339  event.getByLabel(simTracksCollectionName_, simTracks);
340  if (simTracks.isValid()) {
341  plotter->fillSim(simTracks);
342  if (ifHepMC) {
343  simPair.push_back(findSimMuFromRes(evtMC, simTracks));
344  simTracksFound = true;
345  plotter->fillGenSim(evtMC, simTracks);
346  }
347  } else {
348  std::cout << "SimTracks not existent" << std::endl;
349  }
350  if (!simTracksFound) {
351  simPair.push_back(std::make_pair(lorentzVector(0., 0., 0., 0.), lorentzVector(0., 0., 0., 0.)));
352  }
353 }
354 
356  const HepMC::GenEvent* Evt = evtMC->GetEvent();
357  GenMuonPair muFromRes;
358  //Loop on generated particles
359  for (HepMC::GenEvent::particle_const_iterator part = Evt->particles_begin(); part != Evt->particles_end(); part++) {
360  if (std::abs((*part)->pdg_id()) == 13 && (*part)->status() == 1) {
361  bool fromRes = false;
362  unsigned int motherPdgId = 0;
363  for (HepMC::GenVertex::particle_iterator mother = (*part)->production_vertex()->particles_begin(HepMC::ancestors);
364  mother != (*part)->production_vertex()->particles_end(HepMC::ancestors);
365  ++mother) {
366  motherPdgId = (*mother)->pdg_id();
367 
368  // For sherpa the resonance is not saved. The muons from the resonance can be identified
369  // by having as mother a muon of status 3.
370  if (sherpa_) {
371  if (motherPdgId == 13 && (*mother)->status() == 3)
372  fromRes = true;
373  } else {
374  for (int ires = 0; ires < 6; ++ires) {
375  if (motherPdgId == motherPdgIdArray[ires] && resfind_[ires])
376  fromRes = true;
377  }
378  }
379  }
380  if (fromRes) {
381  if ((*part)->pdg_id() == 13) {
382  // muFromRes.first = (*part)->momentum();
383  muFromRes.mu1 = (lorentzVector(
384  (*part)->momentum().px(), (*part)->momentum().py(), (*part)->momentum().pz(), (*part)->momentum().e()));
385  } else {
386  muFromRes.mu2 = (lorentzVector(
387  (*part)->momentum().px(), (*part)->momentum().py(), (*part)->momentum().pz(), (*part)->momentum().e()));
388  }
389  muFromRes.motherId = motherPdgId;
390  }
391  }
392  }
393  return muFromRes;
394 }
395 
396 // std::pair<lorentzVector, lorentzVector> MuScleFitMuonSelector::findGenMuFromRes( const reco::GenParticleCollection* genParticles)
398  // std::pair<lorentzVector,lorentzVector> muFromRes;
399  GenMuonPair muFromRes;
400 
401  //Loop on generated particles
402  if (debug_ > 0)
403  std::cout << "Starting loop on " << genParticles->size() << " genParticles" << std::endl;
404  for (reco::GenParticleCollection::const_iterator part = genParticles->begin(); part != genParticles->end(); ++part) {
405  if (debug_ > 0)
406  std::cout << "genParticle has pdgId = " << std::abs(part->pdgId()) << " and status = " << part->status()
407  << std::endl;
408  if (std::abs(part->pdgId()) == 13) { // && part->status()==3) {
409  bool fromRes = false;
410  unsigned int motherPdgId = part->mother()->pdgId();
411  if (debug_ > 0) {
412  std::cout << "Found a muon with mother: " << motherPdgId << std::endl;
413  }
414  for (int ires = 0; ires < 6; ++ires) {
415  // if( motherPdgId == motherPdgIdArray[ires] && resfind_[ires] ) fromRes = true; // changed by EM 2015.07.30
416  // begin of comment
417  // the list of resonances motherPdgIdArray does not contain the photon (PdgId = 21) while ~1% of the
418  // mu+mu- events in the range [50,120] GeV has a photon as the mother.
419  // It needs to be fixed without spoiling the logic of the selection of different resonances
420  // e.g. mixing up onia etc.
421  // end of comment
422  if ((motherPdgId == motherPdgIdArray[ires] && resfind_[ires]) || motherPdgId == 21)
423  fromRes = true;
424  }
425  if (fromRes) {
426  if (debug_ > 0)
427  std::cout << "fromRes = true, motherPdgId = " << motherPdgId << std::endl;
428  const reco::Candidate* status3Muon = &(*part);
429  const reco::Candidate* status1Muon = getStatus1Muon(status3Muon);
430  if (part->pdgId() == 13) {
431  if (status1Muon->p4().pt() != 0)
432  muFromRes.mu1 = MuScleFitMuon(status1Muon->p4(), -1);
433  else
434  muFromRes.mu1 = MuScleFitMuon(status3Muon->p4(), -1);
435  if (debug_ > 0)
436  std::cout << "Found a genMuon - : " << muFromRes.mu1 << std::endl;
437  // muFromRes.first = (lorentzVector(status1Muon->p4().px(),status1Muon->p4().py(),
438  // status1Muon->p4().pz(),status1Muon->p4().e()));
439  } else {
440  if (status1Muon->p4().pt() != 0)
441  muFromRes.mu2 = MuScleFitMuon(status1Muon->p4(), +1);
442  else
443  muFromRes.mu2 = MuScleFitMuon(status3Muon->p4(), +1);
444  if (debug_ > 0)
445  std::cout << "Found a genMuon + : " << muFromRes.mu2 << std::endl;
446  // muFromRes.second = (lorentzVector(status1Muon->p4().px(),status1Muon->p4().py(),
447  // status1Muon->p4().pz(),status1Muon->p4().e()));
448  }
449  muFromRes.motherId = motherPdgId;
450  }
451  }
452  }
453  return muFromRes;
454 }
455 
456 std::pair<lorentzVector, lorentzVector> MuScleFitMuonSelector::findSimMuFromRes(
458  //Loop on simulated tracks
459  std::pair<lorentzVector, lorentzVector> simMuFromRes;
460  for (edm::SimTrackContainer::const_iterator simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack) {
461  //Chose muons
462  if (std::abs((*simTrack).type()) == 13) {
463  //If tracks from IP than find mother
464  if ((*simTrack).genpartIndex() > 0) {
465  HepMC::GenParticle* gp = evtMC->GetEvent()->barcode_to_particle((*simTrack).genpartIndex());
466  if (gp != nullptr) {
467  for (HepMC::GenVertex::particle_iterator mother = gp->production_vertex()->particles_begin(HepMC::ancestors);
468  mother != gp->production_vertex()->particles_end(HepMC::ancestors);
469  ++mother) {
470  bool fromRes = false;
471  unsigned int motherPdgId = (*mother)->pdg_id();
472  for (int ires = 0; ires < 6; ++ires) {
473  if ((motherPdgId == motherPdgIdArray[ires] && resfind_[ires]) || motherPdgId == 21)
474  fromRes = true;
475  }
476  if (fromRes) {
477  if (gp->pdg_id() == 13)
478  simMuFromRes.first = lorentzVector(simTrack->momentum().px(),
479  simTrack->momentum().py(),
480  simTrack->momentum().pz(),
481  simTrack->momentum().e());
482  else
483  simMuFromRes.second = lorentzVector(simTrack->momentum().px(),
484  simTrack->momentum().py(),
485  simTrack->momentum().pz(),
486  simTrack->momentum().e());
487  }
488  }
489  }
490  // else LogDebug("MuScleFitUtils") << "WARNING: no matching genParticle found for simTrack" << std::endl;
491  }
492  }
493  }
494  return simMuFromRes;
495 }
reco::Candidate::daughter
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
GenMuonPair::mu2
MuScleFitMuon mu2
Definition: GenMuonPair.h:52
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
cscDigiValidation_cfi.simTrack
simTrack
Definition: cscDigiValidation_cfi.py:29
mps_fire.i
i
Definition: mps_fire.py:428
genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
edm::Handle::product
T const * product() const
Definition: Handle.h:70
muon
Definition: MuonCocktails.h:17
MuScleFitMuonSelector::motherPdgIdArray
static const unsigned int motherPdgIdArray[6]
Definition: MuScleFitMuonSelector.h:160
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
GenMuonPair
Definition: GenMuonPair.h:19
pat::CompositeCandidate
Analysis-level particle class.
Definition: CompositeCandidate.h:31
MuScleFitMuonSelector::findSimMuFromRes
std::pair< lorentzVector, lorentzVector > findSimMuFromRes(const edm::Handle< edm::HepMCProduct > &evtMC, const edm::Handle< edm::SimTrackContainer > &simTracks)
Definition: MuScleFitMuonSelector.cc:456
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MuScleFitMuonSelector::sherpa_
const bool sherpa_
Definition: MuScleFitMuonSelector.h:157
MuScleFitMuonSelector::getStatus3Muon
const reco::Candidate * getStatus3Muon(const reco::Candidate *status3Muon)
Definition: MuScleFitMuonSelector.cc:32
GenMuonPair::motherId
Int_t motherId
Definition: GenMuonPair.h:53
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition: GenParticleFwd.h:13
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
MuScleFitMuonSelector::muonType_
const int muonType_
Definition: MuScleFitMuonSelector.h:150
MuScleFitMuonSelector::findGenMuFromRes
GenMuonPair findGenMuFromRes(const reco::GenParticleCollection *genParticles)
Definition: MuScleFitMuonSelector.cc:397
TrackCandidateProducer_cfi.simTracks
simTracks
Definition: TrackCandidateProducer_cfi.py:15
MuScleFitMuon
Definition: Muon.h:14
MuScleFitMuonSelector::selTrackerMuon
bool selTrackerMuon(const pat::Muon *aMuon)
Apply the Onia cuts to select trackerMuons.
Definition: MuScleFitMuonSelector.cc:70
MuScleFitMuonSelector::debug_
const bool debug_
Definition: MuScleFitMuonSelector.h:158
pat::Muon
Analysis-level muon class.
Definition: Muon.h:51
MuScleFitMuonSelector::muonLabel_
const edm::InputTag muonLabel_
Definition: MuScleFitMuonSelector.h:149
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
MuScleFitMuonSelector::selGlobalMuon
bool selGlobalMuon(const pat::Muon *aMuon)
Apply the Onia cuts to select globalMuons.
Definition: MuScleFitMuonSelector.cc:54
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
MuScleFitMuonSelector::PATmuons_
const bool PATmuons_
Definition: MuScleFitMuonSelector.h:151
edm::Ref< TrackCollection >
GenMuonPair::mu1
MuScleFitMuon mu1
Definition: GenMuonPair.h:51
GenParticle.h
ires
int ires[2]
Definition: CascadeWrapper.h:19
reco::HitPattern
Definition: HitPattern.h:147
part
part
Definition: HCALResponse.h:20
MuScleFitMuonSelector.h
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11710
MuScleFitMuonSelector::resfind_
const std::vector< int > resfind_
Definition: MuScleFitMuonSelector.h:152
reco::Candidate::numberOfDaughters
virtual size_type numberOfDaughters() const =0
number of daughters
MuScleFitMuonSelector::genParticlesName_
const std::string genParticlesName_
Definition: MuScleFitMuonSelector.h:154
reco::Muon::isGlobalMuon
bool isGlobalMuon() const override
Definition: Muon.h:299
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
CaloMuon.h
trackerHitRTTI::isMatched
bool isMatched(TrackingRecHit const &hit)
Definition: trackerHitRTTI.h:33
MuScleFitMuonSelector::selectSimulatedMuons
void selectSimulatedMuons(const edm::Event &event, const bool ifHepMC, edm::Handle< edm::HepMCProduct > evtMC, std::vector< std::pair< lorentzVector, lorentzVector > > &simPair, MuScleFitPlotter *plotter)
Definition: MuScleFitMuonSelector.cc:332
allMuons_cfi.allMuons
allMuons
Definition: allMuons_cfi.py:3
lorentzVector
reco::Particle::LorentzVector lorentzVector
Definition: GenMuonPair.h:9
MuScleFitMuonSelector::selectGenSimMuons
void selectGenSimMuons(const edm::Event &event, std::vector< GenMuonPair > &genPair, std::vector< std::pair< lorentzVector, lorentzVector > > &simPair, MuScleFitPlotter *plotter)
Definition: MuScleFitMuonSelector.cc:293
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
cand
Definition: decayParser.h:32
mergedMuons_cfi.caloMuons
caloMuons
Definition: mergedMuons_cfi.py:7
trackingPlots.plotter
plotter
Definition: trackingPlots.py:1297
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
reco::LeafCandidate::charge
int charge() const final
electric charge
Definition: LeafCandidate.h:106
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
MuScleFitMuonSelector::simTracksCollectionName_
const edm::InputTag simTracksCollectionName_
Definition: MuScleFitMuonSelector.h:156
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
reco::Candidate::pdgId
virtual int pdgId() const =0
PDG identifier.
pat::Muon::globalTrack
reco::TrackRef globalTrack() const override
reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon)
Definition: Muon.h:80
reco::Candidate
Definition: Candidate.h:27
objects.autophobj.motherId
motherId
Definition: autophobj.py:237
MuScleFitMuonSelector::getStatus1Muon
const reco::Candidate * getStatus1Muon(const reco::Candidate *status3Muon)
Definition: MuScleFitMuonSelector.cc:9
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
reco::Muon::isTrackerMuon
bool isTrackerMuon() const override
Definition: Muon.h:300
MuScleFitMuonSelector::takeSelectedMuonType
void takeSelectedMuonType(const T &muon, std::vector< reco::Track > &tracks)
Template function used to extract the selected muon type from the muon collection.
Definition: MuScleFitMuonSelector.h:130
MuScleFitMuonSelector::selectGeneratedMuons
void selectGeneratedMuons(const edm::Handle< pat::CompositeCandidateCollection > &collAll, const std::vector< const pat::Muon * > &collMuSel, std::vector< GenMuonPair > &genPair, MuScleFitPlotter *plotter)
For PATmuons the generator information is read directly from the PAT object.
Definition: MuScleFitMuonSelector.cc:237
MuScleFitMuonSelector::mMu2
static const double mMu2
Definition: MuScleFitMuonSelector.h:159
MuScleFitMuonSelector::fillMuonCollection
std::vector< MuScleFitMuon > fillMuonCollection(const std::vector< T > &tracks)
Template function used to convert the muon collection to a vector of reco::LeafCandidate.
Definition: MuScleFitMuonSelector.h:94
MuScleFitPlotter
Definition: MuScleFitPlotter.h:27
pat::Muon::muonID
bool muonID(const std::string &name) const
reco::Candidate::p4
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::HepMCProduct
Definition: HepMCProduct.h:21
MuScleFitMuonSelector::speedup_
const bool speedup_
Definition: MuScleFitMuonSelector.h:153
pat::Muon::innerTrack
reco::TrackRef innerTrack() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon)
Definition: Muon.h:72
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
MuScleFitMuonSelector::selectMuons
void selectMuons(const edm::Event &event, std::vector< MuScleFitMuon > &muons, std::vector< GenMuonPair > &genPair, std::vector< std::pair< lorentzVector, lorentzVector > > &simPair, MuScleFitPlotter *plotter)
Main method used to select muons of type specified by muonType_ from the collection specified by muon...
Definition: MuScleFitMuonSelector.cc:85
Muon.h