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;
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!";
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;
165 return transform(track, recHitsForReFit);
176 if(recHitsForReFit.size() < 2)
return vector<Trajectory>();
210 LogTrace(metname) <<
"RH order (0-insideOut, 1-outsideIn): " << recHitsOrder;
221 LogTrace(metname) <<
"P (0-insideOut, 1-outsideIn): " <<
p;
222 LogTrace(metname) <<
"FD (0-OM, 1-AM, 2-ANY): " << propagationDirection;
227 if(theRefitDirection.propagationDirection() !=
anyDirection){
230 reverse(recHitsForReFit.begin(),recHitsForReFit.end());}
235 if(theRefitDirection.geometricalDirection() != recHitsOrder) reverse(recHitsForReFit.begin(),recHitsForReFit.end());
242 if(theRefitDirection.propagationDirection() !=
anyDirection){
259 LogTrace(metname)<<
"Error wrong initial state!"<<endl;
260 return vector<Trajectory>();
265 if(recHitsForReFit.front()->geographicalId() !=
DetId(innerId)){
266 LogTrace(metname)<<
"Propagation occured"<<endl;
267 firstTSOS =
propagator()->propagate(firstTSOS, recHitsForReFit.front()->det()->
surface());
269 LogTrace(metname)<<
"Propagation error!"<<endl;
270 return vector<Trajectory>();
274 if(theDoPredictionsOnly){
277 for(TransientTrackingRecHit::ConstRecHitContainer::const_iterator ihit = recHitsForReFit.begin();
278 ihit != recHitsForReFit.end(); ++ihit ) {
282 return vector<Trajectory>(1, aTraj);
286 vector<Trajectory> trajectories = theFitter->fit(seed,recHitsForReFit,firstTSOS);
288 if(trajectories.empty()){
289 LogTrace(metname)<<
"No Track refitted!"<<endl;
290 return vector<Trajectory>();
293 Trajectory trajectoryBW = trajectories.front();
295 vector<Trajectory> trajectoriesSM = theSmoother->trajectories(trajectoryBW);
297 if(trajectoriesSM.empty()){
298 LogTrace(metname)<<
"No Track smoothed!"<<endl;
299 return vector<Trajectory>();
302 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
const SurfaceType & surface() 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
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
ParameterSet const & parameterSet(Provenance const &provenance)