CMS 3D CMS Logo

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_(nullptr)
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
230  if ( muon.isGlobalMuon() ) track = muon.innerTrack();
231  else if ( muon.isTrackerMuon() ) track = muon.track();
232  else if ( muon.isStandAloneMuon() || muon.isRPCMuon() || muon.isGEMMuon() || muon.isME0Muon() )
233  return false;
234 
235  for (unsigned int iColl = 0; iColl<trackTokens_.size(); ++iColl){
237  iEvent.getByToken(trackTokens_[iColl],trackHandle);
238  if (muonid::findOppositeTrack(trackHandle, *track, angleThreshold_, deltaPt_).isNonnull()) {
239  result++;
240  }
241  } //loop over track collections
242 
243  return result;
244 }
245 
246 //
247 //Check the number of global muons in an event, return true if there are more than 1 muon
248 //
249 unsigned int
251 
252  unsigned int nGlb = 0;
253 
255  iEvent.getByToken(muonTokens_[1], muonHandle);
256 
257  if( !muonHandle.failedToGet() ) {
258  for ( reco::MuonCollection::const_iterator iMuon = muonHandle->begin(); iMuon != muonHandle->end(); ++iMuon ) {
259  if (!iMuon->isGlobalMuon()) continue;
260  nGlb++;
261  }
262  }
263 
264  return nGlb;
265 }
266 
267 
268 //
269 //Check overlap between collections, use shared hits info
270 //
271 bool
273 
274  // 4 steps in this module
275  // step1 : check whether it's 1leg cosmic muon or not
276  // step2 : both muons (muons and muonsFromCosmics1Leg) should have close IP
277  // step3 : both muons should share very close reference point
278  // step4 : check shared hits in both muon tracks
279 
280  // check if this muon is available in muonsFromCosmics collection
281  bool overlappingMuon = false; //false - not cosmic-like
282  if( !muon.isGlobalMuon() ) return false;
283 
284  // reco muons for cosmics
286  iEvent.getByToken(cosmicToken_, muonHandle);
287 
288  // Global Tracking Geometry
290  iSetup.get<GlobalTrackingGeometryRecord>().get(trackingGeometry);
291 
292  // PV
293  math::XYZPoint RefVtx;
294  RefVtx.SetXYZ(0, 0, 0);
295 
297  iEvent.getByToken(vertexToken_,pvHandle);
298  const reco::VertexCollection & vertices = *pvHandle.product();
299  for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it) {
300  RefVtx = it->position();
301  }
302 
303 
304  if( !muonHandle.failedToGet() ) {
305  for ( reco::MuonCollection::const_iterator cosmicMuon = muonHandle->begin();cosmicMuon != muonHandle->end(); ++cosmicMuon ) {
306  if ( cosmicMuon->innerTrack() == muon.innerTrack() || cosmicMuon->outerTrack() == muon.outerTrack()) return true;
307 
308  reco::TrackRef outertrack = muon.outerTrack();
309  reco::TrackRef costrack = cosmicMuon->outerTrack();
310 
311  bool isUp = false;
312  if( outertrack->phi() > 0 ) isUp = true;
313 
314  // shared hits
315  int RecHitsMuon = outertrack->numberOfValidHits();
316  int RecHitsCosmicMuon = 0;
317  int shared = 0;
318  // count hits for same hemisphere
319  if( costrack.isNonnull() ) {
320  int nhitsUp = 0;
321  int nhitsDown = 0;
322  // unused
323  // bool isCosmic1Leg = false;
324  // bool isCloseIP = false;
325  // bool isCloseRef = false;
326 
327  for( trackingRecHit_iterator coshit = costrack->recHitsBegin(); coshit != costrack->recHitsEnd(); coshit++ ) {
328  if( (*coshit)->isValid() ) {
329  DetId id((*coshit)->geographicalId());
330  double hity = trackingGeometry->idToDet(id)->position().y();
331  if( hity > 0 ) nhitsUp++;
332  if( hity < 0 ) nhitsDown++;
333 
334  if( isUp && hity > 0 ) RecHitsCosmicMuon++;
335  if( !isUp && hity < 0 ) RecHitsCosmicMuon++;
336  }
337  }
338  // step1
339  //UNUSED: if( nhitsUp > 0 && nhitsDown > 0 ) isCosmic1Leg = true;
340  //if( !isCosmic1Leg ) continue;
341 
342  if( outertrack.isNonnull() ) {
343  // step2
344  //UNUSED: const double ipErr = (double)outertrack->d0Error();
345  //UNUSED: double ipThreshold = max(ipThreshold_, ipErr);
346  //UNUSED: if( fabs(outertrack->dxy(RefVtx) + costrack->dxy(RefVtx)) < ipThreshold ) isCloseIP = true;
347  //if( !isCloseIP ) continue;
348 
349  // step3
350  GlobalPoint muonRefVtx( outertrack->vx(), outertrack->vy(), outertrack->vz() );
351  GlobalPoint cosmicRefVtx( costrack->vx(), costrack->vy(), costrack->vz() );
352  //UNUSED: float dist = (muonRefVtx - cosmicRefVtx).mag();
353  //UNUSED: if( dist < 0.1 ) isCloseRef = true;
354  //if( !isCloseRef ) continue;
355 
356  for( trackingRecHit_iterator trkhit = outertrack->recHitsBegin(); trkhit != outertrack->recHitsEnd(); trkhit++ ) {
357  if( (*trkhit)->isValid() ) {
358  for( trackingRecHit_iterator coshit = costrack->recHitsBegin(); coshit != costrack->recHitsEnd(); coshit++ ) {
359  if( (*coshit)->isValid() ) {
360  if( (*trkhit)->geographicalId() == (*coshit)->geographicalId() ) {
361  if( ((*trkhit)->localPosition() - (*coshit)->localPosition()).mag()< 10e-5 ) shared++;
362  }
363 
364  }
365  }
366  }
367  }
368  }
369  }
370  // step4
371  double fraction = -1;
372  if( RecHitsMuon != 0 ) fraction = shared/(double)RecHitsMuon;
373  // std::cout << "shared = " << shared << " " << fraction << " " << RecHitsMuon << " " << RecHitsCosmicMuon << std::endl;
374  if( shared > sharedHits_ && fraction > sharedFrac_ ) {
375  overlappingMuon = true;
376  break;
377  }
378  }
379  }
380 
381  return overlappingMuon;
382 }
383 
384 //
385 //pv matches
386 //
387 unsigned int
389 
390  float maxdxyMult, maxdzMult, maxdxy, maxdz;
391 
392  if (isLoose) {
393  //use "loose" parameter set
394  maxdxyMult = maxdxyLooseMult_;
395  maxdzMult = maxdzLooseMult_;
396  maxdxy = maxdxyLoose_;
397  maxdz = maxdzLoose_;
398  } else {
399  maxdxyMult = maxdxyTightMult_;
400  maxdzMult = maxdzTightMult_;
401  maxdxy = maxdxyTight_;
402  maxdz = maxdzTight_;
403  }
404 
405  unsigned int result = 0;
406 
408  if ( muon.isGlobalMuon() ) track = muon.innerTrack();
409  else if ( muon.isTrackerMuon() || muon.isRPCMuon() ) track = muon.track();
410  else if ( muon.isStandAloneMuon()) track = muon.standAloneMuon();
411 
412  bool multipleMu = false;
413  if (nMuons(iEvent) > 1) multipleMu = true;
414 
415  math::XYZPoint RefVtx;
416  RefVtx.SetXYZ(0, 0, 0);
417 
419  iEvent.getByToken(vertexToken_,pvHandle);
420  const reco::VertexCollection & vertices = *pvHandle.product();
421  for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){
422  RefVtx = it->position();
423 
424  if ( track.isNonnull() ) {
425  if (multipleMu) {
426  //multiple muon event
427 
428  if ( fabs( (*track).dxy(RefVtx) ) < maxdxyMult || fabs( (*track).dz(RefVtx) ) < maxdzMult) {
429  result++;
430 
431  //case of extra large dxy
432  if (!isLoose && fabs( (*track).dxy(RefVtx) ) > largedxyMult_) result -= 1;
433 
434  }
435  } else {
436  //single muon event
437 
438  if (fabs( (*track).dxy(RefVtx) ) < maxdxy || fabs( (*track).dz(RefVtx) ) < maxdz) {
439  result++;
440 
441  //case of extra large dxy
442  if (!isLoose && fabs( (*track).dxy(RefVtx) ) > largedxy_) result -= 1;
443 
444  }
445  }
446  }//track is nonnull
447 }//loop over vertices
448 
449  //special case for non-cosmic large ip muons
450  if (result == 0 && multipleMu) {
451  // consider all reco muons in an event
453  iEvent.getByToken(muonTokens_[1], muonHandle);
454 
455  //cosmic event should have zero good vertices
457  iEvent.getByToken(vertexToken_,pvHandle);
458  const reco::VertexCollection & vertices = *pvHandle.product();
459 
460  //find the "other" one
461  if( !muonHandle.failedToGet() ) {
462  for ( reco::MuonCollection::const_iterator muons = muonHandle->begin(); muons != muonHandle->end(); ++muons ) {
463  if (!muons->isGlobalMuon()) continue;
464  //skip this track
465  if ( muons->innerTrack() == muon.innerTrack() && muons->outerTrack() == muon.outerTrack()) continue;
466  //check ip and vertex of the "other" muon
468  if (muons->isGlobalMuon()) tracks = muons->innerTrack();
469  if (fabs((*tracks).dxy(RefVtx)) > hIpTrdxy_) continue;
470  //check if vertex collection is empty
471  if (vertices.begin() == vertices.end()) continue;
472  //for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it) {
473  //find matching vertex by position
474  //if (fabs(it->z() - tracks->vz()) > 0.01) continue; //means will not be untagged from cosmics
475  if (TMath::Prob(vertices.front().chi2(),(int)(vertices.front().ndof())) > hIpTrvProb_) result = 1;
476  //}
477  }
478  }
479  }
480 
481  return result;
482 
483 }
484 
485 float
487  const edm::EventSetup& iSetup, const reco::Muon& muon, bool CheckMuonID, bool checkVertex) const {
488 
489  float result = 0.0;
490 
491  // return >=1 = identify as cosmic muon (the more like cosmics, the higher is the number)
492  // return 0.0 = identify as collision muon
493  if( muon.isGlobalMuon() ) {
494 
495  unsigned int cosmicVertex = eventActivity(iEvent, muon);
496  bool isOverlapping = isOverlappingMuon(iEvent, iSetup, muon);
497  unsigned int looseIp = pvMatches(iEvent, muon, true);
498  unsigned int tightIp = pvMatches(iEvent, muon, false);
499  float looseTime = muonTiming(iEvent, muon, true);
500  float tightTime = muonTiming(iEvent, muon, false);
501  unsigned int backToback = backToBack2LegCosmic(iEvent,muon);
502  //bool cosmicSegment = checkMuonSegments(muon);
503 
504  //short cut to reject cosmic event
505  if (checkVertex && cosmicVertex == 0) return 10.0;
506 
507  // compatibility (0 - 10)
508  // weight is assigned by the performance of individual module
509  // btob: ~90% eff / ~0% misid
510  // ip: ~90% eff / ~0% misid
511  // time: ~30% eff / ~0% misid
512  double weight_btob = 2.0;
513  double weight_ip = 2.0;
514  double weight_time = 1.0;
515  double weight_overlap = 0.5;
516 
517  // collision muon should have compatibility < 4 (0 - 4)
518  // cosmic muon should have compatibility >= 4 (4 - 10)
519 
520  // b-to-b (max comp.: 4.0)
521  if( backToback >= 1 ) {
522  //in this case it is cosmic for sure
523  result += weight_btob*2.;
524  if( tightIp == 1 ) {
525  // check with other observables to reduce mis-id (subtract compatibilities)
526  if( looseIp == 1 ) {
527  if( backToback < 2 ) result -= weight_btob*0.5;
528  }
529  }
530  }
531 
532  // ip (max comp.: 4.0)
533  if( tightIp == 0 ) {
534  //in this case it is cosmic for sure
535  result += weight_ip*2.0;
536  if( backToback == 0 ) {
537  // check with other observables to reduce mis-id (subtract compatibilities)
538  if( tightTime == 0 ) {
539  if( looseTime == 0 && !isOverlapping ) result -= weight_ip*1.0;
540  }
541  }
542  }
543  else if( tightIp >= 2 ) {
544  // in this case it is almost collision-like (reduce compatibility)
545  // if multi pvs: comp = -2.0
546  if( backToback >= 1 ) result -= weight_ip*1.0;
547  }
548 
549  // timing (max comp.: 2.0)
550  if( tightTime > 0 ) {
551  // bonus track
552  if( looseTime > 0 ) {
553  if( backToback >= 1 ) {
554  if( tightIp == 0 ) result += weight_time*tightTime;
555  else if( looseIp == 0 ) result += weight_time*0.25;
556  }
557  }
558  else {
559  if( backToback >= 1 && tightIp == 0 ) result += weight_time*0.25;
560  }
561  }
562 
563  // overlapping
564  if( backToback == 0 && isOverlapping ) {
565  // bonus track
566  if( tightIp == 0 && tightTime >= 1 ) {
567  result += weight_overlap*1.0;
568  }
569  }
570  }//is global muon
571 
572 
573 // if (CheckMuonID && cosmicSegment) result += 4;
574 
575  return result;
576 }
577 
578 
579 
580 //
581 //Track activity/vertex quality, count good vertices
582 //
583 unsigned int
585 {
586 
587  unsigned int result = 0; //no good vertices - cosmic-like
588 
589  //check track activity
591  iEvent.getByToken(trackTokens_[0],tracks);
592  if (!tracks.failedToGet() && tracks->size() < 3) return 0;
593 
594  //cosmic event should have zero good vertices
596  if (!iEvent.getByToken(vertexToken_,pvHandle)) {return 0;} else {
597  const reco::VertexCollection & vertices = *pvHandle.product();
598  //check if vertex collection is empty
599  if (vertices.begin() == vertices.end()) return 0;
600  for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){
601  if ((TMath::Prob(it->chi2(),(int)it->ndof()) > minvProb_) && (fabs(it->z()) <= maxvertZ_) && (fabs(it->position().rho()) <= maxvertRho_)) result++;
602  }
603  }
604  return result;
605 }
606 
607 //
608 //Muon iD variables
609 //
611 {
612  bool result = false;
613  // initial set up using Jordan's study: GlobalMuonPromptTight + TMOneStationLoose
615 
616  return result;
617 }
618 
620 
621  bool result = false;
622  if (imuon.numberOfMatches() < nChamberMatches_ && muon::segmentCompatibility(imuon) < segmentComp_) result = true;
623 
624  return result;
625 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
reco::TrackRef findOppositeTrack(const edm::Handle< reco::TrackCollection > &collection, const reco::Track &muon, double angleMatch=0.01, double momentumMatch=0.05)
TrackRef track() const override
reference to a Track
Definition: Muon.h:49
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
bool isStandAloneMuon() const override
Definition: Muon.h:278
virtual TrackRef innerTrack() const
Definition: Muon.h:48
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
unsigned int nMuons(const edm::Event &) const
get number of muons in the vent
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
T y() const
Definition: PV3DBase.h:63
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 ...
#define nullptr
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 DT/CSC combined timing information
Definition: Muon.h:131
bool isME0Muon() const
Definition: Muon.h:283
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
bool isTrackerMuon() const override
Definition: Muon.h:277
int numberOfMatches(unsigned int type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
float backToBackCompatibility
cosmic-likeness based on presence of a track in opp side: 0 == no matching opp tracks ...
bool isRPCMuon() const
Definition: Muon.h:281
int iEvent
Definition: GenABIO.cc:230
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:48
bool isGlobalMuon() const override
Definition: Muon.h:276
edm::EDGetTokenT< reco::MuonCollection > cosmicToken_
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
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:52
float timeCompatibility
cosmic-likeness based on time: 0 == prompt-like
bool failedToGet() const
Definition: HandleBase.h:78
Definition: DetId.h:18
bool isTimeValid() const
Definition: Muon.h:129
T const * product() const
Definition: Handle.h:81
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
bool isGEMMuon() const
Definition: Muon.h:282
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
MuonCosmicCompatibilityFiller(const edm::ParameterSet &, edm::ConsumesCollector &)
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
HLT enums.
std::vector< edm::InputTag > inputTrackCollections_
T get() const
Definition: EventSetup.h:63
const GeomDet * idToDet(DetId) const override
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
float ipCompatibility
cosmic-likeness based on the 2D impact parameters (dxy, dz wrt to PV). 0 == cosmic-like ...
float vertexCompatibility
cosmic-likeness based on the event activity information: tracker track multiplicity and vertex qualit...