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();
133 auto const &
hit = (*selHits)[ih];
167 std::vector<reco::GsfTangent> tangents;
169 if ( measurements.size()>2 ) {
170 tangents.reserve(measurements.size()-2);
171 Trajectory::DataContainer::const_iterator ibegin,iend;
174 ibegin = measurements.begin() + 1;
175 iend = measurements.end() - 1;
179 ibegin = measurements.end() - 2;
180 iend = measurements.begin();
187 for ( Trajectory::DataContainer::const_iterator
i=ibegin;
188 i!=iend;
i+=increment ) {
189 if (
i->recHit().get() ) {
190 DetId detId(
i->recHit()->geographicalId());
208 std::vector<reco::GsfComponent5D> outerStates;
209 outerStates.reserve(outertsos.
components().size());
211 std::vector<reco::GsfComponent5D> innerStates;
212 innerStates.reserve(innertsos.
components().size());
225 fillMode(track,innertsos,gsfProp,tipExtrapolator,tscblBuilder,bs);
232 LogTrace(
"TrackingRegressionTest") <<
"========== TrackProducer Info ===================";
233 LogTrace(
"TrackingRegressionTest") <<
"number of finalGsfTracks: " << selTracks->size();
234 for (reco::GsfTrackCollection::const_iterator it = selTracks->begin(); it != selTracks->end(); it++) {
235 LogTrace(
"TrackingRegressionTest") <<
"track's n valid and invalid hit, chi2, pt : "
236 << it->found() <<
" , "
237 << it->lost() <<
" , "
238 << it->normalizedChi2() <<
" , "
242 LogTrace(
"TrackingRegressionTest") <<
"=================================================";
246 evt.
put( selTrackExtras );
247 evt.
put( selGsfTrackExtras );
255 for ( std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
256 i != tjTkMap.end();
i++ ) {
259 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory> >( rTrajs, (*i).first ),
262 evt.
put( trajTrackMap );
268 std::vector<reco::GsfComponent5D>&
states)
const
273 for ( std::vector<TrajectoryStateOnSurface>::const_iterator
i=
components.begin();
293 if ( !vtxTsos.isValid() ) vtxTsos = innertsos;
296 if ( !vtxTsos.isValid() )
return;
302 for (
unsigned int iv=0; iv<5; ++iv ) {
305 modeParameters(iv) = utils.
mode().
mean();
309 modeParameters(iv) = utils.
mean();
310 modeCovariance(iv,iv) = utils.
variance();
316 for (
unsigned int iv1=0; iv1<5; ++iv1 ) {
317 for (
unsigned int iv2=0; iv2<iv1; ++iv2 ) {
318 double cov12 = meanCovariance(iv1,iv2) *
319 sqrt(modeCovariance(iv1,iv1)/meanCovariance(iv1,iv1)*
320 modeCovariance(iv2,iv2)/meanCovariance(iv2,iv2));
321 modeCovariance(iv1,iv2) = modeCovariance(iv2,iv1) = cov12;
325 vtxTsos.localParameters().pzSign()),
328 vtxTsos.magneticField(),
329 vtxTsos.surfaceSide());
331 if ( !tscbl.isValid() )
return;
342 cov(iv1,iv2) = tscblCov(iv1,iv2);
370 double VarQpRatio =
sqrt(varQp/covariance(0,0));
372 covariance(0,0) = varQp;
373 for (
int i=1;
i<5; ++
i ) covariance(
i,0) *= VarQpRatio;
401 bool result = mts.momentumFromModeCartesian(upState,mom);
420 if ( tm.
recHit()->isValid() ) {
421 hitPos = tm.
recHit()->localPosition();
422 hitErr = tm.
recHit()->localPositionError();
425 deltaP = collinearFit.
deltaP();
math::Error< dimension >::type CovarianceMatrix
double pzSign() const
Sign of the z-component of the momentum in the local frame.
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
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
static int position[TOTALCHAMBERS][3]
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
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
Measurement1D deltaP() const
estimated deltaP (out-in) from fit parameters
TrajectoryMeasurement const & lastMeasurement() const
void setSecondHitPattern(Trajectory *traj, reco::GsfTrack &track, const Propagator *prop, const MeasurementTrackerEvent *measTk)
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
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) ...
void setHitPattern(const C &c)
set hit patterns from vector of hit references
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...
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
double variance(unsigned int i) const
variance of a component
const AlgebraicSymMatrix55 & matrix() const
edm::ESHandle< NavigationSchool > theSchool
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 &)
Put produced collections in the event.
const Point & position() const
position
TrajectoryStateOnSurface const & updatedState() const
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
edm::OrphanHandle< TrackCollection > rTracks_
std::vector< TrajectoryStateOnSurface > components() const
math::XYZVector Vector
spatial vector
tuple AnalyticalPropagator
bool modeIsValid() const
mode status
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
math::Vector< dimension >::type ParameterVector