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() )
101 trajectories.push_back( ptr );
118 if ( tracks.size() != external.size() )
120 edm::LogInfo(
"ReferenceTrajectories") <<
"@SUB=DualTrajectoryFactory::trajectories"
121 <<
"Inconsistent input:\n"
122 <<
"\tnumber of tracks = " << tracks.size()
123 <<
"\tnumber of external predictions = " << external.size();
129 if (magneticField->inTesla(
GlobalPoint(0.,0.,0.)).mag2() < 1.e-6) {
130 edm::LogWarning(
"Alignment") <<
"@SUB=DualTrajectoryFactory::trajectories"
131 <<
"B-field in z is " << magneticField->inTesla(
GlobalPoint(0.,0.,0.)).z()
132 <<
": You should probably use the DualBzeroTrajectoryFactory\n"
133 <<
"or fix this code to switch automatically as the ReferenceTrajectoryFactory does.";
136 ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
137 ExternalPredictionCollection::const_iterator itExternal = external.begin();
139 while ( itTracks != tracks.end() )
145 if ( (*itExternal).isValid() )
150 if ( !propExternal.
isValid() )
continue;
163 ptr->setParameterErrors( externalParamErrors );
164 trajectories.push_back( ptr );
176 trajectories.push_back( ptr );
196 Trajectory::DataContainer::iterator itM;
198 for ( itM = allTrajMeas.begin(); itM != allTrajMeas.end(); itM++ )
200 if (
useRecHit( ( *itM ).recHit() ) ) usedTrajMeas.push_back( *itM );
203 unsigned int iMeas = 0;
204 unsigned int nMeas = usedTrajMeas.size();
205 unsigned int nRefStateMeas = nMeas/2;
207 for ( itM = usedTrajMeas.begin(); itM != usedTrajMeas.end(); itM++, iMeas++ )
211 if ( iMeas < nRefStateMeas ) {
213 }
else if ( iMeas > nRefStateMeas ) {
216 if ( ( *itM ).updatedState().isValid() )
218 input.
refTsos = ( *itM ).updatedState();
241 const std::pair< TrajectoryStateOnSurface, double > tsosWithPath =
243 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.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")