CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Private Member Functions
CosmicNavigationSchool Class Reference
Inheritance diagram for CosmicNavigationSchool:
SimpleNavigationSchool 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 ()
 
- Public Member Functions inherited from SimpleNavigationSchool
virtual StateType navigableLayers () override
 
 SimpleNavigationSchool ()
 
 SimpleNavigationSchool (const GeometricSearchTracker *theTracker, const MagneticField *field)
 
 ~SimpleNavigationSchool ()
 
- 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)
 

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
 
BNLCType theBarrelNLC
 
const MagneticFieldtheField
 
FDLC theForwardLayers
 
FNLCType theForwardNLC
 
FDLC theLeftLayers
 
FDLC theRightLayers
 
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.

References newFWLiteAna::build.

86 {
87  build(theInputTracker, field, CosmicNavigationSchoolConfiguration());
88 }
void build(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
CosmicNavigationSchool::~CosmicNavigationSchool ( )
inline
CosmicNavigationSchool::CosmicNavigationSchool ( )
inlineprotected

Definition at line 41 of file CosmicNavigationSchool.cc.

41 {}

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

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.size()>=1){
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.size()>=1){
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.size()>=1){
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)
int i
Definition: DBlmapReader.cc:9
void linkBarrelLayers(SymmetricLayerFinder &symFinder)
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 * theField
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
std::vector< BarrelDetLayer const * > const & barrelLayers() const
void CosmicNavigationSchool::buildAdditionalBarrelLinks ( )
private

Definition at line 261 of file CosmicNavigationSchool.cc.

References 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 }
int i
Definition: DBlmapReader.cc:9
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 i, j, SymmetricLayerFinder::mirror(), outsideIn, position, DetLayer::seqNum(), SimpleForwardNavigableLayer::setAdditionalLink(), and SimpleNavigableLayer::setCheckCrossingSide().

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 }
int i
Definition: DBlmapReader.cc:9
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
int seqNum() const
Definition: DetLayer.h:36
StateType theAllNavigableLayer
int j
Definition: DBlmapReader.cc:9
void setCheckCrossingSide(bool docheck)
static int position[264][3]
Definition: ReadPGInfo.cc:509
virtual 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(), 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 }
int i
Definition: DBlmapReader.cc:9
virtual DetLayer const * detLayer() const =0
virtual StateType navigableLayers() override
StateType theAllNavigableLayer
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&...args) const
NavigationDirection.
void setState(const StateType &state)
void buildAdditionalForwardLinks(SymmetricLayerFinder &symFinder)
void CosmicNavigationSchool::linkBarrelLayers ( SymmetricLayerFinder symFinder)
privatevirtual

Reimplemented from SimpleNavigationSchool.

Definition at line 182 of file CosmicNavigationSchool.cc.

References i, and SymmetricLayerFinder::mirror().

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 }
int i
Definition: DBlmapReader.cc:9
std::vector< const BarrelDetLayer * > BDLC
const ForwardDetLayer * mirror(const ForwardDetLayer *layer)
std::vector< const ForwardDetLayer * > FDLC
const MagneticField * theField
virtual void linkNextLargerLayer(BDLI, BDLI, BDLC &)
virtual void linkNextForwardLayer(BarrelDetLayer const *, FDLC &)