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

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

References a, 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().

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

Definition at line 259 of file CosmicNavigationSchool.cc.

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

259  {
260  for (auto i = theBarrelLayers.begin(); i != theBarrelLayers.end(); i++) {
261  SimpleNavigableLayer* navigableLayer =
262  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*i)->seqNum()]);
263  if (i+1 != theBarrelLayers.end() )navigableLayer->setAdditionalLink(*(i+1), outsideIn);
264  }
265 }
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, 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
280  dynamic_cast<SimpleForwardNavigableLayer*>(theAllNavigableLayer[(i)->seqNum()]);
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.){
286  nfl ->setAdditionalLink(j, outsideIn);
287  mnfl->setAdditionalLink(j, outsideIn);
288  break;
289  }
290  }
291  }
292 }
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 213 of file CosmicNavigationSchool.cc.

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

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

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

Referenced by build().

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