CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
SimpleNavigationSchool Class Reference

#include <SimpleNavigationSchool.h>

Inheritance diagram for SimpleNavigationSchool:
NavigationSchool BeamHaloNavigationSchool CosmicNavigationSchool SkippingLayerCosmicNavigationSchool

Public Member Functions

virtual StateType navigableLayers () override
 
 SimpleNavigationSchool ()
 
 SimpleNavigationSchool (const GeometricSearchTracker *theTracker, const MagneticField *field)
 
 ~SimpleNavigationSchool ()
 
- Public Member Functions inherited from NavigationSchool
const std::vector< const DetLayer * > & allLayersInSystem () const
 
template<typename... Args>
std::vector< const DetLayer * > compatibleLayers (const DetLayer &detLayer, Args &&...args) const
 Returns all layers compatible. More...
 
 NavigationSchool ()
 
template<typename... Args>
std::vector< const DetLayer * > nextLayers (const DetLayer &detLayer, Args &&...args) const
 NavigationDirection. More...
 
virtual ~NavigationSchool ()
 

Protected Types

typedef std::vector< const BarrelDetLayer * > BDLC
 
typedef BDLC::iterator BDLI
 
typedef std::vector< SimpleBarrelNavigableLayer * > BNLCType
 
typedef BDLC::const_iterator ConstBDLI
 
typedef FDLC::const_iterator ConstFDLI
 
typedef std::vector< const DetLayer * > DLC
 
typedef DLC::iterator DLI
 
typedef std::vector< const ForwardDetLayer * > FDLC
 
typedef FDLC::iterator FDLI
 
typedef std::vector< SimpleForwardNavigableLayer * > FNLCType
 

Protected Member Functions

virtual float barrelLength ()
 
void cleanMemory ()
 
virtual void establishInverseRelations ()
 
virtual void linkBarrelLayers (SymmetricLayerFinder &symFinder)
 
virtual void linkForwardLayers (SymmetricLayerFinder &symFinder)
 
virtual void linkNextBarrelLayer (ForwardDetLayer const *fl, BDLC &)
 
virtual void linkNextForwardLayer (BarrelDetLayer const *, FDLC &)
 
virtual void linkNextLargerLayer (BDLI, BDLI, BDLC &)
 
virtual void linkNextLayerInGroup (FDLI fli, const FDLC &group, FDLC &reachableFL)
 
virtual void linkOuterGroup (ForwardDetLayer const *fl, const FDLC &group, FDLC &reachableFL)
 
virtual void linkWithinGroup (FDLI fl, const FDLC &group, FDLC &reachableFL)
 
virtual ConstFDLI outerRadiusIncrease (FDLI fl, const FDLC &group)
 
virtual std::vector< FDLCsplitForwardLayers ()
 
- Protected Member Functions inherited from NavigationSchool
void setState (const StateType &state)
 

Protected Attributes

BDLC theBarrelLayers
 
float theBarrelLength
 
BNLCType theBarrelNLC
 
const MagneticFieldtheField
 
FDLC theForwardLayers
 
FNLCType theForwardNLC
 
FDLC theLeftLayers
 
FDLC theRightLayers
 
const GeometricSearchTrackertheTracker
 
- Protected Attributes inherited from NavigationSchool
const std::vector< const DetLayer * > * theAllDetLayersInSystem
 
StateType theAllNavigableLayer
 

Additional Inherited Members

- Public Types inherited from NavigationSchool
typedef std::vector< NavigableLayer * > StateType
 

Detailed Description

Concrete navigation school for the Tracker

Definition at line 20 of file SimpleNavigationSchool.h.

Member Typedef Documentation

typedef std::vector<const BarrelDetLayer*> SimpleNavigationSchool::BDLC
protected

Definition at line 34 of file SimpleNavigationSchool.h.

typedef BDLC::iterator SimpleNavigationSchool::BDLI
protected

Definition at line 37 of file SimpleNavigationSchool.h.

Definition at line 48 of file SimpleNavigationSchool.h.

typedef BDLC::const_iterator SimpleNavigationSchool::ConstBDLI
protected

Definition at line 39 of file SimpleNavigationSchool.h.

typedef FDLC::const_iterator SimpleNavigationSchool::ConstFDLI
protected

Definition at line 40 of file SimpleNavigationSchool.h.

typedef std::vector<const DetLayer*> SimpleNavigationSchool::DLC
protected

Definition at line 33 of file SimpleNavigationSchool.h.

typedef DLC::iterator SimpleNavigationSchool::DLI
protected

Definition at line 36 of file SimpleNavigationSchool.h.

typedef std::vector<const ForwardDetLayer*> SimpleNavigationSchool::FDLC
protected

Definition at line 35 of file SimpleNavigationSchool.h.

typedef FDLC::iterator SimpleNavigationSchool::FDLI
protected

Definition at line 38 of file SimpleNavigationSchool.h.

Definition at line 49 of file SimpleNavigationSchool.h.

Constructor & Destructor Documentation

SimpleNavigationSchool::SimpleNavigationSchool ( )
inline

Definition at line 23 of file SimpleNavigationSchool.h.

23 : theField(0),theTracker(0){};
const GeometricSearchTracker * theTracker
const MagneticField * theField
SimpleNavigationSchool::SimpleNavigationSchool ( const GeometricSearchTracker theTracker,
const MagneticField field 
)

Definition at line 29 of file SimpleNavigationSchool.cc.

References GeometricSearchTracker::allLayers(), GeometricSearchTracker::barrelLayers(), establishInverseRelations(), GeometricSearchTracker::forwardLayers(), mps_fire::i, linkBarrelLayers(), linkForwardLayers(), NavigationSchool::theAllDetLayersInSystem, NavigationSchool::theAllNavigableLayer, theBarrelLayers, theForwardLayers, theLeftLayers, theRightLayers, and theTracker.

30  :
31  theBarrelLength(0),theField(field), theTracker(theInputTracker)
32 {
33 
34  theAllDetLayersInSystem=&theInputTracker->allLayers();
35  theAllNavigableLayer.resize(theInputTracker->allLayers().size(),nullptr);
36 
37 
38  // Get barrel layers
39  for( auto i : theTracker->barrelLayers()) {
40  theBarrelLayers.push_back( i );
41  }
42 
43  // get forward layers
44  for( auto i : theTracker->forwardLayers()) {
45  theForwardLayers.push_back( i );
46  }
47 
48  FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
49  not1(DetBelowZ(0)));
50  theLeftLayers = FDLC( theForwardLayers.begin(), middle);
51  theRightLayers = FDLC( middle, theForwardLayers.end());
52 
54 
55  // only work on positive Z side; negative by mirror symmetry later
56  linkBarrelLayers( symFinder);
57  linkForwardLayers( symFinder);
59 }
std::vector< ForwardDetLayer const * > const & forwardLayers() const
const GeometricSearchTracker * theTracker
StateType theAllNavigableLayer
virtual void linkForwardLayers(SymmetricLayerFinder &symFinder)
virtual void establishInverseRelations()
std::vector< const ForwardDetLayer * > FDLC
const std::vector< const DetLayer * > * theAllDetLayersInSystem
const MagneticField * theField
virtual void linkBarrelLayers(SymmetricLayerFinder &symFinder)
std::vector< BarrelDetLayer const * > const & barrelLayers() const
SimpleNavigationSchool::~SimpleNavigationSchool ( )
inline

Member Function Documentation

float SimpleNavigationSchool::barrelLength ( )
protectedvirtual

Definition at line 365 of file SimpleNavigationSchool.cc.

References mps_fire::i, LogDebug, hpstanc_transforms::max, theBarrelLayers, and theBarrelLength.

Referenced by linkNextBarrelLayer().

366 {
367  if ( theBarrelLength < 1.) {
368  for (BDLI i=theBarrelLayers.begin(); i!=theBarrelLayers.end(); i++) {
370  (**i).surface().bounds().length() / 2.f);
371  }
372 
373  LogDebug("TkNavigation") << "The barrel length is " << theBarrelLength ;
374  }
375  return theBarrelLength;
376 }
#define LogDebug(id)
void SimpleNavigationSchool::cleanMemory ( )
protected

Definition at line 61 of file SimpleNavigationSchool.cc.

References cuy::ib, theBarrelNLC, and theForwardNLC.

Referenced by BeamHaloNavigationSchool::~BeamHaloNavigationSchool(), and CosmicNavigationSchool::~CosmicNavigationSchool().

61  {
62  // free the memory allocated to the SimpleNavigableLayers
63  for ( vector< SimpleBarrelNavigableLayer*>::const_iterator
64  ib = theBarrelNLC.begin(); ib != theBarrelNLC.end(); ib++) {
65  delete (*ib);
66  }
67  theBarrelNLC.clear();
68  for ( vector< SimpleForwardNavigableLayer*>::const_iterator
69  ifl = theForwardNLC.begin(); ifl != theForwardNLC.end(); ifl++) {
70  delete (*ifl);
71  }
72  theForwardNLC.clear();
73 }
ib
Definition: cuy.py:660
void SimpleNavigationSchool::establishInverseRelations ( )
protectedvirtual

Reimplemented in BeamHaloNavigationSchool.

Definition at line 378 of file SimpleNavigationSchool.cc.

References DEFINE_EDM_PLUGIN, NavigableLayer::detLayer(), mps_fire::i, insideOut, navigableLayers(), NavigationSchool::nextLayers(), NavigationSchool::setState(), NavigationSchool::theAllNavigableLayer, theBarrelLayers, and theForwardLayers.

Referenced by SimpleNavigationSchool(), and BeamHaloNavigationSchool::~BeamHaloNavigationSchool().

378  {
379 
380  // NavigationSetter setter(*this);
381 
383 
384  // find for each layer which are the barrel and forward
385  // layers that point to it
386  typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
387  typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
388 
389 
390  BarrelMapType reachedBarrelLayersMap;
391  ForwardMapType reachedForwardLayersMap;
392 
393 
394  for ( auto bli : theBarrelLayers) {
395  auto reachedLC = nextLayers(*bli, insideOut);
396  for ( auto i : reachedLC) {
397  reachedBarrelLayersMap[i].push_back(bli);
398  }
399  }
400 
401  for ( auto fli : theForwardLayers) {
402  auto reachedLC = nextLayers(*fli, insideOut);
403  for ( auto i : reachedLC) {
404  reachedForwardLayersMap[i].push_back(fli);
405  }
406  }
407 
408  /*
409  vector<DetLayer*> lc = theTracker->allLayers();
410  for ( vector<DetLayer*>::iterator i = lc.begin(); i != lc.end(); i++) {
411  SimpleNavigableLayer* navigableLayer =
412  dynamic_cast<SimpleNavigableLayer*>((**i).navigableLayer());
413  navigableLayer->setInwardLinks( reachedBarrelLayersMap[*i],reachedForwardLayersMap[*i] );
414  }
415  */
416 
417 
418  for(auto nl : theAllNavigableLayer) {
419  if (!nl) continue;
420  auto navigableLayer = static_cast<SimpleNavigableLayer*>(nl);
421  auto dl = nl->detLayer();
422  navigableLayer->setInwardLinks( reachedBarrelLayersMap[dl],reachedForwardLayersMap[dl] );
423  }
424 
425 
426 }
virtual StateType navigableLayers() override
StateType theAllNavigableLayer
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&...args) const
NavigationDirection.
virtual DetLayer const * detLayer() const =0
void setState(const StateType &state)
void SimpleNavigationSchool::linkBarrelLayers ( SymmetricLayerFinder symFinder)
protectedvirtual

Reimplemented in CosmicNavigationSchool.

Definition at line 91 of file SimpleNavigationSchool.cc.

References mps_fire::i, linkNextForwardLayer(), linkNextLargerLayer(), SymmetricLayerFinder::mirror(), theBarrelLayers, theBarrelNLC, and theField.

Referenced by navigableLayers(), and SimpleNavigationSchool().

92 {
93  // Link barrel layers outwards
94  for ( BDLI i = theBarrelLayers.begin(); i != theBarrelLayers.end(); i++) {
95  BDLC reachableBL;
96  FDLC leftFL;
97  FDLC rightFL;
98 
99  // always add next barrel layer first
100  if ( i+1 != theBarrelLayers.end()) reachableBL.push_back(*(i+1));
101 
102  // Add closest reachable forward layer (except for last BarrelLayer)
103  if (i != theBarrelLayers.end() - 1) {
104  linkNextForwardLayer( *i, rightFL);
105  }
106 
107  // Add next BarrelLayer with length larger than the current BL
108  if ( i+2 < theBarrelLayers.end()) {
109  linkNextLargerLayer( i, theBarrelLayers.end(), reachableBL);
110  }
111 
112  theBarrelNLC.push_back( new
113  SimpleBarrelNavigableLayer( *i, reachableBL,
114  symFinder.mirror(rightFL),
115  rightFL,theField, 5.));
116  }
117 }
std::vector< const BarrelDetLayer * > BDLC
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
std::vector< const ForwardDetLayer * > FDLC
const MagneticField * theField
virtual void linkNextLargerLayer(BDLI, BDLI, BDLC &)
virtual void linkNextForwardLayer(BarrelDetLayer const *, FDLC &)
void SimpleNavigationSchool::linkForwardLayers ( SymmetricLayerFinder symFinder)
protectedvirtual

Definition at line 158 of file SimpleNavigationSchool.cc.

References g, edmIntegrityCheck::group, mps_fire::i, linkNextBarrelLayer(), linkNextLayerInGroup(), linkOuterGroup(), linkWithinGroup(), LogDebug, SymmetricLayerFinder::mirror(), splitForwardLayers(), theField, and theForwardNLC.

Referenced by linkNextLargerLayer(), and SimpleNavigationSchool().

159 {
160 
161  // handle right side first, groups are only on the right
162  vector<FDLC> groups = splitForwardLayers();
163 
164  LogDebug("TkNavigation") << "SimpleNavigationSchool, Forward groups size = " << groups.size() ;
165  for (vector<FDLC>::iterator g = groups.begin(); g != groups.end(); g++) {
166  LogDebug("TkNavigation") << "group " << g - groups.begin() << " has "
167  << g->size() << " layers " ;
168  }
169 
170  for ( vector<FDLC>::iterator group = groups.begin();
171  group != groups.end(); group++) {
172 
173  for ( FDLI i = group->begin(); i != group->end(); i++) {
174 
175  BDLC reachableBL;
176  FDLC reachableFL;
177 
178  // Always connect to next barrel layer first, if exists
179  linkNextBarrelLayer( *i, reachableBL);
180 
181  // Then always connect to next forward layer of "same" size,
182  // and layers of larger inner Radius
183  linkNextLayerInGroup( i, *group, reachableFL);
184 
185  // Then connect to next N fw layers of next size
186  if ( group+1 != groups.end()) {
187  linkOuterGroup( *i, *(group+1), reachableFL);
188  }
189 
190  // or connect within the group if outer radius increases
191  linkWithinGroup( i, *group, reachableFL);
192 
193  theForwardNLC.push_back( new SimpleForwardNavigableLayer( *i,reachableBL,
194  reachableFL,
195  theField,
196  5.));
197  theForwardNLC.push_back( new SimpleForwardNavigableLayer( symFinder.mirror(*i),
198  reachableBL,
199  symFinder.mirror(reachableFL),
200  theField,
201  5.));
202 
203  }
204  }
205 
206 // // now the left side by symmetry
207 // for ( FDLI ileft = theLeftLayers.begin();
208 // ileft != theLeftLayers.end(); ileft++) {
209 // ForwardDetLayer* right = symFinder.mirror( *ileft);
210 
211 // theForwardNLC.push_back( new
212 // SimpleForwardNavigableLayer( *ileft , right->nextBarrelLayers(),
213 // symFinder.mirror(right->nextForwardLayers())));
214 // }
215 }
#define LogDebug(id)
std::vector< const BarrelDetLayer * > BDLC
virtual void linkNextBarrelLayer(ForwardDetLayer const *fl, BDLC &)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
virtual void linkNextLayerInGroup(FDLI fli, const FDLC &group, FDLC &reachableFL)
virtual void linkWithinGroup(FDLI fl, const FDLC &group, FDLC &reachableFL)
std::vector< const ForwardDetLayer * > FDLC
const MagneticField * theField
virtual std::vector< FDLC > splitForwardLayers()
virtual void linkOuterGroup(ForwardDetLayer const *fl, const FDLC &group, FDLC &reachableFL)
void SimpleNavigationSchool::linkNextBarrelLayer ( ForwardDetLayer const *  fl,
BDLC  
)
protectedvirtual

Definition at line 217 of file SimpleNavigationSchool.cc.

References barrelLength(), interestingEgammaIsoDetIdsSequence_cff::outerRadius, GeometricSearchDet::position(), ForwardDetLayer::specificSurface(), theBarrelLayers, and PV3DBase< T, PVType, FrameType >::z().

Referenced by linkForwardLayers().

219 {
220  if ( fl->position().z() > barrelLength()) return;
221 
222  float outerRadius = fl->specificSurface().outerRadius();
223  float zpos = fl->position().z();
224  for ( BDLI bli = theBarrelLayers.begin(); bli != theBarrelLayers.end(); bli++) {
225  if ( outerRadius < (**bli).specificSurface().radius() &&
226  zpos < (**bli).surface().bounds().length() / 2.) {
227  reachableBL.push_back( *bli);
228  return;
229  }
230  }
231 }
void SimpleNavigationSchool::linkNextForwardLayer ( BarrelDetLayer const *  ,
FDLC  
)
protectedvirtual

Definition at line 119 of file SimpleNavigationSchool.cc.

References Surface::bounds(), Bounds::length(), TCMET_cfi::radius, BarrelDetLayer::specificSurface(), BarrelDetLayer::surface(), and theRightLayers.

Referenced by linkBarrelLayers().

121 {
122  // find first forward layer with larger Z and larger outer radius
123  float length = bl->surface().bounds().length() / 2.;
124  float radius = bl->specificSurface().radius();
125  for ( FDLI fli = theRightLayers.begin();
126  fli != theRightLayers.end(); fli++) {
127  if ( length < (**fli).position().z() &&
128  radius < (**fli).specificSurface().outerRadius()) {
129  //search if there are any sovrapposition between forward layers
130  for ( FDLI fliNext = fli; fliNext != theRightLayers.end(); fliNext++) {
131  if ( (**fliNext).position().z() < (**fli).position().z() && (**fliNext).specificSurface().innerRadius() < (**fli).specificSurface().outerRadius()) {
132  rightFL.push_back( *fliNext);
133  return;
134  }
135  }
136  rightFL.push_back( *fli);
137  return;
138  }
139  }
140 }
void SimpleNavigationSchool::linkNextLargerLayer ( BDLI  bli,
BDLI  end,
BDLC reachableBL 
)
protectedvirtual

Definition at line 142 of file SimpleNavigationSchool.cc.

References end, geometryDiff::epsilon, mps_fire::i, and linkForwardLayers().

Referenced by linkBarrelLayers().

144 {
145  // compare length of next layer with length of following ones
146  float length = (**(bli+1)).surface().bounds().length();
147  float epsilon = 0.1;
148 
149  for ( BDLI i = bli+2; i < end; i++) {
150  if ( length + epsilon < (**i).surface().bounds().length()) {
151  reachableBL.push_back( *i);
152  return;
153  }
154  }
155 }
#define end
Definition: vmac.h:37
void SimpleNavigationSchool::linkNextLayerInGroup ( FDLI  fli,
const FDLC group,
FDLC reachableFL 
)
protectedvirtual

Definition at line 234 of file SimpleNavigationSchool.cc.

References geometryDiff::epsilon, and mps_fire::i.

Referenced by linkForwardLayers().

237 {
238  // Always connect to next forward layer of "same" size, if exists
239  if ( fli+1 != group.end()) {
240  reachableFL.push_back( *(fli+1));
241  // If that layer has an inner radius larger then the current one
242  // also connect ALL next disks of same radius.
243  float innerRThis = (**fli).specificSurface().innerRadius();
244  float innerRNext = (**(fli+1)).specificSurface().innerRadius();
245  const float epsilon = 2.f;
246 
247  if (innerRNext > innerRThis + epsilon) {
248  // next disk is smaller, so it doesn't cover fully subsequent ones
249  // of same radius
250 
251  int i = 2;
252  while ( (fli+i) != group.end()) {
253  if ( (**(fli+i)).specificSurface().innerRadius() <
254  innerRNext + epsilon) {
255  // following disk has not increased in ineer radius
256  reachableFL.push_back( *(fli+i));
257  i++;
258  } else {
259  break;
260  }
261  }
262  }
263  }
264 }
void SimpleNavigationSchool::linkOuterGroup ( ForwardDetLayer const *  fl,
const FDLC group,
FDLC reachableFL 
)
protectedvirtual

Definition at line 267 of file SimpleNavigationSchool.cc.

References plotBeamSpotDB::first, plotBeamSpotDB::last, min(), GeometricSearchDet::position(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by linkForwardLayers().

270 {
271 
272  // insert N layers with Z grater than fl
273 
274  ConstFDLI first = find_if( group.begin(), group.end(),
275  not1( DetBelowZ( fl->position().z())));
276  if ( first != group.end()) {
277 
278  // Hard-wired constant!!!!!!
279  ConstFDLI last = min( first + 7, group.end());
280 
281  reachableFL.insert( reachableFL.end(), first, last);
282  }
283 }
FDLC::const_iterator ConstFDLI
T min(T a, T b)
Definition: MathUtil.h:58
void SimpleNavigationSchool::linkWithinGroup ( FDLI  fl,
const FDLC group,
FDLC reachableFL 
)
protectedvirtual

Definition at line 285 of file SimpleNavigationSchool.cc.

References outerRadiusIncrease().

Referenced by linkForwardLayers().

288 {
289  ConstFDLI biggerLayer = outerRadiusIncrease( fl, group);
290  if ( biggerLayer != group.end() && biggerLayer != fl+1) {
291  reachableFL.push_back( *biggerLayer);
292  }
293 }
FDLC::const_iterator ConstFDLI
virtual ConstFDLI outerRadiusIncrease(FDLI fl, const FDLC &group)
SimpleNavigationSchool::StateType SimpleNavigationSchool::navigableLayers ( )
overridevirtual

Implements NavigationSchool.

Definition at line 76 of file SimpleNavigationSchool.cc.

References cuy::ib, linkBarrelLayers(), mps_fire::result, theBarrelNLC, and theForwardNLC.

Referenced by establishInverseRelations().

77 {
79  for ( vector< SimpleBarrelNavigableLayer*>::const_iterator
80  ib = theBarrelNLC.begin(); ib != theBarrelNLC.end(); ib++) {
81  result.push_back( *ib);
82  }
83  for ( vector< SimpleForwardNavigableLayer*>::const_iterator
84  ifl = theForwardNLC.begin(); ifl != theForwardNLC.end(); ifl++) {
85  result.push_back( *ifl);
86  }
87  return result;
88 }
std::vector< NavigableLayer * > StateType
ib
Definition: cuy.py:660
SimpleNavigationSchool::ConstFDLI SimpleNavigationSchool::outerRadiusIncrease ( FDLI  fl,
const FDLC group 
)
protectedvirtual

Definition at line 296 of file SimpleNavigationSchool.cc.

References geometryDiff::epsilon, and interestingEgammaIsoDetIdsSequence_cff::outerRadius.

Referenced by linkWithinGroup().

297 {
298  const float epsilon = 5.f;
299  float outerRadius = (**fl).specificSurface().outerRadius();
300  while ( ++fl != group.end()) {
301  if ( (**fl).specificSurface().outerRadius() > outerRadius + epsilon) {
302  return fl;
303  }
304  }
305  return fl;
306 }
vector< SimpleNavigationSchool::FDLC > SimpleNavigationSchool::splitForwardLayers ( )
protectedvirtual

Definition at line 309 of file SimpleNavigationSchool.cc.

References begin, end, mps_fire::i, LogDebug, GeometricSearchTracker::posPixelForwardLayers(), GeometricSearchTracker::posTidLayers(), mps_fire::result, theRightLayers, and theTracker.

Referenced by linkForwardLayers().

310 {
311  // only work on positive Z side; negative by mirror symmetry later
312 
313  FDLC myRightLayers( theRightLayers);
314  FDLI begin = myRightLayers.begin();
315  FDLI end = myRightLayers.end();
316 
317  // sort according to inner radius, but keeping the ordering in z!
318  stable_sort ( begin, end, DiskLessInnerRadius());
319 
320  // partition in cylinders
321  vector<FDLC> result;
322  FDLC current;
323  current.push_back( *begin);
324  for ( FDLI i = begin+1; i != end; i++) {
325 
326 #ifdef EDM_ML_DEBUG
327  LogDebug("TkNavigation") << "(**i).specificSurface().innerRadius() = "
328  << (**i).specificSurface().innerRadius() << endl
329  << "(**(i-1)).specificSurface().outerRadius()) = "
330  << (**(i-1)).specificSurface().outerRadius() ;
331  LogDebug("TkNavigation") << "(**i).specificSurface().position().z() = "
332  << (**i).specificSurface().position().z() << endl
333  << "(**(i-1)).specificSurface().position().z() = "
334  << (**(i-1)).specificSurface().position().z() ;
335 #endif
336 
337  // if inner radius of i is larger than outer radius of i-1 then split!
338  // FIXME: The solution found for phase2 is a bit dirty, we can do better.
339  // For phase2 we compare the EXTENDED pixel with the TID to get the assignment right!
340  if ( (**i).specificSurface().innerRadius() > (**(i-1)).specificSurface().outerRadius() ||
341  (theTracker->posPixelForwardLayers().back()->specificSurface().position().z() > theTracker->posTidLayers().front()->specificSurface().position().z() &&
342  (**i).specificSurface().position().z() < (**(i-1)).specificSurface().position().z()) ){
343 
344  LogDebug("TkNavigation") << "found break between groups" ;
345 
346  // sort layers in group along Z
347  stable_sort ( current.begin(), current.end(), DetLessZ());
348 
349  result.push_back(current);
350  current.clear();
351  }
352  current.push_back(*i);
353  }
354  result.push_back(current); // save last one too
355 
356  // now sort subsets in Z
357  for ( vector<FDLC>::iterator ivec = result.begin();
358  ivec != result.end(); ivec++) {
359  stable_sort( ivec->begin(), ivec->end(), DetLessZ());
360  }
361 
362  return result;
363 }
#define LogDebug(id)
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
const GeometricSearchTracker * theTracker
#define end
Definition: vmac.h:37
std::vector< const ForwardDetLayer * > FDLC
std::vector< ForwardDetLayer const * > const & posTidLayers() const
#define begin
Definition: vmac.h:30

Member Data Documentation

BDLC SimpleNavigationSchool::theBarrelLayers
protected
float SimpleNavigationSchool::theBarrelLength
protected

Definition at line 46 of file SimpleNavigationSchool.h.

Referenced by barrelLength().

BNLCType SimpleNavigationSchool::theBarrelNLC
protected

Definition at line 50 of file SimpleNavigationSchool.h.

Referenced by cleanMemory(), linkBarrelLayers(), and navigableLayers().

const MagneticField* SimpleNavigationSchool::theField
protected

Definition at line 78 of file SimpleNavigationSchool.h.

Referenced by linkBarrelLayers(), and linkForwardLayers().

FDLC SimpleNavigationSchool::theForwardLayers
protected

Definition at line 43 of file SimpleNavigationSchool.h.

Referenced by establishInverseRelations(), and SimpleNavigationSchool().

FNLCType SimpleNavigationSchool::theForwardNLC
protected

Definition at line 51 of file SimpleNavigationSchool.h.

Referenced by cleanMemory(), linkForwardLayers(), and navigableLayers().

FDLC SimpleNavigationSchool::theLeftLayers
protected

Definition at line 45 of file SimpleNavigationSchool.h.

Referenced by SimpleNavigationSchool().

FDLC SimpleNavigationSchool::theRightLayers
protected
const GeometricSearchTracker* SimpleNavigationSchool::theTracker
protected

Definition at line 79 of file SimpleNavigationSchool.h.

Referenced by SimpleNavigationSchool(), and splitForwardLayers().