39 theTrackerRecHitBuilderName = parameterSet.
getParameter<
string>(
"TrackerRecHitBuilder");
40 theMuonRecHitBuilderName = parameterSet.
getParameter<
string>(
"MuonRecHitBuilder");
42 theRPCInTheFit = parameterSet.
getParameter<
bool>(
"RefitRPCHits");
44 theCacheId_TC = theCacheId_GTG = theCacheId_MG = theCacheId_TRH = 0;
45 theSkipStationDT = parameterSet.
getParameter<
int>(
"SkipStationDT");
46 theSkipStationCSC = parameterSet.
getParameter<
int>(
"SkipStationCSC");
47 theSkipWheelDT = parameterSet.
getParameter<
int>(
"SkipWheelDT");
48 theTrackerSkipSystem = parameterSet.
getParameter<
int>(
"TrackerSkipSystem");
49 theTrackerSkipSection = parameterSet.
getParameter<
int>(
"TrackerSkipSection");
67 if ( newCacheId_TC != theCacheId_TC ){
68 LogTrace(metname) <<
"Tracking Component changed!";
69 theCacheId_TC = newCacheId_TC;
77 if ( newCacheId_GTG != theCacheId_GTG ) {
78 LogTrace(metname) <<
"GlobalTrackingGeometry changed!";
79 theCacheId_GTG = newCacheId_GTG;
85 if ( newCacheId_MG != theCacheId_MG ) {
86 LogTrace(metname) <<
"Magnetic Field changed!";
87 theCacheId_MG = newCacheId_MG;
93 if ( newCacheId_TRH != theCacheId_TRH ) {
94 theCacheId_TRH = newCacheId_TRH;
95 LogTrace(metname) <<
"TransientRecHitRecord changed!";
114 if((*hit)->isValid()) {
115 if ( (*hit)->geographicalId().det() ==
DetId::Tracker && TrackerKeep((*hit)->geographicalId())) {
116 tkHits.push_back(theTrackerRecHitBuilder->build(&**
hit));
117 }
else if ( (*hit)->geographicalId().det() ==
DetId::Muon && MuonKeep((*hit)->geographicalId())){
118 if( (*hit)->geographicalId().subdetId() == 3 && !theRPCInTheFit){
119 LogTrace(
"Reco|TrackingTools|TrackTransformer") <<
"RPC Rec Hit discarged";
122 staHits.push_back(theMuonRecHitBuilder->build(&**
hit));
127 if(staHits.empty())
return staHits;
137 copy(staHits.begin(),staHits.end(),back_inserter(tkHits));
139 for(TransientTrackingRecHit::ConstRecHitContainer::const_iterator
hit = tkHits.begin();
140 hit !=tkHits.end(); ++
hit){
142 DetId hitId = (*hit)->geographicalId();
143 GlobalPoint glbpoint = trackingGeometry()->idToDet(hitId)->position();
147 LogTrace(
"TrackFitters") << glbpoint <<
" I am TIB " << tTopo_->tibLayer(hitId);
149 LogTrace(
"TrackFitters") << glbpoint <<
" I am TOB " << tTopo_->tobLayer(hitId);
151 LogTrace(
"TrackFitters") << glbpoint <<
" I am TEC " << tTopo_->tecWheel(hitId);
153 LogTrace(
"TrackFitters") << glbpoint <<
" I am TID " << tTopo_->tidWheel(hitId);
155 LogTrace(
"TrackFitters") << glbpoint <<
" I am PixBar " << tTopo_->pxbLayer(hitId);
157 LogTrace(
"TrackFitters") << glbpoint <<
" I am PixFwd " << tTopo_->pxfDisk(hitId);
159 LogTrace(
"TrackFitters") <<
" UNKNOWN TRACKER HIT TYPE ";
168 LogTrace(
"TrackFitters") <<
" UNKNOWN MUON HIT TYPE ";
170 LogTrace(
"TrackFitters") <<
" UNKNOWN HIT TYPE ";
179 if(up)
return theFitterOI;
180 else return theFitterIO;
185 if(up)
return theSmootherOI;
186 else return theSmootherIO;
190 if(up)
return thePropagatorIO;
191 else return thePropagatorOI;
206 if(recHitsForReFit.size() < 2)
return vector<Trajectory>();
208 bool up = recHitsForReFit.back()->globalPosition().y()>0 ?
true :
false;
215 LogTrace(metname) <<
"Prop Dir: " << propagationDirection <<
" FirstId " << innerId <<
" firstTSOS " << firstTSOS;
220 if(recHitsForReFit.front()->geographicalId() !=
DetId(innerId)){
221 LogTrace(metname)<<
"Propagation occurring"<<endl;
222 firstTSOS =
propagator(up)->propagate(firstTSOS, recHitsForReFit.front()->det()->surface());
223 LogTrace(metname)<<
"Final destination: " << recHitsForReFit.front()->det()->surface().position() << endl;
224 if(!firstTSOS.isValid()){
225 LogTrace(metname)<<
"Propagation error!"<<endl;
226 return vector<Trajectory>();
231 vector<Trajectory>
trajectories = fitter(up)->fit(seed,recHitsForReFit,firstTSOS);
233 if(trajectories.empty()){
234 LogTrace(metname)<<
"No Track refitted!"<<endl;
235 return vector<Trajectory>();
238 Trajectory trajectoryBW = trajectories.front();
240 vector<Trajectory> trajectoriesSM = smoother(up)->trajectories(trajectoryBW);
242 if(trajectoriesSM.empty()){
243 LogTrace(metname)<<
"No Track smoothed!"<<endl;
244 return vector<Trajectory>();
247 return trajectoriesSM;
257 if (theTrackerSkipSystem < 0 )
return true;
262 if (
id.subdetId() == theTrackerSkipSystem)
263 layer=tTopo_->layer(
id);
265 if (theTrackerSkipSection > -998 && layer == theTrackerSkipSection) retVal =
false;
275 if (theSkipStationDT < 0 && theSkipStationCSC < 0)
return true;
298 if (isRPC && (station == theSkipStationCSC || station == theSkipStationDT))
return false;
299 if (isDT && station == theSkipStationDT )
return false;
300 if (isCSC && station == theSkipStationCSC )
return false;
302 if (isDT && theSkipWheelDT > -998 && wheel == theSkipWheelDT)
return false;
T getParameter(std::string const &) const
const std::string metname
def setup(process, global_tag, zero_tesla=False)
bool isDT(GeomDetEnumerators::SubDetector m)
TrajectoryStateOnSurface innermostMeasurementState() const
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
TrajectoryStateOnSurface outermostMeasurementState() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
trackingRecHit_iterator recHitsEnd() const
last iterator to RecHits
std::vector< ConstRecHitPointer > ConstRecHitContainer
bool isRPC(GeomDetEnumerators::SubDetector m)
const Track & track() const
bool isCSC(GeomDetEnumerators::SubDetector m)
int station() const
Return the station number.
Detector det() const
get the detector field from this detid
int wheel() const
Return the wheel number.
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
T const * product() const
trackingRecHit_iterator recHitsBegin() const
first iterator to RecHits
ParameterSet const & parameterSet(Provenance const &provenance)