59 theMass(config.getParameter<double>(
"ParticleMass"))
61 edm::LogInfo(
"Alignment") <<
"@SUB=DualTrajectoryFactory"
78 if (magneticField->inTesla(
GlobalPoint(0.,0.,0.)).mag2() < 1.e-6) {
79 edm::LogWarning(
"Alignment") <<
"@SUB=DualTrajectoryFactory::trajectories"
80 <<
"B-field in z is " << magneticField->inTesla(
GlobalPoint(0.,0.,0.)).z()
81 <<
": You should probably use the DualBzeroTrajectoryFactory\n"
82 <<
"or fix this code to switch automatically as the ReferenceTrajectoryFactory does.";
85 ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
87 while ( itTracks != tracks.end() )
102 trajectories.push_back( ptr );
119 if ( tracks.size() != external.size() )
121 edm::LogInfo(
"ReferenceTrajectories") <<
"@SUB=DualTrajectoryFactory::trajectories"
122 <<
"Inconsistent input:\n"
123 <<
"\tnumber of tracks = " << tracks.size()
124 <<
"\tnumber of external predictions = " << external.size();
130 if (magneticField->inTesla(
GlobalPoint(0.,0.,0.)).mag2() < 1.e-6) {
131 edm::LogWarning(
"Alignment") <<
"@SUB=DualTrajectoryFactory::trajectories"
132 <<
"B-field in z is " << magneticField->inTesla(
GlobalPoint(0.,0.,0.)).z()
133 <<
": You should probably use the DualBzeroTrajectoryFactory\n"
134 <<
"or fix this code to switch automatically as the ReferenceTrajectoryFactory does.";
137 ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
138 ExternalPredictionCollection::const_iterator itExternal = external.begin();
140 while ( itTracks != tracks.end() )
146 if ( (*itExternal).isValid() )
151 if ( !propExternal.
isValid() )
continue;
164 ptr->setParameterErrors( externalParamErrors );
165 trajectories.push_back( ptr );
178 trajectories.push_back( ptr );
198 Trajectory::DataContainer::iterator itM;
200 for ( itM = allTrajMeas.begin(); itM != allTrajMeas.end(); itM++ )
202 if (
useRecHit( ( *itM ).recHit() ) ) usedTrajMeas.push_back( *itM );
205 unsigned int iMeas = 0;
206 unsigned int nMeas = usedTrajMeas.size();
207 unsigned int nRefStateMeas = nMeas/2;
209 for ( itM = usedTrajMeas.begin(); itM != usedTrajMeas.end(); itM++, iMeas++ )
213 if ( iMeas < nRefStateMeas ) {
215 }
else if ( iMeas > nRefStateMeas ) {
218 if ( ( *itM ).updatedState().isValid() )
220 input.
refTsos = ( *itM ).updatedState();
243 const std::pair< TrajectoryStateOnSurface, double > tsosWithPath =
245 return tsosWithPath.first;
const TrajectoryStateOnSurface propagateExternal(const TrajectoryStateOnSurface &external, const Surface &surface, const MagneticField *magField) const
const DualTrajectoryInput referenceStateAndRecHits(const ConstTrajTrackPair &track) const
MaterialEffects materialEffects(void) const
Global3DPoint GlobalPoint
virtual const Trajectory::DataContainer orderedTrajectoryMeasurements(const Trajectory &trajectory) const
AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &fts, const Plane &plane) const override
propagation to plane with path length
static std::string const input
virtual ~DualTrajectoryFactory()
const SurfaceType & surface() const
std::vector< TrajectoryMeasurement > DataContainer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
virtual DualTrajectoryFactory * clone() const override
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
DualTrajectoryFactory(const edm::ParameterSet &config)
virtual const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
Produce the reference trajectories.
AlignmentAlgorithmBase::ConstTrajTrackPairCollection ConstTrajTrackPairCollection
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
T const * product() const
PropagationDirection propagationDirection(void) const
CLHEP::HepSymMatrix AlgebraicSymMatrix
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< TrajectoryStateOnSurface > ExternalPredictionCollection
A factory that produces instances of class ReferenceTrajectory from a given TrajTrackPairCollection.