56 void buildAdditionalBarrelLinks();
98 LogTrace(
"CosmicNavigationSchool") <<
"*********Running CosmicNavigationSchool***********";
101 theTracker = theInputTracker;
103 theAllDetLayersInSystem = &theInputTracker->
allLayers();
104 theAllNavigableLayer.resize(theInputTracker->
allLayers().size(),
nullptr);
107 vector<BarrelDetLayer const*>
const& blc = theTracker->barrelLayers();
108 for (
auto i = blc.begin();
i != blc.end();
i++) {
115 theBarrelLayers.push_back((*
i));
119 vector<ForwardDetLayer const*>
const& flc = theTracker->forwardLayers();
120 for (
auto i = flc.begin();
i != flc.end();
i++) {
127 theForwardLayers.push_back((*
i));
131 find_if(theForwardLayers.begin(), theForwardLayers.end(), [](
auto const*
a) {
return a->position().z() >= 0.0; });
132 theLeftLayers =
FDLC(theForwardLayers.begin(), middle);
133 theRightLayers =
FDLC(middle, theForwardLayers.end());
138 linkBarrelLayers(symFinder);
139 linkForwardLayers(symFinder);
140 establishInverseRelations(symFinder);
147 const std::vector<const BarrelDetLayer*>& tobL = theInputTracker->
tobLayers();
150 LogDebug(
"CosmicNavigationSchool") <<
" adding all TOB self search.";
151 for (
auto lIt = tobL.begin(); lIt != tobL.end(); ++lIt)
152 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
156 LogDebug(
"CosmicNavigationSchool") <<
" adding TOB1 to TOB1.";
160 const std::vector<const BarrelDetLayer*>& tibL = theInputTracker->
tibLayers();
163 LogDebug(
"CosmicNavigationSchool") <<
" adding all TIB self search.";
164 for (
auto lIt = tibL.begin(); lIt != tibL.end(); ++lIt)
165 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
169 LogDebug(
"CosmicNavigationSchool") <<
" adding tib1 to tib1.";
173 const std::vector<const BarrelDetLayer*>& pxbL = theInputTracker->
pixelBarrelLayers();
176 LogDebug(
"CosmicNavigationSchool") <<
" adding all PXB self search.";
177 for (
auto lIt = pxbL.begin(); lIt != pxbL.end(); ++lIt)
178 dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*lIt)->seqNum()])->theSelfSearch =
true;
182 LogDebug(
"CosmicNavigationSchool") <<
" adding pxb1 to pxb1.";
194 for (
BDLI i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
200 if (
i + 1 != theBarrelLayers.end())
201 reachableBL.push_back(*(
i + 1));
204 if (
i != theBarrelLayers.end() - 1) {
205 linkNextForwardLayer(*
i, rightFL);
209 if (
i + 2 < theBarrelLayers.end()) {
210 linkNextLargerLayer(
i, theBarrelLayers.end(), reachableBL);
213 theBarrelNLC.push_back(
225 setState(navigableLayers());
229 typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
230 typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
232 BarrelMapType reachedBarrelLayersMap;
233 ForwardMapType reachedForwardLayersMap;
235 for (
auto bli : theBarrelLayers) {
236 auto reachedLC = nextLayers(*bli,
insideOut);
237 for (
auto i : reachedLC) {
238 reachedBarrelLayersMap[
i].push_back(bli);
242 for (
auto fli : theForwardLayers) {
243 auto reachedLC = nextLayers(*fli,
insideOut);
244 for (
auto i : reachedLC) {
245 reachedForwardLayersMap[
i].push_back(fli);
249 for (
auto nl : theAllNavigableLayer) {
254 navigableLayer->setInwardLinks(reachedBarrelLayersMap[dl], reachedForwardLayersMap[dl]);
258 buildAdditionalForwardLinks(symFinder);
262 for (
auto i = theBarrelLayers.begin();
i != theBarrelLayers.end();
i++) {
264 if (
i + 1 != theBarrelLayers.end())
278 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.) {
323 build(theInputTracker, field, conf);
348 magFieldToken_ =
cc.consumes();
349 geometricSearchTrackerToken_ =
cc.consumes();
368 &iRecord.
get(geometricSearchTrackerToken_), &iRecord.
get(magFieldToken_), config_));
374 desc.add<
bool>(
"noPXB");
375 desc.add<
bool>(
"noPXF");
376 desc.add<
bool>(
"noTIB");
377 desc.add<
bool>(
"noTID");
378 desc.add<
bool>(
"noTOB");
379 desc.add<
bool>(
"noTEC");
380 desc.add<
bool>(
"selfSearch");
381 desc.add<
bool>(
"allSelf");
void linkBarrelLayers(SymmetricLayerFinder &symFinder) override
T getParameter(std::string const &) const
~SkippingLayerCosmicNavigationSchool() override
std::unique_ptr< NavigationSchool > ReturnType
void buildAdditionalBarrelLinks()
std::vector< const BarrelDetLayer * > BDLC
uint32_t cc[maxCellsPerHit]
virtual DetLayer const * detLayer() const =0
std::vector< DetLayer const * > const & allLayers() const
SkippingLayerCosmicNavigationSchool(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
~CosmicNavigationSchool() override
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
SkippingLayerCosmicNavigationSchoolESProducer(const edm::ParameterSet &iConfig)
void addDefault(ParameterSetDescription const &psetDescription)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
virtual void establishInverseRelations()
std::vector< const ForwardDetLayer * > FDLC
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
virtual void linkBarrelLayers(SymmetricLayerFinder &symFinder)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< BarrelDetLayer const * > const & tibLayers() const
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)
static int position[264][3]
CosmicNavigationSchoolConfiguration()
std::vector< BarrelDetLayer const * > const & tobLayers() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
ReturnType produce(const NavigationSchoolRecord &)
void setAdditionalLink(const DetLayer *, NavigationDirection direction=insideOut) override
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
void buildAdditionalForwardLinks(SymmetricLayerFinder &symFinder)
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)