CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
StartingLayerFinder.cc
Go to the documentation of this file.
2 
10 
13 
14 #include <utility>
15 
16 using namespace std;
17 
18 namespace {
19 
20  typedef std::pair<float, float> Range;
21 
22  inline bool rangesIntersect(const Range& a, const Range& b) {
23  if (a.first > b.second || b.first > a.second)
24  return false;
25  else
26  return true;
27  }
28 }; // namespace
29 
30 vector<const DetLayer*> StartingLayerFinder::operator()(const FreeTrajectoryState& aFts, float dr, float dz) const {
31  vector<const DetLayer*> mylayers;
32  mylayers.reserve(3);
33 
34  FreeTrajectoryState fastFts(aFts.parameters());
35 
36  //barrel pixel
37  TrajectoryStateOnSurface pTsos = thePropagator.propagate(fastFts, firstPixelBarrelLayer()->surface());
38 
39  if (pTsos.isValid()) {
40  Range barrZRange(
41  firstPixelBarrelLayer()->position().z() - 0.5 * (firstPixelBarrelLayer()->surface().bounds().length()),
42  firstPixelBarrelLayer()->position().z() + 0.5 * (firstPixelBarrelLayer()->surface().bounds().length()));
43  Range trajZRange(pTsos.globalPosition().z() - dz, pTsos.globalPosition().z() + dz);
44 
45  if (rangesIntersect(trajZRange, barrZRange)) {
46  mylayers.push_back(firstPixelBarrelLayer());
47  }
48  }
49 
50  //negative fwd pixel
51 
52  for (auto infwd : firstPosPixelFwdLayer()) {
53  pTsos = thePropagator.propagate(fastFts, infwd->surface());
54  if (pTsos.isValid()) {
55  Range nfwdRRange(infwd->specificSurface().innerRadius(), infwd->specificSurface().outerRadius());
56  Range trajRRange(pTsos.globalPosition().perp() - dr, pTsos.globalPosition().perp() + dr);
57  if (rangesIntersect(trajRRange, nfwdRRange)) {
58  mylayers.push_back(infwd);
59  }
60  }
61  }
62 
63  //positive fwd pixel
64  for (auto ipfwd : firstPosPixelFwdLayer()) {
65  pTsos = thePropagator.propagate(fastFts, ipfwd->surface());
66  if (pTsos.isValid()) {
67  Range pfwdRRange(ipfwd->specificSurface().innerRadius(), ipfwd->specificSurface().outerRadius());
68  Range trajRRange(pTsos.globalPosition().perp() - dr, pTsos.globalPosition().perp() + dr);
69  if (rangesIntersect(trajRRange, pfwdRRange)) {
70  mylayers.push_back(ipfwd);
71  }
72  }
73  }
74 
75  return mylayers;
76 }
77 
79  checkPixelLayers();
80  return theFirstPixelBarrelLayer;
81 }
82 
83 const vector<const ForwardDetLayer*> StartingLayerFinder::firstNegPixelFwdLayer() const {
84  checkPixelLayers();
85  return theFirstNegPixelFwdLayer;
86 }
87 
88 const vector<const ForwardDetLayer*> StartingLayerFinder::firstPosPixelFwdLayer() const {
89  checkPixelLayers();
90  return theFirstPosPixelFwdLayer;
91 }
92 
94  if (!thePixelLayersValid) {
95  const GeometricSearchTracker* theGeometricSearchTracker = theMeasurementTracker.geometricSearchTracker();
96 
97  theFirstPixelBarrelLayer = theGeometricSearchTracker->pixelBarrelLayers().front();
98  theFirstNegPixelFwdLayer = theGeometricSearchTracker->negPixelForwardLayers();
99  theFirstPosPixelFwdLayer = theGeometricSearchTracker->posPixelForwardLayers();
100  thePixelLayersValid = true;
101  }
102 }
const GlobalTrajectoryParameters & parameters() const
PixelRecoRange< float > Range
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
const std::vector< const ForwardDetLayer * > firstPosPixelFwdLayer() const
const BarrelDetLayer * firstPixelBarrelLayer() const
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
std::vector< const DetLayer * > operator()(const FreeTrajectoryState &aFts, float dr, float dz) const
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
bool rangesIntersect(const Range &a, const Range &b)
double b
Definition: hdecay.h:118
void checkPixelLayers() const
double a
Definition: hdecay.h:119
static int position[264][3]
Definition: ReadPGInfo.cc:289
const std::vector< const ForwardDetLayer * > firstNegPixelFwdLayer() const