|
|
Go to the documentation of this file.
33 std::unique_ptr<TrackingRecHitCollection>& selHits,
34 std::unique_ptr<reco::GsfTrackCollection>& selTracks,
35 std::unique_ptr<reco::TrackExtraCollection>& selTrackExtras,
36 std::unique_ptr<reco::GsfTrackExtraCollection>& selGsfTrackExtras,
51 std::map<unsigned int, unsigned int> tjTkMap;
55 for (
auto&
i : algoResults) {
58 selTrajectories->push_back(*theTraj);
65 LogDebug(
"TrackProducer") <<
"In GsfTrackProducerBase::putInEvt - seedDir=" << seedDir;
68 selTracks->push_back(
t);
73 tjTkMap[iTjRef - 1] = iTkRef - 1;
78 unsigned int innerId, outerId;
105 track.setExtra(teref);
136 auto ih = selHits->size();
137 t2t(*theTraj, *selHits, trajParams, chi2s);
138 auto ie = selHits->size();
139 tx.
setHits(rHits, ih, ie - ih);
141 for (; ih < ie; ++ih) {
142 auto const&
hit = (*selHits)[ih];
143 track.appendHitPattern(
hit, *ttopo);
148 std::vector<reco::GsfTangent> tangents;
150 if (measurements.size() > 2) {
151 tangents.reserve(measurements.size() - 2);
152 Trajectory::DataContainer::const_iterator ibegin, iend;
155 ibegin = measurements.begin() + 1;
156 iend = measurements.end() - 1;
159 ibegin = measurements.end() - 2;
160 iend = measurements.begin();
167 for (Trajectory::DataContainer::const_iterator
i = ibegin;
i != iend;
i += increment) {
168 if (
i->recHit().get()) {
169 DetId detId(
i->recHit()->geographicalId());
187 std::vector<reco::GsfComponent5D> outerStates;
189 std::vector<reco::GsfComponent5D> innerStates;
193 track.setGsfExtra(terefGsf);
200 fillMode(
track, innertsos, gsfProp, tipExtrapolator, tscblBuilder,
bs);
207 LogTrace(
"TrackingRegressionTest") <<
"========== TrackProducer Info ===================";
208 LogTrace(
"TrackingRegressionTest") <<
"number of finalGsfTracks: " << selTracks->size();
209 for (reco::GsfTrackCollection::const_iterator it = selTracks->begin(); it != selTracks->end(); it++) {
210 LogTrace(
"TrackingRegressionTest") <<
"track's n valid and invalid hit, chi2, pt : " << it->found() <<
" , "
211 << it->lost() <<
" , " << it->normalizedChi2() <<
" , " << it->pt() <<
" , "
214 LogTrace(
"TrackingRegressionTest") <<
"=================================================";
225 std::unique_ptr<TrajGsfTrackAssociationCollection> trajTrackMap(
227 for (std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
i != tjTkMap.end();
i++) {
230 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory> >(rTrajs, (*i).first),
244 states.emplace_back(st.weight(), st.localParameters().vector(), st.localError().matrix());
257 bs.position().y() + (
track.vz() -
bs.position().z()) *
bs.dydz(),
260 if (!vtxTsos.isValid())
264 if (!vtxTsos.isValid())
271 for (
unsigned int iv = 0;
iv < 5; ++
iv) {
274 modeParameters(
iv) =
utils.mode().mean();
275 modeCovariance(
iv,
iv) =
utils.mode().variance();
276 if (!
utils.modeIsValid()) {
278 modeParameters(
iv) =
utils.mean();
279 modeCovariance(
iv,
iv) =
utils.variance();
285 for (
unsigned int iv1 = 0; iv1 < 5; ++iv1) {
286 for (
unsigned int iv2 = 0; iv2 < iv1; ++iv2) {
287 double cov12 = meanCovariance(iv1, iv2) *
sqrt(modeCovariance(iv1, iv1) / meanCovariance(iv1, iv1) *
288 modeCovariance(iv2, iv2) / meanCovariance(iv2, iv2));
289 modeCovariance(iv1, iv2) = modeCovariance(iv2, iv1) = cov12;
295 vtxTsos.magneticField(),
296 vtxTsos.surfaceSide());
298 if (!tscbl.isValid())
310 cov(iv1, iv2) = tscblCov(iv1, iv2);
337 double VarQpRatio =
sqrt(varQp / covariance(0, 0));
339 covariance(0, 0) = varQp;
340 for (
int i = 1;
i < 5; ++
i)
341 covariance(
i, 0) *= VarQpRatio;
384 if (tm.
recHit()->isValid()) {
385 hitPos = tm.
recHit()->localPosition();
386 hitErr = tm.
recHit()->localPositionError();
388 CollinearFitAtTM2 collinearFit(fwdPars, fwdCov, bwdPars, bwdCov, hitPos, hitErr);
389 deltaP = collinearFit.
deltaP();
Measurement1D deltaP() const
estimated deltaP (out-in) from fit parameters
GlobalVector momentum() const
RefProd< PROD > getRefBeforePut()
const SingleGaussianState1D & mode() const
edm::OrphanHandle< TrackCollection > rTracks_
void fillMode(reco::GsfTrack &track, const TrajectoryStateOnSurface innertsos, const Propagator &gsfProp, const TransverseImpactPointExtrapolator &tipExtrapolator, TrajectoryStateClosestToBeamLineBuilder &tscblBuilder, const reco::BeamSpot &bs) const
edm::RefToBase< TrajectorySeed > seedRef(void) const
GlobalPoint position() const
PropagationDirection const & direction() const
GlobalPoint globalPosition() const
TrackCharge charge() const
math::Error< dimensionMode >::type CovarianceMatrixMode
3 parameter covariance matrix (momentum part) from mode
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
TrajectoryStateOnSurface const & updatedState() const
const AlgebraicSymMatrix55 & matrix() const
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
void setSecondHitPattern(Trajectory *traj, reco::GsfTrack &track, const Propagator *prop, const MeasurementTrackerEvent *measTk, const TrackerTopology *ttopo)
std::vector< AlgoProduct > AlgoProductCollection
double mean() const
parameter vector
void localParametersFromQpMode(const TrajectoryStateOnSurface tsos, AlgebraicVector5 ¶meters, AlgebraicSymMatrix55 &covariance) const
local parameters rescaled with q/p from mode
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
double variance() const
variance
std::vector< TrajectoryMeasurement > DataContainer
const CurvilinearTrajectoryError & curvilinearError() const
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
math::Vector< dimension >::type ParameterVector
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::GsfTrackCollection, unsigned short > > TrajGsfTrackAssociationCollection
AlgebraicVector5 vector() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static constexpr auto TEC
GlobalVector momentum() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
const LocalTrajectoryParameters & localParameters() const
float pzSign() const
Sign of the z-component of the momentum in the local frame.
XYZPointD XYZPoint
point in space with cartesian internal representation
virtual void putInEvt(edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::unique_ptr< TrackingRecHitCollection > &, std::unique_ptr< reco::GsfTrackCollection > &, std::unique_ptr< reco::TrackExtraCollection > &, std::unique_ptr< reco::GsfTrackExtraCollection > &, std::unique_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, TransientTrackingRecHitBuilder const *, const reco::BeamSpot &, const TrackerTopology *ttopo)
Put produced collections in the event.
math::Error< dimension >::type CovarianceMatrix
TrajectoryMeasurement const & lastMeasurement() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
static int position[264][3]
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
static constexpr auto TOB
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
ROOT::Math::SVector< double, 5 > AlgebraicVector5
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
DataContainer const & measurements() const
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
ConstRecHitPointer const & recHit() const
static constexpr auto TID
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
TrajectoryMeasurement const & firstMeasurement() const
bool computeModeAtTM(const TrajectoryMeasurement &tm, reco::GsfTrackExtra::Point &position, reco::GsfTrackExtra::Vector &momentum, Measurement1D &deltaP) const
position, momentum and estimated deltaP at an intermediate measurement (true if successful)
edm::EDGetTokenT< MeasurementTrackerEvent > mteSrc_
const CurvilinearTrajectoryError & curvilinearError() const
static constexpr auto TIB
const SurfaceType & surface() const
edm::Ref< GsfTrackExtraCollection > GsfTrackExtraRef
persistent reference to a GsfTrackExtra
const GlobalTrajectoryParameters & globalParameters() const
Detector identifier class for the strip tracker.
void fillStates(TrajectoryStateOnSurface tsos, std::vector< reco::GsfComponent5D > &states) const
const LocalTrajectoryError & localError() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const MagneticField * magneticField() const
const AlgebraicSymMatrix55 & matrix() const
bool modeIsValid() const
mode status
math::XYZVector Vector
spatial vector
edm::ESHandle< NavigationSchool > theSchool