CMS 3D CMS Logo

StartingLayerFinder.cc
Go to the documentation of this file.
2 
10 
13 
14 
15 #include <utility>
16 
17 using namespace std;
18 
19 vector<const DetLayer*>
20 StartingLayerFinder::startingLayers(const FTS& aFts, float dr, float dz) const {
21 
22 
23 
24 
25  vector<const DetLayer*> mylayers;
26  mylayers.reserve(3);
27 
28  FTS fastFts(aFts.parameters());
29 
30 
31  //barrel pixel
32  TSOS pTsos =
33  propagator()->propagate(fastFts, firstPixelBarrelLayer()->surface());
34 
35  if(pTsos.isValid()) {
36 
37  Range barrZRange(firstPixelBarrelLayer()->position().z() -
38  0.5*(firstPixelBarrelLayer()->surface().bounds().length()),
39  firstPixelBarrelLayer()->position().z() +
40  0.5*(firstPixelBarrelLayer()->surface().bounds().length()));
41  Range trajZRange(pTsos.globalPosition().z() - dz,
42  pTsos.globalPosition().z() + dz);
43 
44  if(rangesIntersect(trajZRange, barrZRange)) {
45  mylayers.push_back(firstPixelBarrelLayer());
46 
47  }
48  }
49 
50 
51  //negative fwd pixel
52 
53  for(auto infwd : firstPosPixelFwdLayer() ) {
54  pTsos = propagator()->propagate(fastFts, infwd->surface());
55  if(pTsos.isValid()) {
56  Range nfwdRRange(infwd->specificSurface().innerRadius(),
57  infwd->specificSurface().outerRadius());
58  Range trajRRange(pTsos.globalPosition().perp() - dr,
59  pTsos.globalPosition().perp() + dr);
60  if(rangesIntersect(trajRRange, nfwdRRange)) {
61  mylayers.push_back(infwd);
62 
63  }
64  }
65  }
66 
67  //positive fwd pixel
68  for(auto ipfwd: firstPosPixelFwdLayer()) {
69  pTsos = propagator()->propagate(fastFts, ipfwd->surface());
70  if(pTsos.isValid()) {
71  Range pfwdRRange(ipfwd->specificSurface().innerRadius(),
72  ipfwd->specificSurface().outerRadius());
73  Range trajRRange(pTsos.globalPosition().perp() - dr,
74  pTsos.globalPosition().perp() + dr);
75  if(rangesIntersect(trajRRange, pfwdRRange)) {
76  mylayers.push_back(ipfwd);
77 
78  }
79  }
80  }
81 
82 
83 
84  return mylayers;
85 
86 
87 
88 
89 
90 }
91 
92 vector<const DetLayer*>
94 
95 
96 
97  float dr = 0., dz = 0.;
98 
99 
100  if(propagator()->propagationDirection() != aSeed.direction())
101  return vector<const DetLayer*>();
102 
103  if(aSeed.nHits() != 2) return vector<const DetLayer*>();
104 
105 
106  TrackingRecHitCollection::const_iterator firstHit= aSeed.recHits().first;
107  const TrackingRecHit* recHit1=&(*firstHit);
108  const DetLayer* hit1Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit1->geographicalId());
109 
110  TrackingRecHitCollection::const_iterator secondHit= aSeed.recHits().second;
111  const TrackingRecHit* recHit2=&(*secondHit);
112  const DetLayer* hit2Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit2->geographicalId());
113 
114 
117 
119  dr = 0.1; dz = 5.;
120  } else if(p1 == GeomDetEnumerators::endcap && p2 == GeomDetEnumerators::endcap) {
121  dr = 5.; dz = 0.1;
122  } else {
123  dr = 0.1; dz = 0.1;
124  }
125 
126 
127 
128  const GeomDet* gdet = theMeasurementTracker->geomTracker()->idToDet( DetId( aSeed.startingState().detId()));
129 
130 
132  thePropagator->magneticField());
133 
134 
135  const FreeTrajectoryState* fts=tsos.freeTrajectoryState();
136 
137  return startingLayers(*fts, dr, dz);
138 }
139 
141  checkPixelLayers();
142  return theFirstPixelBarrelLayer;
143 }
144 
145 const vector<const ForwardDetLayer*> StartingLayerFinder::firstNegPixelFwdLayer() const {
146  checkPixelLayers();
147  return theFirstNegPixelFwdLayer;
148 }
149 
150 const vector<const ForwardDetLayer*> StartingLayerFinder::firstPosPixelFwdLayer() const {
151  checkPixelLayers();
152  return theFirstPosPixelFwdLayer;
153 }
154 
156 
157 
158  if(!thePixelLayersValid) {
159 
160  const GeometricSearchTracker* theGeometricSearchTracker=theMeasurementTracker->geometricSearchTracker();
161 
162 
163  theFirstPixelBarrelLayer = theGeometricSearchTracker->pixelBarrelLayers().front();
164  theFirstNegPixelFwdLayer = theGeometricSearchTracker->negPixelForwardLayers();
165  theFirstPosPixelFwdLayer = theGeometricSearchTracker->posPixelForwardLayers();
166  thePixelLayersValid = true;
167 
168 
169 
170  }
171 
172 
173 }
174 
175 
176 
PropagationDirection direction() const
const GlobalTrajectoryParameters & parameters() const
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
const std::vector< const ForwardDetLayer * > firstPosPixelFwdLayer() const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
const BarrelDetLayer * firstPixelBarrelLayer() const
std::pair< float, float > Range
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
bool rangesIntersect(const Range &a, const Range &b)
unsigned int detId() const
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
double p2[4]
Definition: TauolaWrapper.h:90
Definition: DetId.h:18
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
range recHits() const
void checkPixelLayers() const
unsigned int nHits() const
double p1[4]
Definition: TauolaWrapper.h:89
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::vector< const DetLayer * > startingLayers(const FTS &aFts, float dr, float dz) const
DetId geographicalId() const
const std::vector< const ForwardDetLayer * > firstNegPixelFwdLayer() const