CMS 3D CMS Logo

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