#include "Event/TrgTrack.h"
#include "Event/Track.h"
Go to the source code of this file.
Namespaces | |
namespace | TrgTrackConverter |
Defines | |
#define | TrgTrackConverter_H 1 |
Functions | |
void | toTrack (const TrgTrack >rack, Track &track) |
convert a TrgTrack to a Track. | |
void | setFields (const TrgTrack >rack, Track &track) |
retrieve the type of tracks of the TrgTrack | |
std::vector< LHCbID > | lhcbIDs (const TrgTrack >rack) |
retrieve the LHCbIDs of the gtrack | |
void | toState (const TrgState &gstate, State &state) |
convert a TrgState into a state | |
void | toTrgTrack (const Track &track, TrgTrack >rack) |
convert a track into a TrgTrack | |
void | setTrgFields (const Track >rack, TrgTrack >rack) |
set the flags into the gtrack | |
void | setTrgTrackReferences (const std::vector< LHCbID > &ids, TrgTrack >rack) |
set the id into TrgTrack | |
void | toTrgState (const State &state, TrgState &gstate) |
convert a state into a TrgState |
|
Definition at line 2 of file TrgTrackConverter.h. |
|
retrieve the LHCbIDs of the gtrack
Definition at line 61 of file TrgTrackConverter.cpp. Referenced by TrgTrackToTrack::testLHCbIDs(), and TrgTrackConverter::toTrack(). 00061 { 00062 00063 std::vector<LHCbID> ids; 00064 00065 const std::vector< std::pair<VeloChannelID,int> >& vref 00066 = gtrack.veloReference(); 00067 for (std::vector< std::pair<VeloChannelID,int> >::const_iterator 00068 it = vref.begin(); it != vref.end(); it++) { 00069 const std::pair<VeloChannelID,int>& velo = *it; 00070 LHCbID id = LHCbID(velo.first); 00071 id.setSpareBits((unsigned) velo.second); 00072 ids.push_back(id); 00073 } 00074 00075 const std::vector< std::pair<ITChannelID,int> >& itref 00076 = gtrack.itReference(); 00077 for (std::vector< std::pair<ITChannelID,int> >::const_iterator 00078 it = itref.begin(); it != itref.end(); it++) { 00079 const std::pair<ITChannelID,int>& si = *it; 00080 LHCbID id = LHCbID(si.first); 00081 id.setSpareBits((unsigned) si.second); 00082 ids.push_back(id); 00083 } 00084 00085 00086 const std::vector< std::pair<OTChannelID,int> >& otref 00087 = gtrack.otReference(); 00088 for (std::vector< std::pair<OTChannelID,int> >::const_iterator 00089 it = otref.begin(); it != otref.end(); it++) { 00090 const std::pair<OTChannelID,int>& ot = *it; 00091 LHCbID id = LHCbID(ot.first); 00092 // id.setSpareBits((unsigned) ot.second); 00093 ids.push_back(id); 00094 } 00095 00096 return ids; 00097 }
|
|
retrieve the type of tracks of the TrgTrack
Definition at line 34 of file TrgTrackConverter.cpp. Referenced by TrgTrackConverter::toTrack(). 00034 { 00035 00036 // setting the type 00037 TrgTrack::TrgTrackType gtype = (TrgTrack::TrgTrackType) gtrack.type(); 00038 if (gtype == TrgTrack::TypeVeloR ) track.setType(TrackKeys::VeloR); 00039 if (gtype == TrgTrack::TypeVelo3D) track.setType(TrackKeys::Velo); 00040 if (gtype == TrgTrack::TypeVeloTT) track.setType(TrackKeys::Downstream); 00041 if (gtype == TrgTrack::TypeLong) track.setType(TrackKeys::Long); 00042 if (gtype == TrgTrack::TypeDownstream) track.setType(TrackKeys::Downstream); 00043 00044 // setting the history 00045 track.setHistory(TrackKeys::TrgVelo); 00046 if (gtype == TrgTrack::TypeDownstream) 00047 track.setHistory(TrackKeys::TrgVeloTT); 00048 if (gtype == TrgTrack::TypeLong) track.setHistory(TrackKeys::TrgForward); 00049 if (gtype == TrgTrack::TypeKShort) track.setHistory(TrackKeys::TrKshort); 00050 00051 // set the flags 00052 track.setFlag(TrackKeys::Valid,true); 00053 track.setFlag(TrackKeys::Unique,true); 00054 if (gtrack.backward()) track.setFlag(TrackKeys::Backward,true); 00055 00056 if (gtrack.selectedIP2D()) track.setFlag(TrackKeys::IPSelected,true); 00057 if (gtrack.selectedMuon2D()) track.setFlag(TrackKeys::PIDSelected,true); 00058 00059 }
|
|
set the flags into the gtrack
Definition at line 168 of file TrgTrackConverter.cpp. Referenced by TrgTrackConverter::toTrgTrack(). 00168 { 00169 00170 // setting the type 00171 gtrack.setType(TrgTrack::TypeUnknown); 00172 if (track.type() == TrackKeys::VeloR); 00173 gtrack.setType( TrgTrack::TypeUnknown); 00174 if (track.checkFlag(TrackKeys::Backward)) gtrack.setBackward(true); 00175 if (track.type() == TrackKeys::Long) 00176 gtrack.setType(TrgTrack::TypeLong); 00177 if (track.type() == TrackKeys::Upstream) 00178 gtrack.setType(TrgTrack::TypeVeloTT); 00179 if (track.type() == TrackKeys::Downstream) 00180 gtrack.setType(TrgTrack::TypeVeloTT); 00181 00182 // setting the flags 00183 if (track.checkFlag(TrackKeys::Valid)) gtrack.setBadTrack(false); 00184 else gtrack.setBadTrack(true); 00185 00186 if (track.checkFlag(TrackKeys::IPSelected)) gtrack.setSelectedIP2D(true); 00187 if (track.checkFlag(TrackKeys::PIDSelected)) gtrack.setSelectedMuon2D(true); 00188 00189 }
|
|
set the id into TrgTrack
Definition at line 142 of file TrgTrackConverter.cpp. Referenced by TrgTrackConverter::toTrgTrack(). 00143 { 00144 00145 std::vector< std::pair<VeloChannelID,int> > veref; 00146 std::vector< std::pair<ITChannelID,int> > siref; 00147 std::vector< std::pair<OTChannelID,int> > otref; 00148 00149 for (std::vector<LHCbID>::const_iterator it = ids.begin(); 00150 it != ids.end(); it++) { 00151 const LHCbID& id = *it; 00152 int size = (int) id.spareBits(); 00153 if (id.isVelo()) { 00154 veref.push_back( std::pair<VeloChannelID,int>(id.veloID(),size)); 00155 } else if (id.isST()) { 00156 size = 1; 00157 veref.push_back( std::pair<ITChannelID,int>(id.stID(),size)); 00158 } else if (id.isOT()) { 00159 veref.push_back( std::pair<OTChannelID,int>(id.otID(),size)); 00160 } 00161 } 00162 00163 gtrack.setVeloReference(veref); 00164 gtrack.setITReference(siref); 00165 gtrack.setOTReference(otref); 00166 }
|
|
convert a TrgState into a state
Definition at line 99 of file TrgTrackConverter.cpp. Referenced by TrgTrackConverter::toTrack(). 00099 { 00100 state.setState(gstate.stateVector()); 00101 state.setCovariance(gstate.covariance()); 00102 state.setZ(gstate.z()); 00103 }
|
|
convert a TrgTrack to a Track.
Definition at line 4 of file TrgTrackConverter.cpp. References TrgTrackConverter::lhcbIDs(), TrgTrackConverter::setFields(), and TrgTrackConverter::toState(). Referenced by TrgTrackToTrack::execute(). 00004 { 00005 00006 // reset the track 00007 track.reset(); 00008 00009 // set the fields 00010 setFields(gtrack,track); 00011 00012 // set the chi2 00013 track.setChi2PerDoF(gtrack.chiSquared()); 00014 track.setNDoF(gtrack.degreeOfFreedom()); 00015 00016 // set the physics state 00017 toState(gtrack.firstState(),track.firstState()); 00018 00019 // set the other states 00020 for (std::vector<TrgState>::const_iterator it = gtrack.otherStates().begin(); 00021 it != gtrack.otherStates().end(); it++) { 00022 const TrgState& gstate = *it; 00023 State* state = new State(); 00024 toState(gstate,*state); 00025 track.addToStates(*state); 00026 } 00027 00028 // set the LHCbIDs 00029 std::vector<LHCbID> ids = lhcbIDs(gtrack); 00030 track.setLhcbIDs(ids); 00031 00032 }
|
|
convert a state into a TrgState
Definition at line 136 of file TrgTrackConverter.cpp. Referenced by TrgTrackConverter::toTrgTrack(). 00136 { 00137 gstate.setStateVector(state.stateVector()); 00138 gstate.setCovariance(state.covariance()); 00139 gstate.setZ(state.z()); 00140 }
|
|
convert a track into a TrgTrack
Definition at line 107 of file TrgTrackConverter.cpp. References TrgTrackConverter::setTrgFields(), TrgTrackConverter::setTrgTrackReferences(), and TrgTrackConverter::toTrgState(). Referenced by TrackToTrgTrack::execute(). 00107 { 00108 00109 gtrack.reset(); 00110 00111 // set the types 00112 setTrgFields(track,gtrack); 00113 00114 // set the chi2 00115 gtrack.setChiSquared(track.chi2()); 00116 gtrack.setDegreeOfFreedom(track.nDoF()); 00117 00118 // set the main state 00119 toTrgState(track.firstState(),gtrack.firstState()); 00120 00121 // set the other states 00122 for (std::vector<State*>::const_iterator 00123 it = track.states().begin(); it != track.states().end(); it++) { 00124 const State& state = *(*it); 00125 TrgState gstate; 00126 toTrgState(state,gstate); 00127 gtrack.otherStates().push_back(gstate); 00128 } 00129 00130 // set the references 00131 const std::vector<LHCbID>& ids = track.lhcbIDs(); 00132 setTrgTrackReferences(ids,gtrack); 00133 00134 }
|