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
 NavigationDirection. More...
 
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 15 of file CosmicNavigationSchool.cc.

Constructor & Destructor Documentation

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

Definition at line 84 of file CosmicNavigationSchool.cc.

86 {
87  build(theInputTracker, field, CosmicNavigationSchoolConfiguration());
88 }
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 90 of file CosmicNavigationSchool.cc.

References GeometricSearchTracker::allLayers(), CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::allSelf, mps_fire::i, GeomDetEnumerators::isTrackerPixel(), linkBarrelLayers(), 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().

93 {
94  LogTrace("CosmicNavigationSchool") << "*********Running CosmicNavigationSchool***********" ;
95  theBarrelLength = 0;theField = field; theTracker = theInputTracker;
96 
97  theAllDetLayersInSystem=&theInputTracker->allLayers();
98  theAllNavigableLayer.resize(theInputTracker->allLayers().size(),nullptr);
99 
100 
101 
102 
103  // Get barrel layers
104  vector<BarrelDetLayer const*> const& blc = theTracker->barrelLayers();
105  for ( auto i = blc.begin(); i != blc.end(); i++) {
106  if (conf.noPXB && GeomDetEnumerators::isTrackerPixel((*i)->subDetector())) continue;
107  if (conf.noTOB && (*i)->subDetector() == GeomDetEnumerators::TOB) continue;
108  if (conf.noTIB && (*i)->subDetector() == GeomDetEnumerators::TIB) continue;
109  theBarrelLayers.push_back( (*i) );
110  }
111 
112  // get forward layers
113  vector<ForwardDetLayer const*> const& flc = theTracker->forwardLayers();
114  for ( auto i = flc.begin(); i != flc.end(); i++) {
115  if (conf.noPXF && GeomDetEnumerators::isTrackerPixel((*i)->subDetector())) continue;
116  if (conf.noTEC && (*i)->subDetector() == GeomDetEnumerators::TEC) continue;
117  if (conf.noTID && (*i)->subDetector() == GeomDetEnumerators::TID) continue;
118  theForwardLayers.push_back( (*i) );
119  }
120 
121  FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
122  not1(DetBelowZ(0)));
123  theLeftLayers = FDLC( theForwardLayers.begin(), middle);
124  theRightLayers = FDLC( middle, theForwardLayers.end());
125 
127 
128  // only work on positive Z side; negative by mirror symmetry later
129  linkBarrelLayers( symFinder);
130  linkForwardLayers( symFinder);
131  establishInverseRelations( symFinder );
132 
133  if (conf.self){
134 
135  // set the self search by hand
136  // NavigationSetter setter(*this);
137 
138  //add TOB1->TOB1 inward link
139  const std::vector< const BarrelDetLayer * > & tobL = theInputTracker->tobLayers();
140  if (!tobL.empty()){
141  if (conf.allSelf){
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;
145  }else{
146  SimpleNavigableLayer* navigableLayer =
147  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[tobL.front()->seqNum()]);
148  LogDebug("CosmicNavigationSchool")<<" adding TOB1 to TOB1.";
149  navigableLayer->theSelfSearch = true;
150  }
151  }
152  const std::vector< const BarrelDetLayer * > & tibL = theInputTracker->tibLayers();
153  if (!tibL.empty()){
154  if (conf.allSelf){
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;
158  }else{
159  SimpleNavigableLayer* navigableLayer =
160  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[tibL.front()->seqNum()]);
161  LogDebug("CosmicNavigationSchool")<<" adding tib1 to tib1.";
162  navigableLayer->theSelfSearch = true;
163  }
164  }
165  const std::vector< const BarrelDetLayer * > & pxbL = theInputTracker->pixelBarrelLayers();
166  if (!pxbL.empty()){
167  if (conf.allSelf){
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;
171  }else{
172  SimpleNavigableLayer* navigableLayer =
173  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[pxbL.front()->seqNum()]);
174  LogDebug("CosmicNavigationSchool")<<" adding pxb1 to pxb1.";
175  navigableLayer->theSelfSearch = true;
176  }
177  }
178  }
179 }
#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
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 =
263  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*i)->seqNum()]);
264  if (i+1 != theBarrelLayers.end() )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 269 of file CosmicNavigationSchool.cc.

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

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
281  dynamic_cast<SimpleForwardNavigableLayer*>(theAllNavigableLayer[(i)->seqNum()]);
283  dynamic_cast<SimpleForwardNavigableLayer*>(theAllNavigableLayer[symFinder.mirror(i)->seqNum()]);
284  for (auto j : theBarrelLayers) {
285  if ((i)->specificSurface().outerRadius() < (j)->specificSurface().radius() &&
286  fabs((i)->specificSurface().position().z()) < (j)->surface().bounds().length()/2.){
287  nfl ->setAdditionalLink(j, outsideIn);
288  mnfl->setAdditionalLink(j, outsideIn);
289  break;
290  }
291  }
292  }
293 }
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
int seqNum() const
Definition: DetLayer.h:36
StateType theAllNavigableLayer
void setCheckCrossingSide(bool docheck)
static int position[264][3]
Definition: ReadPGInfo.cc:509
void setAdditionalLink(const DetLayer *, NavigationDirection direction=insideOut) override
void CosmicNavigationSchool::establishInverseRelations ( SymmetricLayerFinder symFinder)
private

Definition at line 214 of file CosmicNavigationSchool.cc.

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

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

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

Referenced by build().

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