#include <MuonUpdatorAtVertex.h>
Public Member Functions | |
MuonUpdatorAtVertex (const edm::ParameterSet &pset, const MuonServiceProxy *service) | |
Constructor. | |
std::pair< bool, FreeTrajectoryState > | propagate (const TrajectoryStateOnSurface &tsos) const __attribute__((deprecated)) |
Propagate the state to the 2D-PCA (nominal CMS axis) - DEPRECATED -. | |
std::pair< bool, FreeTrajectoryState > | propagate (const TrajectoryStateOnSurface &tsos, const reco::BeamSpot &beamSpot) const |
Propagate the state to the 2D-PCA. | |
std::pair< bool, FreeTrajectoryState > | propagateToNominalLine (const TrajectoryStateOnSurface &tsos) const |
Propagate the state to the 2D-PCA (nominal CMS axis) | |
std::pair< bool, FreeTrajectoryState > | propagateWithUpdate (const TrajectoryStateOnSurface &tsos, const reco::BeamSpot &beamSpot) const |
Propagate to the 2D-PCA and apply the vertex constraint. | |
std::pair< bool, FreeTrajectoryState > | update (const reco::TransientTrack &track, const reco::BeamSpot &beamSpot) const |
Applies the vertex constraint. | |
std::pair< bool, FreeTrajectoryState > | update (const FreeTrajectoryState &ftsAtVtx, const reco::BeamSpot &beamSpot) const |
Applies the vertex constraint. | |
virtual | ~MuonUpdatorAtVertex () |
Destructor. | |
Private Attributes | |
double | theChi2Cut |
SingleTrackVertexConstraint | theConstrictor |
GlobalError | thePositionErrors |
std::string | thePropagatorName |
const MuonServiceProxy * | theService |
TransientTrackFromFTSFactory | theTransientTrackFactory |
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)
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.
Definition at line 41 of file MuonUpdatorAtVertex.h.
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.
:theService(service){ thePropagatorName = pset.getParameter<string>("Propagator"); // Errors on the Beam spot position vector<double> errors = pset.getParameter< vector<double> >("BeamSpotPositionErrors"); if(errors.size() != 3) edm::LogError("Muon|RecoMuon|MuonUpdatorAtVertex") <<"MuonUpdatorAtVertex::BeamSpotPositionErrors wrong number of parameters!!"; // assume: // errors[0] = sigma(x) // errors[1] = sigma(y) // errors[2] = sigma(z) AlgebraicSymMatrix33 mat; mat(0,0) = errors[0]*errors[0]; mat(1,1) = errors[1]*errors[1]; mat(2,2) = errors[2]*errors[2]; GlobalError glbErrPos(mat); thePositionErrors = glbErrPos; // cut on chi^2 theChi2Cut = pset.getParameter<double>("MaxChi2"); }
MuonUpdatorAtVertex::~MuonUpdatorAtVertex | ( | ) | [virtual] |
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().
{ const string metname = "Muon|RecoMuon|MuonUpdatorAtVertex"; if(TrackerBounds::isInside(tsos.globalPosition())){ LogTrace(metname) << "Trajectory inside the Tracker"; TSCBLBuilderNoMaterial tscblBuilder; TrajectoryStateClosestToBeamLine tscbl = tscblBuilder(*(tsos.freeState()), beamSpot); if(tscbl.isValid()) return pair<bool,FreeTrajectoryState>(true,tscbl.trackStateAtPCA()); else edm::LogWarning(metname) << "Propagation to the PCA using TSCPBuilderNoMaterial failed!" << " This can cause a severe bug."; } else{ LogTrace(metname) << "Trajectory inside the muon system"; FreeTrajectoryState result = theService->propagator(thePropagatorName)->propagate(*tsos.freeState(),beamSpot); LogTrace(metname) << "MuonUpdatorAtVertex::propagate, path: " << result << " parameters: " << result.parameters(); if(result.hasError()) return pair<bool,FreeTrajectoryState>(true,result); else edm::LogInfo(metname) << "Propagation to the PCA failed!"; } return pair<bool,FreeTrajectoryState>(false,FreeTrajectoryState()); }
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().
{ return propagateToNominalLine(tsos); }
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().
{ const string metname = "Muon|RecoMuon|MuonUpdatorAtVertex"; if(TrackerBounds::isInside(tsos.globalPosition())){ LogTrace(metname) << "Trajectory inside the Tracker"; TSCPBuilderNoMaterial tscpBuilder; TrajectoryStateClosestToPoint tscp = tscpBuilder(*(tsos.freeState()), GlobalPoint(0.,0.,0.)); if(tscp.isValid()) return pair<bool,FreeTrajectoryState>(true,tscp.theState()); else edm::LogWarning(metname) << "Propagation to the PCA using TSCPBuilderNoMaterial failed!" << " This can cause a severe bug."; } else{ LogTrace(metname) << "Trajectory inside the muon system"; // Define a line using two 3D-points GlobalPoint p1(0.,0.,-1500); GlobalPoint p2(0.,0.,1500); pair<FreeTrajectoryState,double> result = theService->propagator(thePropagatorName)->propagateWithPath(*tsos.freeState(),p1,p2); LogTrace(metname) << "MuonUpdatorAtVertex::propagate, path: " << result.second << " parameters: " << result.first.parameters(); if(result.first.hasError()) return pair<bool,FreeTrajectoryState>(true,result.first); else edm::LogInfo(metname) << "Propagation to the PCA failed! Path: "<<result.second; } return pair<bool,FreeTrajectoryState>(false,FreeTrajectoryState()); }
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().
{ pair<bool,FreeTrajectoryState> propagationResult = propagate(tsos,beamSpot); if(propagationResult.first){ return update(propagationResult.second, beamSpot); } else{ edm::LogInfo("Muon|RecoMuon|MuonUpdatorAtVertex") << "Constraint at vertex failed"; return pair<bool,FreeTrajectoryState>(false,FreeTrajectoryState()); } }
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().
{ return update(theTransientTrackFactory.build(ftsAtVtx),beamSpot); }
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 MuonTrackLoader::buildTrackUpdatedAtPCA(), propagateWithUpdate(), and update().
{ const std::string metname = "Muon|RecoMuon|MuonUpdatorAtVertex"; pair<bool,FreeTrajectoryState> result(false,FreeTrajectoryState()); GlobalPoint spotPos(beamSpot.x0(),beamSpot.y0(),beamSpot.z0()); SingleTrackVertexConstraint::BTFtuple constrainedTransientTrack; // Temporary hack here. A fix in the SingleTrackVertexConstraint code // is needed. Once available try&catch will be removed try{ constrainedTransientTrack = theConstrictor.constrain(track, spotPos, thePositionErrors); } catch(cms::Exception& e) { edm::LogWarning(metname) << "cms::Exception caught in MuonUpdatorAtVertex::update\n" << "Exception from SingleTrackVertexConstraint\n" << e.explainSelf(); return result; } if(constrainedTransientTrack.get<0>()) if(constrainedTransientTrack.get<2>() <= theChi2Cut) { result.first = true; result.second = *constrainedTransientTrack.get<1>().impactPointState().freeState(); } else LogTrace(metname) << "Constraint at vertex failed: too large chi2"; else LogTrace(metname) << "Constraint at vertex failed"; return result; }
double MuonUpdatorAtVertex::theChi2Cut [private] |
Definition at line 87 of file MuonUpdatorAtVertex.h.
Referenced by MuonUpdatorAtVertex(), and update().
Definition at line 86 of file MuonUpdatorAtVertex.h.
Referenced by update().
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().
Definition at line 85 of file MuonUpdatorAtVertex.h.
Referenced by update().