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