CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Attributes
MuonServiceProxy Class Reference

#include <MuonServiceProxy.h>

Public Member Functions

edm::ESHandle
< MuonDetLayerGeometry
detLayerGeometry () const
 get the detLayer geometry More...
 
const edm::EventSetupeventSetup () const
 get the whole EventSetup More...
 
bool isTrackingComponentsRecordChanged () const
 check if the MuonReco Geometry has been changed More...
 
edm::ESHandle< MagneticFieldmagneticField () const
 get the magnetic field More...
 
const MuonNavigationSchoolmuonNavigationSchool () const
 
 MuonServiceProxy (const edm::ParameterSet &par)
 Constructor. More...
 
edm::ESHandle< Propagatorpropagator (std::string propagatorName) const
 get the propagator More...
 
edm::ESHandle
< GlobalTrackingGeometry
trackingGeometry () const
 get the tracking geometry More...
 
void update (const edm::EventSetup &setup)
 update the services each event More...
 
virtual ~MuonServiceProxy ()
 Destructor. More...
 

Private Types

typedef std::map< std::string,
edm::ESHandle< Propagator > > 
propagators
 

Private Attributes

unsigned long long theCacheId_DG
 
unsigned long long theCacheId_GTG
 
unsigned long long theCacheId_MG
 
unsigned long long theCacheId_P
 
bool theChangeInTrackingComponentsRecord
 
edm::ESHandle
< MuonDetLayerGeometry
theDetLayerGeometry
 
const edm::EventSetuptheEventSetup
 
edm::ESHandle< MagneticFieldtheMGField
 
bool theMuonNavigationFlag
 
propagators thePropagators
 
bool theRPCLayer
 
const MuonNavigationSchooltheSchool
 
edm::ESHandle
< GlobalTrackingGeometry
theTrackingGeometry
 

Detailed Description

Class to handle the services needed by the muon reconstruction This class avoid the EventSetup percolation. The update method is called each event in order to update the pointers.

Author
N. Amapane - CERN nicol.nosp@m.a.am.nosp@m.apane.nosp@m.@cer.nosp@m.n.ch
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 24 of file MuonServiceProxy.h.

Member Typedef Documentation

typedef std::map<std::string, edm::ESHandle<Propagator> > MuonServiceProxy::propagators
private

Definition at line 62 of file MuonServiceProxy.h.

Constructor & Destructor Documentation

MuonServiceProxy::MuonServiceProxy ( const edm::ParameterSet par)

Constructor.

Definition at line 34 of file MuonServiceProxy.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, theCacheId_DG, theCacheId_GTG, theCacheId_MG, theCacheId_P, theChangeInTrackingComponentsRecord, theMuonNavigationFlag, thePropagators, and theRPCLayer.

35 
36  // load the propagators map
37  vector<string> noPropagators;
38  vector<string> propagatorNames;
39 
40  theMuonNavigationFlag = par.getUntrackedParameter<bool>("UseMuonNavigation",true);
41  if(theMuonNavigationFlag) theRPCLayer = par.getParameter<bool>("RPCLayers");
42  else theRPCLayer = true;
43 
44  propagatorNames = par.getUntrackedParameter<vector<string> >("Propagators", noPropagators);
45 
46  if(propagatorNames.empty())
47  LogDebug("Muon|RecoMuon|MuonServiceProxy") << "NO propagator(s) selected!";
48 
49  for(vector<string>::iterator propagatorName = propagatorNames.begin();
50  propagatorName != propagatorNames.end(); ++propagatorName)
51  thePropagators[ *propagatorName ] = ESHandle<Propagator>(0);
52 
53  theCacheId_GTG = 0;
54  theCacheId_MG = 0;
55  theCacheId_DG = 0;
56  theCacheId_P = 0;
58 
59 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned long long theCacheId_MG
unsigned long long theCacheId_P
edm::ESHandle< MagneticField > theMGField
bool theChangeInTrackingComponentsRecord
unsigned long long theCacheId_DG
const MuonNavigationSchool * theSchool
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
propagators thePropagators
const edm::EventSetup * theEventSetup
unsigned long long theCacheId_GTG
edm::ESHandle< MuonDetLayerGeometry > theDetLayerGeometry
MuonServiceProxy::~MuonServiceProxy ( )
virtual

Destructor.

Definition at line 63 of file MuonServiceProxy.cc.

63  {
64 
65  // FIXME: how do that?
66  // delete theTrackingGeometry;
67  // delete theMGField;
68  // delete theDetLayerGeometry;
69 
70  // FIXME: is it enough?
71  thePropagators.clear();
72  if(theSchool) delete theSchool;
73 }
const MuonNavigationSchool * theSchool
propagators thePropagators

Member Function Documentation

edm::ESHandle<MuonDetLayerGeometry> MuonServiceProxy::detLayerGeometry ( ) const
inline

get the detLayer geometry

Definition at line 44 of file MuonServiceProxy.h.

References theDetLayerGeometry.

Referenced by MuonSimHitProducer::produce().

44 {return theDetLayerGeometry;}
edm::ESHandle< MuonDetLayerGeometry > theDetLayerGeometry
const edm::EventSetup& MuonServiceProxy::eventSetup ( ) const
inline
bool MuonServiceProxy::isTrackingComponentsRecordChanged ( ) const
inline

check if the MuonReco Geometry has been changed

Definition at line 53 of file MuonServiceProxy.h.

References theChangeInTrackingComponentsRecord.

edm::ESHandle<MagneticField> MuonServiceProxy::magneticField ( ) const
inline
const MuonNavigationSchool* MuonServiceProxy::muonNavigationSchool ( ) const
inline

Definition at line 55 of file MuonServiceProxy.h.

References theSchool.

55  {
56  return theSchool;
57  }
const MuonNavigationSchool * theSchool
ESHandle< Propagator > MuonServiceProxy::propagator ( std::string  propagatorName) const

get the propagator

Definition at line 129 of file MuonServiceProxy.cc.

Referenced by MuonSimHitProducer::beginRun(), TSGForRoadSearch::makeSeeds_0(), TSGForRoadSearch::makeSeeds_3(), TSGForRoadSearch::makeSeeds_4(), TSGFromPropagation::outerTkState(), GlobalCosmicMuonTrajectoryBuilder::propagator(), CosmicMuonTrajectoryBuilder::propagator(), TSGFromPropagation::propagator(), FastTSGFromPropagation::propagator(), CosmicMuonSmoother::propagatorAlong(), CosmicMuonTrajectoryBuilder::propagatorAlong(), CosmicMuonSmoother::propagatorOpposite(), CosmicMuonTrajectoryBuilder::propagatorOpposite(), and TSGForRoadSearch::pushTrajectorySeed().

129  {
130 
131  propagators::const_iterator prop = thePropagators.find(propagatorName);
132 
133  if (prop == thePropagators.end()){
134  LogError("Muon|RecoMuon|MuonServiceProxy")
135  << "MuonServiceProxy: propagator with name: "<< propagatorName <<" not found! Please load it in the MuonServiceProxy.cff";
136  return ESHandle<Propagator>(0);
137  }
138 
139  return prop->second;
140 }
propagators thePropagators
edm::ESHandle<GlobalTrackingGeometry> MuonServiceProxy::trackingGeometry ( ) const
inline
void MuonServiceProxy::update ( const edm::EventSetup setup)

update the services each event

Definition at line 78 of file MuonServiceProxy.cc.

References edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), LogTrace, metname, HcalObjRepresent::setup(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), ResidualRefitting::analyze(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), FastTSGFromL2Muon::beginRun(), TSGFromL2Muon::beginRun(), MuonSimHitProducer::beginRun(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), AlignmentMonitorTracksFromTrajectories::event(), CSCTimingExtractor::fillTiming(), DTTimingExtractor::fillTiming(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), GlobalCosmicMuonProducer::produce(), FastTSGFromL2Muon::produce(), GlobalTrackQualityProducer::produce(), TSGFromL2Muon::produce(), HIMuonTrackingRegionProducer::regions(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), MuonSeedCleaner::seedCleaner(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

78  {
79  const std::string metname = "Muon|RecoMuon|MuonServiceProxy";
80 
82 
83  // Global Tracking Geometry
84  unsigned long long newCacheId_GTG = setup.get<GlobalTrackingGeometryRecord>().cacheIdentifier();
85  if ( newCacheId_GTG != theCacheId_GTG ) {
86  LogTrace(metname) << "GlobalTrackingGeometry changed!";
87  theCacheId_GTG = newCacheId_GTG;
89  }
90 
91  // Magfield Field
92  unsigned long long newCacheId_MG = setup.get<IdealMagneticFieldRecord>().cacheIdentifier();
93  if ( newCacheId_MG != theCacheId_MG ) {
94  LogTrace(metname) << "Magnetic Field changed!";
95  theCacheId_MG = newCacheId_MG;
97  }
98 
99  // DetLayer Geometry
100  unsigned long long newCacheId_DG = setup.get<MuonRecoGeometryRecord>().cacheIdentifier();
101  if ( newCacheId_DG != theCacheId_DG ) {
102  LogTrace(metname) << "Muon Reco Geometry changed!";
103  theCacheId_DG = newCacheId_DG;
105  // MuonNavigationSchool should live until its validity expires, and then DELETE
106  // the NavigableLayers (this is implemented in MuonNavigationSchool's dtor)
107  if ( theMuonNavigationFlag ) {
108  if(theSchool) delete theSchool;
110  }
111  }
112 
113  // Propagators
114  unsigned long long newCacheId_P = setup.get<TrackingComponentsRecord>().cacheIdentifier();
115  if ( newCacheId_P != theCacheId_P ) {
116  LogTrace(metname) << "Tracking Component changed!";
118  theCacheId_P = newCacheId_P;
119  for(propagators::iterator prop = thePropagators.begin(); prop != thePropagators.end();
120  ++prop)
121  setup.get<TrackingComponentsRecord>().get( prop->first , prop->second );
122  }
123  else
125 
126 }
unsigned long long theCacheId_MG
unsigned long long theCacheId_P
const std::string metname
edm::ESHandle< MagneticField > theMGField
bool theChangeInTrackingComponentsRecord
unsigned long long theCacheId_DG
void get(HolderT &iHolder) const
const MuonNavigationSchool * theSchool
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
propagators thePropagators
#define LogTrace(id)
const edm::EventSetup * theEventSetup
const T & get() const
Definition: EventSetup.h:55
unsigned long long theCacheId_GTG
edm::ESHandle< MuonDetLayerGeometry > theDetLayerGeometry
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")

Member Data Documentation

unsigned long long MuonServiceProxy::theCacheId_DG
private

Definition at line 76 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

unsigned long long MuonServiceProxy::theCacheId_GTG
private

Definition at line 74 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

unsigned long long MuonServiceProxy::theCacheId_MG
private

Definition at line 75 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

unsigned long long MuonServiceProxy::theCacheId_P
private

Definition at line 77 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

bool MuonServiceProxy::theChangeInTrackingComponentsRecord
private

Definition at line 79 of file MuonServiceProxy.h.

Referenced by isTrackingComponentsRecordChanged(), and MuonServiceProxy().

edm::ESHandle<MuonDetLayerGeometry> MuonServiceProxy::theDetLayerGeometry
private

Definition at line 66 of file MuonServiceProxy.h.

Referenced by detLayerGeometry().

const edm::EventSetup* MuonServiceProxy::theEventSetup
private

Definition at line 67 of file MuonServiceProxy.h.

Referenced by eventSetup().

edm::ESHandle<MagneticField> MuonServiceProxy::theMGField
private

Definition at line 65 of file MuonServiceProxy.h.

Referenced by magneticField().

bool MuonServiceProxy::theMuonNavigationFlag
private

Definition at line 68 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

propagators MuonServiceProxy::thePropagators
private

Definition at line 72 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

bool MuonServiceProxy::theRPCLayer
private

Definition at line 69 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

const MuonNavigationSchool* MuonServiceProxy::theSchool
private

Definition at line 70 of file MuonServiceProxy.h.

Referenced by muonNavigationSchool().

edm::ESHandle<GlobalTrackingGeometry> MuonServiceProxy::theTrackingGeometry
private