20 edm::LogInfo(
"BeamHaloNavigationSchool")<<
"*********Running BeamHaloNavigationSchool *********";
21 theBarrelLength = 0;theField = field; theTracker = theInputTracker;
22 theAllDetLayersInSystem=&theInputTracker->
allLayers();
23 theAllNavigableLayer.resize(theInputTracker->
allLayers().size(),
nullptr);
36 for(
auto const&
l : theTracker->forwardLayers()) {
37 theForwardLayers.push_back(
l);
40 FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
42 theLeftLayers =
FDLC( theForwardLayers.begin(), middle);
43 theRightLayers =
FDLC( middle, theForwardLayers.end());
51 linkForwardLayers( symFinder);
53 setState(navigableLayers());
55 LogDebug(
"BeamHaloNavigationSchool")<<
"inverse relation";
56 establishInverseRelations();
60 LogDebug(
"BeamHaloNavigationSchool")<<
"linkOtherEndLayer";
62 linkOtherEndLayers( symFinder);
66 SimpleNavigationSchool::StateType::iterator layerIt=allLayers.begin();
67 SimpleNavigationSchool::StateType::iterator layerIt_end=allLayers.end();
68 for (;layerIt!=layerIt_end;++layerIt)
73 edm::LogError(
"BeamHaloNavigationSchool")<<
"navigable layer not casting to simplenavigablelayer.";
84 typedef map<const DetLayer*, vector<BarrelDetLayer const*>, less<const DetLayer*> > BarrelMapType;
85 typedef map<const DetLayer*, vector<ForwardDetLayer const*>, less<const DetLayer*> > ForwardMapType;
88 BarrelMapType reachedBarrelLayersMap;
89 ForwardMapType reachedForwardLayersMap;
91 for (
BDLI bli = theBarrelLayers.begin();
92 bli!=theBarrelLayers.end(); bli++) {
94 for (
DLI i = reachedLC.begin();
i != reachedLC.end();
i++) {
95 reachedBarrelLayersMap[*
i].push_back( *bli);
99 for (
FDLI fli = theForwardLayers.begin();
100 fli!=theForwardLayers.end(); fli++) {
102 for (
DLI i = reachedLC.begin();
i != reachedLC.end();
i++) {
103 reachedForwardLayersMap[*
i].push_back( *fli);
108 for (
auto const i : theTracker->allLayers()) {
111 if (!navigableLayer) {
edm::LogInfo(
"BeamHaloNavigationSchool")<<
"a detlayer does not have a navigable layer, which is normal in beam halo navigation.";}
121 LogDebug(
"BeamHaloNavigationSchool")<<
"reachable from horizontal";
123 FDLC reachableFL= reachableFromHorizontal();
127 for (
FDLI fl=reachableFL.begin();fl!=reachableFL.end();fl++)
129 LogDebug(
"BeamHaloNavigationSchool")<<
"adding inward from right";
131 addInward(static_cast<DetLayer const*>(*fl),symFinder.
mirror(*fl));
133 LogDebug(
"BeamHaloNavigationSchool")<<
"adding inward from mirror of right (left?)";
134 addInward(static_cast<DetLayer const*>(symFinder.
mirror(*fl)),*fl);
148 LogDebug(
"BeamHaloNavigationSchool")<<
"retreive the nextlayer outsidein";
152 LogDebug(
"BeamHaloNavigationSchool")<<
"split them barrel/forward";
156 for ( DLC::iterator dli=inwardsLayers.begin();dli!=inwardsLayers.end();dli++)
163 LogDebug(
"BeamHaloNavigationSchool")<<
"add the new ones";
165 inwardsForward.push_back(newF);
167 LogDebug(
"BeamHaloNavigationSchool")<<
"no duplicate please";
168 sort(inwardsForward.begin(),inwardsForward.end());
174 FDLI new_end =unique(inwardsForward.begin(),inwardsForward.end());
176 inwardsForward.erase(new_end,inwardsForward.end());
178 LogDebug(
"BeamHaloNavigationSchool")<<
"set back the inward links (no duplicate)";
189 LogDebug(
"BeamHaloNavigationSchool")<<
"retreive the nextlayer outsidein";
193 LogDebug(
"BeamHaloNavigationSchool")<<
"split them barrel/forward";
197 for ( DLC::iterator dli=inwardsLayers.begin();dli!=inwardsLayers.end();dli++)
205 LogDebug(
"BeamHaloNavigationSchool")<<
"add the new ones";
207 inwardsForward.insert( inwardsForward.end(), news.begin(), news.end());
209 LogDebug(
"BeamHaloNavigationSchool")<<
"no duplicate please";
210 FDLI new_end =unique(inwardsForward.begin(),inwardsForward.end());
211 inwardsForward.erase(new_end,inwardsForward.end());
213 LogDebug(
"BeamHaloNavigationSchool")<<
"set back the inward links (no duplicate)";
224 FDLC myRightLayers( theRightLayers);
226 FDLI end = myRightLayers.end();
233 begin = myRightLayers.begin();
234 end = myRightLayers.end();
237 reachableFL.push_back(*begin);
243 if ((**i).specificSurface().innerRadius() < (**current).specificSurface().innerRadius() ||
244 (**i).specificSurface().outerRadius() > (**current).specificSurface().outerRadius())
246 reachableFL.push_back(*
i);
std::vector< DetLayer const * > const & allLayers() const
std::vector< const BarrelDetLayer * > BDLC
BeamHaloNavigationSchool(const GeometricSearchTracker *theTracker, const MagneticField *field)
FDLC reachableFromHorizontal()
virtual void setInwardLinks(const BDLC &, const FDLC &, TkLayerLess sorter=TkLayerLess(outsideIn))=0
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
std::vector< const DetLayer * > DLC
std::vector< NavigableLayer * > StateType
void establishInverseRelations()
std::vector< const ForwardDetLayer * > FDLC
void setCheckCrossingSide(bool docheck)
virtual std::vector< const DetLayer * > nextLayers(NavigationDirection direction) const =0
void linkOtherEndLayers(SymmetricLayerFinder &symFinder)
void addInward(const DetLayer *det, const FDLC &news)