CMS 3D CMS Logo

Functions
CandidateSimMuonMatcher.cc File Reference
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Tools/CandidateSimMuonMatcher.h"
#include "L1Trigger/L1TMuon/interface/MicroGMTConfiguration.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "DataFormats/GeometrySurface/interface/BoundCylinder.h"
#include "DataFormats/GeometrySurface/interface/SimpleCylinderBounds.h"
#include "DataFormats/GeometrySurface/interface/BoundDisk.h"
#include "DataFormats/GeometrySurface/interface/SimpleDiskBounds.h"
#include "DataFormats/MuonDetId/interface/RPCDetId.h"
#include "TrackingTools/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h"
#include "boost/dynamic_bitset.hpp"
#include "TFile.h"
#include "TH1D.h"

Go to the source code of this file.

Functions

double foldPhi (double phi)
 
double hwGmtPhiToGlobalPhi (int phi)
 
float normal_pdf (float x, float m, float s)
 
bool simTrackIsMuonInBx0 (const SimTrack &simTrack)
 
bool simTrackIsMuonInOmtf (const SimTrack &simTrack)
 
bool simTrackIsMuonInOmtfBx0 (const SimTrack &simTrack)
 
bool trackingParticleIsMuonInBx0 (const TrackingParticle &trackingParticle)
 
bool trackingParticleIsMuonInOmtfBx0 (const TrackingParticle &trackingParticle)
 
bool trackingParticleIsMuonInOmtfEvent0 (const TrackingParticle &trackingParticle)
 

Function Documentation

◆ foldPhi()

double foldPhi ( double  phi)

Definition at line 33 of file CandidateSimMuonMatcher.cc.

References M_PI, and PVValHelper::phi.

Referenced by CandidateSimMuonMatcher::match().

33  {
34  if (phi > M_PI)
35  return (phi - 2 * M_PI);
36  else if (phi < -M_PI)
37  return (phi + 2 * M_PI);
38 
39  return phi;
40 }
#define M_PI

◆ hwGmtPhiToGlobalPhi()

double hwGmtPhiToGlobalPhi ( int  phi)

Definition at line 28 of file CandidateSimMuonMatcher.cc.

References M_PI, and PVValHelper::phi.

Referenced by CandidateSimMuonMatcher::ghostBust(), and CandidateSimMuonMatcher::match().

28  {
29  double phiGmtUnit = 2. * M_PI / 576.;
30  return phi * phiGmtUnit;
31 }
#define M_PI

◆ normal_pdf()

float normal_pdf ( float  x,
float  m,
float  s 
)

Definition at line 376 of file CandidateSimMuonMatcher.cc.

References a, JetChargeProducer_cfi::exp, visualization-live-secondInstance_cfg::m, alignCSCRings::s, and x.

Referenced by CandidateSimMuonMatcher::match().

376  {
377  static const float inv_sqrt_2pi = 0.3989422804014327;
378  float a = (x - m) / s;
379 
380  return inv_sqrt_2pi / s * std::exp(-0.5 * a * a);
381 }
double a
Definition: hdecay.h:121
float x

◆ simTrackIsMuonInBx0()

bool simTrackIsMuonInBx0 ( const SimTrack simTrack)

Definition at line 120 of file CandidateSimMuonMatcher.cc.

References funct::abs(), and cscDigiValidation_cfi::simTrack.

Referenced by CandidateSimMuonMatcher::observeEventEnd().

120  {
121  if (std::abs(simTrack.type()) == 13 ||
122  std::abs(simTrack.type()) == 1000015) { // 1000015 is stau, todo use other selection (e.g. pt>20) if needed
123  //only muons
124  if (simTrack.eventId().bunchCrossing() == 0)
125  return true;
126  }
127  return false;
128 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ simTrackIsMuonInOmtf()

bool simTrackIsMuonInOmtf ( const SimTrack simTrack)

Definition at line 87 of file CandidateSimMuonMatcher.cc.

References funct::abs(), LogTrace, and cscDigiValidation_cfi::simTrack.

Referenced by simTrackIsMuonInOmtfBx0().

87  {
88  if (std::abs(simTrack.type()) == 13 ||
89  std::abs(simTrack.type()) == 1000015) { // 1000015 is stau, todo use other selection (e.g. pt>20) if needed
90  //only muons
91  } else
92  return false;
93 
94  //in the overlap, the propagation of muons with pt less then ~3.2 fails - the actual threshold depends slightly on eta,
95  if (simTrack.momentum().pt() < 2.5)
96  return false;
97 
98  LogTrace("l1tOmtfEventPrint") << "simTrackIsMuonInOmtf, simTrack type " << std::setw(3) << simTrack.type() << " pt "
99  << std::setw(9) << simTrack.momentum().pt() << " eta " << std::setw(9)
100  << simTrack.momentum().eta() << " phi " << std::setw(9) << simTrack.momentum().phi()
101  << std::endl;
102 
103  //some margin for matching must be used on top of actual OMTF region,
104  //i.e. (0.82-1.24)=>(0.72-1.3),
105  //otherwise many candidates are marked as ghosts
106  if ((std::abs(simTrack.momentum().eta()) >= 0.72) && (std::abs(simTrack.momentum().eta()) <= 1.3)) {
107  } else
108  return false;
109 
110  return true;
111 }
#define LogTrace(id)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ simTrackIsMuonInOmtfBx0()

bool simTrackIsMuonInOmtfBx0 ( const SimTrack simTrack)

Definition at line 113 of file CandidateSimMuonMatcher.cc.

References cscDigiValidation_cfi::simTrack, and simTrackIsMuonInOmtf().

113  {
114  if (simTrack.eventId().bunchCrossing() != 0)
115  return false;
116 
118 }
bool simTrackIsMuonInOmtf(const SimTrack &simTrack)

◆ trackingParticleIsMuonInBx0()

bool trackingParticleIsMuonInBx0 ( const TrackingParticle trackingParticle)

Definition at line 130 of file CandidateSimMuonMatcher.cc.

References funct::abs(), EncodedEventId::bunchCrossing(), TrackingParticle::eventId(), and TrackingParticle::pdgId().

Referenced by CandidateSimMuonMatcher::observeEventEnd().

130  {
131  if (std::abs(trackingParticle.pdgId()) == 13 ||
132  std::abs(trackingParticle.pdgId()) ==
133  1000015) { // 1000015 is stau, todo use other selection (e.g. pt>20) if needed
134  //only muons
135  if (trackingParticle.eventId().bunchCrossing() == 0)
136  return true;
137  }
138  return false;
139 }
int pdgId() const
PDG ID.
EncodedEventId eventId() const
Signal source, crossing number.
int bunchCrossing() const
get the detector field from this detid
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ trackingParticleIsMuonInOmtfBx0()

bool trackingParticleIsMuonInOmtfBx0 ( const TrackingParticle trackingParticle)

Definition at line 141 of file CandidateSimMuonMatcher.cc.

References funct::abs(), EncodedEventId::bunchCrossing(), EncodedEventId::event(), TrackingParticle::eventId(), TrackingParticle::g4Tracks(), edm::Ref< C, T, F >::isNonnull(), LogTrace, TrackingParticle::momentum(), TrackingParticle::parentVertex(), TrackingParticle::pdgId(), and TrackingParticle::pt().

Referenced by trackingParticleIsMuonInOmtfEvent0().

141  {
142  if (trackingParticle.eventId().bunchCrossing() != 0)
143  return false;
144 
145  if (std::abs(trackingParticle.pdgId()) == 13 || std::abs(trackingParticle.pdgId()) == 1000015) {
146  // 1000015 is stau, todo use other selection (e.g. pt>20) if needed
147  //only muons
148  } else
149  return false;
150 
151  //in the overlap, the propagation of muons with pt less then ~3.2 fails, the actual threshold depends slightly on eta,
152  if (trackingParticle.pt() < 2.5)
153  return false;
154 
155  if (trackingParticle.parentVertex().isNonnull())
156  LogTrace("l1tOmtfEventPrint") << "trackingParticleIsMuonInOmtfBx0, pdgId " << std::setw(3)
157  << trackingParticle.pdgId() << " pt " << std::setw(9) << trackingParticle.pt()
158  << " eta " << std::setw(9) << trackingParticle.momentum().eta() << " phi "
159  << std::setw(9) << trackingParticle.momentum().phi() << " event "
160  << trackingParticle.eventId().event() << " trackId "
161  << trackingParticle.g4Tracks().at(0).trackId() << " parentVertex Rho "
162  << trackingParticle.parentVertex()->position().Rho() << " eta "
163  << trackingParticle.parentVertex()->position().eta() << " phi "
164  << trackingParticle.parentVertex()->position().phi() << std::endl;
165  else
166  LogTrace("l1tOmtfEventPrint") << "trackingParticleIsMuonInOmtfBx0, pdgId " << std::setw(3)
167  << trackingParticle.pdgId() << " pt " << std::setw(9) << trackingParticle.pt()
168  << " eta " << std::setw(9) << trackingParticle.momentum().eta() << " phi "
169  << std::setw(9) << trackingParticle.momentum().phi() << " trackId "
170  << trackingParticle.g4Tracks().at(0).trackId();
171 
172  //some margin for matching must be used on top of actual OMTF region,
173  //i.e. (0.82-1.24)=>(0.72-1.3),
174  //otherwise many candidates are marked as ghosts
175  if ((std::abs(trackingParticle.momentum().eta()) >= 0.72) && (std::abs(trackingParticle.momentum().eta()) <= 1.3)) {
176  } else
177  return false;
178 
179  return true;
180 }
int pdgId() const
PDG ID.
EncodedEventId eventId() const
Signal source, crossing number.
Vector momentum() const
spatial momentum vector
int event() const
get the contents of the subdetector field (should be protected?)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
const std::vector< SimTrack > & g4Tracks() const
#define LogTrace(id)
int bunchCrossing() const
get the detector field from this detid
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const TrackingVertexRef & parentVertex() const
double pt() const
Transverse momentum. Note this is taken from the first SimTrack only.

◆ trackingParticleIsMuonInOmtfEvent0()

bool trackingParticleIsMuonInOmtfEvent0 ( const TrackingParticle trackingParticle)

Definition at line 182 of file CandidateSimMuonMatcher.cc.

References EncodedEventId::event(), TrackingParticle::eventId(), and trackingParticleIsMuonInOmtfBx0().

182  {
183  if (trackingParticle.eventId().event() != 0)
184  return false;
185 
186  return trackingParticleIsMuonInOmtfBx0(trackingParticle);
187 }
EncodedEventId eventId() const
Signal source, crossing number.
int event() const
get the contents of the subdetector field (should be protected?)
bool trackingParticleIsMuonInOmtfBx0(const TrackingParticle &trackingParticle)