CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< GeometricSearchTracker
theGeometricSearchTracker
 
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  :
34  theGeometricSearchTracker(tkLayout), theOutLayerOnlyFlag(outOnly), theEpsilon(-0.01) {
35 
36 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker

Member Function Documentation

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

Definition at line 262 of file DirectTrackerNavigation.cc.

References create_public_lumi_plots::log, and funct::tan().

Referenced by checkCompatible().

262  {
263 
264  if ( z > 0 ) return -log((tan(atan(r/z)/2.)));
265  return log(-(tan(atan(r/z)/2.)));
266 
267 }
float float float z
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 212 of file DirectTrackerNavigation.cc.

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

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

212  {
213 
214  float eta0 = fts.position().eta();
215 
216  const BoundCylinder& bc = dl->specificSurface();
217  float radius = bc.radius();
218  float length = bc.bounds().length()/2.;
219 
220  float eta = calculateEta(radius, length);
221 
222  return ( fabs(eta0) <= (fabs(eta) + theEpsilon) );
223 
224 }
T eta() const
GlobalPoint position() const
float calculateEta(float r, float z) const
T eta() const
Definition: PV3DBase.h:76
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
bool DirectTrackerNavigation::checkCompatible ( const FreeTrajectoryState fts,
const ForwardDetLayer dl 
) const
private

Definition at line 230 of file DirectTrackerNavigation.cc.

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

230  {
231 
232  float eta0 = fts.position().eta();
233 
234  const BoundDisk& bd = dl->specificSurface();
235 
236  float outRadius = bd.outerRadius();
237  float inRadius = bd.innerRadius();
238  float z = bd.position().z();
239 
240  float etaOut = calculateEta(outRadius, z);
241  float etaIn = calculateEta(inRadius, z);
242 
243  if ( eta0 > 0 ) return ( eta0 > ( etaOut - theEpsilon) && eta0 < (etaIn + theEpsilon) );
244  else return ( eta0 < (etaOut + theEpsilon ) && eta0 > ( etaIn - theEpsilon ) );
245 
246 }
float float float z
GlobalPoint position() const
float calculateEta(float r, float z) const
virtual const BoundDisk & specificSurface() const GCC11_FINAL
T eta() const
Definition: PV3DBase.h:76
vector< const DetLayer * > DirectTrackerNavigation::compatibleLayers ( const FreeTrajectoryState fts,
PropagationDirection  timeDirection 
) const

find compatible layers for a given trajectory state

Definition at line 43 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(), and theOutLayerOnlyFlag.

Referenced by TSGFromPropagation::trackerSeeds(), and FastTSGFromPropagation::trackerSeeds().

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

References checkCompatible(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

170  {
171 
172  const vector<ForwardDetLayer*>& forward = theGeometricSearchTracker->negPixelForwardLayers();
173 
174  for (vector<ForwardDetLayer*>::const_iterator iter_E = forward.begin(); iter_E != forward.end(); iter_E++) {
175  if ( checkCompatible(fts,(*iter_E)) ) output.push_back((*iter_E));
176  }
177 
178 }
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 198 of file DirectTrackerNavigation.cc.

References checkCompatible(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

198  {
199 
200  const vector<ForwardDetLayer*>& forward = theGeometricSearchTracker->negTecLayers();
201 
202  for (vector<ForwardDetLayer*>::const_iterator iter_E = forward.begin(); iter_E != forward.end(); iter_E++) {
203  if ( checkCompatible(fts,(*iter_E)) ) output.push_back((*iter_E));
204  }
205 
206 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
void DirectTrackerNavigation::inOutBTID ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 184 of file DirectTrackerNavigation.cc.

References checkCompatible(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

184  {
185 
186  const vector<ForwardDetLayer*>& forward = theGeometricSearchTracker->negTidLayers();
187 
188  for (vector<ForwardDetLayer*>::const_iterator iter_E = forward.begin(); iter_E != forward.end(); iter_E++) {
189  if ( checkCompatible(fts,(*iter_E)) ) output.push_back((*iter_E));
190  }
191 
192 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
void DirectTrackerNavigation::inOutFPx ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 128 of file DirectTrackerNavigation.cc.

References checkCompatible(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

128  {
129 
130  const vector<ForwardDetLayer*>& forward = theGeometricSearchTracker->posPixelForwardLayers();
131 
132  for (vector<ForwardDetLayer*>::const_iterator iter_E = forward.begin(); iter_E != forward.end(); iter_E++) {
133  if ( checkCompatible(fts,(*iter_E)) ) output.push_back((*iter_E));
134  }
135 
136 }
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 156 of file DirectTrackerNavigation.cc.

References checkCompatible(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

156  {
157 
158  const vector<ForwardDetLayer*>& forward = theGeometricSearchTracker->posTecLayers();
159 
160  for (vector<ForwardDetLayer*>::const_iterator iter_E = forward.begin(); iter_E != forward.end(); iter_E++) {
161  if ( checkCompatible(fts,(*iter_E)) ) output.push_back((*iter_E));
162  }
163 
164 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
void DirectTrackerNavigation::inOutFTID ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 142 of file DirectTrackerNavigation.cc.

References checkCompatible(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

142  {
143 
144  const vector<ForwardDetLayer*>& forward = theGeometricSearchTracker->posTidLayers();
145 
146  for (vector<ForwardDetLayer*>::const_iterator iter_E = forward.begin(); iter_E != forward.end(); iter_E++) {
147  if ( checkCompatible(fts,(*iter_E)) ) output.push_back((*iter_E));
148  }
149 
150 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
void DirectTrackerNavigation::inOutPx ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 86 of file DirectTrackerNavigation.cc.

References Reference_intrackfit_cff::barrel, checkCompatible(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

86  {
87 
88  const vector<BarrelDetLayer*>& barrel = theGeometricSearchTracker->pixelBarrelLayers();
89 
90  for (vector<BarrelDetLayer*>::const_iterator iter_B = barrel.begin(); iter_B != barrel.end(); iter_B++) {
91  if ( checkCompatible(fts,(*iter_B)) ) output.push_back((*iter_B));
92  }
93 
94 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
void DirectTrackerNavigation::inOutTIB ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 100 of file DirectTrackerNavigation.cc.

References Reference_intrackfit_cff::barrel, checkCompatible(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

100  {
101 
102  const vector<BarrelDetLayer*>& barrel = theGeometricSearchTracker->tibLayers();
103 
104  for (vector<BarrelDetLayer*>::const_iterator iter_B = barrel.begin(); iter_B != barrel.end(); iter_B++) {
105  if ( checkCompatible(fts,(*iter_B)) ) output.push_back((*iter_B));
106  }
107 
108 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
void DirectTrackerNavigation::inOutTOB ( const FreeTrajectoryState fts,
std::vector< const DetLayer * > &  output 
) const
private

Definition at line 114 of file DirectTrackerNavigation.cc.

References Reference_intrackfit_cff::barrel, checkCompatible(), and theGeometricSearchTracker.

Referenced by compatibleLayers().

114  {
115 
116  const vector<BarrelDetLayer*>& barrel = theGeometricSearchTracker->tobLayers();
117 
118  for (vector<BarrelDetLayer*>::const_iterator iter_B = barrel.begin(); iter_B != barrel.end(); iter_B++) {
119  if ( checkCompatible(fts,(*iter_B)) ) output.push_back((*iter_B));
120  }
121 
122 }
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool checkCompatible(const FreeTrajectoryState &, const BarrelDetLayer *) const
bool DirectTrackerNavigation::outward ( const FreeTrajectoryState fts) const
private

Definition at line 252 of file DirectTrackerNavigation.cc.

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

Referenced by compatibleLayers().

252  {
253 
254  return (fts.position().basicVector().dot(fts.momentum().basicVector()) > 0);
255 
256 }
GlobalVector momentum() const
GlobalPoint position() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
T dot(const Basic3DVector &rh) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.

Member Data Documentation

float DirectTrackerNavigation::theEpsilon
private

Definition at line 75 of file DirectTrackerNavigation.h.

Referenced by checkCompatible().

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

Definition at line 73 of file DirectTrackerNavigation.h.

Referenced by compatibleLayers().