Go to the documentation of this file.00001 #include "AnalysisDataFormats/TrackInfo/interface/TrackInfo.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003
00004 using namespace reco;
00005
00006
00007 TrackInfo::TrackInfo( const TrajectorySeed & seed ,const TrajectoryInfo & trajstates): seed_(seed),trajstates_(trajstates){}
00008
00009 const TrajectorySeed & TrackInfo::seed() const {return seed_;}
00010
00011 const reco::TrackInfo::TrajectoryInfo & TrackInfo::trajStateMap() const {return trajstates_;}
00012
00013 const RecHitType TrackInfo::type(TrackingRecHitRef hit) const {
00014 TrajectoryInfo::const_iterator states=trajstates_.find(hit);
00015 if(states!=trajstates_.end())return states->second.type();
00016 else edm::LogError("TrackInfo")<<"This rechit does not exist";
00017 return Null;
00018 }
00019
00020 const PTrajectoryStateOnDet * TrackInfo::stateOnDet(StateType statetype,TrackingRecHitRef hit)const {
00021 TrajectoryInfo::const_iterator states=trajstates_.find(hit);
00022 if(states!=trajstates_.end())return states->second.stateOnDet(statetype);
00023 else edm::LogError("TrackInfo")<<"This rechit does not exist";
00024 return 0;
00025 }
00026
00027 const LocalVector TrackInfo::localTrackMomentum(StateType statetype,TrackingRecHitRef hit)const{
00028
00029 TrajectoryInfo::const_iterator states=trajstates_.find(hit);
00030 if(states!=trajstates_.end())
00031 {
00032 const PTrajectoryStateOnDet * state=states->second.stateOnDet(statetype);
00033 if(state!=0) return state->parameters().momentum();
00034 }
00035 else edm::LogError("TrackInfo")<<"This rechit does not exist";
00036 return LocalVector(0,0,0);
00037 }
00038
00039 const LocalVector TrackInfo::localTrackMomentumOnMono(StateType statetype,TrackingRecHitRef hit)const{
00040
00041 TrajectoryInfo::const_iterator states=trajstates_.find(hit);
00042 if(states!=trajstates_.end())return states->second.localTrackMomentumOnMono(statetype);
00043 else edm::LogError("TrackInfo")<<"This rechit does not exist";
00044 return LocalVector(0,0,0);
00045 }
00046
00047 const LocalVector TrackInfo::localTrackMomentumOnStereo(StateType statetype,TrackingRecHitRef hit)const{
00048
00049 TrajectoryInfo::const_iterator states=trajstates_.find(hit);
00050 if(states!=trajstates_.end())return states->second.localTrackMomentumOnStereo(statetype);
00051 return LocalVector(0,0,0);
00052 }
00053
00054 const LocalPoint TrackInfo::localTrackPosition(StateType statetype,TrackingRecHitRef hit)const {
00055
00056 TrajectoryInfo::const_iterator states=trajstates_.find(hit);
00057 if(states!=trajstates_.end())
00058 {
00059 const PTrajectoryStateOnDet * state=states->second.stateOnDet(statetype);
00060 if(state!=0) return state->parameters().position();
00061 }
00062 else edm::LogError("TrackInfo")<<"This rechit does not exist";
00063 return LocalPoint(0,0,0);
00064 }
00065
00066
00067 const LocalPoint TrackInfo::localTrackPositionOnMono(StateType statetype,TrackingRecHitRef hit)const{
00068
00069 TrajectoryInfo::const_iterator states=trajstates_.find(hit);
00070 if(states!=trajstates_.end())return states->second.localTrackPositionOnMono(statetype);
00071 else edm::LogError("TrackInfo")<<"This rechit does not exist";
00072 return LocalPoint(0,0,0);
00073 }
00074
00075 const LocalPoint TrackInfo::localTrackPositionOnStereo(StateType statetype,TrackingRecHitRef hit)const{
00076
00077 TrajectoryInfo::const_iterator states=trajstates_.find(hit);
00078 if(states!=trajstates_.end())return states->second.localTrackPositionOnStereo(statetype);
00079 else edm::LogError("TrackInfo")<<"This rechit does not exist";
00080 return LocalPoint(0,0,0);
00081 }
00082
00083