28 theAllDetLayersInSystem=&theTracker->allLayers();
29 theAllNavigableLayer.resize(theTracker->allLayers().size(),
nullptr);
33 for(
auto i : theTracker->barrelLayers()) {
34 theBarrelLayers.push_back(
i );
38 for(
auto i : theTracker->forwardLayers()) {
39 theForwardLayers.push_back(
i );
42 FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
44 theLeftLayers =
FDLC( theForwardLayers.begin(), middle);
45 theRightLayers =
FDLC( middle, theForwardLayers.end());
50 linkBarrelLayers( symFinder);
51 linkForwardLayers( symFinder);
52 establishInverseRelations();
57 for ( vector< SimpleBarrelNavigableLayer*>::const_iterator
58 ib = theBarrelNLC.begin();
ib != theBarrelNLC.end();
ib++) {
62 for ( vector< SimpleForwardNavigableLayer*>::const_iterator
63 ifl = theForwardNLC.begin(); ifl != theForwardNLC.end(); ifl++) {
66 theForwardNLC.clear();
73 for ( vector< SimpleBarrelNavigableLayer*>::const_iterator
74 ib = theBarrelNLC.begin();
ib != theBarrelNLC.end();
ib++) {
75 result.push_back( *
ib);
77 for ( vector< SimpleForwardNavigableLayer*>::const_iterator
78 ifl = theForwardNLC.begin(); ifl != theForwardNLC.end(); ifl++) {
79 result.push_back( *ifl);
88 for (
BDLI i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
94 if (
i+1 != theBarrelLayers.end()) reachableBL.push_back(*(
i+1));
97 if (
i != theBarrelLayers.end() - 1) {
98 linkNextForwardLayer( *
i, rightFL);
102 if (
i+2 < theBarrelLayers.end()) {
103 linkNextLargerLayer(
i, theBarrelLayers.end(), reachableBL);
106 theBarrelNLC.push_back(
new 108 symFinder.
mirror(rightFL),
109 rightFL,theField, 5.));
119 for (
FDLI fli = theRightLayers.begin();
120 fli != theRightLayers.end(); fli++) {
121 if ( length < (**fli).position().z() &&
122 radius < (**fli).specificSurface().outerRadius()) {
124 for (
FDLI fliNext = fli; fliNext != theRightLayers.end(); fliNext++) {
125 if ( (**fliNext).position().z() < (**fli).position().z() && (**fliNext).specificSurface().innerRadius() < (**fli).specificSurface().outerRadius()) {
126 rightFL.push_back( *fliNext);
130 rightFL.push_back( *fli);
140 float length = (**(bli+1)).surface().bounds().length();
144 if ( length + epsilon < (**i).surface().bounds().length()) {
145 reachableBL.push_back( *
i);
156 vector<FDLC> groups = splitForwardLayers();
158 LogDebug(
"TkNavigation") <<
"SimpleNavigationSchool, Forward groups size = " << groups.size() ;
159 for (vector<FDLC>::iterator
g = groups.begin();
g != groups.end();
g++) {
160 LogDebug(
"TkNavigation") <<
"group " <<
g - groups.begin() <<
" has " 161 <<
g->size() <<
" layers " ;
164 for ( vector<FDLC>::iterator
group = groups.begin();
173 linkNextBarrelLayer( *
i, reachableBL);
177 linkNextLayerInGroup(
i, *
group, reachableFL);
180 if (
group+1 != groups.end()) {
181 linkOuterGroup( *
i, *(
group+1), reachableFL);
185 linkWithinGroup(
i, *
group, reachableFL);
193 symFinder.
mirror(reachableFL),
214 if ( fl->
position().
z() > barrelLength())
return;
218 for (
BDLI bli = theBarrelLayers.begin(); bli != theBarrelLayers.end(); bli++) {
219 if ( outerRadius < (**bli).specificSurface().radius() &&
220 zpos < (**bli).surface().bounds().length() / 2.) {
221 reachableBL.push_back( *bli);
233 if ( fli+1 != group.end()) {
234 reachableFL.push_back( *(fli+1));
237 float innerRThis = (**fli).specificSurface().innerRadius();
238 float innerRNext = (**(fli+1)).specificSurface().innerRadius();
241 if (innerRNext > innerRThis + epsilon) {
246 while ( (fli+i) != group.end()) {
247 if ( (**(fli+i)).specificSurface().innerRadius() <
250 reachableFL.push_back( *(fli+i));
270 if ( first != group.end()) {
275 reachableFL.insert( reachableFL.end(),
first,
last);
283 ConstFDLI biggerLayer = outerRadiusIncrease( fl, group);
284 if ( biggerLayer != group.end() && biggerLayer != fl+1) {
285 reachableFL.push_back( *biggerLayer);
293 float outerRadius = (**fl).specificSurface().outerRadius();
294 while ( ++fl != group.end()) {
295 if ( (**fl).specificSurface().outerRadius() > outerRadius +
epsilon) {
302 vector<SimpleNavigationSchool::FDLC>
307 FDLC myRightLayers( theRightLayers);
309 FDLI end = myRightLayers.end();
318 current.push_back( *begin);
322 LogDebug(
"TkNavigation") <<
"(**i).specificSurface().innerRadius() = " 323 << (**i).specificSurface().innerRadius() << endl
324 <<
"(**(i-1)).specificSurface().outerRadius()) = " 325 << (**(
i-1)).specificSurface().outerRadius() ;
326 LogDebug(
"TkNavigation") <<
"(**i).specificSurface().position().z() = " 327 << (**i).specificSurface().position().z() << endl
328 <<
"(**(i-1)).specificSurface().position().z() = " 329 << (**(
i-1)).specificSurface().position().z() ;
335 if ( (**i).specificSurface().innerRadius() > (**(
i-1)).specificSurface().outerRadius() ||
336 (theTracker->posPixelForwardLayers().back()->specificSurface().position().z() > theTracker->posTidLayers().front()->specificSurface().position().z() &&
337 (**i).specificSurface().position().z() < (**(
i-1)).specificSurface().position().z()) ){
339 LogDebug(
"TkNavigation") <<
"found break between groups" ;
342 std::stable_sort ( current.begin(), current.end(),
isDetLessZ);
344 result.push_back(current);
347 current.push_back(*
i);
349 result.push_back(current);
352 for ( vector<FDLC>::iterator ivec = result.begin();
353 ivec != result.end(); ivec++) {
354 std::stable_sort( ivec->begin(), ivec->end(),
isDetLessZ);
362 if ( theBarrelLength < 1.) {
363 for (
BDLI i=theBarrelLayers.begin();
i!=theBarrelLayers.end();
i++) {
364 theBarrelLength =
max( theBarrelLength,
365 (**i).surface().bounds().length() / 2.f);
368 LogDebug(
"TkNavigation") <<
"The barrel length is " << theBarrelLength ;
370 return theBarrelLength;
377 setState(navigableLayers());
381 typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
382 typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
385 BarrelMapType reachedBarrelLayersMap;
386 ForwardMapType reachedForwardLayersMap;
389 for (
auto bli : theBarrelLayers) {
390 auto reachedLC = nextLayers(*bli,
insideOut);
391 for (
auto i : reachedLC) {
392 reachedBarrelLayersMap[
i].push_back(bli);
396 for (
auto fli : theForwardLayers) {
397 auto reachedLC = nextLayers(*fli,
insideOut);
398 for (
auto i : reachedLC) {
399 reachedForwardLayersMap[
i].push_back(fli);
413 for(
auto nl : theAllNavigableLayer) {
417 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()