CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions
CfgNavigationSchool Class Reference

#include <CfgNavigationSchool.h>

Inheritance diagram for CfgNavigationSchool:
SimpleNavigationSchool NavigationSchool

Public Member Functions

 CfgNavigationSchool ()
 
 CfgNavigationSchool (const edm::ParameterSet &cfg, const GeometricSearchTracker *theTracker, const MagneticField *field)
 
 ~CfgNavigationSchool ()
 
- 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

void addLayer (std::string &lname, BDLC &reachableBL, FDLC &reachableFL)
 
DetLayerlayer (std::string &lname)
 
void makeBwdLinks (std::string &lname, BDLC &reachableBL, FDLC &reachableFL)
 
void makeFwdLinks (std::string &lname, BDLC &reachableBL, FDLC &reachableFL)
 
- Protected Member Functions inherited from SimpleNavigationSchool
virtual float barrelLength ()
 
void cleanMemory ()
 
virtual void establishInverseRelations ()
 
virtual void linkBarrelLayers (SymmetricLayerFinder &symFinder)
 
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 ()
 

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

Definition at line 13 of file CfgNavigationSchool.h.

Constructor & Destructor Documentation

CfgNavigationSchool::CfgNavigationSchool ( )
inline

Definition at line 15 of file CfgNavigationSchool.h.

15 {};
CfgNavigationSchool::CfgNavigationSchool ( const edm::ParameterSet cfg,
const GeometricSearchTracker theTracker,
const MagneticField field 
)

Definition at line 12 of file CfgNavigationSchool.cc.

References addLayer(), GeometricSearchTracker::allLayers(), GeometricSearchTracker::barrelLayers(), SimpleNavigationSchool::establishInverseRelations(), edm::ParameterSet::exists(), GeometricSearchTracker::forwardLayers(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSetNames(), i, makeBwdLinks(), makeFwdLinks(), h::names, NavigationSchool::theAllDetLayersInSystem, SimpleNavigationSchool::theBarrelLayers, SimpleNavigationSchool::theField, SimpleNavigationSchool::theForwardLayers, and SimpleNavigationSchool::theTracker.

14  {
15  //some genericinitialisation
16  theTracker=theInputTracker;
17  theField=field;
18  theAllDetLayersInSystem=&theInputTracker->allLayers();
19  // Get barrel layers
20  std::vector<BarrelDetLayer*> blc = theTracker->barrelLayers();
21  for ( std::vector<BarrelDetLayer*>::iterator i = blc.begin(); i != blc.end(); i++)
22  theBarrelLayers.push_back( (*i) );
23  // get forward layers
24  std::vector<ForwardDetLayer*> flc = theTracker->forwardLayers();
25  for ( std::vector<ForwardDetLayer*>::iterator i = flc.begin(); i != flc.end(); i++)
26  theForwardLayers.push_back( (*i) );
27 
28  std::vector< std::string > names;
29  cfg.getParameterSetNames(names);
30 
31  bool inverseRelationShip = true;
32  for (unsigned int iN=0;iN!=names.size();++iN){
34  std::vector<std::string> OUT = pset.getParameter<std::vector<std::string> >("OUT");
35  //will not do automatic inverse relation is any IN is specified
36  if ( pset.exists("IN") ) inverseRelationShip = false;
37 
38  BDLC reachableBL;
39  FDLC reachableFL;
40 
41  //create the OUT links
42  for (unsigned int iOut=0;iOut!=OUT.size();++iOut)
43  addLayer(OUT[iOut], reachableBL, reachableFL);
44 
45  makeFwdLinks(names[iN],reachableBL,reachableFL);
46  }
47 
48  //set the navigation to be able to access the NavigableLayer from the DetLayer itself
49  NavigationSetter setter(*this);
50 
51  if( inverseRelationShip ){
53  }else{
54  //set it by hand in the configuration
55  for (unsigned int iN=0;iN!=names.size();++iN){
57  std::vector<std::string> IN = pset.getParameter<std::vector<std::string> >("IN");
58 
59  BDLC reachableBL;
60  FDLC reachableFL;
61 
62  //create the IN links
63  for (unsigned int iIn=0;iIn!=IN.size();++iIn)
64  addLayer(IN[iIn], reachableBL, reachableFL);
65 
66  makeBwdLinks(names[iN],reachableBL,reachableFL);
67  }
68  }
69 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
bool exists(std::string const &parameterName) const
checks if a parameter exists
void makeBwdLinks(std::string &lname, BDLC &reachableBL, FDLC &reachableFL)
std::vector< BarrelDetLayer * > const & barrelLayers() const
std::vector< ForwardDetLayer * > FDLC
virtual void establishInverseRelations()
const MagneticField * theField
void addLayer(std::string &lname, BDLC &reachableBL, FDLC &reachableFL)
void makeFwdLinks(std::string &lname, BDLC &reachableBL, FDLC &reachableFL)
std::vector< BarrelDetLayer * > BDLC
const std::vector< DetLayer * > * theAllDetLayersInSystem
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
std::vector< ForwardDetLayer * > const & forwardLayers() const
static const HistoName names[]
CfgNavigationSchool::~CfgNavigationSchool ( )
inline

Member Function Documentation

void CfgNavigationSchool::addLayer ( std::string &  lname,
BDLC reachableBL,
FDLC reachableFL 
)
protected

Definition at line 107 of file CfgNavigationSchool.cc.

References GeomDetEnumerators::barrel, prof2calltree::l, layer(), and DetLayer::location().

Referenced by CfgNavigationSchool().

107  {
108  DetLayer * l = layer(lname);
110  reachableBL.push_back(dynamic_cast<BarrelDetLayer*>(l));
111  else
112  reachableFL .push_back(dynamic_cast<ForwardDetLayer*>(l));
113 }
virtual Location location() const =0
Which part of the detector (barrel, endcap)
DetLayer * layer(std::string &lname)
DetLayer * CfgNavigationSchool::layer ( std::string &  lname)
protected

Definition at line 116 of file CfgNavigationSchool.cc.

References LogDebug, GeometricSearchTracker::negPixelForwardLayers(), GeometricSearchTracker::negTecLayers(), GeometricSearchTracker::negTidLayers(), GeometricSearchTracker::pixelBarrelLayers(), GeometricSearchTracker::posPixelForwardLayers(), GeometricSearchTracker::posTecLayers(), GeometricSearchTracker::posTidLayers(), SimpleNavigationSchool::theTracker, GeometricSearchTracker::tibLayers(), and GeometricSearchTracker::tobLayers().

Referenced by addLayer(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), makeBwdLinks(), and makeFwdLinks().

116  {
117  std::string part = lname.substr(0,3);
118  unsigned int idLayer = atoi(lname.substr(3,1).c_str())-1;
119  bool isFwd = (lname.find("pos")!=std::string::npos);
120  LogDebug("CfgNavigationSchool")<<"part: "<<part<<"\n idLayer: "<<idLayer<<" is: "<<(isFwd?"isFwd":"isBwd");
121  if (part == "TOB") return theTracker->tobLayers()[idLayer];
122  else if (part == "TIB") return theTracker->tibLayers()[idLayer];
123  else if (part == "TID") return (isFwd?theTracker->posTidLayers()[idLayer]:theTracker->negTidLayers()[idLayer]);
124  else if (part == "TEC") return (isFwd?theTracker->posTecLayers()[idLayer]:theTracker->negTecLayers()[idLayer]);
125  else if (part == "PXB") return theTracker->pixelBarrelLayers()[idLayer];
126  else if (part == "PXF") return (isFwd?theTracker->posPixelForwardLayers()[idLayer]:theTracker->negPixelForwardLayers()[idLayer]);
127 
128  edm::LogError("CfgNavigationSchool")<<"layer specification: "<<lname<<" not understood. returning a null pointer.";
129  return 0;//and crash
130 
131 }
#define LogDebug(id)
std::vector< ForwardDetLayer * > const & posTecLayers() const
const GeometricSearchTracker * theTracker
std::vector< ForwardDetLayer * > const & negTecLayers() const
std::vector< ForwardDetLayer * > const & posPixelForwardLayers() const
part
Definition: HCALResponse.h:21
std::vector< BarrelDetLayer * > const & tibLayers() const
std::vector< ForwardDetLayer * > const & posTidLayers() const
std::vector< ForwardDetLayer * > const & negTidLayers() const
std::vector< BarrelDetLayer * > const & tobLayers() const
std::vector< BarrelDetLayer * > const & pixelBarrelLayers() const
std::vector< ForwardDetLayer * > const & negPixelForwardLayers() const
void CfgNavigationSchool::makeBwdLinks ( std::string &  lname,
BDLC reachableBL,
FDLC reachableFL 
)
protected

Definition at line 98 of file CfgNavigationSchool.cc.

References prof2calltree::l, layer(), DetLayer::navigableLayer(), and SimpleNavigableLayer::setInwardLinks().

Referenced by CfgNavigationSchool().

98  {
99  DetLayer * l = layer(lname);
100  SimpleNavigableLayer * nl = dynamic_cast<SimpleNavigableLayer*>(l->navigableLayer());
101  if (nl) nl->setInwardLinks(reachableBL,reachableFL);
102  else
103  edm::LogError("CfgNavigationSchool")<<"a layer is not casting to SimpleNavigableLayer.";
104 }
NavigableLayer * navigableLayer() const
Return the NavigableLayer associated with this DetLayer.
Definition: DetLayer.h:45
virtual void setInwardLinks(const BDLC &, const FDLC &, TkLayerLess sorter=TkLayerLess(outsideIn))=0
DetLayer * layer(std::string &lname)
void CfgNavigationSchool::makeFwdLinks ( std::string &  lname,
BDLC reachableBL,
FDLC reachableFL 
)
protected

Definition at line 71 of file CfgNavigationSchool.cc.

References GeomDetEnumerators::barrel, prof2calltree::l, layer(), DetLayer::location(), SimpleNavigationSchool::theBarrelNLC, SimpleNavigationSchool::theField, and SimpleNavigationSchool::theForwardNLC.

Referenced by CfgNavigationSchool().

71  {
72  DetLayer * l = layer(lname);
74  //split the FL into left and right.
75 
76  FDLI middle = find_if( reachableFL.begin(), reachableFL.end(),
77  not1(DetBelowZ(0)));
78  FDLC leftFL(reachableFL.begin(), middle);
79  FDLC rightFL(middle, reachableFL.end());
80 
81  BarrelDetLayer * bl = dynamic_cast<BarrelDetLayer *>(l);
82  theBarrelNLC.push_back( new SimpleBarrelNavigableLayer(bl,
83  reachableBL,
84  rightFL,leftFL,
85  theField,
86  5.));
87  }
88  else{
89  ForwardDetLayer * fwdL = dynamic_cast<ForwardDetLayer *>(l);
90  theForwardNLC.push_back( new SimpleForwardNavigableLayer(fwdL,
91  reachableBL,
92  reachableFL,
93  theField,
94  5.));
95  }
96 }
virtual Location location() const =0
Which part of the detector (barrel, endcap)
std::vector< ForwardDetLayer * > FDLC
const MagneticField * theField
DetLayer * layer(std::string &lname)