32 std::auto_ptr<TrackingRecHitCollection>& selHits,
33 std::auto_ptr<reco::GsfTrackCollection>& selTracks,
34 std::auto_ptr<reco::TrackExtraCollection>& selTrackExtras,
35 std::auto_ptr<reco::GsfTrackExtraCollection>& selGsfTrackExtras,
36 std::auto_ptr<std::vector<Trajectory> >& selTrajectories,
51 std::map<unsigned int, unsigned int> tjTkMap;
55 for(AlgoProductCollection::iterator
i=algoResults.begin();
i!=algoResults.end();
i++){
58 selTrajectories->push_back(*theTraj);
65 LogDebug(
"TrackProducer") <<
"In GsfTrackProducerBase::putInEvt - seedDir=" << seedDir;
68 selTracks->push_back( t );
77 unsigned int innerId, outerId;
116 selTrackExtras->push_back(
reco::TrackExtra (outpos, outmom,
true, inpos, inmom,
true,
127 auto ih = selHits->size();
130 auto ie = selHits->size();
131 unsigned int nHitsAdded = 0;
133 auto const &
hit = (*selHits)[ih];
137 tx.
setHits(rHits, hidx, nHitsAdded);
168 std::vector<reco::GsfTangent> tangents;
170 if ( measurements.size()>2 ) {
171 tangents.reserve(measurements.size()-2);
172 Trajectory::DataContainer::const_iterator ibegin,iend;
175 ibegin = measurements.begin() + 1;
176 iend = measurements.end() - 1;
180 ibegin = measurements.end() - 2;
181 iend = measurements.begin();
188 for ( Trajectory::DataContainer::const_iterator
i=ibegin;
189 i!=iend;
i+=increment ) {
190 if (
i->recHit().get() ) {
191 DetId detId(
i->recHit()->geographicalId());
209 std::vector<reco::GsfComponent5D> outerStates;
210 outerStates.reserve(outertsos.
components().size());
212 std::vector<reco::GsfComponent5D> innerStates;
213 innerStates.reserve(innertsos.
components().size());
226 fillMode(track,innertsos,gsfProp,tipExtrapolator,tscblBuilder,bs);
233 LogTrace(
"TrackingRegressionTest") <<
"========== TrackProducer Info ===================";
234 LogTrace(
"TrackingRegressionTest") <<
"number of finalGsfTracks: " << selTracks->size();
235 for (reco::GsfTrackCollection::const_iterator it = selTracks->begin(); it != selTracks->end(); it++) {
236 LogTrace(
"TrackingRegressionTest") <<
"track's n valid and invalid hit, chi2, pt : "
237 << it->found() <<
" , "
238 << it->lost() <<
" , "
239 << it->normalizedChi2() <<
" , "
243 LogTrace(
"TrackingRegressionTest") <<
"=================================================";
247 evt.
put( selTrackExtras );
248 evt.
put( selGsfTrackExtras );
256 for ( std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
257 i != tjTkMap.end();
i++ ) {
260 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory> >( rTrajs, (*i).first ),
263 evt.
put( trajTrackMap );
269 std::vector<reco::GsfComponent5D>& states)
const
274 for ( std::vector<TrajectoryStateOnSurface>::const_iterator
i=
components.begin();
294 if ( !vtxTsos.isValid() ) vtxTsos = innertsos;
297 if ( !vtxTsos.isValid() )
return;
303 for (
unsigned int iv=0; iv<5; ++iv ) {
306 modeParameters(iv) = utils.
mode().
mean();
310 modeParameters(iv) = utils.
mean();
311 modeCovariance(iv,iv) = utils.
variance();
317 for (
unsigned int iv1=0; iv1<5; ++iv1 ) {
318 for (
unsigned int iv2=0; iv2<iv1; ++iv2 ) {
319 double cov12 = meanCovariance(iv1,iv2) *
320 sqrt(modeCovariance(iv1,iv1)/meanCovariance(iv1,iv1)*
321 modeCovariance(iv2,iv2)/meanCovariance(iv2,iv2));
322 modeCovariance(iv1,iv2) = modeCovariance(iv2,iv1) = cov12;
326 vtxTsos.localParameters().pzSign()),
329 vtxTsos.magneticField(),
330 vtxTsos.surfaceSide());
332 if ( !tscbl.isValid() )
return;
343 cov(iv1,iv2) = tscblCov(iv1,iv2);
371 double VarQpRatio =
sqrt(varQp/covariance(0,0));
373 covariance(0,0) = varQp;
374 for (
int i=1;
i<5; ++
i ) covariance(
i,0) *= VarQpRatio;
402 bool result = mts.momentumFromModeCartesian(upState,mom);
421 if ( tm.
recHit()->isValid() ) {
422 hitPos = tm.
recHit()->localPosition();
423 hitErr = tm.
recHit()->localPositionError();
426 deltaP = collinearFit.
deltaP();
math::Error< dimension >::type CovarianceMatrix
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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
edm::RefToBase< TrajectorySeed > seedRef(void) const
std::vector< AlgoProduct > AlgoProductCollection
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
virtual void putInEvt(edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::auto_ptr< TrackingRecHitCollection > &, std::auto_ptr< reco::GsfTrackCollection > &, std::auto_ptr< reco::TrackExtraCollection > &, std::auto_ptr< reco::GsfTrackExtraCollection > &, std::auto_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, TransientTrackingRecHitBuilder const *, const reco::BeamSpot &, const TrackerTopology *ttopo)
Put produced collections in the event.
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
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
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
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_
std::vector< TrajectoryStateOnSurface > components() const
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