test
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< const
ForwardDetLayer * > 
firstNegPixelFwdLayer () const
 
const BarrelDetLayerfirstPixelBarrelLayer () const
 
const std::vector< const
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< const
ForwardDetLayer * > 
theFirstNegPixelFwdLayer
 
const BarrelDetLayertheFirstPixelBarrelLayer
 
std::vector< const
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),
const BarrelDetLayer * theFirstPixelBarrelLayer
std::vector< const ForwardDetLayer * > theFirstNegPixelFwdLayer
const MeasurementTracker * theMeasurementTracker
std::vector< const ForwardDetLayer * > theFirstPosPixelFwdLayer
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 155 of file StartingLayerFinder.cc.

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

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

Definition at line 145 of file StartingLayerFinder.cc.

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

Definition at line 140 of file StartingLayerFinder.cc.

140  {
142  return theFirstPixelBarrelLayer;
143 }
const BarrelDetLayer * theFirstPixelBarrelLayer
void checkPixelLayers() const
const vector< const ForwardDetLayer * > StartingLayerFinder::firstPosPixelFwdLayer ( ) const

Definition at line 150 of file StartingLayerFinder.cc.

150  {
153 }
std::vector< const 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, 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  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 }
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
Definition: Propagator.h:119
bool rangesIntersect(const Range &a, const Range &b) const
const GlobalTrajectoryParameters & parameters() const
const std::vector< const ForwardDetLayer * > firstPosPixelFwdLayer() const
float float float z
const BarrelDetLayer * firstPixelBarrelLayer() const
std::pair< float, float > Range
const Propagator * propagator() const
static int position[264][3]
Definition: ReadPGInfo.cc:509
vector< const DetLayer * > StartingLayerFinder::startingLayers ( const TrajectorySeed aSeed) const

Definition at line 93 of file StartingLayerFinder.cc.

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

93  {
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 
133 
134 
135  const FreeTrajectoryState* fts=tsos.freeTrajectoryState();
136 
137  return startingLayers(*fts, dr, dz);
138 }
PropagationDirection direction() 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:35
const Propagator * propagator() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
const MeasurementTracker * theMeasurementTracker
unsigned int detId() 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
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<const ForwardDetLayer*> StartingLayerFinder::theFirstNegPixelFwdLayer
mutableprivate

Definition at line 69 of file StartingLayerFinder.h.

const BarrelDetLayer* StartingLayerFinder::theFirstPixelBarrelLayer
mutableprivate

Definition at line 68 of file StartingLayerFinder.h.

std::vector<const 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().