CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DirectTrackerNavigation Class Reference

#include <DirectTrackerNavigation.h>

Public Member Functions

std::vector< const DetLayer * > compatibleLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
 find compatible layers for a given trajectory state More...
 
 DirectTrackerNavigation (const edm::ESHandle< GeometricSearchTracker > &, bool outOnly=true)
 constructor More...
 

Private Member Functions

float calculateEta (float r, float z) const
 
bool checkCompatible (const FreeTrajectoryState &, const BarrelDetLayer *) const
 
bool checkCompatible (const FreeTrajectoryState &, const ForwardDetLayer *) const
 
void inOutBPx (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
 
void inOutBTEC (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
 
void inOutBTID (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
 
void inOutFPx (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
 
void inOutFTEC (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
 
void inOutFTID (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
 
void inOutPx (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
 
void inOutTIB (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
 
void inOutTOB (const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
 
bool outward (const FreeTrajectoryState &) const
 

Private Attributes

float theEpsilon
 
edm::ESHandle< GeometricSearchTrackertheGeometricSearchTracker
 
bool theOutLayerOnlyFlag
 

Detailed Description

Definition at line 26 of file DirectTrackerNavigation.h.

Constructor & Destructor Documentation

DirectTrackerNavigation::DirectTrackerNavigation ( const edm::ESHandle< GeometricSearchTracker > &  tkLayout,
bool  outOnly = true 
)

constructor

Definition at line 32 of file DirectTrackerNavigation.cc.

33  : theGeometricSearchTracker(tkLayout), theOutLayerOnlyFlag(outOnly), theEpsilon(-0.01) {}
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker

Member Function Documentation

float DirectTrackerNavigation::calculateEta ( float  r,
float  z 
) const
private

Definition at line 219 of file DirectTrackerNavigation.cc.

References dqm-mbProfile::log, and funct::tan().

Referenced by checkCompatible().

219  {
220  if (z > 0)
221  return -log((tan(atan(r / z) / 2.)));
222  return log(-(tan(atan(r / z) / 2.)));
223 }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
bool DirectTrackerNavigation::checkCompatible ( const FreeTrajectoryState fts,
const BarrelDetLayer dl 
) const
private

Definition at line 176 of file DirectTrackerNavigation.cc.

References calculateEta(), PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), FreeTrajectoryState::position(), CosmicsPD_Skims::radius, BarrelDetLayer::specificSurface(), and theEpsilon.

Referenced by inOutBPx(), inOutBTEC(), inOutBTID(), inOutFPx(), inOutFTEC(), inOutFTID(), inOutPx(), inOutTIB(), and inOutTOB().

176  {
177  float eta0 = fts.position().eta();
178 
179  const BoundCylinder& bc = dl->specificSurface();
180  float radius = bc.radius();
181  float length = bc.bounds().length() / 2.;
182 
183  float eta = calculateEta(radius, length);
184 
185  return (fabs(eta0) <= (fabs(eta) + theEpsilon));
186 }
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
GlobalPoint position() const
float calculateEta(float r, float z) const
T eta() const
Definition: PV3DBase.h:73
bool DirectTrackerNavigation::checkCompatible ( const FreeTrajectoryState fts,
const ForwardDetLayer dl 
) const
private

Definition at line 191 of file DirectTrackerNavigation.cc.

References calculateEta(), PV3DBase< T, PVType, FrameType >::eta(), FreeTrajectoryState::position(), ForwardDetLayer::specificSurface(), theEpsilon, and z.

191  {
192  float eta0 = fts.position().eta();
193 
194  const BoundDisk& bd = dl->specificSurface();
195 
196  float outRadius = bd.outerRadius();
197  float inRadius = bd.innerRadius();
198  float z = bd.position().z();
199 
200  float etaOut = calculateEta(outRadius, z);
201  float etaIn = calculateEta(inRadius, z);
202 
203  if (eta0 > 0)
204  return (eta0 > (etaOut - theEpsilon) && eta0 < (etaIn + theEpsilon));
205  else
206  return (eta0 < (etaOut + theEpsilon) && eta0 > (etaIn - theEpsilon));
207 }
GlobalPoint position() const
float calculateEta(float r, float z) const
virtual const BoundDisk & specificSurface() const final
T eta() const
Definition: PV3DBase.h:73
vector< const DetLayer * > DirectTrackerNavigation::compatibleLayers ( const FreeTrajectoryState fts,
PropagationDirection  timeDirection 
) const

find compatible layers for a given trajectory state

Definition at line 38 of file DirectTrackerNavigation.cc.

References PV3DBase< T, PVType, FrameType >::eta(), inOutBPx(), inOutBTEC(), inOutBTID(), inOutFPx(), inOutFTEC(), inOutFTID(), inOutPx(), inOutTIB(), inOutTOB(), LogTrace, oppositeToMomentum, convertSQLitetoXML_cfg::output, outward(), FreeTrajectoryState::position(), groupFilesInBlocks::reverse, and theOutLayerOnlyFlag.

Referenced by TSGFromPropagation::trackerSeeds().

39  {
40  bool inOut = outward(fts);
41  double eta0 = fts.position().eta();
42 
43  vector<const DetLayer*> output;
44 
45  // check eta of DetLayers for compatibility
46 
47  if (inOut) {
48  if (!theOutLayerOnlyFlag) {
49  inOutPx(fts, output);
50 
51  if (eta0 > 1.55)
52  inOutFPx(fts, output);
53  else if (eta0 < -1.55)
54  inOutBPx(fts, output);
55 
56  if (fabs(eta0) < 1.67)
57  inOutTIB(fts, output);
58 
59  if (eta0 > 1.17)
60  inOutFTID(fts, output);
61  else if (eta0 < -1.17)
62  inOutBTID(fts, output);
63  }
64 
65  if (fabs(eta0) < 1.35)
66  inOutTOB(fts, output);
67 
68  if (eta0 > 0.97)
69  inOutFTEC(fts, output);
70  else if (eta0 < -0.97)
71  inOutBTEC(fts, output);
72 
73  } else {
74  LogTrace("Muon|RecoMuon|DirectionTrackerNavigation") << "No implementation for inward state at this moment. ";
75  }
76 
77  if (dir == oppositeToMomentum)
78  std::reverse(output.begin(), output.end());
79 
80  return output;
81 }
void inOutPx(const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void inOutTIB(const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void inOutFTID(const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void inOutBTID(const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void inOutTOB(const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
#define LogTrace(id)
void inOutFPx(const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
GlobalPoint position() const
void inOutBTEC(const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
bool outward(const FreeTrajectoryState &) const
void inOutFTEC(const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
T eta() const
Definition: PV3DBase.h:73
void inOutBPx(const FreeTrajectoryState &, std::vector< const DetLayer * > &) const
void DirectTrackerNavigation::inOutBPx ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 146 of file DirectTrackerNavigation.cc.

References checkCompatible(), mps_fire::i, GeometricSearchTracker::negPixelForwardLayers(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

146  {
147  for (const auto i : theGeometricSearchTracker->negPixelForwardLayers()) {
148  if (checkCompatible(fts, i))
149  output.push_back(i);
150  }
151 }
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
void DirectTrackerNavigation::inOutBTEC ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 166 of file DirectTrackerNavigation.cc.

References checkCompatible(), mps_fire::i, GeometricSearchTracker::negTecLayers(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

166  {
167  for (const auto i : theGeometricSearchTracker->negTecLayers()) {
168  if (checkCompatible(fts, i))
169  output.push_back(i);
170  }
171 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
std::vector< ForwardDetLayer const * > const & negTecLayers() const
void DirectTrackerNavigation::inOutBTID ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 156 of file DirectTrackerNavigation.cc.

References checkCompatible(), mps_fire::i, GeometricSearchTracker::negTidLayers(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

156  {
157  for (const auto i : theGeometricSearchTracker->negTidLayers()) {
158  if (checkCompatible(fts, i))
159  output.push_back(i);
160  }
161 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
std::vector< ForwardDetLayer const * > const & negTidLayers() const
void DirectTrackerNavigation::inOutFPx ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 116 of file DirectTrackerNavigation.cc.

References checkCompatible(), mps_fire::i, GeometricSearchTracker::posPixelForwardLayers(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

116  {
117  for (const auto i : theGeometricSearchTracker->posPixelForwardLayers()) {
118  if (checkCompatible(fts, i))
119  output.push_back(i);
120  }
121 }
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
void DirectTrackerNavigation::inOutFTEC ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 136 of file DirectTrackerNavigation.cc.

References checkCompatible(), mps_fire::i, GeometricSearchTracker::posTecLayers(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

136  {
137  for (const auto i : theGeometricSearchTracker->posTecLayers()) {
138  if (checkCompatible(fts, i))
139  output.push_back(i);
140  }
141 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
std::vector< ForwardDetLayer const * > const & posTecLayers() const
void DirectTrackerNavigation::inOutFTID ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 126 of file DirectTrackerNavigation.cc.

References checkCompatible(), mps_fire::i, GeometricSearchTracker::posTidLayers(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

126  {
127  for (const auto i : theGeometricSearchTracker->posTidLayers()) {
128  if (checkCompatible(fts, i))
129  output.push_back(i);
130  }
131 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
std::vector< ForwardDetLayer const * > const & posTidLayers() const
void DirectTrackerNavigation::inOutPx ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 86 of file DirectTrackerNavigation.cc.

References checkCompatible(), mps_fire::i, GeometricSearchTracker::pixelBarrelLayers(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

86  {
87  for (const auto i : theGeometricSearchTracker->pixelBarrelLayers()) {
88  if (checkCompatible(fts, i))
89  output.push_back(i);
90  }
91 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
void DirectTrackerNavigation::inOutTIB ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 96 of file DirectTrackerNavigation.cc.

References checkCompatible(), mps_fire::i, theGeometricSearchTracker, and GeometricSearchTracker::tibLayers().

Referenced by compatibleLayers().

96  {
97  for (const auto i : theGeometricSearchTracker->tibLayers()) {
98  if (checkCompatible(fts, i))
99  output.push_back(i);
100  }
101 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
std::vector< BarrelDetLayer const * > const & tibLayers() const
void DirectTrackerNavigation::inOutTOB ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 106 of file DirectTrackerNavigation.cc.

References checkCompatible(), mps_fire::i, theGeometricSearchTracker, and GeometricSearchTracker::tobLayers().

Referenced by compatibleLayers().

106  {
107  for (const auto i : theGeometricSearchTracker->tobLayers()) {
108  if (checkCompatible(fts, i))
109  output.push_back(i);
110  }
111 }
std::vector< BarrelDetLayer const * > const & tobLayers() const
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
bool DirectTrackerNavigation::outward ( const FreeTrajectoryState fts) const
private

Definition at line 212 of file DirectTrackerNavigation.cc.

References PV3DBase< T, PVType, FrameType >::basicVector(), Basic3DVector< T >::dot(), FreeTrajectoryState::momentum(), and FreeTrajectoryState::position().

Referenced by compatibleLayers().

212  {
213  return (fts.position().basicVector().dot(fts.momentum().basicVector()) > 0);
214 }
GlobalVector momentum() const
GlobalPoint position() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.

Member Data Documentation

float DirectTrackerNavigation::theEpsilon
private

Definition at line 67 of file DirectTrackerNavigation.h.

Referenced by checkCompatible().

edm::ESHandle<GeometricSearchTracker> DirectTrackerNavigation::theGeometricSearchTracker
private
bool DirectTrackerNavigation::theOutLayerOnlyFlag
private

Definition at line 65 of file DirectTrackerNavigation.h.

Referenced by compatibleLayers().