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 Attributes
MuonUpdatorAtVertex Class Reference

#include <MuonUpdatorAtVertex.h>

Public Member Functions

 MuonUpdatorAtVertex (const edm::ParameterSet &pset, const MuonServiceProxy *service)
 Constructor. More...
 
std::pair< bool,
FreeTrajectoryState
propagate (const TrajectoryStateOnSurface &tsos, const reco::BeamSpot &beamSpot) const
 Propagate the state to the 2D-PCA. More...
 
std::pair< bool,
FreeTrajectoryState
propagate (const TrajectoryStateOnSurface &tsos) const __attribute__((deprecated))
 Propagate the state to the 2D-PCA (nominal CMS axis) - DEPRECATED -. More...
 
std::pair< bool,
FreeTrajectoryState
propagateToNominalLine (const TrajectoryStateOnSurface &tsos) const
 Propagate the state to the 2D-PCA (nominal CMS axis) More...
 
std::pair< bool,
FreeTrajectoryState
propagateWithUpdate (const TrajectoryStateOnSurface &tsos, const reco::BeamSpot &beamSpot) const
 Propagate to the 2D-PCA and apply the vertex constraint. More...
 
std::pair< bool,
FreeTrajectoryState
update (const reco::TransientTrack &track, const reco::BeamSpot &beamSpot) const
 Applies the vertex constraint. More...
 
std::pair< bool,
FreeTrajectoryState
update (const FreeTrajectoryState &ftsAtVtx, const reco::BeamSpot &beamSpot) const
 Applies the vertex constraint. More...
 
virtual ~MuonUpdatorAtVertex ()
 Destructor. More...
 

Private Attributes

double theChi2Cut
 
SingleTrackVertexConstraint theConstrictor
 
GlobalError thePositionErrors
 
std::string thePropagatorName
 
const MuonServiceProxytheService
 
TransientTrackFromFTSFactory theTransientTrackFactory
 

Detailed Description

This class do the extrapolation of a TrajectoryStateOnSurface to the PCA and can apply, with a different method, the vertex constraint. The vertex constraint is applyed using the Kalman Filter tools used for the vertex reconstruction.

For the time being the propagator is the SteppingHelixPropagator because the method propagate(TSOS,GlobalPoint) it is in its specific interface. Once the interface of the Propagator base class will be updated, then propagator will become generic.

For what concern the beam spot, it is possible set via cff the relevant parameters:

BeamSpotPosition[0] <=> x BeamSpotPosition[1] <=> y BeamSpotPosition[2] <=> z

BeamSpotPositionErrors[0] = sigma(x) BeamSpotPositionErrors[1] = sigma(y) BeamSpotPositionErrors[2] = sigma(z)

Author
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

This class do the extrapolation of a TrajectoryStateOnSurface to the PCA and can apply, with a different method, the vertex constraint. The vertex constraint is applyed using the Kalman Filter tools used for the vertex reconstruction.

Author
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 39 of file MuonUpdatorAtVertex.h.

Constructor & Destructor Documentation

MuonUpdatorAtVertex::MuonUpdatorAtVertex ( const edm::ParameterSet pset,
const MuonServiceProxy service 
)

Constructor.

Definition at line 28 of file MuonUpdatorAtVertex.cc.

References benchmark_cfg::errors, edm::ParameterSet::getParameter(), theChi2Cut, thePositionErrors, and thePropagatorName.

29  :theService(service){
30 
31  thePropagatorName = pset.getParameter<string>("Propagator");
32 
33 
34  // Errors on the Beam spot position
35  vector<double> errors = pset.getParameter< vector<double> >("BeamSpotPositionErrors");
36  if(errors.size() != 3)
37  edm::LogError("Muon|RecoMuon|MuonUpdatorAtVertex")
38  <<"MuonUpdatorAtVertex::BeamSpotPositionErrors wrong number of parameters!!";
39 
40  // assume:
41  // errors[0] = sigma(x)
42  // errors[1] = sigma(y)
43  // errors[2] = sigma(z)
44 
46  mat(0,0) = errors[0]*errors[0];
47  mat(1,1) = errors[1]*errors[1];
48  mat(2,2) = errors[2]*errors[2];
49  GlobalError glbErrPos(mat);
50 
51  thePositionErrors = glbErrPos;
52 
53  // cut on chi^2
54  theChi2Cut = pset.getParameter<double>("MaxChi2");
55 }
T getParameter(std::string const &) const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
const MuonServiceProxy * theService
MuonUpdatorAtVertex::~MuonUpdatorAtVertex ( )
virtual

Destructor.

Definition at line 58 of file MuonUpdatorAtVertex.cc.

58 {}

Member Function Documentation

pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::propagate ( const TrajectoryStateOnSurface tsos,
const reco::BeamSpot beamSpot 
) const

Propagate the state to the 2D-PCA.

Propagate the state to the PCA in 2D, i.e. to the beam line.

Definition at line 64 of file MuonUpdatorAtVertex.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalPosition(), FreeTrajectoryState::hasError(), TrackerBounds::isInside(), TrajectoryStateClosestToBeamLine::isValid(), LogTrace, metname, FreeTrajectoryState::parameters(), mps_fire::result, thePropagatorName, theService, and TrajectoryStateClosestToBeamLine::trackStateAtPCA().

Referenced by MuonTrackLoader::buildTrackAtPCA(), AlignmentMonitorTracksFromTrajectories::event(), and propagateWithUpdate().

64  {
65 
66  const string metname = "Muon|RecoMuon|MuonUpdatorAtVertex";
67 
69  LogTrace(metname) << "Trajectory inside the Tracker";
70 
71  TSCBLBuilderNoMaterial tscblBuilder;
72  TrajectoryStateClosestToBeamLine tscbl = tscblBuilder(*(tsos.freeState()),
73  beamSpot);
74 
75  if(tscbl.isValid())
76  return pair<bool,FreeTrajectoryState>(true,tscbl.trackStateAtPCA());
77  else
78  edm::LogWarning(metname) << "Propagation to the PCA using TSCPBuilderNoMaterial failed!"
79  << " This can cause a severe bug.";
80  }
81  else{
82  LogTrace(metname) << "Trajectory inside the muon system";
83 
85  result = theService->propagator(thePropagatorName)->propagate(*tsos.freeState(),beamSpot);
86 
87  LogTrace(metname) << "MuonUpdatorAtVertex::propagate, path: "
88  << result << " parameters: " << result.parameters();
89 
90  if(result.hasError())
91  return pair<bool,FreeTrajectoryState>(true,result);
92  else
93  edm::LogInfo(metname) << "Propagation to the PCA failed!";
94  }
95  return pair<bool,FreeTrajectoryState>(false,FreeTrajectoryState());
96 }
static bool isInside(const GlobalPoint &)
const GlobalTrajectoryParameters & parameters() const
const std::string metname
GlobalPoint globalPosition() const
tuple result
Definition: mps_fire.py:95
FreeTrajectoryState const * freeState(bool withErrors=true) const
#define LogTrace(id)
const MuonServiceProxy * theService
std::pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::propagate ( const TrajectoryStateOnSurface tsos) const

Propagate the state to the 2D-PCA (nominal CMS axis) - DEPRECATED -.

Definition at line 202 of file MuonUpdatorAtVertex.cc.

References propagateToNominalLine().

202  {
203  return propagateToNominalLine(tsos);
204 }
std::pair< bool, FreeTrajectoryState > propagateToNominalLine(const TrajectoryStateOnSurface &tsos) const
Propagate the state to the 2D-PCA (nominal CMS axis)
std::pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::propagateToNominalLine ( const TrajectoryStateOnSurface tsos) const

Propagate the state to the 2D-PCA (nominal CMS axis)

Definition at line 163 of file MuonUpdatorAtVertex.cc.

References TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalPosition(), TrackerBounds::isInside(), TrajectoryStateClosestToPoint::isValid(), LogTrace, metname, p1, p2, mps_fire::result, thePropagatorName, theService, and TrajectoryStateClosestToPoint::theState().

Referenced by propagate().

163  {
164 
165  const string metname = "Muon|RecoMuon|MuonUpdatorAtVertex";
166 
168  LogTrace(metname) << "Trajectory inside the Tracker";
169 
170  TSCPBuilderNoMaterial tscpBuilder;
171  TrajectoryStateClosestToPoint tscp = tscpBuilder(*(tsos.freeState()),
172  GlobalPoint(0.,0.,0.));
173 
174  if(tscp.isValid())
175  return pair<bool,FreeTrajectoryState>(true,tscp.theState());
176  else
177  edm::LogWarning(metname) << "Propagation to the PCA using TSCPBuilderNoMaterial failed!"
178  << " This can cause a severe bug.";
179  }
180  else{
181  LogTrace(metname) << "Trajectory inside the muon system";
182 
183  // Define a line using two 3D-points
184  GlobalPoint p1(0.,0.,-1500);
185  GlobalPoint p2(0.,0.,1500);
186 
187  pair<FreeTrajectoryState,double>
188  result = theService->propagator(thePropagatorName)->propagateWithPath(*tsos.freeState(),p1,p2);
189 
190  LogTrace(metname) << "MuonUpdatorAtVertex::propagate, path: "
191  << result.second << " parameters: " << result.first.parameters();
192 
193  if(result.first.hasError())
194  return pair<bool,FreeTrajectoryState>(true,result.first);
195  else
196  edm::LogInfo(metname) << "Propagation to the PCA failed! Path: "<<result.second;
197  }
198  return pair<bool,FreeTrajectoryState>(false,FreeTrajectoryState());
199 }
static bool isInside(const GlobalPoint &)
const std::string metname
const FreeTrajectoryState & theState() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint globalPosition() const
tuple result
Definition: mps_fire.py:95
FreeTrajectoryState const * freeState(bool withErrors=true) const
double p2[4]
Definition: TauolaWrapper.h:90
#define LogTrace(id)
double p1[4]
Definition: TauolaWrapper.h:89
const MuonServiceProxy * theService
pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::propagateWithUpdate ( const TrajectoryStateOnSurface tsos,
const reco::BeamSpot beamSpot 
) const

Propagate to the 2D-PCA and apply the vertex constraint.

Definition at line 147 of file MuonUpdatorAtVertex.cc.

References propagate(), and update().

Referenced by AlignmentMonitorTracksFromTrajectories::event().

147  {
148 
149  pair<bool,FreeTrajectoryState>
150  propagationResult = propagate(tsos,beamSpot);
151 
152  if(propagationResult.first){
153  return update(propagationResult.second, beamSpot);
154  }
155  else{
156  edm::LogInfo("Muon|RecoMuon|MuonUpdatorAtVertex") << "Constraint at vertex failed";
157  return pair<bool,FreeTrajectoryState>(false,FreeTrajectoryState());
158  }
159 }
std::pair< bool, FreeTrajectoryState > propagate(const TrajectoryStateOnSurface &tsos, const reco::BeamSpot &beamSpot) const
Propagate the state to the 2D-PCA.
std::pair< bool, FreeTrajectoryState > update(const reco::TransientTrack &track, const reco::BeamSpot &beamSpot) const
Applies the vertex constraint.
pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::update ( const reco::TransientTrack track,
const reco::BeamSpot beamSpot 
) const

Applies the vertex constraint.

Definition at line 100 of file MuonUpdatorAtVertex.cc.

References SingleTrackVertexConstraint::constrain(), alignCSCRings::e, cms::Exception::explainSelf(), LogTrace, metname, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, theChi2Cut, theConstrictor, thePositionErrors, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), MuonTrackLoader::buildTrackUpdatedAtPCA(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), MatrixUtil.Steps::overwrite(), propagateWithUpdate(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), 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(), update(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

100  {
101 
102  const std::string metname = "Muon|RecoMuon|MuonUpdatorAtVertex";
103 
104 
105  pair<bool,FreeTrajectoryState> result(false,FreeTrajectoryState());
106 
107  GlobalPoint spotPos(beamSpot.x0(),beamSpot.y0(),beamSpot.z0());
108 
109  SingleTrackVertexConstraint::BTFtuple constrainedTransientTrack;
110 
111  // Temporary hack here. A fix in the SingleTrackVertexConstraint code
112  // is needed. Once available try&catch will be removed
113  try{
114  constrainedTransientTrack = theConstrictor.constrain(track,
115  spotPos,
117  }
118  catch(cms::Exception& e) {
119  edm::LogWarning(metname) << "cms::Exception caught in MuonUpdatorAtVertex::update\n"
120  << "Exception from SingleTrackVertexConstraint\n"
121  << e.explainSelf();
122  return result;
123  }
124 
125 
126  if(constrainedTransientTrack.get<0>())
127  if(constrainedTransientTrack.get<2>() <= theChi2Cut) {
128  result.first = true;
129  result.second = *constrainedTransientTrack.get<1>().impactPointState().freeState();
130  }
131  else
132  LogTrace(metname) << "Constraint at vertex failed: too large chi2";
133  else
134  LogTrace(metname) << "Constraint at vertex failed";
135 
136  return result;
137 }
double z0() const
z coordinate
Definition: BeamSpot.h:68
const std::string metname
virtual std::string explainSelf() const
Definition: Exception.cc:146
tuple result
Definition: mps_fire.py:95
#define LogTrace(id)
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
double y0() const
y coordinate
Definition: BeamSpot.h:66
SingleTrackVertexConstraint theConstrictor
boost::tuple< bool, reco::TransientTrack, float > BTFtuple
double x0() const
x coordinate
Definition: BeamSpot.h:64
pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::update ( const FreeTrajectoryState ftsAtVtx,
const reco::BeamSpot beamSpot 
) const

Applies the vertex constraint.

Definition at line 140 of file MuonUpdatorAtVertex.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, TransientTrackFromFTSFactory::build(), theTransientTrackFactory, and update().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), 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().

140  {
141 
142  return update(theTransientTrackFactory.build(ftsAtVtx),beamSpot);
143 }
TransientTrackFromFTSFactory theTransientTrackFactory
std::pair< bool, FreeTrajectoryState > update(const reco::TransientTrack &track, const reco::BeamSpot &beamSpot) const
Applies the vertex constraint.
reco::TransientTrack build(const FreeTrajectoryState &fts) const

Member Data Documentation

double MuonUpdatorAtVertex::theChi2Cut
private

Definition at line 85 of file MuonUpdatorAtVertex.h.

Referenced by MuonUpdatorAtVertex(), and update().

SingleTrackVertexConstraint MuonUpdatorAtVertex::theConstrictor
private

Definition at line 84 of file MuonUpdatorAtVertex.h.

Referenced by update().

GlobalError MuonUpdatorAtVertex::thePositionErrors
private

Definition at line 87 of file MuonUpdatorAtVertex.h.

Referenced by MuonUpdatorAtVertex(), and update().

std::string MuonUpdatorAtVertex::thePropagatorName
private

Definition at line 81 of file MuonUpdatorAtVertex.h.

Referenced by MuonUpdatorAtVertex(), propagate(), and propagateToNominalLine().

const MuonServiceProxy* MuonUpdatorAtVertex::theService
private

Definition at line 80 of file MuonUpdatorAtVertex.h.

Referenced by propagate(), and propagateToNominalLine().

TransientTrackFromFTSFactory MuonUpdatorAtVertex::theTransientTrackFactory
private

Definition at line 83 of file MuonUpdatorAtVertex.h.

Referenced by update().