00001 00009 #include "RecoMuon/StandAloneTrackFinder/interface/StandAloneMuonRefitter.h" 00010 00011 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" 00012 00013 #include "TrackingTools/PatternTools/interface/TrajectoryFitter.h" 00014 00015 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00016 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00017 #include "FWCore/Framework/interface/EventSetup.h" 00018 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h" 00019 #include "TrackingTools/TrackFitters/interface/TrajectoryStateWithArbitraryError.h" 00020 00021 using namespace edm; 00022 using namespace std; 00023 00024 StandAloneMuonRefitter::StandAloneMuonRefitter(const ParameterSet& par, const MuonServiceProxy* service):theService(service){ 00025 theFitterName = par.getParameter<string>("FitterName"); 00026 theTEMPORARYoption = par.getParameter<int>("Option"); 00027 } 00028 00030 StandAloneMuonRefitter::~StandAloneMuonRefitter(){ 00031 00032 } 00033 00034 // Operations 00035 00037 StandAloneMuonRefitter::RefitResult StandAloneMuonRefitter::refit(const Trajectory& trajectory){ 00038 00039 theService->eventSetup().get<TrackingComponentsRecord>().get(theFitterName, theFitter); 00040 00041 vector<Trajectory> refitted; 00042 00043 if(theTEMPORARYoption == 1) 00044 refitted = theFitter->fit(trajectory); 00045 00046 else if(theTEMPORARYoption == 2 || theTEMPORARYoption == 3){ 00047 TrajectoryMeasurement lastTM = trajectory.lastMeasurement(); 00048 TrajectoryStateOnSurface firstTsos = lastTM.updatedState(); 00049 if (theTEMPORARYoption == 3) 00050 firstTsos = TrajectoryStateWithArbitraryError()(lastTM.updatedState()); 00051 TransientTrackingRecHit::ConstRecHitContainer trajRH = trajectory.recHits(); 00052 reverse(trajRH.begin(),trajRH.end()); 00053 00054 vector<Trajectory> refitted = theFitter->fit(trajectory.seed(), trajRH, firstTsos); 00055 } 00056 00057 if(!refitted.empty()) return RefitResult(true,refitted.front()); 00058 else return RefitResult(false,trajectory); 00059 } 00060 00061 00062 // { 00063 // TransientTrackingRecHit::ConstRecHitContainer trajRH = trajectory.recHits(); 00064 // for() 00065 00066 // }