Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

TrgTrackConverter Class Reference

#include <TrgTrackConverter.h>

List of all members.

Static Public Member Functions

static TracktoTrack (const TrgTrack &gtrack)
 convert a TrgTrack to a Track.
static std::vector< Track::TrackTypeTrackTypes (const TrgTrack &gtrack)
static std::vector< Track::HistoryFlagTrackHistory (const TrgTrack &gtrack)
static std::vector< Track::FlagTrackFlags (const TrgTrack &gtrack)
static std::vector< LHCbIDTrackIDs (const TrgTrack &gtrack)
static void toState (const TrgState &state, State &state)
static TrgTrack * toTrgTrack (const Track &track)
static void toTrgState (const State &state, TrgState &state)
static void print (const TrgTrack &track)
static void print (const Track &track)
static std::ostream & str (const Track &track, std::ostream &os=std::cout)
static std::ostream & str (const State &state, std::ostream &os=std::cout)


Detailed Description

Author:
J.A. Hernando
Date:
25/11/2002

Definition at line 10 of file TrgTrackConverter.h.


Member Function Documentation

static void TrgTrackConverter::print const Track track  )  [static]
 

static void TrgTrackConverter::print const TrgTrack &  track  )  [static]
 

std::ostream & TrgTrackConverter::str const State state,
std::ostream &  os = std::cout
[static]
 

Definition at line 159 of file TrgTrackConverter.cpp.

References Track::flags().

00159                                                                      {
00160   os << " flags " << state.flags() << std::endl;
00161   os << " z " << state.z() << std::endl;
00162   os << " state " << state.state() << std::endl;
00163   os << " cov " << state.covariance() << std::endl;
00164   return os;
00165 }

std::ostream & TrgTrackConverter::str const Track track,
std::ostream &  os = std::cout
[static]
 

Definition at line 150 of file TrgTrackConverter.cpp.

References Track::chi2(), and Track::flags().

Referenced by TrgTrackToTrack::execute().

00150                                                                      {
00151   os << " flags " << track.flags() << std::endl;
00152   os << " chi2  " << track.chi2() << std::endl;
00153   os << " physics state "; str(track.physicsState(),os); 
00154   return os; 
00155 }

void TrgTrackConverter::toState const TrgState &  state,
State state
[static]
 

Definition at line 129 of file TrgTrackConverter.cpp.

Referenced by toTrack().

00129                                                                     {  
00130   
00131   state.setState(gstate.stateVector());
00132   state.setCovariance(gstate.covariance());
00133   //  state.setZ(gstate.z());
00134 }

Track * TrgTrackConverter::toTrack const TrgTrack &  gtrack  )  [static]
 

convert a TrgTrack to a Track.

Definition at line 3 of file TrgTrackConverter.cpp.

References Track::addToStates(), Track::physicsState(), Track::setChi2PerDoF(), Track::setFlag(), Track::setLhcbIDs(), Track::setNDoF(), Track::setType(), toState(), TrackFlags(), TrackIDs(), and TrackTypes().

Referenced by TrgTrackToTrack::execute().

00003                                                         {
00004 
00005   // construct the track
00006   Track* track = new Track();
00007 
00008   // set the types
00009   std::vector<Track::TrackType> types = TrackTypes(gtrack);
00010   for (std::vector<Track::TrackType>::const_iterator 
00011          it = types.begin(); it != types.end(); it++) {
00012     track->setType(*it);
00013   }
00014     
00015   // set the flags
00016   std::vector<Track::Flag> flags = TrackFlags(gtrack);
00017   for (std::vector<Track::Flag>::const_iterator 
00018          it = flags.begin(); it != flags.end(); it++) {
00019     track->setFlag(*it);
00020   }
00021 
00022   // set the chi2
00023   track->setChi2PerDoF(gtrack.chiSquared());
00024   track->setNDoF(1);
00025 
00026   // set the main state
00027   toState(gtrack.firstState(),track->physicsState());
00028 
00029   // set the other states
00030   for (std::vector<TrgState>::const_iterator 
00031          it = gtrack.otherStates().begin(); it != gtrack.otherStates().end(); it++) {
00032     const TrgState& gstate = *it;
00033     State* state = new State();
00034     toState(gstate,*state);
00035     track->addToStates(state);
00036   }
00037 
00038   // set the LHCbIDs
00039   std::vector<LHCbID> ids = TrackIDs(gtrack);
00040   track->setLhcbIDs(ids);
00041 
00042   return track;
00043 }

void TrgTrackConverter::toTrgState const State state,
TrgState &  state
[static]
 

Definition at line 143 of file TrgTrackConverter.cpp.

00143                                                                        {
00144   gstate.setStateVector(state.state());
00145   gstate.setCovariance(state.covariance());
00146   gstate.setZ(state.z());
00147 
00148 }

TrgTrack * TrgTrackConverter::toTrgTrack const Track track  )  [static]
 

Definition at line 136 of file TrgTrackConverter.cpp.

00136                                                           {
00137 
00138   TrgTrack* gtrack = new TrgTrack();
00139   return gtrack;
00140 }

std::vector< Track::Flag > TrgTrackConverter::TrackFlags const TrgTrack &  gtrack  )  [static]
 

Definition at line 77 of file TrgTrackConverter.cpp.

Referenced by toTrack().

00077                                                     {
00078   std::vector<Track::Flag> flags;
00079   // if (gtrack.badTrack())
00080   //  flags.push_back(TrackFlag::valid);
00081   //   else if (gtrack.alreadyUsed())
00082   //     flags.push_back(TrackFlag::used);
00083   //   else if (gtrack.backward())
00084   //     flags.push_back(TrackFlag::backward);
00085   //   else if (gtrack.selectedIP2D())
00086   //     flags.push_back(TrackFlag::IPselected);
00087   return flags;
00088 }

std::vector< Track::HistoryFlag > TrgTrackConverter::TrackHistory const TrgTrack &  gtrack  )  [static]
 

Definition at line 71 of file TrgTrackConverter.cpp.

00071                                                       {
00072   std::vector<Track::HistoryFlag> history;
00073   return history;
00074 }

std::vector< LHCbID > TrgTrackConverter::TrackIDs const TrgTrack &  gtrack  )  [static]
 

Definition at line 91 of file TrgTrackConverter.cpp.

Referenced by toTrack().

00091                                                   {
00092   std::vector<LHCbID> ids;
00093   
00094   const std::vector< std::pair<VeloChannelID,int> >& vref 
00095     = gtrack.veloReference();
00096   for (std::vector< std::pair<VeloChannelID,int> >::const_iterator
00097          it = vref.begin(); it != vref.end(); it++) {
00098     const std::pair<VeloChannelID,int>& velo = *it;
00099     LHCbID id = LHCbID(velo.first);
00100     // vid.setSpecific((unsigned) velo.second);
00101     ids.push_back(id);
00102   }
00103 
00104   const std::vector< std::pair<ITChannelID,int> >& itref 
00105     = gtrack.itReference();
00106   for (std::vector< std::pair<ITChannelID,int> >::const_iterator
00107          it = itref.begin(); it != itref.end(); it++) {
00108     const std::pair<ITChannelID,int>& si = *it;
00109     LHCbID id = LHCbID(si.first);
00110     // vid.setSpecific((unsigned) velo.second);
00111     ids.push_back(id);
00112   }
00113 
00114 
00115   const std::vector< std::pair<OTChannelID,int> >& otref 
00116     = gtrack.otReference();
00117   for (std::vector< std::pair<OTChannelID,int> >::const_iterator
00118          it = otref.begin(); it != otref.end(); it++) {
00119     const std::pair<VeloChannelID,int>& ot = *it;
00120     LHCbID id = LHCbID(ot.first);
00121     // vid.setSpecific((unsigned) velo.second);
00122     ids.push_back(id);
00123   }
00124     
00125 
00126   return ids;
00127 }

std::vector< Track::TrackType > TrgTrackConverter::TrackTypes const TrgTrack &  gtrack  )  [static]
 

Definition at line 46 of file TrgTrackConverter.cpp.

Referenced by toTrack().

00046                                                     {
00047   std::vector<Track::TrackType> types;
00048   TrgTrack::TrgTrackType gtype = (TrgTrack::TrgTrackType) gtrack.type();
00049   Track::TrackType type = Track::Velo;
00050   if (gtype == TrgTrack::TypeVeloR )
00051     type = Track::VeloR;
00052   else if (gtype == TrgTrack::TypeVelo3D)
00053     type = Track::Velo;
00054   else if (gtype == TrgTrack::TypeVeloTT)
00055     type = Track::Downstream;
00056   else if (gtype == TrgTrack::TypeLong)
00057     type = Track::Long;
00058   else if (gtype == TrgTrack::TypeDownstream)
00059     type = Track::Downstream;
00060   //  else if (gtype == TrgTrack::TypeKShort)
00061   //  type = Track::KShort;
00062   
00063   types.push_back(type);
00064   
00065   return types;
00066 
00067 
00068 }


The documentation for this class was generated from the following files:
Generated on Thu Apr 7 22:43:32 2005 for New Track Event Model by doxygen 1.4.1