49 void buildAdditionalBarrelLinks();
93 LogTrace(
"CosmicNavigationSchool") <<
"*********Running CosmicNavigationSchool***********" ;
94 theBarrelLength = 0;theField = field; theTracker = theInputTracker;
96 theAllDetLayersInSystem=&theInputTracker->
allLayers();
97 theAllNavigableLayer.resize(theInputTracker->
allLayers().size(),
nullptr);
103 vector<BarrelDetLayer const*>
const& blc = theTracker->barrelLayers();
104 for (
auto i = blc.begin();
i != blc.end();
i++) {
108 theBarrelLayers.push_back( (*
i) );
112 vector<ForwardDetLayer const*>
const& flc = theTracker->forwardLayers();
113 for (
auto i = flc.begin();
i != flc.end();
i++) {
117 theForwardLayers.push_back( (*
i) );
120 FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
121 [](
auto const*
a){
return a->position().z() >= 0.0; });
122 theLeftLayers =
FDLC( theForwardLayers.begin(), middle);
123 theRightLayers =
FDLC( middle, theForwardLayers.end());
128 linkBarrelLayers( symFinder);
129 linkForwardLayers( symFinder);
130 establishInverseRelations( symFinder );
138 const std::vector< const BarrelDetLayer * > & tobL = theInputTracker->
tobLayers();
141 LogDebug(
"CosmicNavigationSchool")<<
" adding all TOB self search.";
142 for (
auto lIt = tobL.begin(); lIt!=tobL.end(); ++lIt)
143 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
147 LogDebug(
"CosmicNavigationSchool")<<
" adding TOB1 to TOB1.";
151 const std::vector< const BarrelDetLayer * > & tibL = theInputTracker->
tibLayers();
154 LogDebug(
"CosmicNavigationSchool")<<
" adding all TIB self search.";
155 for (
auto lIt = tibL.begin(); lIt!=tibL.end(); ++lIt)
156 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
160 LogDebug(
"CosmicNavigationSchool")<<
" adding tib1 to tib1.";
164 const std::vector< const BarrelDetLayer * > & pxbL = theInputTracker->
pixelBarrelLayers();
167 LogDebug(
"CosmicNavigationSchool")<<
" adding all PXB self search.";
168 for (
auto lIt = pxbL.begin(); lIt!=pxbL.end(); ++lIt)
169 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
173 LogDebug(
"CosmicNavigationSchool")<<
" adding pxb1 to pxb1.";
187 for (
BDLI i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
193 if (
i+1 != theBarrelLayers.end()) reachableBL.push_back(*(
i+1));
196 if (
i != theBarrelLayers.end() - 1) {
197 linkNextForwardLayer( *
i, rightFL);
201 if (
i+2 < theBarrelLayers.end()) {
202 linkNextLargerLayer(
i, theBarrelLayers.end(), reachableBL);
205 theBarrelNLC.push_back(
new 207 symFinder.
mirror(rightFL),
208 rightFL,theField, 5.,
false));
220 setState(navigableLayers());
225 typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
226 typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
229 BarrelMapType reachedBarrelLayersMap;
230 ForwardMapType reachedForwardLayersMap;
232 for (
auto bli : theBarrelLayers) {
233 auto reachedLC = nextLayers(*bli,
insideOut);
234 for (
auto i : reachedLC) {
235 reachedBarrelLayersMap[
i].push_back(bli);
239 for (
auto fli : theForwardLayers) {
240 auto reachedLC = nextLayers(*fli,
insideOut);
241 for (
auto i : reachedLC) {
242 reachedForwardLayersMap[
i].push_back(fli);
246 for(
auto nl : theAllNavigableLayer) {
250 navigableLayer->setInwardLinks( reachedBarrelLayersMap[dl],reachedForwardLayersMap[dl] );
254 buildAdditionalForwardLinks(symFinder);
260 for (
auto i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
277 for (
auto i : theRightLayers){
283 for (
auto j : theBarrelLayers) {
284 if ((
i)->specificSurface().outerRadius() < (j)->specificSurface().radius() &&
285 fabs((
i)->specificSurface().
position().
z()) < (j)->surface().bounds().length()/2.){
329 build(theInputTracker, field, conf);
354 theNavigationPSet = iConfig;
358 setWhatProduced(
this, theNavigationSchoolName);
375 std::unique_ptr<NavigationSchool> theNavigationSchool ;
388 return theNavigationSchool;
T getParameter(std::string const &) const
std::string theNavigationSchoolName
void linkBarrelLayers(SymmetricLayerFinder &symFinder) override
~SkippingLayerCosmicNavigationSchool() override
std::unique_ptr< NavigationSchool > ReturnType
std::vector< DetLayer const * > const & allLayers() const
void buildAdditionalBarrelLinks()
std::vector< const BarrelDetLayer * > BDLC
SkippingLayerCosmicNavigationSchool(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
std::vector< BarrelDetLayer const * > const & tobLayers() const
~CosmicNavigationSchool() override
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
SkippingLayerCosmicNavigationSchoolESProducer(const edm::ParameterSet &iConfig)
const DepRecordT getRecord() const
~SkippingLayerCosmicNavigationSchoolESProducer() override
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
virtual void establishInverseRelations()
std::vector< const ForwardDetLayer * > FDLC
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
std::vector< BarrelDetLayer const * > const & tibLayers() const
void build(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
virtual void setAdditionalLink(const DetLayer *, NavigationDirection direction=insideOut)=0
void setCheckCrossingSide(bool docheck)
virtual DetLayer const * detLayer() const =0
static int position[264][3]
CosmicNavigationSchoolConfiguration()
edm::ParameterSet theNavigationPSet
#define DEFINE_EDM_PLUGIN(factory, type, name)
ReturnType produce(const NavigationSchoolRecord &)
void setAdditionalLink(const DetLayer *, NavigationDirection direction=insideOut) override
T const * product() const
void buildAdditionalForwardLinks(SymmetricLayerFinder &symFinder)
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)