34 std::unique_ptr<TrackingRecHitCollection>& selHits,
35 std::unique_ptr<reco::GsfTrackCollection>& selTracks,
36 std::unique_ptr<reco::TrackExtraCollection>& selTrackExtras,
37 std::unique_ptr<reco::GsfTrackExtraCollection>& selGsfTrackExtras,
38 std::unique_ptr<std::vector<Trajectory> >& selTrajectories,
53 std::map<unsigned int, unsigned int> tjTkMap;
57 for(
auto &
i : algoResults){
60 selTrajectories->push_back(*theTraj);
67 LogDebug(
"TrackProducer") <<
"In GsfTrackProducerBase::putInEvt - seedDir=" << seedDir;
70 selTracks->push_back( t );
79 unsigned int innerId, outerId;
118 selTrackExtras->push_back(
reco::TrackExtra (outpos, outmom,
true, inpos, inmom,
true,
131 auto ih = selHits->size();
132 t2t(*theTraj,*selHits,trajParams,chi2s);
133 auto ie = selHits->size();
137 auto const &
hit = (*selHits)[ih];
143 std::vector<reco::GsfTangent> tangents;
145 if ( measurements.size()>2 ) {
146 tangents.reserve(measurements.size()-2);
147 Trajectory::DataContainer::const_iterator ibegin,iend;
150 ibegin = measurements.begin() + 1;
151 iend = measurements.end() - 1;
155 ibegin = measurements.end() - 2;
156 iend = measurements.begin();
163 for ( Trajectory::DataContainer::const_iterator
i=ibegin;
164 i!=iend;
i+=increment ) {
165 if (
i->recHit().get() ) {
166 DetId detId(
i->recHit()->geographicalId());
184 std::vector<reco::GsfComponent5D> outerStates;
186 std::vector<reco::GsfComponent5D> innerStates;
199 fillMode(track,innertsos,gsfProp,tipExtrapolator,tscblBuilder,bs);
206 LogTrace(
"TrackingRegressionTest") <<
"========== TrackProducer Info ===================";
207 LogTrace(
"TrackingRegressionTest") <<
"number of finalGsfTracks: " << selTracks->size();
208 for (reco::GsfTrackCollection::const_iterator it = selTracks->begin(); it != selTracks->end(); it++) {
209 LogTrace(
"TrackingRegressionTest") <<
"track's n valid and invalid hit, chi2, pt : "
210 << it->found() <<
" , "
211 << it->lost() <<
" , "
212 << it->normalizedChi2() <<
" , "
216 LogTrace(
"TrackingRegressionTest") <<
"=================================================";
229 for ( std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
230 i != tjTkMap.end();
i++ ) {
233 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory> >( rTrajs, (*i).first ),
242 std::vector<reco::GsfComponent5D>& states)
const
250 states.emplace_back(st.weight(),st.localParameters().vector(),st.localError().matrix());
267 if ( !vtxTsos.isValid() ) vtxTsos = innertsos;
270 if ( !vtxTsos.isValid() )
return;
276 for (
unsigned int iv=0; iv<5; ++iv ) {
279 modeParameters(iv) = utils.
mode().
mean();
283 modeParameters(iv) = utils.
mean();
284 modeCovariance(iv,iv) = utils.
variance();
290 for (
unsigned int iv1=0; iv1<5; ++iv1 ) {
291 for (
unsigned int iv2=0; iv2<iv1; ++iv2 ) {
292 double cov12 = meanCovariance(iv1,iv2) *
293 sqrt(modeCovariance(iv1,iv1)/meanCovariance(iv1,iv1)*
294 modeCovariance(iv2,iv2)/meanCovariance(iv2,iv2));
295 modeCovariance(iv1,iv2) = modeCovariance(iv2,iv1) = cov12;
299 vtxTsos.localParameters().pzSign()),
302 vtxTsos.magneticField(),
303 vtxTsos.surfaceSide());
305 if ( !tscbl.isValid() )
return;
316 cov(iv1,iv2) = tscblCov(iv1,iv2);
344 double VarQpRatio =
sqrt(varQp/covariance(0,0));
346 covariance(0,0) = varQp;
347 for (
int i=1;
i<5; ++
i ) covariance(
i,0) *= VarQpRatio;
375 bool result = mts.momentumFromModeCartesian(upState,mom);
394 if ( tm.
recHit()->isValid() ) {
395 hitPos = tm.
recHit()->localPosition();
396 hitErr = tm.
recHit()->localPositionError();
399 deltaP = collinearFit.
deltaP();
math::Error< dimension >::type CovarianceMatrix
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
ConstRecHitPointer const & recHit() const
const LocalTrajectoryParameters & localParameters() const
void setGsfExtra(const GsfTrackExtraRef &ref)
set reference to GSF "extra" object
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const CurvilinearTrajectoryError & curvilinearError() 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
GlobalPoint globalPosition() const
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
TrackCharge charge() const
void fillMode(reco::GsfTrack &track, const TrajectoryStateOnSurface innertsos, const Propagator &gsfProp, const TransverseImpactPointExtrapolator &tipExtrapolator, TrajectoryStateClosestToBeamLineBuilder &tscblBuilder, const reco::BeamSpot &bs) const
const MagneticField * magneticField() const
const CurvilinearTrajectoryError & curvilinearError() const
void fillStates(TrajectoryStateOnSurface tsos, std::vector< reco::GsfComponent5D > &states) const
PropagationDirection const & direction() const
double dydz() const
dydz slope
DataContainer const & measurements() const
AlgebraicVector5 vector() const
void setMode(int chargeMode, const Vector &momentumMode, const CovarianceMatrixMode &covarianceMode)
set mode parameters
const SurfaceType & surface() const
std::vector< TrajectoryMeasurement > DataContainer
double mean() const
parameter vector
Measurement1D deltaP() const
estimated deltaP (out-in) from fit parameters
TrajectoryMeasurement const & lastMeasurement() const
GlobalVector momentum() const
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
double variance() const
variance
const SingleGaussianState1D & mode() const
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
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.
edm::RefToBase< TrajectorySeed > seedRef(void) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void localParametersFromQpMode(const TrajectoryStateOnSurface tsos, AlgebraicVector5 ¶meters, AlgebraicSymMatrix55 &covariance) const
local parameters rescaled with q/p from mode
GlobalVector momentum() const
double dxdz() const
dxdz slope
RefProd< PROD > getRefBeforePut()
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
GlobalPoint position() const
edm::Ref< GsfTrackExtraCollection > GsfTrackExtraRef
persistent reference to a GsfTrackExtra
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::GsfTrackCollection, unsigned short > > TrajGsfTrackAssociationCollection
edm::EDGetTokenT< MeasurementTrackerEvent > mteSrc_
Detector identifier class for the strip tracker.
double vz() const
z coordinate of the reference point on track
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
void setExtra(const TrackExtraRef &ref)
set reference to "extra" object
TrajectoryMeasurement const & firstMeasurement() const
ROOT::Math::SVector< double, 5 > AlgebraicVector5
const GlobalTrajectoryParameters & globalParameters() const
double mean(unsigned int i) const
mean value of a component
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
bool appendHitPattern(const TrackingRecHit &hit, const TrackerTopology &ttopo)
append a single hit to the HitPattern
double variance(unsigned int i) const
variance of a component
std::vector< AlgoProduct > AlgoProductCollection
const AlgebraicSymMatrix55 & matrix() const
static int position[264][3]
edm::ESHandle< NavigationSchool > theSchool
const Point & position() const
position
TrajectoryStateOnSurface const & updatedState() const
float pzSign() const
Sign of the z-component of the momentum in the local frame.
edm::OrphanHandle< TrackCollection > rTracks_
math::XYZVector Vector
spatial vector
tuple AnalyticalPropagator
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
bool modeIsValid() const
mode status
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
math::Vector< dimension >::type ParameterVector