CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 "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 simTrackIsMuonInOmtf (const SimTrack &simTrack)
 
bool simTrackIsMuonInOmtfBx0 (const SimTrack &simTrack)
 
bool trackingParticleIsMuonInOmtfBx0 (const TrackingParticle &trackingParticle)
 
bool trackingParticleIsMuonInOmtfEvent0 (const TrackingParticle &trackingParticle)
 

Function Documentation

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
double hwGmtPhiToGlobalPhi ( int  phi)

Definition at line 28 of file CandidateSimMuonMatcher.cc.

References M_PI.

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

28  {
29  double phiGmtUnit = 2. * M_PI / 576.;
30  return phi * phiGmtUnit;
31 }
#define M_PI
float normal_pdf ( float  x,
float  m,
float  s 
)

Definition at line 342 of file CandidateSimMuonMatcher.cc.

References a, funct::exp(), and visualization-live-secondInstance_cfg::m.

Referenced by CandidateSimMuonMatcher::match().

342  {
343  static const float inv_sqrt_2pi = 0.3989422804014327;
344  float a = (x - m) / s;
345 
346  return inv_sqrt_2pi / s * std::exp(-0.5 * a * a);
347 }
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
double a
Definition: hdecay.h:119
float x
bool simTrackIsMuonInOmtf ( const SimTrack simTrack)

Definition at line 87 of file CandidateSimMuonMatcher.cc.

References funct::abs(), LogTrace, CoreSimTrack::momentum(), and CoreSimTrack::type().

Referenced by simTrackIsMuonInOmtfBx0().

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

Definition at line 112 of file CandidateSimMuonMatcher.cc.

References EncodedEventId::bunchCrossing(), CoreSimTrack::eventId(), and simTrackIsMuonInOmtf().

Referenced by CandidateSimMuonMatcher::observeEventEnd().

112  {
113  if (simTrack.eventId().bunchCrossing() != 0)
114  return false;
115 
116  return simTrackIsMuonInOmtf(simTrack);
117 }
EncodedEventId eventId() const
Definition: CoreSimTrack.h:28
bool simTrackIsMuonInOmtf(const SimTrack &simTrack)
int bunchCrossing() const
get the detector field from this detid
bool trackingParticleIsMuonInOmtfBx0 ( const TrackingParticle trackingParticle)

Definition at line 119 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 CandidateSimMuonMatcher::observeEventEnd(), and trackingParticleIsMuonInOmtfEvent0().

119  {
120  /*if(trackingParticle.eventId().event() != 0)
121  LogTrace("l1tOmtfEventPrint") <<"trackingParticleIsMuonInOmtfBx0, pdgId "<<std::setw(3)<<trackingParticle.pdgId()<<" pt "<<std::setw(9)<<trackingParticle.pt()
122  <<" eta "<<std::setw(9)<<trackingParticle.momentum().eta()<<" phi "<<std::setw(9)<<trackingParticle.momentum().phi()<<" event "<<trackingParticle.eventId().event()
123  <<" bx "<<trackingParticle.eventId().bunchCrossing()<<" eventNot0"<<std::endl;*/
124 
125  if (trackingParticle.eventId().bunchCrossing() != 0)
126  return false;
127 
128  if (abs(trackingParticle.pdgId()) == 13 || abs(trackingParticle.pdgId()) == 1000015) {
129  // 1000015 is stau, todo use other selection if needed
130  //only muons
131  } else
132  return false;
133 
134  //in the overlap, the propagation of muons with pt less then ~3.2 fails, the actual threshold depends slightly on eta,
135  if (trackingParticle.pt() < 2.5)
136  return false;
137 
138  if (trackingParticle.parentVertex().isNonnull())
139  LogTrace("l1tOmtfEventPrint") << "trackingParticleIsMuonInOmtfBx0, pdgId " << std::setw(3)
140  << trackingParticle.pdgId() << " pt " << std::setw(9) << trackingParticle.pt()
141  << " eta " << std::setw(9) << trackingParticle.momentum().eta() << " phi "
142  << std::setw(9) << trackingParticle.momentum().phi() << " event "
143  << trackingParticle.eventId().event() << " trackId "
144  << trackingParticle.g4Tracks().at(0).trackId() << " parentVertex Rho "
145  << trackingParticle.parentVertex()->position().Rho() << " eta "
146  << trackingParticle.parentVertex()->position().eta() << " phi "
147  << trackingParticle.parentVertex()->position().phi() << std::endl;
148  else
149  LogTrace("l1tOmtfEventPrint") << "trackingParticleIsMuonInOmtfBx0, pdgId " << std::setw(3)
150  << trackingParticle.pdgId() << " pt " << std::setw(9) << trackingParticle.pt()
151  << " eta " << std::setw(9) << trackingParticle.momentum().eta() << " phi "
152  << std::setw(9) << trackingParticle.momentum().phi() << " trackId "
153  << trackingParticle.g4Tracks().at(0).trackId();
154 
155  //higher margin for matching must be used than actual OMTF region (i.e. 0.82 - 1.24),
156  //otherwise many candidates are marked as ghosts
157  //if( (fabs(simTrack.momentum().eta()) >= 0.82 ) && (fabs(trackingParticle.momentum().eta()) <= 1.24) ) {
158  if ((fabs(trackingParticle.momentum().eta()) >= 0.72) && (fabs(trackingParticle.momentum().eta()) <= 1.3)) {
159  } else
160  return false;
161 
162  return true;
163 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
int event() const
get the contents of the subdetector field (should be protected?)
const std::vector< SimTrack > & g4Tracks() const
Vector momentum() const
spatial momentum vector
int pdgId() const
PDG ID.
double pt() const
Transverse momentum. Note this is taken from the first SimTrack only.
#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
EncodedEventId eventId() const
Signal source, crossing number.
bool trackingParticleIsMuonInOmtfEvent0 ( const TrackingParticle trackingParticle)

Definition at line 165 of file CandidateSimMuonMatcher.cc.

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

165  {
166  if (trackingParticle.eventId().event() != 0)
167  return false;
168 
169  return trackingParticleIsMuonInOmtfBx0(trackingParticle);
170 }
int event() const
get the contents of the subdetector field (should be protected?)
EncodedEventId eventId() const
Signal source, crossing number.
bool trackingParticleIsMuonInOmtfBx0(const TrackingParticle &trackingParticle)