33 : theRPCInTheFit(parameterSet.getParameter<bool>(
"RefitRPCHits")),
34 theDoPredictionsOnly(parameterSet.getParameter<bool>(
"DoPredictionsOnly")),
35 theRefitDirection(parameterSet.getParameter<
string>(
"RefitDirection")),
36 theFitterName(parameterSet.getParameter<
string>(
"Fitter")),
37 theSmootherName(parameterSet.getParameter<
string>(
"Smoother")),
39 theTrackerRecHitBuilderName(parameterSet.getParameter<
string>(
"TrackerRecHitBuilder")),
40 theMuonRecHitBuilderName(parameterSet.getParameter<
string>(
"MuonRecHitBuilder")),
41 theMTDRecHitBuilderName(parameterSet.getParameter<
string>(
"MTDRecHitBuilder")) {
56 bool doPredictionsOnly,
65 desc.
add<
bool>(
"DoPredictionsOnly", doPredictionsOnly);
70 desc.
add<
bool>(
"RefitRPCHits", refitRPCHits);
71 desc.
add<
std::string>(
"TrackerRecHitBuilder", trackerRecHitBuilder);
94 LogTrace(metname) <<
"TransientRecHitRecord changed!";
113 if ((*hit)->isValid()) {
115 result.emplace_back((**hit).cloneForFit(*tkbuilder->geometry()->idToDet((**hit).geographicalId())));
116 }
else if ((*hit)->geographicalId().det() ==
DetId::Muon) {
117 if ((*hit)->geographicalId().subdetId() == 3 && !
theRPCInTheFit) {
118 LogTrace(
"Reco|TrackingTools|TrackTransformer") <<
"RPC Rec Hit discarged";
122 }
else if ((*hit)->geographicalId().det() ==
DetId::Forward && (*hit)->geographicalId().subdetId() ==
FastTime) {
126 throw cms::Exception(
"TrackTransformer") <<
"MTD hit encountered but MTD not available!";
137 if (!recHits.empty()) {
142 auto rFirst = first.
mag2();
143 auto rLast = last.
mag2();
149 LogDebug(
"Reco|TrackingTools|TrackTransformer") <<
"Impossible to determine the rechits order" << endl;
160 return transform(track, recHitsForReFit);
168 if (recHitsForReFit.size() < 2)
169 return vector<Trajectory>();
204 LogTrace(metname) <<
"RH order (0-insideOut, 1-outsideIn): " << recHitsOrder;
217 LogTrace(metname) <<
"P (0-insideOut, 1-outsideIn): " <<
p;
218 LogTrace(metname) <<
"FD (0-OM, 1-AM, 2-ANY): " << propagationDirection;
226 reverse(recHitsForReFit.begin(), recHitsForReFit.end());
233 reverse(recHitsForReFit.begin(), recHitsForReFit.end());
256 LogTrace(metname) <<
"Error wrong initial state!" << endl;
257 return vector<Trajectory>();
262 if (recHitsForReFit.front()->geographicalId() !=
DetId(innerId)) {
263 LogTrace(metname) <<
"Propagation occured" << endl;
264 firstTSOS =
propagator()->propagate(firstTSOS, recHitsForReFit.front()->det()->
surface());
266 LogTrace(metname) <<
"Propagation error!" << endl;
267 return vector<Trajectory>();
274 for (
auto const&
hit : recHitsForReFit) {
275 predTSOS =
propagator()->propagate(predTSOS,
hit->det()->surface());
279 return vector<Trajectory>(1, aTraj);
285 LogTrace(metname) <<
"No Track refitted!" << endl;
291 auto const& trajectoriesSM =
theSmoother->trajectories(trajectoryBW);
293 if (trajectoriesSM.empty()) {
294 LogTrace(metname) <<
"No Track smoothed!" << endl;
297 return trajectoriesSM;
PropagationDirection propagationDirection() const
const std::string metname
GeometricalDirection geometricalDirection() const
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
TrajectoryStateOnSurface innermostMeasurementState() const
bool getData(T &iHolder) const
const SurfaceType & surface() const
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
TrajectoryStateOnSurface outermostMeasurementState() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
trackingRecHit_iterator recHitsEnd() const
last iterator to RecHits
std::vector< ConstRecHitPointer > ConstRecHitContainer
const Track & track() const
thePropagatorName(iConfig.getParameter< std::string >("Propagator"))
GlobalVector globalMomentum() const
static int position[264][3]
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
void push(const TrajectoryMeasurement &tm)
trackingRecHit_iterator recHitsBegin() const
first iterator to RecHits