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