CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  const vector<ForwardDetLayer*> nfwd = firstPosPixelFwdLayer();
54  for(vector<ForwardDetLayer*>::const_iterator infwd = nfwd.begin();
55  infwd != nfwd.end(); infwd++) {
56  pTsos = propagator()->propagate(fastFts, (*infwd)->surface());
57  if(pTsos.isValid()) {
58  Range nfwdRRange((*infwd)->specificSurface().innerRadius(),
59  (*infwd)->specificSurface().outerRadius());
60  Range trajRRange(pTsos.globalPosition().perp() - dr,
61  pTsos.globalPosition().perp() + dr);
62  if(rangesIntersect(trajRRange, nfwdRRange)) {
63  mylayers.push_back(*infwd);
64 
65  }
66  }
67  }
68 
69  //positive fwd pixel
70  const vector<ForwardDetLayer*> pfwd = firstPosPixelFwdLayer();
71  for(vector<ForwardDetLayer*>::const_iterator ipfwd = pfwd.begin();
72  ipfwd != pfwd.end(); ipfwd++) {
73  pTsos = propagator()->propagate(fastFts, (*ipfwd)->surface());
74  if(pTsos.isValid()) {
75  Range pfwdRRange((*ipfwd)->specificSurface().innerRadius(),
76  (*ipfwd)->specificSurface().outerRadius());
77  Range trajRRange(pTsos.globalPosition().perp() - dr,
78  pTsos.globalPosition().perp() + dr);
79  if(rangesIntersect(trajRRange, pfwdRRange)) {
80  mylayers.push_back(*ipfwd);
81 
82  }
83  }
84  }
85 
86 
87 
88  return mylayers;
89 
90 
91 
92 
93 
94 }
95 
96 vector<const DetLayer*>
98 
99 
100 
101  float dr = 0., dz = 0.;
102 
103 
104  if(propagator()->propagationDirection() != aSeed.direction())
105  return vector<const DetLayer*>();
106 
107  if(aSeed.nHits() != 2) return vector<const DetLayer*>();
108 
109 
110  TrackingRecHitCollection::const_iterator firstHit= aSeed.recHits().first;
111  const TrackingRecHit* recHit1=&(*firstHit);
112  const DetLayer* hit1Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit1->geographicalId());
113 
114  TrackingRecHitCollection::const_iterator secondHit= aSeed.recHits().second;
115  const TrackingRecHit* recHit2=&(*secondHit);
116  const DetLayer* hit2Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit2->geographicalId());
117 
118 
121 
123  dr = 0.1; dz = 5.;
124  } else if(p1 == GeomDetEnumerators::endcap && p2 == GeomDetEnumerators::endcap) {
125  dr = 5.; dz = 0.1;
126  } else {
127  dr = 0.1; dz = 0.1;
128  }
129 
130 
131 
132  const GeomDet* gdet = theMeasurementTracker->geomTracker()->idToDet( DetId( aSeed.startingState().detId()));
133 
134 
136  thePropagator->magneticField());
137 
138 
140 
141  return startingLayers(*fts, dr, dz);
142 }
143 
145  checkPixelLayers();
146  return theFirstPixelBarrelLayer;
147 }
148 
149 const vector<ForwardDetLayer*> StartingLayerFinder::firstNegPixelFwdLayer() const {
150  checkPixelLayers();
151  return theFirstNegPixelFwdLayer;
152 }
153 
154 const vector<ForwardDetLayer*> StartingLayerFinder::firstPosPixelFwdLayer() const {
155  checkPixelLayers();
156  return theFirstPosPixelFwdLayer;
157 }
158 
160 
161 
162  if(!thePixelLayersValid) {
163 
164  const GeometricSearchTracker* theGeometricSearchTracker=theMeasurementTracker->geometricSearchTracker();
165 
166 
167  theFirstPixelBarrelLayer = theGeometricSearchTracker->pixelBarrelLayers().front();
168  theFirstNegPixelFwdLayer = theGeometricSearchTracker->negPixelForwardLayers();
169  theFirstPosPixelFwdLayer = theGeometricSearchTracker->posPixelForwardLayers();
170  thePixelLayersValid = true;
171 
172 
173 
174  }
175 
176 
177 }
178 
179 
180 
PropagationDirection direction() const
const std::vector< ForwardDetLayer * > firstPosPixelFwdLayer() const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
const GlobalTrajectoryParameters & parameters() const
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
double double double z
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
const BarrelDetLayer * firstPixelBarrelLayer() const
std::pair< float, float > Range
bool rangesIntersect(const Range &a, const Range &b)
std::vector< ForwardDetLayer * > const & posPixelForwardLayers() const
unsigned int detId() const
double p2[4]
Definition: TauolaWrapper.h:90
Definition: DetId.h:20
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
const std::vector< ForwardDetLayer * > firstNegPixelFwdLayer() const
range recHits() const
void checkPixelLayers() const
unsigned int nHits() const
double p1[4]
Definition: TauolaWrapper.h:89
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
std::vector< const DetLayer * > startingLayers(const FTS &aFts, float dr, float dz) const
DetId geographicalId() const
std::vector< BarrelDetLayer * > const & pixelBarrelLayers() const
std::vector< ForwardDetLayer * > const & negPixelForwardLayers() const