//////////////////////////////////////////////////////////////////////// /// \class RAT::UserTrackInformation /// /// \brief This class represents custom track infromation that we would like to /// keep even if tracking is not enabled. /// /// \author Nuno Barros /// /// REVISION HISTORY: /// 2016-10-23: N Barros - Initial release /// /// \details This class is instanciated through the physics classes to /// provide track information that would not be otherwise available. /// For the moment, the only information that is being stored is a 32 bit /// word representing the photon history. //////////////////////////////////////////////////////////////////////// #ifndef SRC_PHYSICS_USERTRACKINFORMATION_HH_ #define SRC_PHYSICS_USERTRACKINFORMATION_HH_ #include #include #include namespace RAT { class UserTrackInformation: public G4VUserTrackInformation { public: UserTrackInformation(); UserTrackInformation(const G4Track *aTrack); UserTrackInformation(const UserTrackInformation *aTrackInfo); virtual ~UserTrackInformation(); UserTrackInformation& operator=(const UserTrackInformation &right); /// Get the photon history /// /// @return a PhotonHistory UShort_t GetHistory() const {return photonHistory; } /// Set/Unset an item to the photon history /// /// @param[in] bit history item bit, from PhotonHistory enum /// @param[in] status Status to set. If status = 1, set the bit. If status = 0, bit is unset void AddToHistory(DS::MCPE::PhotonHistory bit, DS::MCPE::PhHistoryStatus status = DS::MCPE::hSet) { photonHistory = (photonHistory & ~(0x1 << bit)) | (status << bit); } void ImportHistory(const UserTrackInformation *aTrackInfo); void AddProcessToHistory(const G4Track *aTrack); /// Set the full history (replace id already exists) /// void SetHistory(UShort_t word ) {photonHistory = word;} protected: UShort_t photonHistory; }; } /* namespace RAT */ #endif /* SRC_PHYSICS_USERTRACKINFORMATION_HH_ */