#ifndef TrackParticle_HXX #define TrackParticle_HXX #include #include #include #include using std::vector; namespace COMET { class ITrajectoryTracker; } /// /*! \brief Utilitity class to track a geant trajectory through comet. See method \ref G4Track for normal way to use this class. */ class COMET::ITrajectoryTracker { public: ///\brief Constructor's main job is to set up the pdgdatabase tables if they are not already there. ITrajectoryTracker(); /*! \brief Take one step along a helix of a track with a given momentum, position, and charge. Momentum and position are updated to the new position and momentum. */ void StepHelix(TVector3& position, TVector3& momentum,double charge); /*! \brief Track a particle of a given momentum and charge from start position to end position, filling vector "points" with points starting from nPointStart. Track is rescaled to force it to fit between start and end position even if it missed. This \a partially corrects for the fact that SimG4 does not store all points on a trajectory. */ int TrackParticle(TVector3 StartPosition, TVector3 EndPosition, TVector3 momentum, double charge, vector& points,int nPointStart); /*! \brief Track a geant trajectory through comet. Typical usage: \anchor G4Track \verbatim COMET::IHandle G4Particles = CurrentEvent->Get("truth/G4Trajectories"); COMET::ITrajectoryTracker Tracker; vector points(10000); for (COMET::IG4TrajectoryContainer::const_iterator track = G4Particles->begin(); track != G4Particles->end(); track++) { IG4Trajectory trajectory=(*track).second; int npoint=Tracker.G4Track(trajectory,points); for(uint i=0;i& points); private: /// Return true if a file exists. bool FileExists(TString TstrFilename) ; /// Remember if we found the PDG database. bool fFoundPDG; TDatabasePDG *fPDGDatabase ; }; #endif