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

#include <CosmicNavigationSchool.h>

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 () const
 
 SimpleNavigationSchool ()
 
 SimpleNavigationSchool (const GeometricSearchTracker *theTracker, const MagneticField *field)
 
 ~SimpleNavigationSchool ()
 
- Public Member Functions inherited from NavigationSchool
const std::vector< DetLayer * > & allLayersInSystem () const
 
 NavigationSchool ()
 
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 *fl, BDLC &)
 
virtual void linkNextForwardLayer (BarrelDetLayer *, FDLC &)
 
virtual void linkNextLargerLayer (BDLI, BDLI, BDLC &)
 
virtual void linkNextLayerInGroup (FDLI fli, const FDLC &group, FDLC &reachableFL)
 
virtual void linkOuterGroup (ForwardDetLayer *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 ()
 

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
< 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
< 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< DetLayer * > * theAllDetLayersInSystem
 

Detailed Description

Concrete navigation school for cosmics in the Tracker

Definition at line 17 of file CosmicNavigationSchool.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file CosmicNavigationSchool.cc.

References newFWLiteAna::build.

37 {
38  build(theInputTracker, field, CosmicNavigationSchoolConfiguration());
39 }
void build(const GeometricSearchTracker *theTracker, const MagneticField *field, const CosmicNavigationSchoolConfiguration conf)
CosmicNavigationSchool::~CosmicNavigationSchool ( )
inline
CosmicNavigationSchool::CosmicNavigationSchool ( )
inlineprotected

Definition at line 43 of file CosmicNavigationSchool.h.

43 {}

Member Function Documentation

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

Definition at line 41 of file CosmicNavigationSchool.cc.

References GeometricSearchTracker::allLayers(), CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::allSelf, i, LogDebug, LogTrace, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noPXB, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noPXF, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noTEC, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noTIB, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noTID, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::noTOB, GeomDetEnumerators::PixelBarrel, GeometricSearchTracker::pixelBarrelLayers(), GeomDetEnumerators::PixelEndcap, CosmicNavigationSchool::CosmicNavigationSchoolConfiguration::self, GeomDetEnumerators::TEC, SimpleNavigableLayer::theSelfSearch, GeomDetEnumerators::TIB, GeometricSearchTracker::tibLayers(), GeomDetEnumerators::TID, GeomDetEnumerators::TOB, and GeometricSearchTracker::tobLayers().

Referenced by SkippingLayerCosmicNavigationSchool::SkippingLayerCosmicNavigationSchool().

44 {
45  LogTrace("CosmicNavigationSchool") << "*********Running CosmicNavigationSchool***********" ;
46  theBarrelLength = 0;theField = field; theTracker = theInputTracker;
47 
48  theAllDetLayersInSystem=&theInputTracker->allLayers();
49 
50  // Get barrel layers
51  vector<BarrelDetLayer*> blc = theTracker->barrelLayers();
52  for ( vector<BarrelDetLayer*>::iterator i = blc.begin(); i != blc.end(); i++) {
53  if (conf.noPXB && (*i)->subDetector() == GeomDetEnumerators::PixelBarrel) continue;
54  if (conf.noTOB && (*i)->subDetector() == GeomDetEnumerators::TOB) continue;
55  if (conf.noTIB && (*i)->subDetector() == GeomDetEnumerators::TIB) continue;
56  theBarrelLayers.push_back( (*i) );
57  }
58 
59  // get forward layers
60  vector<ForwardDetLayer*> flc = theTracker->forwardLayers();
61  for ( vector<ForwardDetLayer*>::iterator i = flc.begin(); i != flc.end(); i++) {
62  if (conf.noPXF && (*i)->subDetector() == GeomDetEnumerators::PixelEndcap) continue;
63  if (conf.noTEC && (*i)->subDetector() == GeomDetEnumerators::TEC) continue;
64  if (conf.noTID && (*i)->subDetector() == GeomDetEnumerators::TID) continue;
65  theForwardLayers.push_back( (*i) );
66  }
67 
68  FDLI middle = find_if( theForwardLayers.begin(), theForwardLayers.end(),
69  not1(DetBelowZ(0)));
70  theLeftLayers = FDLC( theForwardLayers.begin(), middle);
71  theRightLayers = FDLC( middle, theForwardLayers.end());
72 
74 
75  // only work on positive Z side; negative by mirror symmetry later
76  linkBarrelLayers( symFinder);
77  linkForwardLayers( symFinder);
78  establishInverseRelations( symFinder );
79 
80  if (conf.self){
81 
82  // set the self search by hand
83  NavigationSetter setter(*this);
84 
85  //add TOB1->TOB1 inward link
86  const std::vector< BarrelDetLayer * > & tobL = theInputTracker->tobLayers();
87  if (tobL.size()>=1){
88  if (conf.allSelf){
89  LogDebug("CosmicNavigationSchool")<<" adding all TOB self search.";
90  for (std::vector< BarrelDetLayer * >::const_iterator lIt = tobL.begin(); lIt!=tobL.end(); ++lIt)
91  dynamic_cast<SimpleNavigableLayer*>((*lIt)->navigableLayer())->theSelfSearch = true;
92  }else{
93  SimpleNavigableLayer* navigableLayer = dynamic_cast<SimpleNavigableLayer*>(tobL.front()->navigableLayer());
94  LogDebug("CosmicNavigationSchool")<<" adding TOB1 to TOB1.";
95  navigableLayer->theSelfSearch = true;
96  }
97  }
98  const std::vector< BarrelDetLayer * > & tibL = theInputTracker->tibLayers();
99  if (tibL.size()>=1){
100  if (conf.allSelf){
101  LogDebug("CosmicNavigationSchool")<<" adding all TIB self search.";
102  for (std::vector< BarrelDetLayer * >::const_iterator lIt = tibL.begin(); lIt!=tibL.end(); ++lIt)
103  dynamic_cast<SimpleNavigableLayer*>((*lIt)->navigableLayer())->theSelfSearch = true;
104  }else{
105  SimpleNavigableLayer* navigableLayer = dynamic_cast<SimpleNavigableLayer*>(tibL.front()->navigableLayer());
106  LogDebug("CosmicNavigationSchool")<<" adding tib1 to tib1.";
107  navigableLayer->theSelfSearch = true;
108  }
109  }
110  const std::vector< BarrelDetLayer * > & pxbL = theInputTracker->pixelBarrelLayers();
111  if (pxbL.size()>=1){
112  if (conf.allSelf){
113  LogDebug("CosmicNavigationSchool")<<" adding all PXB self search.";
114  for (std::vector< BarrelDetLayer * >::const_iterator lIt = pxbL.begin(); lIt!=pxbL.end(); ++lIt)
115  dynamic_cast<SimpleNavigableLayer*>((*lIt)->navigableLayer())->theSelfSearch = true;
116  }else{
117  SimpleNavigableLayer* navigableLayer = dynamic_cast<SimpleNavigableLayer*>(pxbL.front()->navigableLayer());
118  LogDebug("CosmicNavigationSchool")<<" adding pxb1 to pxb1.";
119  navigableLayer->theSelfSearch = true;
120  }
121  }
122  }
123 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
void linkBarrelLayers(SymmetricLayerFinder &symFinder)
std::vector< BarrelDetLayer * > const & barrelLayers() const
std::vector< ForwardDetLayer * > FDLC
#define LogTrace(id)
virtual void linkForwardLayers(SymmetricLayerFinder &symFinder)
virtual void establishInverseRelations()
tuple conf
Definition: dbtoconf.py:185
const MagneticField * theField
const std::vector< DetLayer * > * theAllDetLayersInSystem
std::vector< ForwardDetLayer * > const & forwardLayers() const
void CosmicNavigationSchool::buildAdditionalBarrelLinks ( )
private

Definition at line 204 of file CosmicNavigationSchool.cc.

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

204  {
205  for ( vector<BarrelDetLayer*>::iterator i = theBarrelLayers.begin(); i != theBarrelLayers.end(); i++) {
206  SimpleNavigableLayer* navigableLayer =
207  dynamic_cast<SimpleNavigableLayer*>((**i).navigableLayer());
208  if (i+1 != theBarrelLayers.end() )navigableLayer->setAdditionalLink(*(i+1), outsideIn);
209  }
210 }
int i
Definition: DBlmapReader.cc:9
virtual void setAdditionalLink(DetLayer *, NavigationDirection direction=insideOut)=0
void CosmicNavigationSchool::buildAdditionalForwardLinks ( SymmetricLayerFinder symFinder)
private

Definition at line 213 of file CosmicNavigationSchool.cc.

References i, j, SymmetricLayerFinder::mirror(), DetLayer::navigableLayer(), outsideIn, and SimpleNavigableLayer::setCheckCrossingSide().

213  {
214  //the first layer of FPIX should not check the crossing side (since there are no inner layers to be tryed first)
215  SimpleNavigableLayer* firstR = dynamic_cast<SimpleNavigableLayer*>(theRightLayers.front()->navigableLayer());
216  SimpleNavigableLayer* firstL = dynamic_cast<SimpleNavigableLayer*>(theLeftLayers.front()->navigableLayer());
217  firstR->setCheckCrossingSide(false);
218  firstL->setCheckCrossingSide(false);
219 
220  for ( vector<ForwardDetLayer*>::iterator i = theRightLayers.begin(); i != theRightLayers.end(); i++){
221  //look for first bigger barrel layer and link to it outsideIn
222  SimpleForwardNavigableLayer* nfl = dynamic_cast<SimpleForwardNavigableLayer*>((*i)->navigableLayer());
223  SimpleForwardNavigableLayer* mnfl = dynamic_cast<SimpleForwardNavigableLayer*>(symFinder.mirror(*i)->navigableLayer());
224  for (vector<BarrelDetLayer*>::iterator j = theBarrelLayers.begin(); j != theBarrelLayers.end(); j++){
225  if ((*i)->specificSurface().outerRadius() < (*j)->specificSurface().radius() &&
226  fabs((*i)->specificSurface().position().z()) < (*j)->surface().bounds().length()/2.){
227  nfl ->setAdditionalLink(*j, outsideIn);
228  mnfl->setAdditionalLink(*j, outsideIn);
229  break;
230  }
231  }
232  }
233 }
int i
Definition: DBlmapReader.cc:9
NavigableLayer * navigableLayer() const
Return the NavigableLayer associated with this DetLayer.
Definition: DetLayer.h:51
int j
Definition: DBlmapReader.cc:9
void setCheckCrossingSide(bool docheck)
ForwardDetLayer * mirror(const ForwardDetLayer *layer)
void CosmicNavigationSchool::establishInverseRelations ( SymmetricLayerFinder symFinder)
private

Definition at line 158 of file CosmicNavigationSchool.cc.

References i, insideOut, and SimpleNavigableLayer::setInwardLinks().

158  {
159 
160  //again: standard part is identical to SimpleNavigationSchool one.
161  //After the standard link, special outsideIn links are added
162 
163  NavigationSetter setter(*this);
164 
165  // find for each layer which are the barrel and forward
166  // layers that point to it
167  typedef map<const DetLayer*, vector<BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
168  typedef map<const DetLayer*, vector<ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
169 
170 
171  BarrelMapType reachedBarrelLayersMap;
172  ForwardMapType reachedForwardLayersMap;
173 
174 
175  for ( BDLI bli = theBarrelLayers.begin();
176  bli!=theBarrelLayers.end(); bli++) {
177  DLC reachedLC = (**bli).nextLayers( insideOut);
178  for ( DLI i = reachedLC.begin(); i != reachedLC.end(); i++) {
179  reachedBarrelLayersMap[*i].push_back( *bli);
180  }
181  }
182 
183  for ( FDLI fli = theForwardLayers.begin();
184  fli!=theForwardLayers.end(); fli++) {
185  DLC reachedLC = (**fli).nextLayers( insideOut);
186  for ( DLI i = reachedLC.begin(); i != reachedLC.end(); i++) {
187  reachedForwardLayersMap[*i].push_back( *fli);
188  }
189  }
190 
191 
192  vector<DetLayer*> lc = theTracker->allLayers();
193  for ( vector<DetLayer*>::iterator i = lc.begin(); i != lc.end(); i++) {
194  SimpleNavigableLayer* navigableLayer = dynamic_cast<SimpleNavigableLayer*>((**i).navigableLayer());
195  if (navigableLayer)
196  navigableLayer->setInwardLinks( reachedBarrelLayersMap[*i],reachedForwardLayersMap[*i] );
197  }
198  //buildAdditionalBarrelLinks();
199  buildAdditionalForwardLinks(symFinder);
200 
201 }
int i
Definition: DBlmapReader.cc:9
const GeometricSearchTracker * theTracker
virtual void setInwardLinks(const BDLC &, const FDLC &, TkLayerLess sorter=TkLayerLess(outsideIn))=0
std::vector< const DetLayer * > DLC
std::vector< DetLayer * > const & allLayers() const
void buildAdditionalForwardLinks(SymmetricLayerFinder &symFinder)
void CosmicNavigationSchool::linkBarrelLayers ( SymmetricLayerFinder symFinder)
privatevirtual

Reimplemented from SimpleNavigationSchool.

Definition at line 126 of file CosmicNavigationSchool.cc.

References i, and SymmetricLayerFinder::mirror().

127 {
128  //identical to the SimpleNavigationSchool one, but it allows crossing over the tracker
129  //is some non-standard link is needed, it should probably be added here
130 
131  // Link barrel layers outwards
132  for ( BDLI i = theBarrelLayers.begin(); i != theBarrelLayers.end(); i++) {
133  BDLC reachableBL;
134  FDLC leftFL;
135  FDLC rightFL;
136 
137  // always add next barrel layer first
138  if ( i+1 != theBarrelLayers.end()) reachableBL.push_back(*(i+1));
139 
140  // Add closest reachable forward layer (except for last BarrelLayer)
141  if (i != theBarrelLayers.end() - 1) {
142  linkNextForwardLayer( *i, rightFL);
143  }
144 
145  // Add next BarrelLayer with length larger than the current BL
146  if ( i+2 < theBarrelLayers.end()) {
147  linkNextLargerLayer( i, theBarrelLayers.end(), reachableBL);
148  }
149 
150  theBarrelNLC.push_back( new
151  SimpleBarrelNavigableLayer( *i, reachableBL,
152  symFinder.mirror(rightFL),
153  rightFL,theField, 5.,false));
154  }
155 }
int i
Definition: DBlmapReader.cc:9
virtual void linkNextForwardLayer(BarrelDetLayer *, FDLC &)
std::vector< ForwardDetLayer * > FDLC
const MagneticField * theField
virtual void linkNextLargerLayer(BDLI, BDLI, BDLC &)
std::vector< BarrelDetLayer * > BDLC
ForwardDetLayer * mirror(const ForwardDetLayer *layer)