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

◆ FTS

Definition at line 29 of file StartingLayerFinder.h.

◆ Range

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

Definition at line 31 of file StartingLayerFinder.h.

◆ TSOS

Definition at line 30 of file StartingLayerFinder.h.

Constructor & Destructor Documentation

◆ StartingLayerFinder()

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

Definition at line 34 of file StartingLayerFinder.h.

35  :
36 
37  thePropagator(aPropagator),
39  thePixelLayersValid(false),
40  theFirstPixelBarrelLayer(nullptr),

◆ ~StartingLayerFinder()

StartingLayerFinder::~StartingLayerFinder ( )
inline

Definition at line 44 of file StartingLayerFinder.h.

44 {}

Member Function Documentation

◆ checkPixelLayers()

void StartingLayerFinder::checkPixelLayers ( ) const
private

Definition at line 122 of file StartingLayerFinder.cc.

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 }

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

◆ firstNegPixelFwdLayer()

const vector< const ForwardDetLayer * > StartingLayerFinder::firstNegPixelFwdLayer ( ) const

Definition at line 112 of file StartingLayerFinder.cc.

112  {
115 }

◆ firstPixelBarrelLayer()

const BarrelDetLayer * StartingLayerFinder::firstPixelBarrelLayer ( ) const

Definition at line 107 of file StartingLayerFinder.cc.

107  {
110 }

◆ firstPosPixelFwdLayer()

const vector< const ForwardDetLayer * > StartingLayerFinder::firstPosPixelFwdLayer ( ) const

Definition at line 117 of file StartingLayerFinder.cc.

117  {
120 }

◆ propagator()

const Propagator* StartingLayerFinder::propagator ( ) const
inline

Definition at line 54 of file StartingLayerFinder.h.

54 { return thePropagator; }

References thePropagator.

◆ rangesIntersect()

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  }

References a, and b.

◆ startingLayers() [1/2]

vector< const DetLayer * > StartingLayerFinder::startingLayers ( const FTS aFts,
float  dr,
float  dz 
) const

Definition at line 18 of file StartingLayerFinder.cc.

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 }

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

◆ startingLayers() [2/2]

vector< const DetLayer * > StartingLayerFinder::startingLayers ( const TrajectorySeed aSeed) const

Definition at line 66 of file StartingLayerFinder.cc.

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.;
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 }

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().

Member Data Documentation

◆ theFirstNegPixelFwdLayer

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

Definition at line 61 of file StartingLayerFinder.h.

◆ theFirstPixelBarrelLayer

const BarrelDetLayer* StartingLayerFinder::theFirstPixelBarrelLayer
mutableprivate

Definition at line 60 of file StartingLayerFinder.h.

◆ theFirstPosPixelFwdLayer

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

Definition at line 62 of file StartingLayerFinder.h.

◆ theMeasurementTracker

const MeasurementTracker* StartingLayerFinder::theMeasurementTracker
private

Definition at line 58 of file StartingLayerFinder.h.

◆ thePixelLayersValid

bool StartingLayerFinder::thePixelLayersValid
mutableprivate

Definition at line 59 of file StartingLayerFinder.h.

◆ thePropagator

const Propagator* StartingLayerFinder::thePropagator
private

Definition at line 57 of file StartingLayerFinder.h.

Referenced by propagator().

TrajectoryStateOnSurface::freeTrajectoryState
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:60
StartingLayerFinder::theFirstPixelBarrelLayer
const BarrelDetLayer * theFirstPixelBarrelLayer
Definition: StartingLayerFinder.h:60
GeomDet
Definition: GeomDet.h:27
DetLayer
Definition: DetLayer.h:21
TrajectorySeed::nHits
unsigned int nHits() const
Definition: TrajectorySeed.h:53
Propagator::magneticField
virtual const MagneticField * magneticField() const =0
StartingLayerFinder::thePixelLayersValid
bool thePixelLayersValid
Definition: StartingLayerFinder.h:59
StartingLayerFinder::theFirstNegPixelFwdLayer
std::vector< const ForwardDetLayer * > theFirstNegPixelFwdLayer
Definition: StartingLayerFinder.h:61
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
GeomDetEnumerators::barrel
Definition: GeomDetEnumerators.h:9
DetId
Definition: DetId.h:17
DetLayer::location
virtual Location location() const =0
Which part of the detector (barrel, endcap)
StartingLayerFinder::propagator
const Propagator * propagator() const
Definition: StartingLayerFinder.h:54
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
PTrajectoryStateOnDet::detId
unsigned int detId() const
Definition: PTrajectoryStateOnDet.h:65
StartingLayerFinder::thePropagator
const Propagator * thePropagator
Definition: StartingLayerFinder.h:57
StartingLayerFinder::theMeasurementTracker
const MeasurementTracker * theMeasurementTracker
Definition: StartingLayerFinder.h:58
DDAxes::z
p2
double p2[4]
Definition: TauolaWrapper.h:90
StartingLayerFinder::Range
std::pair< float, float > Range
Definition: StartingLayerFinder.h:31
b
double b
Definition: hdecay.h:118
StartingLayerFinder::rangesIntersect
bool rangesIntersect(const Range &a, const Range &b) const
Definition: StartingLayerFinder.h:66
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
TrajectorySeed::direction
PropagationDirection direction() const
Definition: TrajectorySeed.h:54
a
double a
Definition: hdecay.h:119
GeometricSearchTracker::posPixelForwardLayers
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
Definition: GeometricSearchTracker.h:45
GeomDetEnumerators::endcap
Definition: GeomDetEnumerators.h:9
StartingLayerFinder::firstPixelBarrelLayer
const BarrelDetLayer * firstPixelBarrelLayer() const
Definition: StartingLayerFinder.cc:107
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
FreeTrajectoryState::parameters
const GlobalTrajectoryParameters & parameters() const
Definition: FreeTrajectoryState.h:79
trajectoryStateTransform::transientState
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
Definition: TrajectoryStateTransform.cc:35
p1
double p1[4]
Definition: TauolaWrapper.h:89
StartingLayerFinder::firstPosPixelFwdLayer
const std::vector< const ForwardDetLayer * > firstPosPixelFwdLayer() const
Definition: StartingLayerFinder.cc:117
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
TrackingRecHit
Definition: TrackingRecHit.h:21
GeomDetEnumerators::Location
Location
Definition: GeomDetEnumerators.h:9
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
GeometricSearchTracker::negPixelForwardLayers
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
Definition: GeometricSearchTracker.h:41
PVValHelper::dz
Definition: PVValidationHelpers.h:50
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
GeometricSearchTracker
Definition: GeometricSearchTracker.h:14
TrajectorySeed::recHits
range recHits() const
Definition: TrajectorySeed.h:52
TrajectorySeed::startingState
PTrajectoryStateOnDet const & startingState() const
Definition: TrajectorySeed.h:55
StartingLayerFinder::checkPixelLayers
void checkPixelLayers() const
Definition: StartingLayerFinder.cc:122
StartingLayerFinder::startingLayers
std::vector< const DetLayer * > startingLayers(const FTS &aFts, float dr, float dz) const
Definition: StartingLayerFinder.cc:18
StartingLayerFinder::theFirstPosPixelFwdLayer
std::vector< const ForwardDetLayer * > theFirstPosPixelFwdLayer
Definition: StartingLayerFinder.h:62
GeometricSearchTracker::pixelBarrelLayers
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
Definition: GeometricSearchTracker.h:37