24 produces<TrackingRecHitCollection>();
25 produces<reco::TrackExtraCollection>();
50 multiply(revised_matrix, error_matrix);
52 return revised_matrix;
60 for (
int i = 0;
i != 5;
i++) {
61 for (
int j =
i;
j != 5;
j++) {
62 revised_matrix(
i,
j) *= scale_matrix(
i,
j);
71 for (
int i = 0;
i != 5;
i++) {
72 for (
int j =
i;
j != 5;
j++) {
73 if (denom_matrix(
i,
j) == 0)
75 num_matrix(
i,
j) /= denom_matrix(
i,
j);
93 <<
"\n charge: " <<
charge <<
"\n covariance:\n" 94 << recotrack_orig.
covariance() <<
"\n replaced by:\n" 111 if (trackExtra_orig.
isNull()) {
126 trackExtra_orig->outerMomentum(),
128 trackExtra_orig->innerPosition(),
129 trackExtra_orig->innerMomentum(),
132 trackExtra_orig->outerDetId(),
134 trackExtra_orig->innerDetId(),
135 trackExtra_orig->seedDirection()));
141 return &(TEcol.back());
151 auto const firstHitIndex =
theRHi;
189 auto Toutput = std::make_unique<reco::TrackCollection>();
190 auto TRHoutput = std::make_unique<TrackingRecHitCollection>();
191 auto TEoutput = std::make_unique<reco::TrackExtraCollection>();
197 for (
unsigned int it = 0; it !=
tracks->size(); it++) {
212 Toutput->push_back(recotrack);
225 if (!
attachRecHits(recotrack_orig, recotrackref, *extra, *TRHoutput, ttopo)) {
230 TEoutput->pop_back();
237 LogDebug(
theCategory) <<
"writing: " << Toutput->size() <<
" corrected reco::Track to the event.";
void produce(edm::Event &, const edm::EventSetup &) override
T getParameter(std::string const &) const
void beginJob() override
framework method
edm::RefProd< reco::TrackExtraCollection > theRefprodTE
get reference before put track extra to the event, in order to create edm::Ref
reco::TrackBase::CovarianceMatrix fix_cov_matrix(const reco::TrackBase::CovarianceMatrix &error_matrix, const GlobalVector &momentum)
return a corrected error matrix
CurvilinearTrajectoryError get(GlobalVector momentum, bool convolute=true)
main method to be used. Retrieve a 5x5 symetrical matrix according to parametrization of error or sca...
const Point & referencePoint() const
Reference point on the track.
std::string theInstanceName
instrance name of the created track collecion. rechit and trackextra have no instance name ...
Log< level::Error, false > LogError
edm::InputTag theTrackLabel
input tag of the reco::Track collection to be corrected
bool attachRecHits(const reco::Track &recotrack_orig, reco::Track &recotrack, reco::TrackExtra &trackextra, TrackingRecHitCollection &RHcol, const TrackerTopology &ttopo)
attached rechits to the newly created reco::Track and reco::TrackExtra
std::string theCategory
log category: MuonErrorMatrixAdjuster
void multiply(reco::TrackBase::CovarianceMatrix &revised_matrix, const reco::TrackBase::CovarianceMatrix &scale_matrix)
mutliply revised_matrix (first argument) by second matrix TERM by TERM
edm::ESHandle< MagneticField > theField
hold on to the magnetic field
MuonErrorMatrixAdjuster(const edm::ParameterSet &)
constructor
GlobalPoint position() const
double ndof() const
number of degrees of freedom of the fit
int charge() const
track electric charge
MuonErrorMatrix * theMatrixProvider
T const * product() const
CovarianceMatrix covariance() const
return track covariance matrix
bool divide(reco::TrackBase::CovarianceMatrix &num_matrix, const reco::TrackBase::CovarianceMatrix &denom_matrix)
divide the num_matrix (first argument) by second matrix, TERM by TERM
~MuonErrorMatrixAdjuster() override
destructor
GlobalVector momentum() const
edm::Ref< reco::TrackExtraCollection >::key_type theTEi
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
edm::RefProd< TrackingRecHitCollection > theRefprodRH
get reference before put rechit to the event, in order to create edm::Ref
bool isNull() const
Checks for null.
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
edm::ParameterSet theMatrixProvider_pset
holds the error matrix parametrization
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
void setExtra(const TrackExtraRef &ref)
set reference to "extra" object
auto const & tracks
cannot be loose
reco::TrackExtra * makeTrackExtra(const reco::Track &recotrack_orig, reco::Track &recotrack, reco::TrackExtraCollection &TEcol)
create a track extra for the newly created recotrack, scaling the outer/inner measurment error matrix...
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
double chi2() const
chi-squared of the fit
bool selectTrack(const reco::Track &recotrack_orig)
make a selection on the reco:Track. (dummy for the moment)
bool appendHitPattern(const TrackingRecHit &hit, const TrackerTopology &ttopo)
append a single hit to the HitPattern
reco::Track makeTrack(const reco::Track &recotrack_orig, const FreeTrajectoryState &PCAstate)
create a corrected reco::Track from itself and trajectory state (redundant information) ...
const Vector & momentum() const
track momentum vector
bool theRescale
select the rescaling or replacing method to correct the error matrix
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
const TrackExtraRef & extra() const
reference to "extra" object
edm::Ref< TrackingRecHitCollection >::key_type theRHi