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)
 
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 14 of file CosmicNavigationSchool.cc.

Constructor & Destructor Documentation

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

Definition at line 89 of file CosmicNavigationSchool.cc.

References newFWLiteAna::build.

90  {
91  build(theInputTracker, field, CosmicNavigationSchoolConfiguration());
92 }
void build(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
CosmicNavigationSchool::~CosmicNavigationSchool ( )
inlineoverride
CosmicNavigationSchool::CosmicNavigationSchool ( )
inlineprotected

Member Function Documentation

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

Definition at line 94 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().

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

Definition at line 260 of file CosmicNavigationSchool.cc.

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

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

Definition at line 268 of file CosmicNavigationSchool.cc.

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

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

Definition at line 218 of file CosmicNavigationSchool.cc.

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

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

Reimplemented from SimpleNavigationSchool.

Definition at line 188 of file CosmicNavigationSchool.cc.

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

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