CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SimpleForwardNavigableLayer Class Referencefinal

#include <SimpleForwardNavigableLayer.h>

Inheritance diagram for SimpleForwardNavigableLayer:
SimpleNavigableLayer NavigableLayer

Public Member Functions

std::vector< const DetLayer * > compatibleLayers (NavigationDirection direction) const override
 
std::vector< const DetLayer * > compatibleLayers (const FreeTrajectoryState &fts, PropagationDirection dir) const override
 
const DetLayerdetLayer () const override
 
std::vector< const DetLayer * > nextLayers (NavigationDirection direction) const override
 
std::vector< const DetLayer * > nextLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection) const override
 
void setAdditionalLink (const DetLayer *, NavigationDirection direction=insideOut) override
 
void setDetLayer (const DetLayer *dl) override
 
void setInwardLinks (const BDLC &, const FDLC &, TkLayerLess sorter=TkLayerLess(outsideIn)) override
 
 SimpleForwardNavigableLayer (const ForwardDetLayer *detLayer, const BDLC &outerBL, const FDLC &outerFL, const MagneticField *field, float epsilon, bool checkCrossingSide=true)
 
- Public Member Functions inherited from SimpleNavigableLayer
std::vector< const DetLayer * > compatibleLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const final
 
void setCheckCrossingSide (bool docheck)
 
 SimpleNavigableLayer (const MagneticField *field, float eps, bool checkCrossingSide=true)
 
- Public Member Functions inherited from NavigableLayer
virtual void setDetLayer (DetLayer const *dl)=0
 
void setSchool (NavigationSchool const *sh)
 
virtual ~NavigableLayer ()
 

Private Attributes

const ForwardDetLayertheDetLayer
 
BDLC theInnerBarrelLayers
 
FDLC theInnerForwardLayers
 
DLC theInnerLayers
 
BDLC theOuterBarrelLayers
 
FDLC theOuterForwardLayers
 
DLC theOuterLayers
 

Additional Inherited Members

- Public Types inherited from SimpleNavigableLayer
typedef std::vector< const BarrelDetLayer * > BDLC
 
typedef std::vector< const DetLayer * > DLC
 
typedef std::vector< const ForwardDetLayer * > FDLC
 
- Public Attributes inherited from SimpleNavigableLayer
bool theSelfSearch
 
- Protected Types inherited from SimpleNavigableLayer
typedef BDLC::iterator BDLI
 
typedef BDLC::const_iterator ConstBDLI
 
typedef FDLC::const_iterator ConstFDLI
 
typedef FDLC::iterator FDLI
 
typedef TrajectoryStateOnSurface TSOS
 
- Protected Member Functions inherited from SimpleNavigableLayer
TSOS crossingState (const FreeTrajectoryState &fts, PropagationDirection dir) const
 
AnalyticalPropagator propagator (PropagationDirection dir) const
 
bool wellInside (const FreeTrajectoryState &fts, PropagationDirection dir, const BarrelDetLayer *bl, DLC &result) const
 
bool wellInside (const FreeTrajectoryState &fts, PropagationDirection dir, const ForwardDetLayer *bl, DLC &result) const
 
bool wellInside (const FreeTrajectoryState &fts, PropagationDirection dir, ConstBDLI begin, ConstBDLI end, DLC &result) const
 
bool wellInside (const FreeTrajectoryState &fts, PropagationDirection dir, const DLC &layers, DLC &result) const
 
bool wellInside (const FreeTrajectoryState &fts, PropagationDirection dir, ConstFDLI begin, ConstFDLI end, DLC &result) const
 
- Protected Attributes inherited from SimpleNavigableLayer
bool theCheckCrossingSide
 
float theEpsilon
 
const MagneticFieldtheField
 
- Protected Attributes inherited from NavigableLayer
NavigationSchool const * school = 0
 

Detailed Description

A concrete NavigableLayer for the forward

Definition at line 9 of file SimpleForwardNavigableLayer.h.

Constructor & Destructor Documentation

SimpleForwardNavigableLayer::SimpleForwardNavigableLayer ( const ForwardDetLayer detLayer,
const BDLC outerBL,
const FDLC outerFL,
const MagneticField field,
float  epsilon,
bool  checkCrossingSide = true 
)

Definition at line 15 of file SimpleForwardNavigableLayer.cc.

References theOuterBarrelLayers, theOuterForwardLayers, and theOuterLayers.

21  : SimpleNavigableLayer(field, epsilon, checkCrossingSide),
22  theDetLayer(detLayer),
23  theOuterBarrelLayers(outerBL),
25  theOuterForwardLayers(outerFL),
27  theOuterLayers(0),
28  theInnerLayers(0) {
29  // put barrel and forward layers together
30  theOuterLayers.reserve(outerBL.size() + outerFL.size());
31  for (ConstBDLI bl = outerBL.begin(); bl != outerBL.end(); bl++)
32  theOuterLayers.push_back(*bl);
33  for (ConstFDLI fl = outerFL.begin(); fl != outerFL.end(); fl++)
34  theOuterLayers.push_back(*fl);
35 
36  // sort the outer layers
37  sort(theOuterLayers.begin(), theOuterLayers.end(), TkLayerLess());
40 }
SimpleNavigableLayer(const MagneticField *field, float eps, bool checkCrossingSide=true)
FDLC::const_iterator ConstFDLI
BDLC::const_iterator ConstBDLI

Member Function Documentation

vector< const DetLayer * > SimpleForwardNavigableLayer::compatibleLayers ( NavigationDirection  direction) const
overridevirtual

Implements NavigableLayer.

Definition at line 102 of file SimpleForwardNavigableLayer.cc.

102  {
103  edm::LogError("TkNavigation") << "ERROR: compatibleLayers() method used without all reachableLayers are set";
104  throw DetLayerException("compatibleLayers() method used without all reachableLayers are set");
105  return vector<const DetLayer*>();
106 }
Common base class.
std::vector<const DetLayer*> SimpleForwardNavigableLayer::compatibleLayers ( const FreeTrajectoryState fts,
PropagationDirection  dir 
) const
inlineoverridevirtual

Reimplemented from NavigableLayer.

Definition at line 28 of file SimpleForwardNavigableLayer.h.

References SimpleNavigableLayer::compatibleLayers(), insideOut, and SimpleNavigableLayer::setAdditionalLink().

29  {
30  int counter = 0;
31  return SimpleNavigableLayer::compatibleLayers(fts, dir, counter);
32  }
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const final
const DetLayer* SimpleForwardNavigableLayer::detLayer ( ) const
inlineoverridevirtual
vector< const DetLayer * > SimpleForwardNavigableLayer::nextLayers ( NavigationDirection  direction) const
overridevirtual

Implements NavigableLayer.

Definition at line 42 of file SimpleForwardNavigableLayer.cc.

References insideOut, mps_fire::result, theInnerLayers, and theOuterLayers.

42  {
43  vector<const DetLayer*> result;
44 
45  // the order is the one in which layers
46  // should be checked for a reasonable trajectory
47 
48  if (dir == insideOut) {
49  return theOuterLayers;
50  } else {
51  return theInnerLayers;
52  }
53 
54  return result;
55 }
vector< const DetLayer * > SimpleForwardNavigableLayer::nextLayers ( const FreeTrajectoryState fts,
PropagationDirection  timeDirection 
) const
overridevirtual

Implements NavigableLayer.

Definition at line 57 of file SimpleForwardNavigableLayer.cc.

References FreeTrajectoryState::hasError(), LIKELY, FreeTrajectoryState::momentum(), oppositeToMomentum, FreeTrajectoryState::parameters(), FreeTrajectoryState::position(), position, mps_fire::result, theInnerBarrelLayers, theInnerForwardLayers, theInnerLayers, theOuterBarrelLayers, theOuterForwardLayers, theOuterLayers, and SimpleNavigableLayer::wellInside().

58  {
59  // This method contains the sequence in which the layers are tested.
60  // The iteration stops as soon as a layer contains the propagated state
61  // within epsilon
62 
63  vector<const DetLayer*> result;
64 
65  FreeTrajectoryState ftsWithoutErrors = (fts.hasError()) ? FreeTrajectoryState(fts.parameters()) : fts;
66 
67  auto const position = fts.position();
68  auto const momentum = fts.momentum();
69 
70  //establish whether the tracks is crossing the tracker from outer layers to inner ones
71  //or from inner to outer
72  float zpos = position.z();
73  bool isInOutTrackFWD = momentum.z() * zpos > 0;
74  GlobalVector transversePosition(position.x(), position.y(), 0);
75  bool isInOutTrackBarrel = (transversePosition.dot(momentum) > 0);
76 
77  //establish whether inner or outer layers are crossed after propagation, according
78  //to BOTH propagationDirection AND track momentum
79  bool dirOppositeXORisInOutTrackBarrel =
80  (!(dir == oppositeToMomentum) && isInOutTrackBarrel) || ((dir == oppositeToMomentum) && !isInOutTrackBarrel);
81  bool dirOppositeXORisInOutTrackFWD =
82  (!(dir == oppositeToMomentum) && isInOutTrackFWD) || ((dir == oppositeToMomentum) && !isInOutTrackFWD);
83  //bool dirOppositeXORisInOutTrack = ( !(dir == oppositeToMomentum) && isInOutTrack) || ( (dir == oppositeToMomentum) && !isInOutTrack);
84 
85  if
86  LIKELY(dirOppositeXORisInOutTrackFWD && dirOppositeXORisInOutTrackBarrel) { //standard tracks
87  wellInside(ftsWithoutErrors, dir, theOuterLayers, result);
88  }
89  else if (!dirOppositeXORisInOutTrackFWD && !dirOppositeXORisInOutTrackBarrel) { // !dirOppositeXORisInOutTrack
90  wellInside(ftsWithoutErrors, dir, theInnerLayers, result);
91  } else if (!dirOppositeXORisInOutTrackFWD && dirOppositeXORisInOutTrackBarrel) {
92  wellInside(ftsWithoutErrors, dir, theInnerForwardLayers.begin(), theInnerForwardLayers.end(), result);
93  wellInside(ftsWithoutErrors, dir, theOuterBarrelLayers.begin(), theOuterBarrelLayers.end(), result);
94  } else {
95  wellInside(ftsWithoutErrors, dir, theInnerBarrelLayers.begin(), theInnerBarrelLayers.end(), result);
96  wellInside(ftsWithoutErrors, dir, theOuterForwardLayers.begin(), theOuterForwardLayers.end(), result);
97  }
98 
99  return result;
100 }
const GlobalTrajectoryParameters & parameters() const
#define LIKELY(x)
Definition: Likely.h:20
GlobalVector momentum() const
GlobalPoint position() const
bool wellInside(const FreeTrajectoryState &fts, PropagationDirection dir, const BarrelDetLayer *bl, DLC &result) const
static int position[264][3]
Definition: ReadPGInfo.cc:289
void SimpleForwardNavigableLayer::setAdditionalLink ( const DetLayer additional,
NavigationDirection  direction = insideOut 
)
overridevirtual

Implements SimpleNavigableLayer.

Definition at line 129 of file SimpleForwardNavigableLayer.cc.

References insideOut, theInnerBarrelLayers, theInnerForwardLayers, theInnerLayers, theOuterBarrelLayers, theOuterForwardLayers, and theOuterLayers.

Referenced by CosmicNavigationSchool::buildAdditionalForwardLinks().

129  {
130  const ForwardDetLayer* fadditional = dynamic_cast<const ForwardDetLayer*>(additional);
131  const BarrelDetLayer* badditional = dynamic_cast<const BarrelDetLayer*>(additional);
132  if (badditional) {
133  if (direction == insideOut) {
134  theOuterBarrelLayers.push_back(badditional);
135  theOuterLayers.push_back(badditional);
136  return;
137  }
138  theInnerBarrelLayers.push_back(badditional);
139  theInnerLayers.push_back(badditional);
140  return;
141  } else if (fadditional) {
142  if (direction == insideOut) {
143  theOuterForwardLayers.push_back(fadditional);
144  theOuterLayers.push_back(badditional);
145  return;
146  }
147  theInnerForwardLayers.push_back(fadditional);
148  theInnerLayers.push_back(badditional);
149  return;
150  }
151  edm::LogError("TkNavigation") << "trying to add neither a ForwardDetLayer nor a BarrelDetLayer";
152  return;
153 }
void SimpleForwardNavigableLayer::setDetLayer ( const DetLayer dl)
override

Definition at line 108 of file SimpleForwardNavigableLayer.cc.

References beam_dqm_sourceclient-live_cfg::cerr.

108  {
109  cerr << "Warning: SimpleForwardNavigableLayer::setDetLayer called." << endl << "This should never happen!" << endl;
110 }
void SimpleForwardNavigableLayer::setInwardLinks ( const BDLC innerBL,
const FDLC innerFL,
TkLayerLess  sorter = TkLayerLess(outsideIn) 
)
overridevirtual

Implements SimpleNavigableLayer.

Definition at line 112 of file SimpleForwardNavigableLayer.cc.

References MCScenario_CRAFT1_22X::sorter(), theInnerBarrelLayers, theInnerForwardLayers, and theInnerLayers.

112  {
113  theInnerBarrelLayers = innerBL;
114  theInnerForwardLayers = innerFL;
115 
116  theInnerLayers.clear();
117  theInnerLayers.reserve(innerBL.size() + innerFL.size());
118  for (ConstBDLI bl = innerBL.begin(); bl != innerBL.end(); bl++)
119  theInnerLayers.push_back(*bl);
120  for (ConstFDLI fl = innerFL.begin(); fl != innerFL.end(); fl++)
121  theInnerLayers.push_back(*fl);
122 
123  // sort the inner layers
124  sort(theInnerLayers.begin(), theInnerLayers.end(), sorter);
125  sort(theInnerForwardLayers.begin(), theInnerForwardLayers.end(), sorter);
126  sort(theInnerBarrelLayers.begin(), theInnerBarrelLayers.end(), sorter);
127 }
FDLC::const_iterator ConstFDLI
BDLC::const_iterator ConstBDLI

Member Data Documentation

const ForwardDetLayer* SimpleForwardNavigableLayer::theDetLayer
private

Definition at line 42 of file SimpleForwardNavigableLayer.h.

BDLC SimpleForwardNavigableLayer::theInnerBarrelLayers
private

Definition at line 44 of file SimpleForwardNavigableLayer.h.

Referenced by nextLayers(), setAdditionalLink(), and setInwardLinks().

FDLC SimpleForwardNavigableLayer::theInnerForwardLayers
private

Definition at line 47 of file SimpleForwardNavigableLayer.h.

Referenced by nextLayers(), setAdditionalLink(), and setInwardLinks().

DLC SimpleForwardNavigableLayer::theInnerLayers
private

Definition at line 50 of file SimpleForwardNavigableLayer.h.

Referenced by nextLayers(), setAdditionalLink(), and setInwardLinks().

BDLC SimpleForwardNavigableLayer::theOuterBarrelLayers
private
FDLC SimpleForwardNavigableLayer::theOuterForwardLayers
private
DLC SimpleForwardNavigableLayer::theOuterLayers
private