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 Types | Private Member Functions | Private Attributes
StartingLayerFinder Class Reference

#include <StartingLayerFinder.h>

Public Member Functions

const std::vector
< ForwardDetLayer * > 
firstNegPixelFwdLayer () const
 
const BarrelDetLayerfirstPixelBarrelLayer () const
 
const std::vector
< ForwardDetLayer * > 
firstPosPixelFwdLayer () const
 
const Propagatorpropagator () const
 
 StartingLayerFinder (const Propagator *aPropagator, const MeasurementTracker *tracker)
 
std::vector< const DetLayer * > startingLayers (const FTS &aFts, float dr, float dz) const
 
std::vector< const DetLayer * > startingLayers (const TrajectorySeed &aSeed) const
 
 ~StartingLayerFinder ()
 

Private Types

typedef FreeTrajectoryState FTS
 
typedef std::pair< float, float > Range
 
typedef TrajectoryStateOnSurface TSOS
 

Private Member Functions

void checkPixelLayers () const
 
bool rangesIntersect (const Range &a, const Range &b) const
 

Private Attributes

std::vector< ForwardDetLayer * > theFirstNegPixelFwdLayer
 
BarrelDetLayertheFirstPixelBarrelLayer
 
std::vector< ForwardDetLayer * > theFirstPosPixelFwdLayer
 
const MeasurementTrackertheMeasurementTracker
 
bool thePixelLayersValid
 
const PropagatorthePropagator
 

Detailed Description

Definition at line 29 of file StartingLayerFinder.h.

Member Typedef Documentation

Definition at line 33 of file StartingLayerFinder.h.

typedef std::pair<float, float> StartingLayerFinder::Range
private

Definition at line 35 of file StartingLayerFinder.h.

Definition at line 34 of file StartingLayerFinder.h.

Constructor & Destructor Documentation

StartingLayerFinder::StartingLayerFinder ( const Propagator aPropagator,
const MeasurementTracker tracker 
)
inline

Definition at line 39 of file StartingLayerFinder.h.

39  :
40 
41  thePropagator(aPropagator),
42  theMeasurementTracker(tracker),
43  thePixelLayersValid(false),
std::vector< ForwardDetLayer * > theFirstPosPixelFwdLayer
std::vector< ForwardDetLayer * > theFirstNegPixelFwdLayer
const MeasurementTracker * theMeasurementTracker
BarrelDetLayer * theFirstPixelBarrelLayer
const Propagator * thePropagator
StartingLayerFinder::~StartingLayerFinder ( )
inline

Definition at line 48 of file StartingLayerFinder.h.

48 {}

Member Function Documentation

void StartingLayerFinder::checkPixelLayers ( ) const
private

Definition at line 159 of file StartingLayerFinder.cc.

References GeometricSearchTracker::negPixelForwardLayers(), GeometricSearchTracker::pixelBarrelLayers(), and GeometricSearchTracker::posPixelForwardLayers().

159  {
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 }
std::vector< ForwardDetLayer * > theFirstPosPixelFwdLayer
std::vector< ForwardDetLayer * > theFirstNegPixelFwdLayer
std::vector< ForwardDetLayer * > const & posPixelForwardLayers() const
const MeasurementTracker * theMeasurementTracker
BarrelDetLayer * theFirstPixelBarrelLayer
std::vector< BarrelDetLayer * > const & pixelBarrelLayers() const
std::vector< ForwardDetLayer * > const & negPixelForwardLayers() const
const vector< ForwardDetLayer * > StartingLayerFinder::firstNegPixelFwdLayer ( ) const

Definition at line 149 of file StartingLayerFinder.cc.

149  {
152 }
std::vector< ForwardDetLayer * > theFirstNegPixelFwdLayer
void checkPixelLayers() const
const BarrelDetLayer * StartingLayerFinder::firstPixelBarrelLayer ( ) const

Definition at line 144 of file StartingLayerFinder.cc.

144  {
146  return theFirstPixelBarrelLayer;
147 }
BarrelDetLayer * theFirstPixelBarrelLayer
void checkPixelLayers() const
const vector< ForwardDetLayer * > StartingLayerFinder::firstPosPixelFwdLayer ( ) const

Definition at line 154 of file StartingLayerFinder.cc.

154  {
157 }
std::vector< ForwardDetLayer * > theFirstPosPixelFwdLayer
void checkPixelLayers() const
const Propagator* StartingLayerFinder::propagator ( void  ) const
inline

Definition at line 59 of file StartingLayerFinder.h.

References thePropagator.

59 {return thePropagator;}
const Propagator * thePropagator
bool StartingLayerFinder::rangesIntersect ( const Range a,
const Range b 
) const
inlineprivate

Definition at line 77 of file StartingLayerFinder.h.

77  {
78  if ( a.first > b.second || b.first > a.second) return false;
79  else return true;
80  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
vector< const DetLayer * > StartingLayerFinder::startingLayers ( const FTS aFts,
float  dr,
float  dz 
) const

Definition at line 20 of file StartingLayerFinder.cc.

References FreeTrajectoryState::parameters(), position, LargeD0_PixelPairStep_cff::propagator, rangesIntersect(), and detailsBasic3DVector::z.

20  {
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()),
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 }
const std::vector< ForwardDetLayer * > firstPosPixelFwdLayer() const
bool rangesIntersect(const Range &a, const Range &b) const
const GlobalTrajectoryParameters & parameters() const
float float float z
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
const BarrelDetLayer * firstPixelBarrelLayer() const
std::pair< float, float > Range
const Propagator * propagator() const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:12
vector< const DetLayer * > StartingLayerFinder::startingLayers ( const TrajectorySeed aSeed) const

Definition at line 97 of file StartingLayerFinder.cc.

References GeomDetEnumerators::barrel, PTrajectoryStateOnDet::detId(), TrajectorySeed::direction(), GeomDetEnumerators::endcap, TrajectoryStateOnSurface::freeTrajectoryState(), TrackingRecHit::geographicalId(), DetLayer::location(), TrajectorySeed::nHits(), p1, p2, LargeD0_PixelPairStep_cff::propagator, TrajectorySeed::recHits(), TrajectorySeed::startingState(), GeomDet::surface(), and trajectoryStateTransform::transientState().

97  {
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 
137 
138 
140 
141  return startingLayers(*fts, dr, dz);
142 }
PropagationDirection direction() const
virtual Location location() const =0
Which part of the detector (barrel, endcap)
FreeTrajectoryState * freeTrajectoryState(bool withErrors=true) const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
const Propagator * propagator() const
const MeasurementTracker * theMeasurementTracker
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)
range recHits() const
virtual const MagneticField * magneticField() const =0
unsigned int nHits() const
double p1[4]
Definition: TauolaWrapper.h:89
std::vector< const DetLayer * > startingLayers(const FTS &aFts, float dr, float dz) const
DetId geographicalId() const
const Propagator * thePropagator

Member Data Documentation

std::vector<ForwardDetLayer*> StartingLayerFinder::theFirstNegPixelFwdLayer
mutableprivate

Definition at line 69 of file StartingLayerFinder.h.

BarrelDetLayer* StartingLayerFinder::theFirstPixelBarrelLayer
mutableprivate

Definition at line 68 of file StartingLayerFinder.h.

std::vector<ForwardDetLayer*> StartingLayerFinder::theFirstPosPixelFwdLayer
mutableprivate

Definition at line 70 of file StartingLayerFinder.h.

const MeasurementTracker* StartingLayerFinder::theMeasurementTracker
private

Definition at line 66 of file StartingLayerFinder.h.

bool StartingLayerFinder::thePixelLayersValid
mutableprivate

Definition at line 67 of file StartingLayerFinder.h.

const Propagator* StartingLayerFinder::thePropagator
private

Definition at line 65 of file StartingLayerFinder.h.

Referenced by propagator().