CMS 3D CMS Logo

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 27 of file StartingLayerFinder.h.

Member Typedef Documentation

Definition at line 29 of file StartingLayerFinder.h.

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

Definition at line 31 of file StartingLayerFinder.h.

Definition at line 30 of file StartingLayerFinder.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file StartingLayerFinder.h.

35  :
36 
37  thePropagator(aPropagator),
38  theMeasurementTracker(tracker),
39  thePixelLayersValid(false),
40  theFirstPixelBarrelLayer(nullptr),
const BarrelDetLayer * theFirstPixelBarrelLayer
std::vector< const ForwardDetLayer * > theFirstNegPixelFwdLayer
const MeasurementTracker * theMeasurementTracker
std::vector< const ForwardDetLayer * > theFirstPosPixelFwdLayer
const Propagator * thePropagator
StartingLayerFinder::~StartingLayerFinder ( )
inline

Member Function Documentation

void StartingLayerFinder::checkPixelLayers ( ) const
private

Definition at line 122 of file StartingLayerFinder.cc.

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

122  {
123  if (!thePixelLayersValid) {
124  const GeometricSearchTracker* theGeometricSearchTracker = theMeasurementTracker->geometricSearchTracker();
125 
126  theFirstPixelBarrelLayer = theGeometricSearchTracker->pixelBarrelLayers().front();
127  theFirstNegPixelFwdLayer = theGeometricSearchTracker->negPixelForwardLayers();
128  theFirstPosPixelFwdLayer = theGeometricSearchTracker->posPixelForwardLayers();
129  thePixelLayersValid = true;
130  }
131 }
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 112 of file StartingLayerFinder.cc.

Referenced by ~StartingLayerFinder().

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

Definition at line 107 of file StartingLayerFinder.cc.

Referenced by ~StartingLayerFinder().

107  {
110 }
const BarrelDetLayer * theFirstPixelBarrelLayer
void checkPixelLayers() const
const vector< const ForwardDetLayer * > StartingLayerFinder::firstPosPixelFwdLayer ( ) const

Definition at line 117 of file StartingLayerFinder.cc.

Referenced by ~StartingLayerFinder().

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

Definition at line 54 of file StartingLayerFinder.h.

References thePropagator.

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

Definition at line 66 of file StartingLayerFinder.h.

66  {
67  if (a.first > b.second || b.first > a.second)
68  return false;
69  else
70  return true;
71  }
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
vector< const DetLayer * > StartingLayerFinder::startingLayers ( const FTS aFts,
float  dr,
float  dz 
) const

Definition at line 18 of file StartingLayerFinder.cc.

References flavorHistoryFilter_cfi::dr, PVValHelper::dz, FreeTrajectoryState::parameters(), position, TrackCandidateProducer_cfi::propagator, and rangesIntersect().

Referenced by ~StartingLayerFinder().

18  {
19  vector<const DetLayer*> mylayers;
20  mylayers.reserve(3);
21 
22  FTS fastFts(aFts.parameters());
23 
24  //barrel pixel
25  TSOS pTsos = propagator()->propagate(fastFts, firstPixelBarrelLayer()->surface());
26 
27  if (pTsos.isValid()) {
28  Range barrZRange(
29  firstPixelBarrelLayer()->position().z() - 0.5 * (firstPixelBarrelLayer()->surface().bounds().length()),
30  firstPixelBarrelLayer()->position().z() + 0.5 * (firstPixelBarrelLayer()->surface().bounds().length()));
31  Range trajZRange(pTsos.globalPosition().z() - dz, pTsos.globalPosition().z() + dz);
32 
33  if (rangesIntersect(trajZRange, barrZRange)) {
34  mylayers.push_back(firstPixelBarrelLayer());
35  }
36  }
37 
38  //negative fwd pixel
39 
40  for (auto infwd : firstPosPixelFwdLayer()) {
41  pTsos = propagator()->propagate(fastFts, infwd->surface());
42  if (pTsos.isValid()) {
43  Range nfwdRRange(infwd->specificSurface().innerRadius(), infwd->specificSurface().outerRadius());
44  Range trajRRange(pTsos.globalPosition().perp() - dr, pTsos.globalPosition().perp() + dr);
45  if (rangesIntersect(trajRRange, nfwdRRange)) {
46  mylayers.push_back(infwd);
47  }
48  }
49  }
50 
51  //positive fwd pixel
52  for (auto ipfwd : firstPosPixelFwdLayer()) {
53  pTsos = propagator()->propagate(fastFts, ipfwd->surface());
54  if (pTsos.isValid()) {
55  Range pfwdRRange(ipfwd->specificSurface().innerRadius(), ipfwd->specificSurface().outerRadius());
56  Range trajRRange(pTsos.globalPosition().perp() - dr, pTsos.globalPosition().perp() + dr);
57  if (rangesIntersect(trajRRange, pfwdRRange)) {
58  mylayers.push_back(ipfwd);
59  }
60  }
61  }
62 
63  return mylayers;
64 }
bool rangesIntersect(const Range &a, const Range &b) const
const GlobalTrajectoryParameters & parameters() const
const std::vector< const ForwardDetLayer * > firstPosPixelFwdLayer() const
const BarrelDetLayer * firstPixelBarrelLayer() const
std::pair< float, float > Range
const Propagator * propagator() const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
static int position[264][3]
Definition: ReadPGInfo.cc:289
vector< const DetLayer * > StartingLayerFinder::startingLayers ( const TrajectorySeed aSeed) const

Definition at line 66 of file StartingLayerFinder.cc.

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

66  {
67  float dr = 0., dz = 0.;
68 
69  if (propagator()->propagationDirection() != aSeed.direction())
70  return vector<const DetLayer*>();
71 
72  if (aSeed.nHits() != 2)
73  return vector<const DetLayer*>();
74 
75  TrackingRecHitCollection::const_iterator firstHit = aSeed.recHits().first;
76  const TrackingRecHit* recHit1 = &(*firstHit);
77  const DetLayer* hit1Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit1->geographicalId());
78 
79  TrackingRecHitCollection::const_iterator secondHit = aSeed.recHits().second;
80  const TrackingRecHit* recHit2 = &(*secondHit);
81  const DetLayer* hit2Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit2->geographicalId());
82 
85 
87  dr = 0.1;
88  dz = 5.;
89  } else if (p1 == GeomDetEnumerators::endcap && p2 == GeomDetEnumerators::endcap) {
90  dr = 5.;
91  dz = 0.1;
92  } else {
93  dr = 0.1;
94  dz = 0.1;
95  }
96 
97  const GeomDet* gdet = theMeasurementTracker->geomTracker()->idToDet(DetId(aSeed.startingState().detId()));
98 
100  aSeed.startingState(), &(gdet->surface()), thePropagator->magneticField());
101 
102  const FreeTrajectoryState* fts = tsos.freeTrajectoryState();
103 
104  return startingLayers(*fts, dr, dz);
105 }
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:37
virtual const MagneticField * magneticField() const =0
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:17
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
range recHits() const
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 61 of file StartingLayerFinder.h.

const BarrelDetLayer* StartingLayerFinder::theFirstPixelBarrelLayer
mutableprivate

Definition at line 60 of file StartingLayerFinder.h.

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

Definition at line 62 of file StartingLayerFinder.h.

const MeasurementTracker* StartingLayerFinder::theMeasurementTracker
private

Definition at line 58 of file StartingLayerFinder.h.

bool StartingLayerFinder::thePixelLayersValid
mutableprivate

Definition at line 59 of file StartingLayerFinder.h.

const Propagator* StartingLayerFinder::thePropagator
private

Definition at line 57 of file StartingLayerFinder.h.

Referenced by propagator().