#include <NavigationSetter.h>
Public Types | |
typedef std::vector < NavigableLayer * > | StateType |
Public Member Functions | |
NavigationSetter (const NavigationSchool &) | |
~NavigationSetter () | |
Private Member Functions | |
void | cleanState () |
void | saveState () |
void | setState (const StateType &) |
Private Attributes | |
const NavigationSchool & | theNav |
StateType | theSavedState |
This class sets the navigation state given by the NavigationSchool, and saves the previous state for the affected layers. It must be instatiated as a local variable in the method that needs the navigation of the school, before using the navigation methods. The constructor saves the current state and sets the new one, and the destructod restores the previous state. This allows different reconstruction algorithms to use different navigations in the same set of DetLayers.
Definition at line 20 of file NavigationSetter.h.
typedef std::vector<NavigableLayer*> NavigationSetter::StateType |
Definition at line 23 of file NavigationSetter.h.
NavigationSetter::NavigationSetter | ( | const NavigationSchool & | school | ) |
Definition at line 7 of file NavigationSetter.cc.
References cleanState(), NavigationSchool::navigableLayers(), saveState(), and setState().
: theNav(school) { //save the current state from all layer in the system which is being set: allow to set it back saveState(); //remove any links from the detlayer in the system: allow partial navigation (BeamHalo) cleanState(); //set the current navigation setState(school.navigableLayers()); }
NavigationSetter::~NavigationSetter | ( | ) |
Definition at line 20 of file NavigationSetter.cc.
References cleanState(), setState(), and theSavedState.
{ //remove any link from the detlyaer in the system which has been set cleanState(); /* LogDebug("NavigationSetter")<<"NavigationSchool settings are totally reset in the destructor of NavigationSetter.\n" <<"this is the designed behavior. If you do not get track reconstruction, please refer to\n" <<"https://twiki.cern.ch/twiki/bin/view/CMS/NavigationSchool \n" <<"to properly use the NavigationSetter."; */ //restore the previous layer DetLayer settings within the system which has been set. setState( theSavedState); }
void NavigationSetter::cleanState | ( | ) | [private] |
Definition at line 45 of file NavigationSetter.cc.
References NavigationSchool::allLayersInSystem(), end, i, and theNav.
Referenced by NavigationSetter(), and ~NavigationSetter().
{ //set no navigable layer to all detlayers in the system std::vector<DetLayer*>::const_iterator i = theNav.allLayersInSystem().begin(); std::vector<DetLayer*>::const_iterator end = theNav.allLayersInSystem().end(); for (; i != end; ++i){ if (*i !=0) (*i)->setNavigableLayer(0); } }
void NavigationSetter::saveState | ( | ) | [private] |
Definition at line 36 of file NavigationSetter.cc.
References NavigationSchool::allLayersInSystem(), end, i, theNav, and theSavedState.
Referenced by NavigationSetter().
{ //remember all navigable layers from all layer in the system. std::vector<DetLayer*>::const_iterator i = theNav.allLayersInSystem().begin(); std::vector<DetLayer*>::const_iterator end = theNav.allLayersInSystem().end(); for (; i != end; ++i){ if (*i !=0) theSavedState.push_back( (*i)->navigableLayer()); } }
void NavigationSetter::setState | ( | const StateType & | newState | ) | [private] |
Definition at line 54 of file NavigationSetter.cc.
Referenced by NavigationSetter(), and ~NavigationSetter().
const NavigationSchool& NavigationSetter::theNav [private] |
Definition at line 31 of file NavigationSetter.h.
Referenced by cleanState(), and saveState().
StateType NavigationSetter::theSavedState [private] |
Definition at line 33 of file NavigationSetter.h.
Referenced by saveState(), and ~NavigationSetter().