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)

Date:
2009/09/16 13:12:07
Revision:
1.22
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.

Date:
2009/09/16 13:12:08
Revision:
1.41
Author
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 41 of file MuonUpdatorAtVertex.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 30 of file MuonUpdatorAtVertex.cc.

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

31  :theService(service){
32 
33  thePropagatorName = pset.getParameter<string>("Propagator");
34 
35 
36  // Errors on the Beam spot position
37  vector<double> errors = pset.getParameter< vector<double> >("BeamSpotPositionErrors");
38  if(errors.size() != 3)
39  edm::LogError("Muon|RecoMuon|MuonUpdatorAtVertex")
40  <<"MuonUpdatorAtVertex::BeamSpotPositionErrors wrong number of parameters!!";
41 
42  // assume:
43  // errors[0] = sigma(x)
44  // errors[1] = sigma(y)
45  // errors[2] = sigma(z)
46 
48  mat(0,0) = errors[0]*errors[0];
49  mat(1,1) = errors[1]*errors[1];
50  mat(2,2) = errors[2]*errors[2];
51  GlobalError glbErrPos(mat);
52 
53  thePositionErrors = glbErrPos;
54 
55  // cut on chi^2
56  theChi2Cut = pset.getParameter<double>("MaxChi2");
57 }
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 60 of file MuonUpdatorAtVertex.cc.

60 {}

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 66 of file MuonUpdatorAtVertex.cc.

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

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

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

References propagateToNominalLine().

204  {
205  return propagateToNominalLine(tsos);
206 }
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 165 of file MuonUpdatorAtVertex.cc.

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

Referenced by propagate().

165  {
166 
167  const string metname = "Muon|RecoMuon|MuonUpdatorAtVertex";
168 
170  LogTrace(metname) << "Trajectory inside the Tracker";
171 
172  TSCPBuilderNoMaterial tscpBuilder;
173  TrajectoryStateClosestToPoint tscp = tscpBuilder(*(tsos.freeState()),
174  GlobalPoint(0.,0.,0.));
175 
176  if(tscp.isValid())
177  return pair<bool,FreeTrajectoryState>(true,tscp.theState());
178  else
179  edm::LogWarning(metname) << "Propagation to the PCA using TSCPBuilderNoMaterial failed!"
180  << " This can cause a severe bug.";
181  }
182  else{
183  LogTrace(metname) << "Trajectory inside the muon system";
184 
185  // Define a line using two 3D-points
186  GlobalPoint p1(0.,0.,-1500);
187  GlobalPoint p2(0.,0.,1500);
188 
189  pair<FreeTrajectoryState,double>
190  result = theService->propagator(thePropagatorName)->propagateWithPath(*tsos.freeState(),p1,p2);
191 
192  LogTrace(metname) << "MuonUpdatorAtVertex::propagate, path: "
193  << result.second << " parameters: " << result.first.parameters();
194 
195  if(result.first.hasError())
196  return pair<bool,FreeTrajectoryState>(true,result.first);
197  else
198  edm::LogInfo(metname) << "Propagation to the PCA failed! Path: "<<result.second;
199  }
200  return pair<bool,FreeTrajectoryState>(false,FreeTrajectoryState());
201 }
static bool isInside(const GlobalPoint &)
const std::string metname
const FreeTrajectoryState & theState() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint globalPosition() const
FreeTrajectoryState * freeState(bool withErrors=true) const
tuple result
Definition: query.py:137
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 149 of file MuonUpdatorAtVertex.cc.

References propagate(), and update().

Referenced by AlignmentMonitorTracksFromTrajectories::event().

149  {
150 
151  pair<bool,FreeTrajectoryState>
152  propagationResult = propagate(tsos,beamSpot);
153 
154  if(propagationResult.first){
155  return update(propagationResult.second, beamSpot);
156  }
157  else{
158  edm::LogInfo("Muon|RecoMuon|MuonUpdatorAtVertex") << "Constraint at vertex failed";
159  return pair<bool,FreeTrajectoryState>(false,FreeTrajectoryState());
160  }
161 }
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 102 of file MuonUpdatorAtVertex.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

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

Applies the vertex constraint.

Definition at line 142 of file MuonUpdatorAtVertex.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

142  {
143 
144  return update(theTransientTrackFactory.build(ftsAtVtx),beamSpot);
145 }
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 87 of file MuonUpdatorAtVertex.h.

Referenced by MuonUpdatorAtVertex(), and update().

SingleTrackVertexConstraint MuonUpdatorAtVertex::theConstrictor
private

Definition at line 86 of file MuonUpdatorAtVertex.h.

Referenced by update().

GlobalError MuonUpdatorAtVertex::thePositionErrors
private

Definition at line 89 of file MuonUpdatorAtVertex.h.

Referenced by MuonUpdatorAtVertex(), and update().

std::string MuonUpdatorAtVertex::thePropagatorName
private

Definition at line 83 of file MuonUpdatorAtVertex.h.

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

const MuonServiceProxy* MuonUpdatorAtVertex::theService
private

Definition at line 82 of file MuonUpdatorAtVertex.h.

Referenced by propagate(), and propagateToNominalLine().

TransientTrackFromFTSFactory MuonUpdatorAtVertex::theTransientTrackFactory
private

Definition at line 85 of file MuonUpdatorAtVertex.h.

Referenced by update().