CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonCosmicCompatibilityFiller.cc
Go to the documentation of this file.
1 
14 // system include files
15 #include <memory>
16 #include <string>
17 
18 // user include files
24 
28 
34 
37 
40 
41 #include "TMath.h"
42 
43 
44 using namespace edm;
45 using namespace std;
46 
48  inputMuonCollections_(iConfig.getParameter<std::vector<edm::InputTag> >("InputMuonCollections")),
49  inputTrackCollections_(iConfig.getParameter<std::vector<edm::InputTag> >("InputTrackCollections")),
50  inputCosmicMuonCollection_(iConfig.getParameter<edm::InputTag>("InputCosmicMuonCollection")),
51  inputVertexCollection_(iConfig.getParameter<edm::InputTag>("InputVertexCollection")),
52  service_(0)
53 {
54  // service parameters
55  edm::ParameterSet serviceParameters = iConfig.getParameter<edm::ParameterSet>("ServiceParameters");
56  service_ = new MuonServiceProxy(serviceParameters);
57 
58  //kinematic vars
59  angleThreshold_ = iConfig.getParameter<double>("angleCut");
60  deltaPt_ = iConfig.getParameter<double>("deltaPt");
61  //time
62  offTimePosTightMult_ = iConfig.getParameter<double>("offTimePosTightMult");
63  offTimeNegTightMult_ = iConfig.getParameter<double>("offTimeNegTightMult");
64  offTimePosTight_ = iConfig.getParameter<double>("offTimePosTight");
65  offTimeNegTight_ = iConfig.getParameter<double>("offTimeNegTight");
66  offTimePosLooseMult_ = iConfig.getParameter<double>("offTimePosLooseMult");
67  offTimeNegLooseMult_ = iConfig.getParameter<double>("offTimeNegLooseMult");
68  offTimePosLoose_ = iConfig.getParameter<double>("offTimePosLoose");
69  offTimeNegLoose_ = iConfig.getParameter<double>("offTimeNegLoose");
70  corrTimeNeg_ = iConfig.getParameter<double>("corrTimeNeg");
71  corrTimePos_ = iConfig.getParameter<double>("corrTimePos");
72  //rechits
73  sharedHits_ = iConfig.getParameter<int>("sharedHits");
74  sharedFrac_ = iConfig.getParameter<double>("sharedFrac");
75  ipThreshold_ = iConfig.getParameter<double>("ipCut");
76  //segment comp, matches
77  nChamberMatches_ = iConfig.getParameter<int>("nChamberMatches");
78  segmentComp_ = iConfig.getParameter<double>("segmentComp");
79  //ip, vertex
80  maxdzLooseMult_ = iConfig.getParameter<double>("maxdzLooseMult");
81  maxdxyLooseMult_ = iConfig.getParameter<double>("maxdxyLooseMult");
82  maxdzTightMult_ = iConfig.getParameter<double>("maxdzTightMult");
83  maxdxyTightMult_ = iConfig.getParameter<double>("maxdxyTightMult");
84  maxdzLoose_ = iConfig.getParameter<double>("maxdzLoose");
85  maxdxyLoose_ = iConfig.getParameter<double>("maxdxyLoose");
86  maxdzTight_ = iConfig.getParameter<double>("maxdzTight");
87  maxdxyTight_ = iConfig.getParameter<double>("maxdxyTight");
88  largedxyMult_ = iConfig.getParameter<double>("largedxyMult");
89  largedxy_ = iConfig.getParameter<double>("largedxy");
90  hIpTrdxy_ = iConfig.getParameter<double>("hIpTrdxy");
91  hIpTrvProb_ = iConfig.getParameter<double>("hIpTrvProb");
92  minvProb_ = iConfig.getParameter<double>("minvProb");
93  maxvertZ_ = iConfig.getParameter<double>("maxvertZ");
94  maxvertRho_ = iConfig.getParameter<double>("maxvertRho");
95 // nTrackThreshold_ = iConfig.getParameter<unsigned int>("nTrackThreshold");
96 
97  for(unsigned int i=0;i<inputMuonCollections_.size();++i)
99  for(unsigned int i=0;i<inputTrackCollections_.size();++i)
101 
104 
105 
106 
107 
108 }
109 
111  if (service_) delete service_;
112 }
113 
116 {
117  const std::string theCategory = "MuonCosmicCompatibilityFiller";
118 
120 
121  service_->update(iSetup);
122 
123  float timeCompatibility = muonTiming(iEvent, muon, false);
124  float backToBackCompatibility = backToBack2LegCosmic(iEvent,muon);
125  float overlapCompatibility = isOverlappingMuon(iEvent,iSetup,muon);
126  float ipCompatibility = pvMatches(iEvent,muon,false);
127  float vertexCompatibility = eventActivity(iEvent,muon);
128  float combinedCompatibility = combinedCosmicID(iEvent,iSetup,muon,false,false);
129 
130  returnComp.timeCompatibility = timeCompatibility;
131  returnComp.backToBackCompatibility = backToBackCompatibility;
132  returnComp.overlapCompatibility = overlapCompatibility;
133  returnComp.cosmicCompatibility = combinedCompatibility;
134  returnComp.ipCompatibility = ipCompatibility;
135  returnComp.vertexCompatibility = vertexCompatibility;
136 
137  return returnComp;
138 
139 }
140 
141 //
142 //Timing: 0 - not cosmic-like
143 //
144 float
146 
147  float offTimeNegMult, offTimePosMult, offTimeNeg, offTimePos;
148 
149  if (isLoose) {
150  //use "loose" parameter set
151  offTimeNegMult = offTimeNegLooseMult_;
152  offTimePosMult = offTimePosLooseMult_;
153  offTimeNeg = offTimeNegLoose_;
154  offTimePos = offTimePosLoose_;
155  } else {
156  offTimeNegMult = offTimeNegTightMult_;
157  offTimePosMult = offTimePosTightMult_;
158  offTimeNeg = offTimeNegTight_;
159  offTimePos = offTimePosTight_;
160  }
161 
162  float result = 0.0;
163 
164  if( muon.isTimeValid() ) {
165  //case of multiple muon event
166  if (nMuons(iEvent) > 1) {
167 
168  float positiveTime = 0;
169  if ( muon.time().timeAtIpInOut < offTimeNegMult || muon.time().timeAtIpInOut > offTimePosMult) result = 1.;
170  if ( muon.time().timeAtIpInOut > 0.) positiveTime = muon.time().timeAtIpInOut;
171 
172  //special case, looking for time-correlation
173  // between muons in opposite hemispheres
174  if (!isLoose && result == 0 && positiveTime > corrTimePos_) {
175 
176  //check hemi of this muon
177  bool isUp = false;
178  reco::TrackRef outertrack = muon.outerTrack();
179  if( outertrack.isNonnull() ) {
180  if( outertrack->phi() > 0 ) isUp = true;
181 
182  //loop over muons in that event and find if there are any in the opposite hemi
184  iEvent.getByToken(muonTokens_[1], muonHandle);
185 
186  if( !muonHandle.failedToGet() ) {
187  for ( reco::MuonCollection::const_iterator iMuon = muonHandle->begin(); iMuon != muonHandle->end(); ++iMuon ) {
188  if (!iMuon->isGlobalMuon()) continue;
189 
190  reco::TrackRef checkedTrack = iMuon->outerTrack();
191  if( muon.isTimeValid() ) {
192 
193  // from bottom up
194  if (checkedTrack->phi() < 0 && isUp) {
195  if (iMuon->time().timeAtIpInOut < corrTimeNeg_) result = 1.0;
196  break;
197  } else if (checkedTrack->phi() > 0 && !isUp) {
198  // from top down
199  if (iMuon->time().timeAtIpInOut < corrTimeNeg_) result = 1.0;
200  break;
201  }
202  } //muon is time valid
203  }
204  }
205  } //track is nonnull
206  } //double check timing
207  } else {
208  //case of a single muon event
209  if ( muon.time().timeAtIpInOut < offTimeNeg || muon.time().timeAtIpInOut > offTimePos) result = 1.;
210  }
211  } //is time valid
212 
213 
214  if (!isLoose && result > 0) {
215  //check loose ip
216  if (pvMatches(iEvent, muon, true) == 0) result *= 2.;
217  }
218 
219  return result;
220 }
221 
222 //
223 //Back-to-back selector
224 //
225 unsigned int
227 
228  unsigned int result = 0; //no partners - collision
229  reco::TrackRef track;
230  if ( muon.isGlobalMuon() ) track = muon.innerTrack();
231  else if ( muon.isTrackerMuon() ) track = muon.track();
232  else if ( muon.isStandAloneMuon() || muon.isRPCMuon() ) return false;
233 
234  for (unsigned int iColl = 0; iColl<trackTokens_.size(); ++iColl){
236  iEvent.getByToken(trackTokens_[iColl],trackHandle);
237  if (muonid::findOppositeTrack(trackHandle, *track, angleThreshold_, deltaPt_).isNonnull()) {
238  result++;
239  }
240  } //loop over track collections
241 
242  return result;
243 }
244 
245 //
246 //Check the number of global muons in an event, return true if there are more than 1 muon
247 //
248 unsigned int
250 
251  unsigned int nGlb = 0;
252 
254  iEvent.getByToken(muonTokens_[1], muonHandle);
255 
256  if( !muonHandle.failedToGet() ) {
257  for ( reco::MuonCollection::const_iterator iMuon = muonHandle->begin(); iMuon != muonHandle->end(); ++iMuon ) {
258  if (!iMuon->isGlobalMuon()) continue;
259  nGlb++;
260  }
261  }
262 
263  return nGlb;
264 }
265 
266 
267 //
268 //Check overlap between collections, use shared hits info
269 //
270 bool
272 
273  // 4 steps in this module
274  // step1 : check whether it's 1leg cosmic muon or not
275  // step2 : both muons (muons and muonsFromCosmics1Leg) should have close IP
276  // step3 : both muons should share very close reference point
277  // step4 : check shared hits in both muon tracks
278 
279  // check if this muon is available in muonsFromCosmics collection
280  bool overlappingMuon = false; //false - not cosmic-like
281  if( !muon.isGlobalMuon() ) return false;
282 
283  // reco muons for cosmics
285  iEvent.getByToken(cosmicToken_, muonHandle);
286 
287  // Global Tracking Geometry
289  iSetup.get<GlobalTrackingGeometryRecord>().get(trackingGeometry);
290 
291  // PV
292  math::XYZPoint RefVtx;
293  RefVtx.SetXYZ(0, 0, 0);
294 
296  iEvent.getByToken(vertexToken_,pvHandle);
297  const reco::VertexCollection & vertices = *pvHandle.product();
298  for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it) {
299  RefVtx = it->position();
300  }
301 
302 
303  if( !muonHandle.failedToGet() ) {
304  for ( reco::MuonCollection::const_iterator cosmicMuon = muonHandle->begin();cosmicMuon != muonHandle->end(); ++cosmicMuon ) {
305  if ( cosmicMuon->innerTrack() == muon.innerTrack() || cosmicMuon->outerTrack() == muon.outerTrack()) return true;
306 
307  reco::TrackRef outertrack = muon.outerTrack();
308  reco::TrackRef costrack = cosmicMuon->outerTrack();
309 
310  bool isUp = false;
311  if( outertrack->phi() > 0 ) isUp = true;
312 
313  // shared hits
314  int RecHitsMuon = outertrack->numberOfValidHits();
315  int RecHitsCosmicMuon = 0;
316  int shared = 0;
317  // count hits for same hemisphere
318  if( costrack.isNonnull() ) {
319  int nhitsUp = 0;
320  int nhitsDown = 0;
321  // unused
322  // bool isCosmic1Leg = false;
323  // bool isCloseIP = false;
324  // bool isCloseRef = false;
325 
326  for( trackingRecHit_iterator coshit = costrack->recHitsBegin(); coshit != costrack->recHitsEnd(); coshit++ ) {
327  if( (*coshit)->isValid() ) {
328  DetId id((*coshit)->geographicalId());
329  double hity = trackingGeometry->idToDet(id)->position().y();
330  if( hity > 0 ) nhitsUp++;
331  if( hity < 0 ) nhitsDown++;
332 
333  if( isUp && hity > 0 ) RecHitsCosmicMuon++;
334  if( !isUp && hity < 0 ) RecHitsCosmicMuon++;
335  }
336  }
337  // step1
338  //UNUSED: if( nhitsUp > 0 && nhitsDown > 0 ) isCosmic1Leg = true;
339  //if( !isCosmic1Leg ) continue;
340 
341  if( outertrack.isNonnull() ) {
342  // step2
343  //UNUSED: const double ipErr = (double)outertrack->d0Error();
344  //UNUSED: double ipThreshold = max(ipThreshold_, ipErr);
345  //UNUSED: if( fabs(outertrack->dxy(RefVtx) + costrack->dxy(RefVtx)) < ipThreshold ) isCloseIP = true;
346  //if( !isCloseIP ) continue;
347 
348  // step3
349  GlobalPoint muonRefVtx( outertrack->vx(), outertrack->vy(), outertrack->vz() );
350  GlobalPoint cosmicRefVtx( costrack->vx(), costrack->vy(), costrack->vz() );
351  //UNUSED: float dist = (muonRefVtx - cosmicRefVtx).mag();
352  //UNUSED: if( dist < 0.1 ) isCloseRef = true;
353  //if( !isCloseRef ) continue;
354 
355  for( trackingRecHit_iterator trkhit = outertrack->recHitsBegin(); trkhit != outertrack->recHitsEnd(); trkhit++ ) {
356  if( (*trkhit)->isValid() ) {
357  for( trackingRecHit_iterator coshit = costrack->recHitsBegin(); coshit != costrack->recHitsEnd(); coshit++ ) {
358  if( (*coshit)->isValid() ) {
359  if( (*trkhit)->geographicalId() == (*coshit)->geographicalId() ) {
360  if( ((*trkhit)->localPosition() - (*coshit)->localPosition()).mag()< 10e-5 ) shared++;
361  }
362 
363  }
364  }
365  }
366  }
367  }
368  }
369  // step4
370  double fraction = -1;
371  if( RecHitsMuon != 0 ) fraction = shared/(double)RecHitsMuon;
372  // std::cout << "shared = " << shared << " " << fraction << " " << RecHitsMuon << " " << RecHitsCosmicMuon << std::endl;
373  if( shared > sharedHits_ && fraction > sharedFrac_ ) {
374  overlappingMuon = true;
375  break;
376  }
377  }
378  }
379 
380  return overlappingMuon;
381 }
382 
383 //
384 //pv matches
385 //
386 unsigned int
388 
389  float maxdxyMult, maxdzMult, maxdxy, maxdz;
390 
391  if (isLoose) {
392  //use "loose" parameter set
393  maxdxyMult = maxdxyLooseMult_;
394  maxdzMult = maxdzLooseMult_;
395  maxdxy = maxdxyLoose_;
396  maxdz = maxdzLoose_;
397  } else {
398  maxdxyMult = maxdxyTightMult_;
399  maxdzMult = maxdzTightMult_;
400  maxdxy = maxdxyTight_;
401  maxdz = maxdzTight_;
402  }
403 
404  unsigned int result = 0;
405 
406  reco::TrackRef track;
407  if ( muon.isGlobalMuon() ) track = muon.innerTrack();
408  else if ( muon.isTrackerMuon() || muon.isRPCMuon() ) track = muon.track();
409  else if ( muon.isStandAloneMuon()) track = muon.standAloneMuon();
410 
411  bool multipleMu = false;
412  if (nMuons(iEvent) > 1) multipleMu = true;
413 
414  math::XYZPoint RefVtx;
415  RefVtx.SetXYZ(0, 0, 0);
416 
418  iEvent.getByToken(vertexToken_,pvHandle);
419  const reco::VertexCollection & vertices = *pvHandle.product();
420  for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){
421  RefVtx = it->position();
422 
423  if ( track.isNonnull() ) {
424  if (multipleMu) {
425  //multiple muon event
426 
427  if ( fabs( (*track).dxy(RefVtx) ) < maxdxyMult || fabs( (*track).dz(RefVtx) ) < maxdzMult) {
428  result++;
429 
430  //case of extra large dxy
431  if (!isLoose && fabs( (*track).dxy(RefVtx) ) > largedxyMult_) result -= 1;
432 
433  }
434  } else {
435  //single muon event
436 
437  if (fabs( (*track).dxy(RefVtx) ) < maxdxy || fabs( (*track).dz(RefVtx) ) < maxdz) {
438  result++;
439 
440  //case of extra large dxy
441  if (!isLoose && fabs( (*track).dxy(RefVtx) ) > largedxy_) result -= 1;
442 
443  }
444  }
445  }//track is nonnull
446 }//loop over vertices
447 
448  //special case for non-cosmic large ip muons
449  if (result == 0 && multipleMu) {
450  // consider all reco muons in an event
452  iEvent.getByToken(muonTokens_[1], muonHandle);
453 
454  //cosmic event should have zero good vertices
456  iEvent.getByToken(vertexToken_,pvHandle);
457  const reco::VertexCollection & vertices = *pvHandle.product();
458 
459  //find the "other" one
460  if( !muonHandle.failedToGet() ) {
461  for ( reco::MuonCollection::const_iterator muons = muonHandle->begin(); muons != muonHandle->end(); ++muons ) {
462  if (!muons->isGlobalMuon()) continue;
463  //skip this track
464  if ( muons->innerTrack() == muon.innerTrack() && muons->outerTrack() == muon.outerTrack()) continue;
465  //check ip and vertex of the "other" muon
467  if (muons->isGlobalMuon()) tracks = muons->innerTrack();
468  if (fabs((*tracks).dxy(RefVtx)) > hIpTrdxy_) continue;
469  //check if vertex collection is empty
470  if (vertices.begin() == vertices.end()) continue;
471  //for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it) {
472  //find matching vertex by position
473  //if (fabs(it->z() - tracks->vz()) > 0.01) continue; //means will not be untagged from cosmics
474  if (TMath::Prob(vertices.front().chi2(),(int)(vertices.front().ndof())) > hIpTrvProb_) result = 1;
475  //}
476  }
477  }
478  }
479 
480  return result;
481 
482 }
483 
484 float
486  const edm::EventSetup& iSetup, const reco::Muon& muon, bool CheckMuonID, bool checkVertex) const {
487 
488  float result = 0.0;
489 
490  // return >=1 = identify as cosmic muon (the more like cosmics, the higher is the number)
491  // return 0.0 = identify as collision muon
492  if( muon.isGlobalMuon() ) {
493 
494  unsigned int cosmicVertex = eventActivity(iEvent, muon);
495  bool isOverlapping = isOverlappingMuon(iEvent, iSetup, muon);
496  unsigned int looseIp = pvMatches(iEvent, muon, true);
497  unsigned int tightIp = pvMatches(iEvent, muon, false);
498  float looseTime = muonTiming(iEvent, muon, true);
499  float tightTime = muonTiming(iEvent, muon, false);
500  unsigned int backToback = backToBack2LegCosmic(iEvent,muon);
501  //bool cosmicSegment = checkMuonSegments(muon);
502 
503  //short cut to reject cosmic event
504  if (checkVertex && cosmicVertex == 0) return 10.0;
505 
506  // compatibility (0 - 10)
507  // weight is assigned by the performance of individual module
508  // btob: ~90% eff / ~0% misid
509  // ip: ~90% eff / ~0% misid
510  // time: ~30% eff / ~0% misid
511  double weight_btob = 2.0;
512  double weight_ip = 2.0;
513  double weight_time = 1.0;
514  double weight_overlap = 0.5;
515 
516  // collision muon should have compatibility < 4 (0 - 4)
517  // cosmic muon should have compatibility >= 4 (4 - 10)
518 
519  // b-to-b (max comp.: 4.0)
520  if( backToback >= 1 ) {
521  //in this case it is cosmic for sure
522  result += weight_btob*2.;
523  if( tightIp == 1 ) {
524  // check with other observables to reduce mis-id (subtract compatibilities)
525  if( looseIp == 1 ) {
526  if( backToback < 2 ) result -= weight_btob*0.5;
527  }
528  }
529  }
530 
531  // ip (max comp.: 4.0)
532  if( tightIp == 0 ) {
533  //in this case it is cosmic for sure
534  result += weight_ip*2.0;
535  if( backToback == 0 ) {
536  // check with other observables to reduce mis-id (subtract compatibilities)
537  if( tightTime == 0 ) {
538  if( looseTime == 0 && !isOverlapping ) result -= weight_ip*1.0;
539  }
540  }
541  }
542  else if( tightIp >= 2 ) {
543  // in this case it is almost collision-like (reduce compatibility)
544  // if multi pvs: comp = -2.0
545  if( backToback >= 1 ) result -= weight_ip*1.0;
546  }
547 
548  // timing (max comp.: 2.0)
549  if( tightTime > 0 ) {
550  // bonus track
551  if( looseTime > 0 ) {
552  if( backToback >= 1 ) {
553  if( tightIp == 0 ) result += weight_time*tightTime;
554  else if( looseIp == 0 ) result += weight_time*0.25;
555  }
556  }
557  else {
558  if( backToback >= 1 && tightIp == 0 ) result += weight_time*0.25;
559  }
560  }
561 
562  // overlapping
563  if( backToback == 0 && isOverlapping ) {
564  // bonus track
565  if( tightIp == 0 && tightTime >= 1 ) {
566  result += weight_overlap*1.0;
567  }
568  }
569  }//is global muon
570 
571 
572 // if (CheckMuonID && cosmicSegment) result += 4;
573 
574  return result;
575 }
576 
577 
578 
579 //
580 //Track activity/vertex quality, count good vertices
581 //
582 unsigned int
584 {
585 
586  unsigned int result = 0; //no good vertices - cosmic-like
587 
588  //check track activity
590  iEvent.getByToken(trackTokens_[0],tracks);
591  if (!tracks.failedToGet() && tracks->size() < 3) return 0;
592 
593  //cosmic event should have zero good vertices
595  if (!iEvent.getByToken(vertexToken_,pvHandle)) {return 0;} else {
596  const reco::VertexCollection & vertices = *pvHandle.product();
597  //check if vertex collection is empty
598  if (vertices.begin() == vertices.end()) return 0;
599  for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){
600  if ((TMath::Prob(it->chi2(),(int)it->ndof()) > minvProb_) && (fabs(it->z()) <= maxvertZ_) && (fabs(it->position().rho()) <= maxvertRho_)) result++;
601  }
602  }
603  return result;
604 }
605 
606 //
607 //Muon iD variables
608 //
610 {
611  bool result = false;
612  // initial set up using Jordan's study: GlobalMuonPromptTight + TMOneStationLoose
614 
615  return result;
616 }
617 
619 
620  bool result = false;
621  if (imuon.numberOfMatches() < nChamberMatches_ && muon::segmentCompatibility(imuon) < segmentComp_) result = true;
622 
623  return result;
624 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
reco::TrackRef findOppositeTrack(const edm::Handle< reco::TrackCollection > &collection, const reco::Track &muon, double angleMatch=0.01, double momentumMatch=0.05)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
virtual TrackRef innerTrack() const
Definition: Muon.h:48
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
bool isTrackerMuon() const
Definition: Muon.h:219
unsigned int nMuons(const edm::Event &) const
get number of muons in the vent
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
virtual TrackRef track() const
reference to a Track
Definition: Muon.h:49
bool isGlobalMuon() const
Definition: Muon.h:218
std::vector< edm::EDGetTokenT< reco::TrackCollection > > trackTokens_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
unsigned int pvMatches(const edm::Event &, const reco::Muon &, bool) const
return cosmic-likeness based on the 2D impact parameters (dxy, dz wrt to PV). 0 == cosmic-like ...
bool isStandAloneMuon() const
Definition: Muon.h:220
float combinedCosmicID(const edm::Event &, const edm::EventSetup &iSetup, const reco::Muon &, bool CheckMuonID, bool checkVertex) const
combined cosmic-likeness: 0 == not cosmic-like
MuonTime time() const
get timing information
Definition: Muon.h:131
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
float backToBackCompatibility
cosmic-likeness based on presence of a track in opp side: 0 == no matching opp tracks ...
bool isRPCMuon() const
Definition: Muon.h:223
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< reco::MuonCollection > cosmicToken_
tuple result
Definition: query.py:137
unsigned int backToBack2LegCosmic(const edm::Event &, const reco::Muon &) const
return cosmic-likeness based on presence of a track in opp side: 0 == no matching opp tracks ...
std::vector< edm::EDGetTokenT< reco::MuonCollection > > muonTokens_
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
reco::MuonCosmicCompatibility fillCompatibility(const reco::Muon &muon, edm::Event &, const edm::EventSetup &)
fill cosmic compatibility variables
unsigned int eventActivity(const edm::Event &, const reco::Muon &) const
returns cosmic-likeness based on the event activity information: tracker track multiplicity and verte...
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:51
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
float timeCompatibility
cosmic-likeness based on time: 0 == prompt-like
bool failedToGet() const
Definition: HandleBase.h:79
Definition: DetId.h:18
bool isTimeValid() const
Definition: Muon.h:129
T const * product() const
Definition: Handle.h:81
tuple tracks
Definition: testEve_cfg.py:39
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const T & get() const
Definition: EventSetup.h:55
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
MuonCosmicCompatibilityFiller(const edm::ParameterSet &, edm::ConsumesCollector &)
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
tuple muons
Definition: patZpeak.py:38
std::vector< edm::InputTag > inputTrackCollections_
float muonTiming(const edm::Event &iEvent, const reco::Muon &muon, bool isLoose) const
check muon time (DT and CSC) information: 0 == prompt-like
bool checkMuonID(const reco::Muon &) const
tag a muon as cosmic based on the muonID information
bool isOverlappingMuon(const edm::Event &, const edm::EventSetup &iSetup, const reco::Muon &) const
returns cosmic-likeness based on overlap with traversing cosmic muon (only muon/STA hits are used) ...
bool checkMuonSegments(const reco::Muon &muon) const
tag a muon as cosmic based on segment compatibility and the number of segment matches ...
std::vector< edm::InputTag > inputMuonCollections_
float cosmicCompatibility
combined cosmic-likeness: 0 == not cosmic-like
float overlapCompatibility
cosmic-likeness based on overlap with traversing cosmic muon (only muon/STA hits are used) ...
float timeAtIpInOut
Definition: MuonTime.h:14
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
float ipCompatibility
cosmic-likeness based on the 2D impact parameters (dxy, dz wrt to PV). 0 == cosmic-like ...
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track
Definition: Muon.h:52
float vertexCompatibility
cosmic-likeness based on the event activity information: tracker track multiplicity and vertex qualit...