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

References newFWLiteAna::build.

39 {
40  build(theInputTracker, field, CosmicNavigationSchoolConfiguration());
41 }
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 43 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().

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

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

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

Definition at line 215 of file CosmicNavigationSchool.cc.

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

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

Definition at line 160 of file CosmicNavigationSchool.cc.

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

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

References i, and SymmetricLayerFinder::mirror().

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