CMS 3D CMS Logo

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 }
TrajectoryStateOnSurface.h
PixelSubdetector.h
Range
PixelRecoRange< float > Range
Definition: PixelTripletHLTGenerator.cc:31
StartingLayerFinder::firstNegPixelFwdLayer
const std::vector< const ForwardDetLayer * > firstNegPixelFwdLayer() const
Definition: StartingLayerFinder.cc:83
TrackingRecHitFwd.h
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
TrackingRecHit.h
PTrajectoryStateOnDet.h
TrajectorySeed.h
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
GeometricSearchTracker::posPixelForwardLayers
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
Definition: GeometricSearchTracker.h:45
StartingLayerFinder::firstPixelBarrelLayer
const BarrelDetLayer * firstPixelBarrelLayer() const
Definition: StartingLayerFinder.cc:78
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
FreeTrajectoryState::parameters
const GlobalTrajectoryParameters & parameters() const
Definition: FreeTrajectoryState.h:79
StartingLayerFinder::firstPosPixelFwdLayer
const std::vector< const ForwardDetLayer * > firstPosPixelFwdLayer() const
Definition: StartingLayerFinder.cc:88
BarrelDetLayer
Definition: BarrelDetLayer.h:22
StartingLayerFinder::operator()
std::vector< const DetLayer * > operator()(const FreeTrajectoryState &aFts, float dr, float dz) const
Definition: StartingLayerFinder.cc:30
std
Definition: JetResolutionObject.h:76
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
GeometricSearchTracker::negPixelForwardLayers
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
Definition: GeometricSearchTracker.h:41
DetId.h
PVValHelper::dz
Definition: PVValidationHelpers.h:50
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
GeometricSearchTracker
Definition: GeometricSearchTracker.h:14
rangesIntersect
bool rangesIntersect(const Range &a, const Range &b)
Definition: rangesIntersect.h:14
TrajectoryStateTransform.h
StartingLayerFinder::checkPixelLayers
void checkPixelLayers() const
Definition: StartingLayerFinder.cc:93
StripSubdetector.h
StartingLayerFinder.h
GeometricSearchTracker::pixelBarrelLayers
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
Definition: GeometricSearchTracker.h:37