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 Attributes
SimpleForwardNavigableLayer Class Referencefinal

#include <SimpleForwardNavigableLayer.h>

Inheritance diagram for SimpleForwardNavigableLayer:
SimpleNavigableLayer NavigableLayer

Public Member Functions

virtual std::vector< const
DetLayer * > 
compatibleLayers (NavigationDirection direction) const override
 
virtual std::vector< const
DetLayer * > 
compatibleLayers (const FreeTrajectoryState &fts, PropagationDirection dir) const override
 
virtual const DetLayerdetLayer () const override
 
virtual std::vector< const
DetLayer * > 
nextLayers (NavigationDirection direction) const override
 
virtual std::vector< const
DetLayer * > 
nextLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection) const override
 
virtual void setAdditionalLink (const DetLayer *, NavigationDirection direction=insideOut) override
 
virtual void setDetLayer (const DetLayer *dl) override
 
virtual 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
virtual 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 = 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 17 of file SimpleForwardNavigableLayer.cc.

References theOuterBarrelLayers, theOuterForwardLayers, and theOuterLayers.

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

116  {
117  edm::LogError("TkNavigation") << "ERROR: compatibleLayers() method used without all reachableLayers are set" ;
118  throw DetLayerException("compatibleLayers() method used without all reachableLayers are set");
119  return vector<const DetLayer*>();
120 
121 }
Common base class.
virtual std::vector<const DetLayer*> SimpleForwardNavigableLayer::compatibleLayers ( const FreeTrajectoryState fts,
PropagationDirection  dir 
) const
inlineoverridevirtual

Reimplemented from NavigableLayer.

Definition at line 32 of file SimpleForwardNavigableLayer.h.

References SimpleNavigableLayer::compatibleLayers(), and counter.

33  {
34  int counter=0;
35  return SimpleNavigableLayer::compatibleLayers(fts,dir,counter);
36  }
virtual std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const final
static std::atomic< unsigned int > counter
dbl *** dir
Definition: mlp_gen.cc:35
virtual const DetLayer* SimpleForwardNavigableLayer::detLayer ( ) const
inlineoverridevirtual

Implements NavigableLayer.

Definition at line 40 of file SimpleForwardNavigableLayer.h.

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

Implements NavigableLayer.

Definition at line 51 of file SimpleForwardNavigableLayer.cc.

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

52 {
53  vector<const DetLayer*> result;
54 
55  // the order is the one in which layers
56  // should be checked for a reasonable trajectory
57 
58  if ( dir == insideOut ) {
59  return theOuterLayers;
60  }
61  else {
62  return theInnerLayers;
63  }
64 
65  return result;
66 }
tuple result
Definition: mps_fire.py:83
dbl *** dir
Definition: mlp_gen.cc:35
vector< const DetLayer * > SimpleForwardNavigableLayer::nextLayers ( const FreeTrajectoryState fts,
PropagationDirection  timeDirection 
) const
overridevirtual

Implements NavigableLayer.

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

71 {
72  // This method contains the sequence in which the layers are tested.
73  // The iteration stops as soon as a layer contains the propagated state
74  // within epsilon
75 
76  vector<const DetLayer*> result;
77 
78  FreeTrajectoryState ftsWithoutErrors = (fts.hasError()) ?
79  FreeTrajectoryState(fts.parameters()) : fts;
80 
81  auto const position = fts.position();
82  auto const momentum = fts.momentum();
83 
84 
85  //establish whether the tracks is crossing the tracker from outer layers to inner ones
86  //or from inner to outer
87  float zpos = position.z();
88  bool isInOutTrackFWD = momentum.z()*zpos>0;
89  GlobalVector transversePosition(position.x(), position.y(), 0);
90  bool isInOutTrackBarrel = (transversePosition.dot(momentum)>0);
91 
92  //establish whether inner or outer layers are crossed after propagation, according
93  //to BOTH propagationDirection AND track momentum
94  bool dirOppositeXORisInOutTrackBarrel = ( !(dir == oppositeToMomentum) && isInOutTrackBarrel) || ( (dir == oppositeToMomentum) && !isInOutTrackBarrel);
95  bool dirOppositeXORisInOutTrackFWD = ( !(dir == oppositeToMomentum) && isInOutTrackFWD) || ( (dir == oppositeToMomentum) && !isInOutTrackFWD);
96  //bool dirOppositeXORisInOutTrack = ( !(dir == oppositeToMomentum) && isInOutTrack) || ( (dir == oppositeToMomentum) && !isInOutTrack);
97 
98  if likely( dirOppositeXORisInOutTrackFWD && dirOppositeXORisInOutTrackBarrel ) { //standard tracks
99  wellInside(ftsWithoutErrors, dir, theOuterLayers, result);
100  }
101  else if (!dirOppositeXORisInOutTrackFWD && !dirOppositeXORisInOutTrackBarrel){ // !dirOppositeXORisInOutTrack
102  wellInside(ftsWithoutErrors, dir, theInnerLayers, result);
103  } else if (!dirOppositeXORisInOutTrackFWD && dirOppositeXORisInOutTrackBarrel ) {
104  wellInside(ftsWithoutErrors, dir, theInnerForwardLayers.begin(), theInnerForwardLayers.end(), result);
105  wellInside(ftsWithoutErrors, dir, theOuterBarrelLayers.begin(), theOuterBarrelLayers.end(), result);
106  } else {
107  wellInside(ftsWithoutErrors, dir, theInnerBarrelLayers.begin(), theInnerBarrelLayers.end(), result);
108  wellInside(ftsWithoutErrors, dir, theOuterForwardLayers.begin(), theOuterForwardLayers.end(), result);
109  }
110 
111  return result;
112 }
const GlobalTrajectoryParameters & parameters() const
tuple result
Definition: mps_fire.py:83
#define likely(x)
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:509
dbl *** dir
Definition: mlp_gen.cc:35
void SimpleForwardNavigableLayer::setAdditionalLink ( const DetLayer additional,
NavigationDirection  direction = insideOut 
)
overridevirtual

Implements SimpleNavigableLayer.

Definition at line 150 of file SimpleForwardNavigableLayer.cc.

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

Referenced by CosmicNavigationSchool::buildAdditionalForwardLinks().

150  {
151  const ForwardDetLayer* fadditional = dynamic_cast<const ForwardDetLayer*>(additional);
152  const BarrelDetLayer* badditional = dynamic_cast<const BarrelDetLayer*>(additional);
153  if (badditional){
154  if (direction==insideOut){
155  theOuterBarrelLayers.push_back(badditional);
156  theOuterLayers.push_back(badditional);
157  return;
158  }
159  theInnerBarrelLayers.push_back(badditional);
160  theInnerLayers.push_back(badditional);
161  return;
162  } else if (fadditional){
163  if (direction==insideOut){
164  theOuterForwardLayers.push_back(fadditional);
165  theOuterLayers.push_back(badditional);
166  return;
167  }
168  theInnerForwardLayers.push_back(fadditional);
169  theInnerLayers.push_back(badditional);
170  return;
171  }
172  edm::LogError("TkNavigation") << "trying to add neither a ForwardDetLayer nor a BarrelDetLayer";
173  return;
174 }
void SimpleForwardNavigableLayer::setDetLayer ( const DetLayer dl)
overridevirtual

Implements NavigableLayer.

Definition at line 124 of file SimpleForwardNavigableLayer.cc.

References ecal_dqm_sourceclient-live_cfg::cerr.

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

Implements SimpleNavigableLayer.

Definition at line 129 of file SimpleForwardNavigableLayer.cc.

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

131  {
132 
133  theInnerBarrelLayers = innerBL;
134  theInnerForwardLayers = innerFL;
135 
136  theInnerLayers.clear();
137  theInnerLayers.reserve(innerBL.size() + innerFL.size());
138  for ( ConstBDLI bl = innerBL.begin(); bl != innerBL.end(); bl++ )
139  theInnerLayers.push_back(*bl);
140  for ( ConstFDLI fl = innerFL.begin(); fl != innerFL.end(); fl++ )
141  theInnerLayers.push_back(*fl);
142 
143  // sort the inner layers
144  sort(theInnerLayers.begin(), theInnerLayers.end(),sorter);
146  sort(theInnerBarrelLayers.begin(), theInnerBarrelLayers.end(), sorter);
147 
148 }
FDLC::const_iterator ConstFDLI
BDLC::const_iterator ConstBDLI

Member Data Documentation

const ForwardDetLayer* SimpleForwardNavigableLayer::theDetLayer
private

Definition at line 46 of file SimpleForwardNavigableLayer.h.

BDLC SimpleForwardNavigableLayer::theInnerBarrelLayers
private

Definition at line 48 of file SimpleForwardNavigableLayer.h.

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

FDLC SimpleForwardNavigableLayer::theInnerForwardLayers
private

Definition at line 51 of file SimpleForwardNavigableLayer.h.

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

DLC SimpleForwardNavigableLayer::theInnerLayers
private

Definition at line 54 of file SimpleForwardNavigableLayer.h.

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

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