32 theAllDetLayersInSystem=&theTracker->allLayers();
33 theAllNavigableLayer.resize(theTracker->allLayers().size(),
nullptr);
37 for(
auto i : theTracker->barrelLayers()) {
38 theBarrelLayers.push_back(
i );
42 for(
auto i : theTracker->forwardLayers()) {
43 theForwardLayers.push_back(
i );
46 FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
48 theLeftLayers =
FDLC( theForwardLayers.begin(), middle);
49 theRightLayers =
FDLC( middle, theForwardLayers.end());
54 linkBarrelLayers( symFinder);
55 linkForwardLayers( symFinder);
56 establishInverseRelations();
61 for ( vector< SimpleBarrelNavigableLayer*>::const_iterator
62 ib = theBarrelNLC.begin();
ib != theBarrelNLC.end();
ib++) {
66 for ( vector< SimpleForwardNavigableLayer*>::const_iterator
67 ifl = theForwardNLC.begin(); ifl != theForwardNLC.end(); ifl++) {
70 theForwardNLC.clear();
77 for ( vector< SimpleBarrelNavigableLayer*>::const_iterator
78 ib = theBarrelNLC.begin();
ib != theBarrelNLC.end();
ib++) {
79 result.push_back( *
ib);
81 for ( vector< SimpleForwardNavigableLayer*>::const_iterator
82 ifl = theForwardNLC.begin(); ifl != theForwardNLC.end(); ifl++) {
83 result.push_back( *ifl);
92 for (
BDLI i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
98 if (
i+1 != theBarrelLayers.end()) reachableBL.push_back(*(
i+1));
101 if (
i != theBarrelLayers.end() - 1) {
102 linkNextForwardLayer( *
i, rightFL);
106 if (
i+2 < theBarrelLayers.end()) {
107 linkNextLargerLayer(
i, theBarrelLayers.end(), reachableBL);
110 theBarrelNLC.push_back(
new 112 symFinder.
mirror(rightFL),
113 rightFL,theField, 5.));
123 for (
FDLI fli = theRightLayers.begin();
124 fli != theRightLayers.end(); fli++) {
125 if ( length < (**fli).position().z() &&
126 radius < (**fli).specificSurface().outerRadius()) {
128 for (
FDLI fliNext = fli; fliNext != theRightLayers.end(); fliNext++) {
129 if ( (**fliNext).position().z() < (**fli).position().z() && (**fliNext).specificSurface().innerRadius() < (**fli).specificSurface().outerRadius()) {
130 rightFL.push_back( *fliNext);
134 rightFL.push_back( *fli);
144 float length = (**(bli+1)).surface().bounds().length();
148 if ( length + epsilon < (**i).surface().bounds().length()) {
149 reachableBL.push_back( *
i);
160 vector<FDLC> groups = splitForwardLayers();
162 LogDebug(
"TkNavigation") <<
"SimpleNavigationSchool, Forward groups size = " << groups.size() ;
163 for (vector<FDLC>::iterator
g = groups.begin();
g != groups.end();
g++) {
164 LogDebug(
"TkNavigation") <<
"group " <<
g - groups.begin() <<
" has " 165 <<
g->size() <<
" layers " ;
168 for ( vector<FDLC>::iterator
group = groups.begin();
177 linkNextBarrelLayer( *
i, reachableBL);
181 linkNextLayerInGroup(
i, *
group, reachableFL);
184 if (
group+1 != groups.end()) {
185 linkOuterGroup( *
i, *(
group+1), reachableFL);
189 linkWithinGroup(
i, *
group, reachableFL);
197 symFinder.
mirror(reachableFL),
218 if ( fl->
position().
z() > barrelLength())
return;
222 for (
BDLI bli = theBarrelLayers.begin(); bli != theBarrelLayers.end(); bli++) {
223 if ( outerRadius < (**bli).specificSurface().radius() &&
224 zpos < (**bli).surface().bounds().length() / 2.) {
225 reachableBL.push_back( *bli);
237 if ( fli+1 != group.end()) {
238 reachableFL.push_back( *(fli+1));
241 float innerRThis = (**fli).specificSurface().innerRadius();
242 float innerRNext = (**(fli+1)).specificSurface().innerRadius();
245 if (innerRNext > innerRThis + epsilon) {
250 while ( (fli+i) != group.end()) {
251 if ( (**(fli+i)).specificSurface().innerRadius() <
254 reachableFL.push_back( *(fli+i));
274 if ( first != group.end()) {
279 reachableFL.insert( reachableFL.end(),
first,
last);
287 ConstFDLI biggerLayer = outerRadiusIncrease( fl, group);
288 if ( biggerLayer != group.end() && biggerLayer != fl+1) {
289 reachableFL.push_back( *biggerLayer);
297 float outerRadius = (**fl).specificSurface().outerRadius();
298 while ( ++fl != group.end()) {
299 if ( (**fl).specificSurface().outerRadius() > outerRadius +
epsilon) {
306 vector<SimpleNavigationSchool::FDLC>
311 FDLC myRightLayers( theRightLayers);
313 FDLI end = myRightLayers.end();
321 current.push_back( *begin);
325 LogDebug(
"TkNavigation") <<
"(**i).specificSurface().innerRadius() = " 326 << (**i).specificSurface().innerRadius() << endl
327 <<
"(**(i-1)).specificSurface().outerRadius()) = " 328 << (**(
i-1)).specificSurface().outerRadius() ;
329 LogDebug(
"TkNavigation") <<
"(**i).specificSurface().position().z() = " 330 << (**i).specificSurface().position().z() << endl
331 <<
"(**(i-1)).specificSurface().position().z() = " 332 << (**(
i-1)).specificSurface().position().z() ;
338 if ( (**i).specificSurface().innerRadius() > (**(
i-1)).specificSurface().outerRadius() ||
339 (theTracker->posPixelForwardLayers().back()->specificSurface().position().z() > theTracker->posTidLayers().front()->specificSurface().position().z() &&
340 (**i).specificSurface().position().z() < (**(
i-1)).specificSurface().position().z()) ){
342 LogDebug(
"TkNavigation") <<
"found break between groups" ;
345 stable_sort ( current.begin(), current.end(),
DetLessZ());
347 result.push_back(current);
350 current.push_back(*
i);
352 result.push_back(current);
355 for ( vector<FDLC>::iterator ivec = result.begin();
356 ivec != result.end(); ivec++) {
357 stable_sort( ivec->begin(), ivec->end(),
DetLessZ());
365 if ( theBarrelLength < 1.) {
366 for (
BDLI i=theBarrelLayers.begin();
i!=theBarrelLayers.end();
i++) {
367 theBarrelLength =
max( theBarrelLength,
368 (**i).surface().bounds().length() / 2.f);
371 LogDebug(
"TkNavigation") <<
"The barrel length is " << theBarrelLength ;
373 return theBarrelLength;
380 setState(navigableLayers());
384 typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
385 typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
388 BarrelMapType reachedBarrelLayersMap;
389 ForwardMapType reachedForwardLayersMap;
392 for (
auto bli : theBarrelLayers) {
393 auto reachedLC = nextLayers(*bli,
insideOut);
394 for (
auto i : reachedLC) {
395 reachedBarrelLayersMap[
i].push_back(bli);
399 for (
auto fli : theForwardLayers) {
400 auto reachedLC = nextLayers(*fli,
insideOut);
401 for (
auto i : reachedLC) {
402 reachedForwardLayersMap[
i].push_back(fli);
416 for(
auto nl : theAllNavigableLayer) {
420 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
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()