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