48 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));
222 setState(navigableLayers());
227 typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
228 typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
231 BarrelMapType reachedBarrelLayersMap;
232 ForwardMapType reachedForwardLayersMap;
234 for (
auto bli : theBarrelLayers) {
235 auto reachedLC = nextLayers(*bli,
insideOut);
236 for (
auto i : reachedLC) {
237 reachedBarrelLayersMap[
i].push_back(bli);
241 for (
auto fli : theForwardLayers) {
242 auto reachedLC = nextLayers(*fli,
insideOut);
243 for (
auto i : reachedLC) {
244 reachedForwardLayersMap[
i].push_back(fli);
248 for(
auto nl : theAllNavigableLayer) {
251 auto dl = nl->detLayer();
252 navigableLayer->setInwardLinks( reachedBarrelLayersMap[
dl],reachedForwardLayersMap[dl] );
256 buildAdditionalForwardLinks(symFinder);
262 for (
auto i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
279 for (
auto i : theRightLayers){
285 for (
auto j : theBarrelLayers) {
286 if ((
i)->specificSurface().outerRadius() < (
j)->specificSurface().radius() &&
287 fabs((
i)->specificSurface().
position().z()) < (
j)->surface().bounds().length()/2.){
331 build(theInputTracker, field, conf);
340 #include "boost/shared_ptr.hpp"
357 theNavigationPSet = iConfig;
361 setWhatProduced(
this, theNavigationSchoolName);
383 using namespace edm::es;
396 return theNavigationSchool;
T getParameter(std::string const &) const
std::string theNavigationSchoolName
void linkBarrelLayers(SymmetricLayerFinder &symFinder)
std::vector< DetLayer const * > const & allLayers() const
void buildAdditionalBarrelLinks()
std::vector< const BarrelDetLayer * > BDLC
~SkippingLayerCosmicNavigationSchool()
SkippingLayerCosmicNavigationSchool(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
std::vector< BarrelDetLayer const * > const & tobLayers() const
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
boost::shared_ptr< NavigationSchool > ReturnType
const DepRecordT & getRecord() const
SkippingLayerCosmicNavigationSchoolESProducer(const edm::ParameterSet &iConfig)
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
~SkippingLayerCosmicNavigationSchoolESProducer()
virtual void establishInverseRelations()
std::vector< const ForwardDetLayer * > FDLC
virtual void linkBarrelLayers(SymmetricLayerFinder &symFinder)
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
boost::shared_ptr< NavigationSchool > theNavigationSchool
void setCheckCrossingSide(bool docheck)
static int position[264][3]
CosmicNavigationSchoolConfiguration()
edm::ParameterSet theNavigationPSet
~CosmicNavigationSchool()
#define DEFINE_EDM_PLUGIN(factory, type, name)
ReturnType produce(const NavigationSchoolRecord &)
volatile std::atomic< bool > shutdown_flag false
virtual void setAdditionalLink(const DetLayer *, NavigationDirection direction=insideOut) override
void buildAdditionalForwardLinks(SymmetricLayerFinder &symFinder)