29 theAllDetLayersInSystem=&theTracker->allLayers();
30 theAllNavigableLayer.resize(theTracker->allLayers().size(),
nullptr);
34 for(
auto i : theTracker->barrelLayers()) {
35 theBarrelLayers.push_back(
i );
39 for(
auto i : theTracker->forwardLayers()) {
40 theForwardLayers.push_back(
i );
43 FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
45 theLeftLayers =
FDLC( theForwardLayers.begin(), middle);
46 theRightLayers =
FDLC( middle, theForwardLayers.end());
51 linkBarrelLayers( symFinder);
52 linkForwardLayers( symFinder);
53 establishInverseRelations();
58 for ( vector< SimpleBarrelNavigableLayer*>::const_iterator
59 ib = theBarrelNLC.begin();
ib != theBarrelNLC.end();
ib++) {
63 for ( vector< SimpleForwardNavigableLayer*>::const_iterator
64 ifl = theForwardNLC.begin(); ifl != theForwardNLC.end(); ifl++) {
67 theForwardNLC.clear();
74 for ( vector< SimpleBarrelNavigableLayer*>::const_iterator
75 ib = theBarrelNLC.begin();
ib != theBarrelNLC.end();
ib++) {
76 result.push_back( *
ib);
78 for ( vector< SimpleForwardNavigableLayer*>::const_iterator
79 ifl = theForwardNLC.begin(); ifl != theForwardNLC.end(); ifl++) {
80 result.push_back( *ifl);
89 for (
BDLI i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
95 if (
i+1 != theBarrelLayers.end()) reachableBL.push_back(*(
i+1));
98 if (
i != theBarrelLayers.end() - 1) {
99 linkNextForwardLayer( *
i, rightFL);
103 if (
i+2 < theBarrelLayers.end()) {
104 linkNextLargerLayer(
i, theBarrelLayers.end(), reachableBL);
107 theBarrelNLC.push_back(
new 109 symFinder.
mirror(rightFL),
110 rightFL,theField, 5.));
120 for (
FDLI fli = theRightLayers.begin();
121 fli != theRightLayers.end(); fli++) {
122 if ( length < (**fli).position().z() &&
123 radius < (**fli).specificSurface().outerRadius()) {
125 for (
FDLI fliNext = fli; fliNext != theRightLayers.end(); fliNext++) {
126 if ( (**fliNext).position().z() < (**fli).position().z() && (**fliNext).specificSurface().innerRadius() < (**fli).specificSurface().outerRadius()) {
127 rightFL.push_back( *fliNext);
131 rightFL.push_back( *fli);
141 float length = (**(bli+1)).surface().bounds().length();
145 if ( length + epsilon < (**i).surface().bounds().length()) {
146 reachableBL.push_back( *
i);
157 vector<FDLC> groups = splitForwardLayers();
159 LogDebug(
"TkNavigation") <<
"SimpleNavigationSchool, Forward groups size = " << groups.size() ;
160 for (vector<FDLC>::iterator
g = groups.begin();
g != groups.end();
g++) {
161 LogDebug(
"TkNavigation") <<
"group " <<
g - groups.begin() <<
" has " 162 <<
g->size() <<
" layers " ;
165 for ( vector<FDLC>::iterator
group = groups.begin();
174 linkNextBarrelLayer( *
i, reachableBL);
178 linkNextLayerInGroup(
i, *
group, reachableFL);
181 if (
group+1 != groups.end()) {
182 linkOuterGroup( *
i, *(
group+1), reachableFL);
186 linkWithinGroup(
i, *
group, reachableFL);
194 symFinder.
mirror(reachableFL),
215 if ( fl->
position().
z() > barrelLength())
return;
219 for (
BDLI bli = theBarrelLayers.begin(); bli != theBarrelLayers.end(); bli++) {
220 if ( outerRadius < (**bli).specificSurface().radius() &&
221 zpos < (**bli).surface().bounds().length() / 2.) {
222 reachableBL.push_back( *bli);
234 if ( fli+1 != group.end()) {
235 reachableFL.push_back( *(fli+1));
238 float innerRThis = (**fli).specificSurface().innerRadius();
239 float innerRNext = (**(fli+1)).specificSurface().innerRadius();
242 if (innerRNext > innerRThis + epsilon) {
247 while ( (fli+i) != group.end()) {
248 if ( (**(fli+i)).specificSurface().innerRadius() <
251 reachableFL.push_back( *(fli+i));
271 if ( first != group.end()) {
276 reachableFL.insert( reachableFL.end(),
first,
last);
284 ConstFDLI biggerLayer = outerRadiusIncrease( fl, group);
285 if ( biggerLayer != group.end() && biggerLayer != fl+1) {
286 reachableFL.push_back( *biggerLayer);
294 float outerRadius = (**fl).specificSurface().outerRadius();
295 while ( ++fl != group.end()) {
296 if ( (**fl).specificSurface().outerRadius() > outerRadius +
epsilon) {
303 vector<SimpleNavigationSchool::FDLC>
308 FDLC myRightLayers( theRightLayers);
310 FDLI end = myRightLayers.end();
319 current.push_back( *begin);
323 LogDebug(
"TkNavigation") <<
"(**i).specificSurface().innerRadius() = " 324 << (**i).specificSurface().innerRadius() << endl
325 <<
"(**(i-1)).specificSurface().outerRadius()) = " 326 << (**(
i-1)).specificSurface().outerRadius() ;
327 LogDebug(
"TkNavigation") <<
"(**i).specificSurface().position().z() = " 328 << (**i).specificSurface().position().z() << endl
329 <<
"(**(i-1)).specificSurface().position().z() = " 330 << (**(
i-1)).specificSurface().position().z() ;
336 if ( (**i).specificSurface().innerRadius() > (**(
i-1)).specificSurface().outerRadius() ||
337 (theTracker->posPixelForwardLayers().back()->specificSurface().position().z() > theTracker->posTidLayers().front()->specificSurface().position().z() &&
338 (**i).specificSurface().position().z() < (**(
i-1)).specificSurface().position().z()) ){
340 LogDebug(
"TkNavigation") <<
"found break between groups" ;
343 std::stable_sort ( current.begin(), current.end(),
isDetLessZ);
345 result.push_back(current);
348 current.push_back(*
i);
350 result.push_back(current);
353 for ( vector<FDLC>::iterator ivec = result.begin();
354 ivec != result.end(); ivec++) {
355 std::stable_sort( ivec->begin(), ivec->end(),
isDetLessZ);
363 if ( theBarrelLength < 1.) {
364 for (
BDLI i=theBarrelLayers.begin();
i!=theBarrelLayers.end();
i++) {
365 theBarrelLength =
max( theBarrelLength,
366 (**i).surface().bounds().length() / 2.f);
369 LogDebug(
"TkNavigation") <<
"The barrel length is " << theBarrelLength ;
371 return theBarrelLength;
378 setState(navigableLayers());
382 typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
383 typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
386 BarrelMapType reachedBarrelLayersMap;
387 ForwardMapType reachedForwardLayersMap;
390 for (
auto bli : theBarrelLayers) {
391 auto reachedLC = nextLayers(*bli,
insideOut);
392 for (
auto i : reachedLC) {
393 reachedBarrelLayersMap[
i].push_back(bli);
397 for (
auto fli : theForwardLayers) {
398 auto reachedLC = nextLayers(*fli,
insideOut);
399 for (
auto i : reachedLC) {
400 reachedForwardLayersMap[
i].push_back(fli);
414 for(
auto nl : theAllNavigableLayer) {
418 navigableLayer->setInwardLinks( reachedBarrelLayersMap[dl],reachedForwardLayersMap[dl] );
virtual float length() const =0
std::vector< const BarrelDetLayer * > BDLC
virtual void linkNextBarrelLayer(ForwardDetLayer const *fl, BDLC &)
const Bounds & bounds() const
StateType navigableLayers() override
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
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
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
FDLC::const_iterator ConstFDLI
bool isDetLessZ(const GeometricSearchDet *a, const GeometricSearchDet *b)
virtual void linkNextLayerInGroup(FDLI fli, const FDLC &group, FDLC &reachableFL)
std::vector< NavigableLayer * > StateType
virtual void linkWithinGroup(FDLI fl, const FDLC &group, FDLC &reachableFL)
virtual void linkForwardLayers(SymmetricLayerFinder &symFinder)
virtual void establishInverseRelations()
std::vector< const ForwardDetLayer * > FDLC
virtual void linkBarrelLayers(SymmetricLayerFinder &symFinder)
virtual const BoundDisk & specificSurface() const final
virtual const Surface::PositionType & position() const
Returns position of the surface.
virtual ConstFDLI outerRadiusIncrease(FDLI fl, const FDLC &group)
virtual std::vector< FDLC > splitForwardLayers()
virtual void linkNextLargerLayer(BDLI, BDLI, BDLC &)
virtual DetLayer const * detLayer() const =0
#define DEFINE_EDM_PLUGIN(factory, type, name)
virtual void linkNextForwardLayer(BarrelDetLayer const *, FDLC &)
const BoundSurface & surface() const final
GeometricSearchDet interface.
virtual void linkOuterGroup(ForwardDetLayer const *fl, const FDLC &group, FDLC &reachableFL)
virtual float barrelLength()