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();
float pzSign() const
Sign of the z-component of the momentum in the local frame.
math::Error< dimension >::type CovarianceMatrix
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
math::Error< dimensionMode >::type CovarianceMatrixMode
3 parameter covariance matrix (momentum part) from mode
const CurvilinearTrajectoryError & curvilinearError() const
const LocalTrajectoryError & localError() const
GlobalPoint position() const
void localParametersFromQpMode(const TrajectoryStateOnSurface tsos, AlgebraicVector5 ¶meters, AlgebraicSymMatrix55 &covariance) const
local parameters rescaled with q/p from mode
static constexpr auto TID
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
const GlobalTrajectoryParameters & globalParameters() const
void setSecondHitPattern(Trajectory *traj, reco::GsfTrack &track, const Propagator *prop, const MeasurementTrackerEvent *measTk, const TrackerTopology *ttopo)
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
edm::RefToBase< TrajectorySeed > seedRef(void) const
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
const LocalTrajectoryParameters & localParameters() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const SurfaceType & surface() const
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
TrajectoryMeasurement const & lastMeasurement() const
void fillMode(reco::GsfTrack &track, const TrajectoryStateOnSurface innertsos, const Propagator &gsfProp, const TransverseImpactPointExtrapolator &tipExtrapolator, TrajectoryStateClosestToBeamLineBuilder &tscblBuilder, const reco::BeamSpot &bs) const
DataContainer const & measurements() const
GlobalVector momentum() const
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::GsfTrackCollection, unsigned short > > TrajGsfTrackAssociationCollection
std::vector< TrajectoryMeasurement > DataContainer
GlobalPoint globalPosition() const
PropagationDirection const & direction() const
TrackCharge charge() const
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
AlgebraicVector5 vector() const
GlobalVector momentum() const
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
ROOT::Math::SVector< double, 5 > AlgebraicVector5
bool modeIsValid() const
mode status
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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.
static constexpr auto TOB
const SingleGaussianState1D & mode() const
double mean() const
parameter vector
RefProd< PROD > getRefBeforePut()
edm::Ref< GsfTrackExtraCollection > GsfTrackExtraRef
persistent reference to a GsfTrackExtra
edm::EDGetTokenT< MeasurementTrackerEvent > mteSrc_
Detector identifier class for the strip tracker.
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) ...
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
const CurvilinearTrajectoryError & curvilinearError() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
std::vector< AlgoProduct > AlgoProductCollection
XYZPointD XYZPoint
point in space with cartesian internal representation
const AlgebraicSymMatrix55 & matrix() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Measurement1D deltaP() const
estimated deltaP (out-in) from fit parameters
void fillStates(TrajectoryStateOnSurface tsos, std::vector< reco::GsfComponent5D > &states) const
static constexpr auto TIB
TrajectoryStateOnSurface const & updatedState() const
TrajectoryMeasurement const & firstMeasurement() const
static int position[264][3]
const AlgebraicSymMatrix55 & matrix() const
edm::ESHandle< NavigationSchool > theSchool
const MagneticField * magneticField() const
double variance() const
variance
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
edm::OrphanHandle< TrackCollection > rTracks_
math::XYZVector Vector
spatial vector
static constexpr auto TEC
ConstRecHitPointer const & recHit() const
math::Vector< dimension >::type ParameterVector