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

87 {
88  build(theInputTracker, field, CosmicNavigationSchoolConfiguration());
89 }
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 91 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().

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

Definition at line 270 of file CosmicNavigationSchool.cc.

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

270  {
271  //the first layer of FPIX should not check the crossing side (since there are no inner layers to be tryed first)
272  SimpleNavigableLayer* firstR =
273  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[theRightLayers.front()->seqNum()]);
274  SimpleNavigableLayer* firstL =
275  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[theLeftLayers.front()->seqNum()]);
276  firstR->setCheckCrossingSide(false);
277  firstL->setCheckCrossingSide(false);
278 
279  for (auto i : theRightLayers){
280  //look for first bigger barrel layer and link to it outsideIn
282  dynamic_cast<SimpleForwardNavigableLayer*>(theAllNavigableLayer[(i)->seqNum()]);
284  dynamic_cast<SimpleForwardNavigableLayer*>(theAllNavigableLayer[symFinder.mirror(i)->seqNum()]);
285  for (auto j : theBarrelLayers) {
286  if ((i)->specificSurface().outerRadius() < (j)->specificSurface().radius() &&
287  fabs((i)->specificSurface().position().z()) < (j)->surface().bounds().length()/2.){
288  nfl ->setAdditionalLink(j, outsideIn);
289  mnfl->setAdditionalLink(j, outsideIn);
290  break;
291  }
292  }
293  }
294 }
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 215 of file CosmicNavigationSchool.cc.

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

215  {
216 
217  //again: standard part is identical to SimpleNavigationSchool one.
218  //After the standard link, special outsideIn links are added
219 
220  // NavigationSetter setter(*this);
221 
223 
224 
225  // find for each layer which are the barrel and forward
226  // layers that point to it
227  typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
228  typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
229 
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) continue;
250  auto navigableLayer = static_cast<SimpleNavigableLayer*>(nl);
251  auto dl = nl->detLayer();
252  navigableLayer->setInwardLinks( reachedBarrelLayersMap[dl],reachedForwardLayersMap[dl] );
253  }
254 
255  //buildAdditionalBarrelLinks();
256  buildAdditionalForwardLinks(symFinder);
257 
258 }
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 183 of file CosmicNavigationSchool.cc.

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

Referenced by build().

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