CMS 3D CMS Logo

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, FreeTrajectoryStatepropagate (const TrajectoryStateOnSurface &tsos) const __attribute__((deprecated))
 Propagate the state to the 2D-PCA (nominal CMS axis) - DEPRECATED -. More...
 
std::pair< bool, FreeTrajectoryStatepropagate (const TrajectoryStateOnSurface &tsos, const reco::BeamSpot &beamSpot) const
 Propagate the state to the 2D-PCA. More...
 
std::pair< bool, FreeTrajectoryStatepropagateToNominalLine (const TrajectoryStateOnSurface &tsos) const
 Propagate the state to the 2D-PCA (nominal CMS axis) More...
 
std::pair< bool, FreeTrajectoryStatepropagateWithUpdate (const TrajectoryStateOnSurface &tsos, const reco::BeamSpot &beamSpot) const
 Propagate to the 2D-PCA and apply the vertex constraint. More...
 
std::pair< bool, FreeTrajectoryStateupdate (const FreeTrajectoryState &ftsAtVtx, const reco::BeamSpot &beamSpot) const
 Applies the vertex constraint. More...
 
std::pair< bool, FreeTrajectoryStateupdate (const reco::TransientTrack &track, 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 42 of file MuonUpdatorAtVertex.h.

Constructor & Destructor Documentation

◆ MuonUpdatorAtVertex()

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

Constructor.

Definition at line 28 of file MuonUpdatorAtVertex.cc.

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

References muonDTDigis_cfi::pset, theChi2Cut, thePositionErrors, and thePropagatorName.

◆ ~MuonUpdatorAtVertex()

MuonUpdatorAtVertex::~MuonUpdatorAtVertex ( )
virtual

Destructor.

Definition at line 56 of file MuonUpdatorAtVertex.cc.

56 {}

Member Function Documentation

◆ propagate() [1/2]

std::pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::propagate ( const TrajectoryStateOnSurface tsos) const

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

Definition at line 177 of file MuonUpdatorAtVertex.cc.

177  {
178  return propagateToNominalLine(tsos);
179 }

References propagateToNominalLine().

◆ propagate() [2/2]

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

62  {
63  const string metname = "Muon|RecoMuon|MuonUpdatorAtVertex";
64 
66  LogTrace(metname) << "Trajectory inside the Tracker";
67 
68  TSCBLBuilderNoMaterial tscblBuilder;
69  TrajectoryStateClosestToBeamLine tscbl = tscblBuilder(*(tsos.freeState()), beamSpot);
70 
71  if (tscbl.isValid())
72  return pair<bool, FreeTrajectoryState>(true, tscbl.trackStateAtPCA());
73  else
74  edm::LogWarning(metname) << "Propagation to the PCA using TSCPBuilderNoMaterial failed!"
75  << " This can cause a severe bug.";
76  } else {
77  LogTrace(metname) << "Trajectory inside the muon system";
78 
79  FreeTrajectoryState result = theService->propagator(thePropagatorName)->propagate(*tsos.freeState(), beamSpot);
80 
81  LogTrace(metname) << "MuonUpdatorAtVertex::propagate, path: " << result << " parameters: " << result.parameters();
82 
83  if (result.hasError())
84  return pair<bool, FreeTrajectoryState>(true, result);
85  else
86  edm::LogInfo(metname) << "Propagation to the PCA failed!";
87  }
88  return pair<bool, FreeTrajectoryState>(false, FreeTrajectoryState());
89 }

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

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

◆ propagateToNominalLine()

std::pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::propagateToNominalLine ( const TrajectoryStateOnSurface tsos) const

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

Definition at line 141 of file MuonUpdatorAtVertex.cc.

142  {
143  const string metname = "Muon|RecoMuon|MuonUpdatorAtVertex";
144 
146  LogTrace(metname) << "Trajectory inside the Tracker";
147 
148  TSCPBuilderNoMaterial tscpBuilder;
149  TrajectoryStateClosestToPoint tscp = tscpBuilder(*(tsos.freeState()), GlobalPoint(0., 0., 0.));
150 
151  if (tscp.isValid())
152  return pair<bool, FreeTrajectoryState>(true, tscp.theState());
153  else
154  edm::LogWarning(metname) << "Propagation to the PCA using TSCPBuilderNoMaterial failed!"
155  << " This can cause a severe bug.";
156  } else {
157  LogTrace(metname) << "Trajectory inside the muon system";
158 
159  // Define a line using two 3D-points
160  GlobalPoint p1(0., 0., -1500);
161  GlobalPoint p2(0., 0., 1500);
162 
163  pair<FreeTrajectoryState, double> result =
164  theService->propagator(thePropagatorName)->propagateWithPath(*tsos.freeState(), p1, p2);
165 
166  LogTrace(metname) << "MuonUpdatorAtVertex::propagate, path: " << result.second
167  << " parameters: " << result.first.parameters();
168 
169  if (result.first.hasError())
170  return pair<bool, FreeTrajectoryState>(true, result.first);
171  else
172  edm::LogInfo(metname) << "Propagation to the PCA failed! Path: " << result.second;
173  }
174  return pair<bool, FreeTrajectoryState>(false, FreeTrajectoryState());
175 }

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

Referenced by propagate().

◆ propagateWithUpdate()

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

130  {
131  pair<bool, FreeTrajectoryState> propagationResult = propagate(tsos, beamSpot);
132 
133  if (propagationResult.first) {
134  return update(propagationResult.second, beamSpot);
135  } else {
136  edm::LogInfo("Muon|RecoMuon|MuonUpdatorAtVertex") << "Constraint at vertex failed";
137  return pair<bool, FreeTrajectoryState>(false, FreeTrajectoryState());
138  }
139 }

References pwdgSkimBPark_cfi::beamSpot, propagate(), and update().

Referenced by AlignmentMonitorTracksFromTrajectories::event().

◆ update() [1/2]

pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::update ( const FreeTrajectoryState ftsAtVtx,
const reco::BeamSpot beamSpot 
) const

◆ update() [2/2]

pair< bool, FreeTrajectoryState > MuonUpdatorAtVertex::update ( const reco::TransientTrack track,
const reco::BeamSpot beamSpot 
) const

Applies the vertex constraint.

Definition at line 91 of file MuonUpdatorAtVertex.cc.

92  {
93  const std::string metname = "Muon|RecoMuon|MuonUpdatorAtVertex";
94 
95  pair<bool, FreeTrajectoryState> result(false, FreeTrajectoryState());
96 
97  GlobalPoint spotPos(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
98 
99  SingleTrackVertexConstraint::BTFtuple constrainedTransientTrack;
100 
101  // Temporary hack here. A fix in the SingleTrackVertexConstraint code
102  // is needed. Once available try&catch will be removed
103  try {
104  constrainedTransientTrack = theConstrictor.constrain(track, spotPos, thePositionErrors);
105  } catch (cms::Exception &e) {
106  edm::LogWarning(metname) << "cms::Exception caught in MuonUpdatorAtVertex::update\n"
107  << "Exception from SingleTrackVertexConstraint\n"
108  << e.explainSelf();
109  return result;
110  }
111 
112  if (std::get<0>(constrainedTransientTrack))
113  if (std::get<2>(constrainedTransientTrack) <= theChi2Cut) {
114  result.first = true;
115  result.second = *std::get<1>(constrainedTransientTrack).impactPointState().freeState();
116  } else
117  LogTrace(metname) << "Constraint at vertex failed: too large chi2";
118  else
119  LogTrace(metname) << "Constraint at vertex failed";
120 
121  return result;
122 }

References pwdgSkimBPark_cfi::beamSpot, SingleTrackVertexConstraint::constrain(), MillePedeFileConverter_cfg::e, LogTrace, metname, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, theChi2Cut, theConstrictor, thePositionErrors, and HLT_FULL_cff::track.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), MatrixUtil.Steps::overwrite(), propagateWithUpdate(), and update().

Member Data Documentation

◆ theChi2Cut

double MuonUpdatorAtVertex::theChi2Cut
private

Definition at line 81 of file MuonUpdatorAtVertex.h.

Referenced by MuonUpdatorAtVertex(), and update().

◆ theConstrictor

SingleTrackVertexConstraint MuonUpdatorAtVertex::theConstrictor
private

Definition at line 80 of file MuonUpdatorAtVertex.h.

Referenced by update().

◆ thePositionErrors

GlobalError MuonUpdatorAtVertex::thePositionErrors
private

Definition at line 83 of file MuonUpdatorAtVertex.h.

Referenced by MuonUpdatorAtVertex(), and update().

◆ thePropagatorName

std::string MuonUpdatorAtVertex::thePropagatorName
private

Definition at line 77 of file MuonUpdatorAtVertex.h.

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

◆ theService

const MuonServiceProxy* MuonUpdatorAtVertex::theService
private

Definition at line 76 of file MuonUpdatorAtVertex.h.

Referenced by propagate(), and propagateToNominalLine().

◆ theTransientTrackFactory

TransientTrackFromFTSFactory MuonUpdatorAtVertex::theTransientTrackFactory
private

Definition at line 79 of file MuonUpdatorAtVertex.h.

Referenced by update().

MuonUpdatorAtVertex::theChi2Cut
double theChi2Cut
Definition: MuonUpdatorAtVertex.h:81
TrajectoryStateClosestToBeamLine
Definition: TrajectoryStateClosestToBeamLine.h:15
service
Definition: service.py:1
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
MuonUpdatorAtVertex::theConstrictor
SingleTrackVertexConstraint theConstrictor
Definition: MuonUpdatorAtVertex.h:80
MuonUpdatorAtVertex::propagateToNominalLine
std::pair< bool, FreeTrajectoryState > propagateToNominalLine(const TrajectoryStateOnSurface &tsos) const
Propagate the state to the 2D-PCA (nominal CMS axis)
Definition: MuonUpdatorAtVertex.cc:141
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TrackerBounds::isInside
static bool isInside(const GlobalPoint &)
Definition: TrackerBounds.cc:37
TrajectoryStateOnSurface::freeState
FreeTrajectoryState const * freeState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:58
errors
Definition: errors.py:1
SingleTrackVertexConstraint::constrain
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
Definition: SingleTrackVertexConstraint.cc:21
p2
double p2[4]
Definition: TauolaWrapper.h:90
SingleTrackVertexConstraint::BTFtuple
std::tuple< bool, reco::TransientTrack, float > BTFtuple
Definition: SingleTrackVertexConstraint.h:23
MuonUpdatorAtVertex::theService
const MuonServiceProxy * theService
Definition: MuonUpdatorAtVertex.h:76
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MuonUpdatorAtVertex::thePositionErrors
GlobalError thePositionErrors
Definition: MuonUpdatorAtVertex.h:83
MuonUpdatorAtVertex::thePropagatorName
std::string thePropagatorName
Definition: MuonUpdatorAtVertex.h:77
TransientTrackFromFTSFactory::build
reco::TransientTrack build(const FreeTrajectoryState &fts) const
Definition: TransientTrackFromFTSFactory.cc:7
p1
double p1[4]
Definition: TauolaWrapper.h:89
GlobalErrorBase< double, ErrorMatrixTag >
TrajectoryStateClosestToPoint
Definition: TrajectoryStateClosestToPoint.h:18
MuonUpdatorAtVertex::propagate
std::pair< bool, FreeTrajectoryState > propagate(const TrajectoryStateOnSurface &tsos, const reco::BeamSpot &beamSpot) const
Propagate the state to the 2D-PCA.
Definition: MuonUpdatorAtVertex.cc:61
TSCPBuilderNoMaterial
Definition: TSCPBuilderNoMaterial.h:17
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
TSCBLBuilderNoMaterial
Definition: TSCBLBuilderNoMaterial.h:13
TrajectoryStateClosestToPoint::isValid
bool isValid() const
Definition: TrajectoryStateClosestToPoint.h:111
MuonUpdatorAtVertex::update
std::pair< bool, FreeTrajectoryState > update(const reco::TransientTrack &track, const reco::BeamSpot &beamSpot) const
Applies the vertex constraint.
Definition: MuonUpdatorAtVertex.cc:91
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
TrajectoryStateClosestToBeamLine::isValid
bool isValid() const
Definition: TrajectoryStateClosestToBeamLine.h:50
TrajectoryStateClosestToBeamLine::trackStateAtPCA
FTS const & trackStateAtPCA() const
Definition: TrajectoryStateClosestToBeamLine.h:32
TrajectoryStateClosestToPoint::theState
const FreeTrajectoryState & theState() const
Definition: TrajectoryStateClosestToPoint.h:96
edm::Log
Definition: MessageLogger.h:70
MuonUpdatorAtVertex::theTransientTrackFactory
TransientTrackFromFTSFactory theTransientTrackFactory
Definition: MuonUpdatorAtVertex.h:79
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40