55 void buildAdditionalBarrelLinks();
97 LogTrace(
"CosmicNavigationSchool") <<
"*********Running CosmicNavigationSchool***********";
100 theTracker = theInputTracker;
102 theAllDetLayersInSystem = &theInputTracker->
allLayers();
103 theAllNavigableLayer.resize(theInputTracker->
allLayers().size(),
nullptr);
106 vector<BarrelDetLayer const*>
const& blc = theTracker->barrelLayers();
107 for (
auto i = blc.begin();
i != blc.end();
i++) {
114 theBarrelLayers.push_back((*
i));
118 vector<ForwardDetLayer const*>
const& flc = theTracker->forwardLayers();
119 for (
auto i = flc.begin();
i != flc.end();
i++) {
126 theForwardLayers.push_back((*
i));
130 find_if(theForwardLayers.begin(), theForwardLayers.end(), [](
auto const*
a) {
return a->position().z() >= 0.0; });
131 theLeftLayers =
FDLC(theForwardLayers.begin(), middle);
132 theRightLayers =
FDLC(middle, theForwardLayers.end());
137 linkBarrelLayers(symFinder);
138 linkForwardLayers(symFinder);
139 establishInverseRelations(symFinder);
146 const std::vector<const BarrelDetLayer*>& tobL = theInputTracker->
tobLayers();
149 LogDebug(
"CosmicNavigationSchool") <<
" adding all TOB self search.";
150 for (
auto lIt = tobL.begin(); lIt != tobL.end(); ++lIt)
151 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
155 LogDebug(
"CosmicNavigationSchool") <<
" adding TOB1 to TOB1.";
159 const std::vector<const BarrelDetLayer*>& tibL = theInputTracker->
tibLayers();
162 LogDebug(
"CosmicNavigationSchool") <<
" adding all TIB self search.";
163 for (
auto lIt = tibL.begin(); lIt != tibL.end(); ++lIt)
164 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
168 LogDebug(
"CosmicNavigationSchool") <<
" adding tib1 to tib1.";
172 const std::vector<const BarrelDetLayer*>& pxbL = theInputTracker->
pixelBarrelLayers();
175 LogDebug(
"CosmicNavigationSchool") <<
" adding all PXB self search.";
176 for (
auto lIt = pxbL.begin(); lIt != pxbL.end(); ++lIt)
177 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
181 LogDebug(
"CosmicNavigationSchool") <<
" adding pxb1 to pxb1.";
193 for (
BDLI i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
199 if (
i + 1 != theBarrelLayers.end())
200 reachableBL.push_back(*(
i + 1));
203 if (
i != theBarrelLayers.end() - 1) {
204 linkNextForwardLayer(*
i, rightFL);
208 if (
i + 2 < theBarrelLayers.end()) {
209 linkNextLargerLayer(
i, theBarrelLayers.end(), reachableBL);
212 theBarrelNLC.push_back(
224 setState(navigableLayers());
228 typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
229 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) {
253 navigableLayer->setInwardLinks(reachedBarrelLayersMap[dl], reachedForwardLayersMap[dl]);
257 buildAdditionalForwardLinks(symFinder);
261 for (
auto i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
263 if (
i + 1 != theBarrelLayers.end())
277 for (
auto i : theRightLayers) {
282 for (
auto j : theBarrelLayers) {
283 if ((
i)->specificSurface().outerRadius() < (
j)->specificSurface().radius() &&
284 fabs((
i)->specificSurface().
position().
z()) < (
j)->surface().bounds().length() / 2.) {
322 build(theInputTracker, field, conf);
347 .setConsumes(magFieldToken_)
348 .setConsumes(geometricSearchTrackerToken_);
367 &iRecord.
get(geometricSearchTrackerToken_), &iRecord.
get(magFieldToken_), config_));
373 desc.
add<
bool>(
"noPXB");
374 desc.
add<
bool>(
"noPXF");
375 desc.
add<
bool>(
"noTIB");
376 desc.
add<
bool>(
"noTID");
377 desc.
add<
bool>(
"noTOB");
378 desc.
add<
bool>(
"noTEC");
379 desc.
add<
bool>(
"selfSearch");
380 desc.
add<
bool>(
"allSelf");
T getParameter(std::string const &) const
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)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
SkippingLayerCosmicNavigationSchoolESProducer(const edm::ParameterSet &iConfig)
void addDefault(ParameterSetDescription const &psetDescription)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual void establishInverseRelations()
std::vector< const ForwardDetLayer * > FDLC
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
std::vector< BarrelDetLayer const * > const & tibLayers() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > geometricSearchTrackerToken_
void build(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
virtual void setAdditionalLink(const DetLayer *, NavigationDirection direction=insideOut)=0
CosmicNavigationSchool::CosmicNavigationSchoolConfiguration const config_
void setCheckCrossingSide(bool docheck)
virtual DetLayer const * detLayer() const =0
static int position[264][3]
CosmicNavigationSchoolConfiguration()
#define DEFINE_EDM_PLUGIN(factory, type, name)
ReturnType produce(const NavigationSchoolRecord &)
void setAdditionalLink(const DetLayer *, NavigationDirection direction=insideOut) override
void buildAdditionalForwardLinks(SymmetricLayerFinder &symFinder)
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)