45 LogTrace(
"CosmicNavigationSchool") <<
"*********Running CosmicNavigationSchool***********" ;
46 theBarrelLength = 0;theField =
field; theTracker = theInputTracker;
48 theAllDetLayersInSystem=&theInputTracker->
allLayers();
51 vector<BarrelDetLayer*> blc = theTracker->barrelLayers();
52 for ( vector<BarrelDetLayer*>::iterator
i = blc.begin();
i != blc.end();
i++) {
56 theBarrelLayers.push_back( (*
i) );
60 vector<ForwardDetLayer*> flc = theTracker->forwardLayers();
61 for ( vector<ForwardDetLayer*>::iterator
i = flc.begin();
i != flc.end();
i++) {
65 theForwardLayers.push_back( (*
i) );
68 FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
70 theLeftLayers =
FDLC( theForwardLayers.begin(), middle);
71 theRightLayers =
FDLC( middle, theForwardLayers.end());
76 linkBarrelLayers( symFinder);
77 linkForwardLayers( symFinder);
78 establishInverseRelations( symFinder );
86 const std::vector< BarrelDetLayer * > & tobL = theInputTracker->
tobLayers();
89 LogDebug(
"CosmicNavigationSchool")<<
" adding all TOB self search.";
90 for (std::vector< BarrelDetLayer * >::const_iterator lIt = tobL.begin(); lIt!=tobL.end(); ++lIt)
91 dynamic_cast<SimpleNavigableLayer*>((*lIt)->navigableLayer())->theSelfSearch =
true;
94 LogDebug(
"CosmicNavigationSchool")<<
" adding TOB1 to TOB1.";
98 const std::vector< BarrelDetLayer * > & tibL = theInputTracker->
tibLayers();
101 LogDebug(
"CosmicNavigationSchool")<<
" adding all TIB self search.";
102 for (std::vector< BarrelDetLayer * >::const_iterator lIt = tibL.begin(); lIt!=tibL.end(); ++lIt)
103 dynamic_cast<SimpleNavigableLayer*>((*lIt)->navigableLayer())->theSelfSearch =
true;
106 LogDebug(
"CosmicNavigationSchool")<<
" adding tib1 to tib1.";
110 const std::vector< BarrelDetLayer * > & pxbL = theInputTracker->
pixelBarrelLayers();
113 LogDebug(
"CosmicNavigationSchool")<<
" adding all PXB self search.";
114 for (std::vector< BarrelDetLayer * >::const_iterator lIt = pxbL.begin(); lIt!=pxbL.end(); ++lIt)
115 dynamic_cast<SimpleNavigableLayer*>((*lIt)->navigableLayer())->theSelfSearch =
true;
118 LogDebug(
"CosmicNavigationSchool")<<
" adding pxb1 to pxb1.";
132 for (
BDLI i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
138 if (
i+1 != theBarrelLayers.end()) reachableBL.push_back(*(
i+1));
141 if (
i != theBarrelLayers.end() - 1) {
142 linkNextForwardLayer( *
i, rightFL);
146 if (
i+2 < theBarrelLayers.end()) {
147 linkNextLargerLayer(
i, theBarrelLayers.end(), reachableBL);
150 theBarrelNLC.push_back(
new
151 SimpleBarrelNavigableLayer( *
i, reachableBL,
152 symFinder.
mirror(rightFL),
153 rightFL,theField, 5.,
false));
167 typedef map<const DetLayer*, vector<BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
168 typedef map<const DetLayer*, vector<ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
171 BarrelMapType reachedBarrelLayersMap;
172 ForwardMapType reachedForwardLayersMap;
175 for (
BDLI bli = theBarrelLayers.begin();
176 bli!=theBarrelLayers.end(); bli++) {
178 for (
DLI i = reachedLC.begin();
i != reachedLC.end();
i++) {
179 reachedBarrelLayersMap[*
i].push_back( *bli);
183 for (
FDLI fli = theForwardLayers.begin();
184 fli!=theForwardLayers.end(); fli++) {
186 for (
DLI i = reachedLC.begin();
i != reachedLC.end();
i++) {
187 reachedForwardLayersMap[*
i].push_back( *fli);
192 vector<DetLayer*> lc = theTracker->allLayers();
193 for ( vector<DetLayer*>::iterator
i = lc.begin();
i != lc.end();
i++) {
196 navigableLayer->
setInwardLinks( reachedBarrelLayersMap[*
i],reachedForwardLayersMap[*i] );
199 buildAdditionalForwardLinks(symFinder);
205 for ( vector<BarrelDetLayer*>::iterator
i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
220 for ( vector<ForwardDetLayer*>::iterator
i = theRightLayers.begin();
i != theRightLayers.end();
i++){
222 SimpleForwardNavigableLayer* nfl =
dynamic_cast<SimpleForwardNavigableLayer*
>((*i)->navigableLayer());
223 SimpleForwardNavigableLayer* mnfl =
dynamic_cast<SimpleForwardNavigableLayer*
>(symFinder.
mirror(*i)->
navigableLayer());
224 for (vector<BarrelDetLayer*>::iterator
j = theBarrelLayers.begin();
j != theBarrelLayers.end();
j++){
225 if ((*i)->specificSurface().outerRadius() < (*j)->specificSurface().radius() &&
226 fabs((*i)->specificSurface().position().z()) < (*j)->surface().bounds().length()/2.){
T getParameter(std::string const &) const
NavigableLayer * navigableLayer() const
Return the NavigableLayer associated with this DetLayer.
void linkBarrelLayers(SymmetricLayerFinder &symFinder)
void buildAdditionalBarrelLinks()
virtual void setInwardLinks(const BDLC &, const FDLC &, TkLayerLess sorter=TkLayerLess(outsideIn))=0
std::vector< ForwardDetLayer * > FDLC
std::vector< const DetLayer * > DLC
virtual void establishInverseRelations()
std::vector< DetLayer * > const & allLayers() const
virtual void setAdditionalLink(DetLayer *, NavigationDirection direction=insideOut)=0
void build(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
void setCheckCrossingSide(bool docheck)
std::vector< BarrelDetLayer * > const & tibLayers() const
CosmicNavigationSchoolConfiguration()
std::vector< BarrelDetLayer * > BDLC
void buildAdditionalForwardLinks(SymmetricLayerFinder &symFinder)
std::vector< BarrelDetLayer * > const & tobLayers() const
std::vector< BarrelDetLayer * > const & pixelBarrelLayers() const
ForwardDetLayer * mirror(const ForwardDetLayer *layer)