22 edm::LogInfo(
"BeamHaloNavigationSchool")<<
"*********Running BeamHaloNavigationSchool *********";
23 theBarrelLength = 0;theField = field; theTracker = theInputTracker;
24 theAllDetLayersInSystem=&theInputTracker->
allLayers();
33 vector<ForwardDetLayer*> flc = theTracker->forwardLayers();
34 for ( vector<ForwardDetLayer*>::iterator
i = flc.begin();
i != flc.end();
i++) {
35 theForwardLayers.push_back( (*
i) );
38 FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
40 theLeftLayers =
FDLC( theForwardLayers.begin(), middle);
41 theRightLayers =
FDLC( middle, theForwardLayers.end());
49 linkForwardLayers( symFinder);
50 LogDebug(
"BeamHaloNavigationSchool")<<
"inverse relation";
51 establishInverseRelations();
55 LogDebug(
"BeamHaloNavigationSchool")<<
"linkOtherEndLayer";
56 linkOtherEndLayers( symFinder);
60 SimpleNavigationSchool::StateType::iterator layerIt=allLayers.begin();
61 SimpleNavigationSchool::StateType::iterator layerIt_end=allLayers.end();
62 for (;layerIt!=layerIt_end;++layerIt)
67 edm::LogError(
"BeamHaloNavigationSchool")<<
"navigable layer not casting to simplenavigablelayer.";
79 typedef map<const DetLayer*, vector<BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
80 typedef map<const DetLayer*, vector<ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
83 BarrelMapType reachedBarrelLayersMap;
84 ForwardMapType reachedForwardLayersMap;
86 for (
BDLI bli = theBarrelLayers.begin();
87 bli!=theBarrelLayers.end(); bli++) {
89 for (
DLI i = reachedLC.begin();
i != reachedLC.end();
i++) {
90 reachedBarrelLayersMap[*
i].push_back( *bli);
94 for (
FDLI fli = theForwardLayers.begin();
95 fli!=theForwardLayers.end(); fli++) {
97 for (
DLI i = reachedLC.begin();
i != reachedLC.end();
i++) {
98 reachedForwardLayersMap[*
i].push_back( *fli);
103 vector<DetLayer*> lc = theTracker->allLayers();
104 for ( vector<DetLayer*>::iterator
i = lc.begin();
i != lc.end();
i++) {
107 if (!navigableLayer) {
edm::LogInfo(
"BeamHaloNavigationSchool")<<
"a detlayer does not have a navigable layer, which is normal in beam halo navigation.";}
118 LogDebug(
"BeamHaloNavigationSchool")<<
"reachable from horizontal";
120 FDLC reachableFL= reachableFromHorizontal();
124 for (
FDLI fl=reachableFL.begin();fl!=reachableFL.end();fl++)
126 LogDebug(
"BeamHaloNavigationSchool")<<
"adding inward from right";
130 LogDebug(
"BeamHaloNavigationSchool")<<
"adding inward from mirror of right (left?)";
251 LogDebug(
"BeamHaloNavigationSchool")<<
"retreive the nextlayer outsidein";
255 LogDebug(
"BeamHaloNavigationSchool")<<
"split them barrel/forward";
259 for ( DLC::iterator dli=inwardsLayers.begin();dli!=inwardsLayers.end();dli++)
266 LogDebug(
"BeamHaloNavigationSchool")<<
"add the new ones";
268 inwardsForward.push_back(newF);
270 LogDebug(
"BeamHaloNavigationSchool")<<
"no duplicate please";
271 sort(inwardsForward.begin(),inwardsForward.end());
277 FDLI new_end =unique(inwardsForward.begin(),inwardsForward.end());
279 inwardsForward.erase(new_end,inwardsForward.end());
281 LogDebug(
"BeamHaloNavigationSchool")<<
"set back the inward links (no duplicate)";
292 LogDebug(
"BeamHaloNavigationSchool")<<
"retreive the nextlayer outsidein";
296 LogDebug(
"BeamHaloNavigationSchool")<<
"split them barrel/forward";
300 for ( DLC::iterator dli=inwardsLayers.begin();dli!=inwardsLayers.end();dli++)
308 LogDebug(
"BeamHaloNavigationSchool")<<
"add the new ones";
310 inwardsForward.insert( inwardsForward.end(), news.begin(), news.end());
312 LogDebug(
"BeamHaloNavigationSchool")<<
"no duplicate please";
313 FDLI new_end =unique(inwardsForward.begin(),inwardsForward.end());
314 inwardsForward.erase(new_end,inwardsForward.end());
316 LogDebug(
"BeamHaloNavigationSchool")<<
"set back the inward links (no duplicate)";
327 FDLC myRightLayers( theRightLayers);
329 FDLI end = myRightLayers.end();
336 begin = myRightLayers.begin();
337 end = myRightLayers.end();
340 reachableFL.push_back(*begin);
346 if ((**i).specificSurface().innerRadius() < (**current).specificSurface().innerRadius() ||
347 (**i).specificSurface().outerRadius() > (**current).specificSurface().outerRadius())
349 reachableFL.push_back(*
i);
void addInward(DetLayer *det, FDLC news)
BeamHaloNavigationSchool(const GeometricSearchTracker *theTracker, const MagneticField *field)
FDLC reachableFromHorizontal()
virtual void setInwardLinks(const BDLC &, const FDLC &, TkLayerLess sorter=TkLayerLess(outsideIn))=0
std::vector< ForwardDetLayer * > FDLC
std::vector< const DetLayer * > DLC
std::vector< NavigableLayer * > StateType
void establishInverseRelations()
std::vector< DetLayer * > const & allLayers() const
void setCheckCrossingSide(bool docheck)
virtual std::vector< const DetLayer * > nextLayers(NavigationDirection direction) const =0
void linkOtherEndLayers(SymmetricLayerFinder &symFinder)
std::vector< BarrelDetLayer * > BDLC
ForwardDetLayer * mirror(const ForwardDetLayer *layer)