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

Definition at line 212 of file CosmicNavigationSchool.cc.

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

212  {
213  for (auto i = theBarrelLayers.begin(); i != theBarrelLayers.end(); i++) {
214  SimpleNavigableLayer* navigableLayer =
215  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[(*i)->seqNum()]);
216  if (i+1 != theBarrelLayers.end() )navigableLayer->setAdditionalLink(*(i+1), outsideIn);
217  }
218 }
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 221 of file CosmicNavigationSchool.cc.

References i, j, SymmetricLayerFinder::mirror(), outsideIn, position, DetLayer::seqNum(), SimpleNavigableLayer::setCheckCrossingSide(), and detailsBasic3DVector::z.

221  {
222  //the first layer of FPIX should not check the crossing side (since there are no inner layers to be tryed first)
223  SimpleNavigableLayer* firstR =
224  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[theRightLayers.front()->seqNum()]);
225  SimpleNavigableLayer* firstL =
226  dynamic_cast<SimpleNavigableLayer*>(theAllNavigableLayer[theLeftLayers.front()->seqNum()]);
227  firstR->setCheckCrossingSide(false);
228  firstL->setCheckCrossingSide(false);
229 
230  for (auto i : theRightLayers){
231  //look for first bigger barrel layer and link to it outsideIn
232  SimpleForwardNavigableLayer* nfl =
233  dynamic_cast<SimpleForwardNavigableLayer*>(theAllNavigableLayer[(i)->seqNum()]);
234  SimpleForwardNavigableLayer* mnfl =
235  dynamic_cast<SimpleForwardNavigableLayer*>(theAllNavigableLayer[symFinder.mirror(i)->seqNum()]);
236  for (auto j : theBarrelLayers) {
237  if ((i)->specificSurface().outerRadius() < (j)->specificSurface().radius() &&
238  fabs((i)->specificSurface().position().z()) < (j)->surface().bounds().length()/2.){
239  nfl ->setAdditionalLink(j, outsideIn);
240  mnfl->setAdditionalLink(j, outsideIn);
241  break;
242  }
243  }
244  }
245 }
int i
Definition: DBlmapReader.cc:9
float float float z
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
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)
void CosmicNavigationSchool::establishInverseRelations ( SymmetricLayerFinder symFinder)
private

Definition at line 166 of file CosmicNavigationSchool.cc.

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

166  {
167 
168  //again: standard part is identical to SimpleNavigationSchool one.
169  //After the standard link, special outsideIn links are added
170 
171  // NavigationSetter setter(*this);
172 
174 
175 
176  // find for each layer which are the barrel and forward
177  // layers that point to it
178  typedef map<const DetLayer*, vector<const BarrelDetLayer*>, less<const DetLayer*> > BarrelMapType;
179  typedef map<const DetLayer*, vector<const ForwardDetLayer*>, less<const DetLayer*> > ForwardMapType;
180 
181 
182  BarrelMapType reachedBarrelLayersMap;
183  ForwardMapType reachedForwardLayersMap;
184 
185  for ( auto bli : theBarrelLayers) {
186  auto reachedLC = nextLayers(*bli, insideOut);
187  for ( auto i : reachedLC) {
188  reachedBarrelLayersMap[i].push_back(bli);
189  }
190  }
191 
192  for ( auto fli : theForwardLayers) {
193  auto reachedLC = nextLayers(*fli, insideOut);
194  for ( auto i : reachedLC) {
195  reachedForwardLayersMap[i].push_back(fli);
196  }
197  }
198 
199  for(auto nl : theAllNavigableLayer) {
200  if (!nl) continue;
201  auto navigableLayer = static_cast<SimpleNavigableLayer*>(nl);
202  auto dl = nl->detLayer();
203  navigableLayer->setInwardLinks( reachedBarrelLayersMap[dl],reachedForwardLayersMap[dl] );
204  }
205 
206  //buildAdditionalBarrelLinks();
207  buildAdditionalForwardLinks(symFinder);
208 
209 }
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 133 of file CosmicNavigationSchool.cc.

References i, and SymmetricLayerFinder::mirror().

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