32 string refitDirectionName = parameterSet.
getParameter<
string>(
"RefitDirection");
35 theFitterName = parameterSet.
getParameter<
string>(
"Fitter");
36 theSmootherName = parameterSet.
getParameter<
string>(
"Smoother");
37 thePropagatorName = parameterSet.
getParameter<
string>(
"Propagator");
39 theTrackerRecHitBuilderName = parameterSet.
getParameter<
string>(
"TrackerRecHitBuilder");
40 theMuonRecHitBuilderName = parameterSet.
getParameter<
string>(
"MuonRecHitBuilder");
42 theRPCInTheFit = parameterSet.
getParameter<
bool>(
"RefitRPCHits");
43 theDoPredictionsOnly = parameterSet.
getParameter<
bool>(
"DoPredictionsOnly");
45 theCacheId_TC = theCacheId_GTG = theCacheId_MG = theCacheId_TRH = 0;
54 const std::string
metname =
"Reco|TrackingTools|TrackTransformer";
62 if ( newCacheId_TC != theCacheId_TC ){
63 LogTrace(metname) <<
"Tracking Component changed!";
64 theCacheId_TC = newCacheId_TC;
70 if ( newCacheId_GTG != theCacheId_GTG ) {
71 LogTrace(metname) <<
"GlobalTrackingGeometry changed!";
72 theCacheId_GTG = newCacheId_GTG;
78 if ( newCacheId_MG != theCacheId_MG ) {
79 LogTrace(metname) <<
"Magnetic Field changed!";
80 theCacheId_MG = newCacheId_MG;
86 if ( newCacheId_TRH != theCacheId_TRH ) {
87 theCacheId_TRH = newCacheId_TRH;
88 LogTrace(metname) <<
"TransientRecHitRecord changed!";
96 return transform(*track);
106 if((*hit)->isValid()) {
108 result.push_back(theTrackerRecHitBuilder->build(&**
hit));
109 }
else if ( (*hit)->geographicalId().det() ==
DetId::Muon ){
110 if( (*hit)->geographicalId().subdetId() == 3 && !theRPCInTheFit){
111 LogTrace(
"Reco|TrackingTools|TrackTransformer") <<
"RPC Rec Hit discarged";
114 result.push_back(theMuonRecHitBuilder->build(&**
hit));
126 if (!recHits.empty()){
130 double rFirst = first.
mag();
131 double rLast = last.
mag();
135 LogDebug(
"Reco|TrackingTools|TrackTransformer") <<
"Impossible to determine the rechits order" <<endl;
140 LogDebug(
"Reco|TrackingTools|TrackTransformer") <<
"Impossible to determine the rechits order" <<endl;
158 const std::string
metname =
"Reco|TrackingTools|TrackTransformer";
165 return transform(track, recHitsForReFit);
173 const std::string
metname =
"Reco|TrackingTools|TrackTransformer";
175 if(recHitsForReFit.size() < 2)
return vector<Trajectory>();
209 LogTrace(metname) <<
"RH order (0-insideOut, 1-outsideIn): " << recHitsOrder;
220 LogTrace(metname) <<
"P (0-insideOut, 1-outsideIn): " <<
p;
221 LogTrace(metname) <<
"FD (0-OM, 1-AM, 2-ANY): " << propagationDirection;
226 if(theRefitDirection.propagationDirection() !=
anyDirection){
229 reverse(recHitsForReFit.begin(),recHitsForReFit.end());}
234 if(theRefitDirection.geometricalDirection() != recHitsOrder) reverse(recHitsForReFit.begin(),recHitsForReFit.end());
241 if(theRefitDirection.propagationDirection() !=
anyDirection){
258 LogTrace(metname)<<
"Error wrong initial state!"<<endl;
259 return vector<Trajectory>();
264 if(recHitsForReFit.front()->geographicalId() !=
DetId(innerId)){
265 LogTrace(metname)<<
"Propagation occured"<<endl;
266 firstTSOS =
propagator()->propagate(firstTSOS, recHitsForReFit.front()->det()->
surface());
268 LogTrace(metname)<<
"Propagation error!"<<endl;
269 return vector<Trajectory>();
273 if(theDoPredictionsOnly){
276 for(TransientTrackingRecHit::ConstRecHitContainer::const_iterator ihit = recHitsForReFit.begin();
277 ihit != recHitsForReFit.end(); ++ihit ) {
281 return vector<Trajectory>(1, aTraj);
285 vector<Trajectory> trajectories = theFitter->fit(seed,recHitsForReFit,firstTSOS);
287 if(trajectories.empty()){
288 LogTrace(metname)<<
"No Track refitted!"<<endl;
289 return vector<Trajectory>();
292 Trajectory trajectoryBW = trajectories.front();
294 vector<Trajectory> trajectoriesSM = theSmoother->trajectories(trajectoryBW);
296 if(trajectoriesSM.empty()){
297 LogTrace(metname)<<
"No Track smoothed!"<<endl;
298 return vector<Trajectory>();
301 return trajectoriesSM;
T getParameter(std::string const &) const
const std::string metname
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
static int position[TOTALCHAMBERS][3]
TrajectoryStateOnSurface innermostMeasurementState() const
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
TrajectoryStateOnSurface outermostMeasurementState() const
trackingRecHit_iterator recHitsEnd() const
last iterator to RecHits
std::vector< ConstRecHitPointer > ConstRecHitContainer
const Track & track() const
GlobalVector globalMomentum() const
const Surface & surface() const
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
void push(const TrajectoryMeasurement &tm)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
trackingRecHit_iterator recHitsBegin() const
first iterator to RecHits