CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
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 = nullptr
 

Detailed Description

A concrete NavigableLayer for the forward

Definition at line 10 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 16 of file SimpleForwardNavigableLayer.cc.

References theOuterBarrelLayers, theOuterForwardLayers, and theOuterLayers.

22  : SimpleNavigableLayer(field, epsilon, checkCrossingSide),
23  theDetLayer(detLayer),
24  theOuterBarrelLayers(outerBL),
26  theOuterForwardLayers(outerFL),
28  theOuterLayers(0),
29  theInnerLayers(0) {
30  // put barrel and forward layers together
31  theOuterLayers.reserve(outerBL.size() + outerFL.size());
32  for (ConstBDLI bl = outerBL.begin(); bl != outerBL.end(); bl++)
33  theOuterLayers.push_back(*bl);
34  for (ConstFDLI fl = outerFL.begin(); fl != outerFL.end(); fl++)
35  theOuterLayers.push_back(*fl);
36 
37  // sort the outer layers
38  sort(theOuterLayers.begin(), theOuterLayers.end(), TkLayerLess());
41 }
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 101 of file SimpleForwardNavigableLayer.cc.

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

Reimplemented from NavigableLayer.

Definition at line 29 of file SimpleForwardNavigableLayer.h.

References SimpleNavigableLayer::compatibleLayers(), and counter.

30  {
31  int counter = 0;
32  return SimpleNavigableLayer::compatibleLayers(fts, dir, counter);
33  }
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const final
static std::atomic< unsigned int > counter
const DetLayer* SimpleForwardNavigableLayer::detLayer ( ) const
inlineoverridevirtual

Implements NavigableLayer.

Definition at line 37 of file SimpleForwardNavigableLayer.h.

37 { return theDetLayer; }
vector< const DetLayer * > SimpleForwardNavigableLayer::nextLayers ( NavigationDirection  direction) const
overridevirtual

Implements NavigableLayer.

Definition at line 43 of file SimpleForwardNavigableLayer.cc.

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

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

Implements NavigableLayer.

Definition at line 58 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().

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

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

Referenced by CosmicNavigationSchool::buildAdditionalForwardLinks().

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

Implements NavigableLayer.

Definition at line 107 of file SimpleForwardNavigableLayer.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr.

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

Implements SimpleNavigableLayer.

Definition at line 111 of file SimpleForwardNavigableLayer.cc.

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

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

Member Data Documentation

const ForwardDetLayer* SimpleForwardNavigableLayer::theDetLayer
private

Definition at line 43 of file SimpleForwardNavigableLayer.h.

BDLC SimpleForwardNavigableLayer::theInnerBarrelLayers
private

Definition at line 45 of file SimpleForwardNavigableLayer.h.

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

FDLC SimpleForwardNavigableLayer::theInnerForwardLayers
private

Definition at line 48 of file SimpleForwardNavigableLayer.h.

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

DLC SimpleForwardNavigableLayer::theInnerLayers
private

Definition at line 51 of file SimpleForwardNavigableLayer.h.

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

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