49 void buildAdditionalBarrelLinks();
94 LogTrace(
"CosmicNavigationSchool") <<
"*********Running CosmicNavigationSchool***********" ;
95 theBarrelLength = 0;theField = field; theTracker = theInputTracker;
97 theAllDetLayersInSystem=&theInputTracker->
allLayers();
98 theAllNavigableLayer.resize(theInputTracker->
allLayers().size(),
nullptr);
104 vector<BarrelDetLayer const*>
const& blc = theTracker->barrelLayers();
105 for (
auto i = blc.begin();
i != blc.end();
i++) {
109 theBarrelLayers.push_back( (*
i) );
113 vector<ForwardDetLayer const*>
const& flc = theTracker->forwardLayers();
114 for (
auto i = flc.begin();
i != flc.end();
i++) {
118 theForwardLayers.push_back( (*
i) );
121 FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
123 theLeftLayers =
FDLC( theForwardLayers.begin(), middle);
124 theRightLayers =
FDLC( middle, theForwardLayers.end());
129 linkBarrelLayers( symFinder);
130 linkForwardLayers( symFinder);
131 establishInverseRelations( symFinder );
139 const std::vector< const BarrelDetLayer * > & tobL = theInputTracker->
tobLayers();
142 LogDebug(
"CosmicNavigationSchool")<<
" adding all TOB self search.";
143 for (
auto lIt = tobL.begin(); lIt!=tobL.end(); ++lIt)
144 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
148 LogDebug(
"CosmicNavigationSchool")<<
" adding TOB1 to TOB1.";
152 const std::vector< const BarrelDetLayer * > & tibL = theInputTracker->
tibLayers();
155 LogDebug(
"CosmicNavigationSchool")<<
" adding all TIB self search.";
156 for (
auto lIt = tibL.begin(); lIt!=tibL.end(); ++lIt)
157 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
161 LogDebug(
"CosmicNavigationSchool")<<
" adding tib1 to tib1.";
165 const std::vector< const BarrelDetLayer * > & pxbL = theInputTracker->
pixelBarrelLayers();
168 LogDebug(
"CosmicNavigationSchool")<<
" adding all PXB self search.";
169 for (
auto lIt = pxbL.begin(); lIt!=pxbL.end(); ++lIt)
170 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
174 LogDebug(
"CosmicNavigationSchool")<<
" adding pxb1 to pxb1.";
188 for (
BDLI i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
194 if (
i+1 != theBarrelLayers.end()) reachableBL.push_back(*(
i+1));
197 if (
i != theBarrelLayers.end() - 1) {
198 linkNextForwardLayer( *
i, rightFL);
202 if (
i+2 < theBarrelLayers.end()) {
203 linkNextLargerLayer(
i, theBarrelLayers.end(), reachableBL);
206 theBarrelNLC.push_back(
new 208 symFinder.
mirror(rightFL),
209 rightFL,theField, 5.,
false));
221 setState(navigableLayers());
226 typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
227 typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
230 BarrelMapType reachedBarrelLayersMap;
231 ForwardMapType reachedForwardLayersMap;
233 for (
auto bli : theBarrelLayers) {
234 auto reachedLC = nextLayers(*bli,
insideOut);
235 for (
auto i : reachedLC) {
236 reachedBarrelLayersMap[
i].push_back(bli);
240 for (
auto fli : theForwardLayers) {
241 auto reachedLC = nextLayers(*fli,
insideOut);
242 for (
auto i : reachedLC) {
243 reachedForwardLayersMap[
i].push_back(fli);
247 for(
auto nl : theAllNavigableLayer) {
251 navigableLayer->setInwardLinks( reachedBarrelLayersMap[dl],reachedForwardLayersMap[dl] );
255 buildAdditionalForwardLinks(symFinder);
261 for (
auto i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
278 for (
auto i : theRightLayers){
284 for (
auto j : theBarrelLayers) {
285 if ((
i)->specificSurface().outerRadius() < (j)->specificSurface().radius() &&
286 fabs((
i)->specificSurface().
position().
z()) < (j)->surface().bounds().length()/2.){
330 build(theInputTracker, field, conf);
355 theNavigationPSet = iConfig;
359 setWhatProduced(
this, theNavigationSchoolName);
376 std::unique_ptr<NavigationSchool> theNavigationSchool ;
389 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
std::vector< BarrelDetLayer const * > const & tibLayers() const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
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)