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