CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Member Functions
CosmicNavigationSchool Class Reference
Inheritance diagram for CosmicNavigationSchool:
SimpleNavigationSchool TkNavigationSchool NavigationSchool SkippingLayerCosmicNavigationSchool

Classes

class  CosmicNavigationSchoolConfiguration
 

Public Member Functions

void build (const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
 
 CosmicNavigationSchool (const GeometricSearchTracker *theTracker, const MagneticField *field)
 
 ~CosmicNavigationSchool () override
 
- Public Member Functions inherited from SimpleNavigationSchool
StateType navigableLayers () override
 
 SimpleNavigationSchool ()
 
 SimpleNavigationSchool (const GeometricSearchTracker *tracker, const MagneticField *field)
 
 ~SimpleNavigationSchool () override
 
- Public Member Functions inherited from TkNavigationSchool
const MagneticFieldfield () const
 
const GeometricSearchTrackersearchTracker () const
 
 TkNavigationSchool (const GeometricSearchTracker *tracker, const MagneticField *field)
 
- Public Member Functions inherited from NavigationSchool
const std::vector< const DetLayer * > & allLayersInSystem () const
 
template<typename... Args>
std::vector< const DetLayer * > compatibleLayers (const DetLayer &detLayer, Args &&... args) const
 Returns all layers compatible. More...
 
 NavigationSchool ()
 
template<typename... Args>
std::vector< const DetLayer * > nextLayers (const DetLayer &detLayer, Args &&... args) const
 
virtual ~NavigationSchool ()
 

Protected Member Functions

 CosmicNavigationSchool ()
 
- Protected Member Functions inherited from SimpleNavigationSchool
virtual float barrelLength ()
 
void cleanMemory ()
 
virtual void establishInverseRelations ()
 
virtual void linkForwardLayers (SymmetricLayerFinder &symFinder)
 
virtual void linkNextBarrelLayer (ForwardDetLayer const *fl, BDLC &)
 
virtual void linkNextForwardLayer (BarrelDetLayer const *, FDLC &)
 
virtual void linkNextLargerLayer (BDLI, BDLI, BDLC &)
 
virtual void linkNextLayerInGroup (FDLI fli, const FDLC &group, FDLC &reachableFL)
 
virtual void linkOuterGroup (ForwardDetLayer const *fl, const FDLC &group, FDLC &reachableFL)
 
virtual void linkWithinGroup (FDLI fl, const FDLC &group, FDLC &reachableFL)
 
virtual ConstFDLI outerRadiusIncrease (FDLI fl, const FDLC &group)
 
virtual std::vector< FDLCsplitForwardLayers ()
 
- Protected Member Functions inherited from NavigationSchool
void setState (const StateType &state)
 

Private Member Functions

void buildAdditionalBarrelLinks ()
 
void buildAdditionalForwardLinks (SymmetricLayerFinder &symFinder)
 
virtual void establishInverseRelations ()
 
void establishInverseRelations (SymmetricLayerFinder &symFinder)
 
void linkBarrelLayers (SymmetricLayerFinder &symFinder) override
 

Additional Inherited Members

- Public Types inherited from NavigationSchool
typedef std::vector< NavigableLayer * > StateType
 
- Protected Types inherited from SimpleNavigationSchool
typedef std::vector< const BarrelDetLayer * > BDLC
 
typedef BDLC::iterator BDLI
 
typedef std::vector< SimpleBarrelNavigableLayer * > BNLCType
 
typedef BDLC::const_iterator ConstBDLI
 
typedef FDLC::const_iterator ConstFDLI
 
typedef std::vector< const DetLayer * > DLC
 
typedef DLC::iterator DLI
 
typedef std::vector< const ForwardDetLayer * > FDLC
 
typedef FDLC::iterator FDLI
 
typedef std::vector< SimpleForwardNavigableLayer * > FNLCType
 
- Protected Attributes inherited from SimpleNavigationSchool
BDLC theBarrelLayers
 
float theBarrelLength = 0
 
BNLCType theBarrelNLC
 
FDLC theForwardLayers
 
FNLCType theForwardNLC
 
FDLC theLeftLayers
 
FDLC theRightLayers
 
- Protected Attributes inherited from TkNavigationSchool
const MagneticFieldtheField
 
const GeometricSearchTrackertheTracker
 
- Protected Attributes inherited from NavigationSchool
const std::vector< const DetLayer * > * theAllDetLayersInSystem
 
StateType theAllNavigableLayer
 

Detailed Description

Concrete navigation school for cosmics in the Tracker

Definition at line 15 of file CosmicNavigationSchool.cc.

Constructor & Destructor Documentation

◆ CosmicNavigationSchool() [1/2]

CosmicNavigationSchool::CosmicNavigationSchool ( const GeometricSearchTracker theTracker,
const MagneticField field 
)

Definition at line 90 of file CosmicNavigationSchool.cc.

References newFWLiteAna::build.

91  {
92  build(theInputTracker, field, CosmicNavigationSchoolConfiguration());
93 }
const MagneticField & field() const
void build(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)

◆ ~CosmicNavigationSchool()

CosmicNavigationSchool::~CosmicNavigationSchool ( )
inlineoverride

◆ CosmicNavigationSchool() [2/2]

CosmicNavigationSchool::CosmicNavigationSchool ( )
inlineprotected

Definition at line 48 of file CosmicNavigationSchool.cc.

48 {}

Member Function Documentation

◆ build()

void CosmicNavigationSchool::build ( const GeometricSearchTracker theTracker,
const MagneticField field,
const CosmicNavigationSchoolConfiguration  conf 
)

Definition at line 95 of file CosmicNavigationSchool.cc.

References a, GeometricSearchTracker::allLayers(), CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::allSelf, mps_fire::i, GeomDetEnumerators::isTrackerPixel(), LogDebug, LogTrace, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noPXB, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noPXF, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noTEC, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noTIB, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noTID, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noTOB, GeometricSearchTracker::pixelBarrelLayers(), CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::self, GeomDetEnumerators::TEC, SimpleNavigableLayer::theSelfSearch, GeomDetEnumerators::TIB, GeometricSearchTracker::tibLayers(), GeomDetEnumerators::TID, GeomDetEnumerators::TOB, and GeometricSearchTracker::tobLayers().

97  {
98  LogTrace("CosmicNavigationSchool") << "*********Running CosmicNavigationSchool***********";
99  theBarrelLength = 0;
100  theField = field;
101  theTracker = theInputTracker;
102 
103  theAllDetLayersInSystem = &theInputTracker->allLayers();
104  theAllNavigableLayer.resize(theInputTracker->allLayers().size(), nullptr);
105 
106  // Get barrel layers
107  vector<BarrelDetLayer const*> const& blc = theTracker->barrelLayers();
108  for (auto i = blc.begin(); i != blc.end(); i++) {
109  if (conf.noPXB && GeomDetEnumerators::isTrackerPixel((*i)->subDetector()))
110  continue;
111  if (conf.noTOB && (*i)->subDetector() == GeomDetEnumerators::TOB)
112  continue;
113  if (conf.noTIB && (*i)->subDetector() == GeomDetEnumerators::TIB)
114  continue;
115  theBarrelLayers.push_back((*i));
116  }
117 
118  // get forward layers
119  vector<ForwardDetLayer const*> const& flc = theTracker->forwardLayers();
120  for (auto i = flc.begin(); i != flc.end(); i++) {
121  if (conf.noPXF && GeomDetEnumerators::isTrackerPixel((*i)->subDetector()))
122  continue;
123  if (conf.noTEC && (*i)->subDetector() == GeomDetEnumerators::TEC)
124  continue;
125  if (conf.noTID && (*i)->subDetector() == GeomDetEnumerators::TID)
126  continue;
127  theForwardLayers.push_back((*i));
128  }
129 
130  FDLI middle =
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());
134 
136 
137  // only work on positive Z side; negative by mirror symmetry later
138  linkBarrelLayers(symFinder);
139  linkForwardLayers(symFinder);
140  establishInverseRelations(symFinder);
141 
142  if (conf.self) {
143  // set the self search by hand
144  // NavigationSetter setter(*this);
145 
146  //add TOB1->TOB1 inward link
147  const std::vector<const BarrelDetLayer*>& tobL = theInputTracker->tobLayers();
148  if (!tobL.empty()) {
149  if (conf.allSelf) {
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;
153  } else {
154  SimpleNavigableLayer* navigableLayer =
155  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[tobL.front()->seqNum()]);
156  LogDebug("CosmicNavigationSchool") << " adding TOB1 to TOB1.";
157  navigableLayer->theSelfSearch = true;
158  }
159  }
160  const std::vector<const BarrelDetLayer*>& tibL = theInputTracker->tibLayers();
161  if (!tibL.empty()) {
162  if (conf.allSelf) {
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;
166  } else {
167  SimpleNavigableLayer* navigableLayer =
168  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[tibL.front()->seqNum()]);
169  LogDebug("CosmicNavigationSchool") << " adding tib1 to tib1.";
170  navigableLayer->theSelfSearch = true;
171  }
172  }
173  const std::vector<const BarrelDetLayer*>& pxbL = theInputTracker->pixelBarrelLayers();
174  if (!pxbL.empty()) {
175  if (conf.allSelf) {
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;
179  } else {
180  SimpleNavigableLayer* navigableLayer =
181  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[pxbL.front()->seqNum()]);
182  LogDebug("CosmicNavigationSchool") << " adding pxb1 to pxb1.";
183  navigableLayer->theSelfSearch = true;
184  }
185  }
186  }
187 }
void linkBarrelLayers(SymmetricLayerFinder &symFinder) override
std::vector< ForwardDetLayer const * > const & forwardLayers() const
#define LogTrace(id)
const MagneticField & field() const
StateType theAllNavigableLayer
virtual void linkForwardLayers(SymmetricLayerFinder &symFinder)
virtual void establishInverseRelations()
std::vector< const ForwardDetLayer * > FDLC
const std::vector< const DetLayer * > * theAllDetLayersInSystem
std::vector< BarrelDetLayer const * > const & barrelLayers() const
const GeometricSearchTracker * theTracker
double a
Definition: hdecay.h:119
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
const MagneticField * theField
#define LogDebug(id)

◆ buildAdditionalBarrelLinks()

void CosmicNavigationSchool::buildAdditionalBarrelLinks ( )
private

Definition at line 261 of file CosmicNavigationSchool.cc.

References mps_fire::i, outsideIn, and SimpleNavigableLayer::setAdditionalLink().

261  {
262  for (auto i = theBarrelLayers.begin(); i != theBarrelLayers.end(); i++) {
263  SimpleNavigableLayer* navigableLayer = dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*i)->seqNum()]);
264  if (i + 1 != theBarrelLayers.end())
265  navigableLayer->setAdditionalLink(*(i + 1), outsideIn);
266  }
267 }
StateType theAllNavigableLayer
virtual void setAdditionalLink(const DetLayer *, NavigationDirection direction=insideOut)=0

◆ buildAdditionalForwardLinks()

void CosmicNavigationSchool::buildAdditionalForwardLinks ( SymmetricLayerFinder symFinder)
private

Definition at line 269 of file CosmicNavigationSchool.cc.

References mps_fire::i, dqmiolumiharvest::j, SymmetricLayerFinder::mirror(), outsideIn, position, DetLayer::seqNum(), SimpleForwardNavigableLayer::setAdditionalLink(), and SimpleNavigableLayer::setCheckCrossingSide().

269  {
270  //the first layer of FPIX should not check the crossing side (since there are no inner layers to be tryed first)
271  SimpleNavigableLayer* firstR =
272  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[theRightLayers.front()->seqNum()]);
273  SimpleNavigableLayer* firstL =
274  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[theLeftLayers.front()->seqNum()]);
275  firstR->setCheckCrossingSide(false);
276  firstL->setCheckCrossingSide(false);
277 
278  for (auto i : theRightLayers) {
279  //look for first bigger barrel layer and link to it outsideIn
282  dynamic_cast<SimpleForwardNavigableLayer*>(theAllNavigableLayer[symFinder.mirror(i)->seqNum()]);
283  for (auto j : theBarrelLayers) {
284  if ((i)->specificSurface().outerRadius() < (j)->specificSurface().radius() &&
285  fabs((i)->specificSurface().position().z()) < (j)->surface().bounds().length() / 2.) {
287  mnfl->setAdditionalLink(j, outsideIn);
288  break;
289  }
290  }
291  }
292 }
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
StateType theAllNavigableLayer
int seqNum() const
Definition: DetLayer.h:35
void setCheckCrossingSide(bool docheck)
static int position[264][3]
Definition: ReadPGInfo.cc:289
void setAdditionalLink(const DetLayer *, NavigationDirection direction=insideOut) override

◆ establishInverseRelations() [1/2]

void SimpleNavigationSchool::establishInverseRelations
private

Definition at line 324 of file SimpleNavigationSchool.cc.

324  {
325  // NavigationSetter setter(*this);
326 
328 
329  // find for each layer which are the barrel and forward
330  // layers that point to it
331  typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
332  typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
333 
334  BarrelMapType reachedBarrelLayersMap;
335  ForwardMapType reachedForwardLayersMap;
336 
337  for (auto bli : theBarrelLayers) {
338  auto reachedLC = nextLayers(*bli, insideOut);
339  for (auto i : reachedLC) {
340  reachedBarrelLayersMap[i].push_back(bli);
341  }
342  }
343 
344  for (auto fli : theForwardLayers) {
345  auto reachedLC = nextLayers(*fli, insideOut);
346  for (auto i : reachedLC) {
347  reachedForwardLayersMap[i].push_back(fli);
348  }
349  }
350 
351  /*
352  vector<DetLayer*> lc = theTracker->allLayers();
353  for ( vector<DetLayer*>::iterator i = lc.begin(); i != lc.end(); i++) {
354  SimpleNavigableLayer* navigableLayer =
355  dynamic_cast<SimpleNavigableLayer*>((**i).navigableLayer());
356  navigableLayer->setInwardLinks( reachedBarrelLayersMap[*i],reachedForwardLayersMap[*i] );
357  }
358  */
359 
360  for (auto nl : theAllNavigableLayer) {
361  if (!nl)
362  continue;
363  auto navigableLayer = static_cast<SimpleNavigableLayer*>(nl);
364  auto dl = nl->detLayer();
365  navigableLayer->setInwardLinks(reachedBarrelLayersMap[dl], reachedForwardLayersMap[dl]);
366  }
367 }
virtual DetLayer const * detLayer() const =0
StateType navigableLayers() override
StateType theAllNavigableLayer
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&... args) const
void setState(const StateType &state)

◆ establishInverseRelations() [2/2]

void CosmicNavigationSchool::establishInverseRelations ( SymmetricLayerFinder symFinder)
private

Definition at line 219 of file CosmicNavigationSchool.cc.

References NavigableLayer::detLayer(), mps_fire::i, and insideOut.

219  {
220  //again: standard part is identical to SimpleNavigationSchool one.
221  //After the standard link, special outsideIn links are added
222 
223  // NavigationSetter setter(*this);
224 
226 
227  // find for each layer which are the barrel and forward
228  // layers that point to it
229  typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
230  typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
231 
232  BarrelMapType reachedBarrelLayersMap;
233  ForwardMapType reachedForwardLayersMap;
234 
235  for (auto bli : theBarrelLayers) {
236  auto reachedLC = nextLayers(*bli, insideOut);
237  for (auto i : reachedLC) {
238  reachedBarrelLayersMap[i].push_back(bli);
239  }
240  }
241 
242  for (auto fli : theForwardLayers) {
243  auto reachedLC = nextLayers(*fli, insideOut);
244  for (auto i : reachedLC) {
245  reachedForwardLayersMap[i].push_back(fli);
246  }
247  }
248 
249  for (auto nl : theAllNavigableLayer) {
250  if (!nl)
251  continue;
252  auto navigableLayer = static_cast<SimpleNavigableLayer*>(nl);
253  auto dl = nl->detLayer();
254  navigableLayer->setInwardLinks(reachedBarrelLayersMap[dl], reachedForwardLayersMap[dl]);
255  }
256 
257  //buildAdditionalBarrelLinks();
258  buildAdditionalForwardLinks(symFinder);
259 }
virtual DetLayer const * detLayer() const =0
StateType navigableLayers() override
StateType theAllNavigableLayer
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&... args) const
void setState(const StateType &state)
void buildAdditionalForwardLinks(SymmetricLayerFinder &symFinder)

◆ linkBarrelLayers()

void CosmicNavigationSchool::linkBarrelLayers ( SymmetricLayerFinder symFinder)
overrideprivatevirtual

Reimplemented from SimpleNavigationSchool.

Definition at line 189 of file CosmicNavigationSchool.cc.

References mps_fire::i, and SymmetricLayerFinder::mirror().

189  {
190  //identical to the SimpleNavigationSchool one, but it allows crossing over the tracker
191  //is some non-standard link is needed, it should probably be added here
192 
193  // Link barrel layers outwards
194  for (BDLI i = theBarrelLayers.begin(); i != theBarrelLayers.end(); i++) {
195  BDLC reachableBL;
196  FDLC leftFL;
197  FDLC rightFL;
198 
199  // always add next barrel layer first
200  if (i + 1 != theBarrelLayers.end())
201  reachableBL.push_back(*(i + 1));
202 
203  // Add closest reachable forward layer (except for last BarrelLayer)
204  if (i != theBarrelLayers.end() - 1) {
205  linkNextForwardLayer(*i, rightFL);
206  }
207 
208  // Add next BarrelLayer with length larger than the current BL
209  if (i + 2 < theBarrelLayers.end()) {
210  linkNextLargerLayer(i, theBarrelLayers.end(), reachableBL);
211  }
212 
213  theBarrelNLC.push_back(
214  new SimpleBarrelNavigableLayer(*i, reachableBL, symFinder.mirror(rightFL), rightFL, theField, 5., false));
215  }
216 }
std::vector< const BarrelDetLayer * > BDLC
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
std::vector< const ForwardDetLayer * > FDLC
virtual void linkNextLargerLayer(BDLI, BDLI, BDLC &)
virtual void linkNextForwardLayer(BarrelDetLayer const *, FDLC &)
const MagneticField * theField