// // File : EyeRunHeader.hh // // Purpose: Header file for EyeRunHeader.cc, // containing the class declarations for TEyeRunHeader // // $Id: EyeRunHeader.hh 12083 2011-02-21 17:11:42Z mathes $ // #ifndef _EyeRunHeader_hh_ #define _EyeRunHeader_hh_ #include #include #include #include /** @file EyeRunHeader.hh * Declaration of the class TEyeRunHeader. * @author H.-J. Mathes, FzK */ #include #include /** Class for the run header of an Eye RUN. */ class TEyeRunHeader : public TObject { public: /** Constructor for the class TEyeRunHeader. */ TEyeRunHeader(); /** Copy constructor of the class TEyeRunHeader. */ TEyeRunHeader(const TEyeRunHeader& rhs) : TObject(rhs) { *this = rhs; } /** Destructor of the class TEyeRunHeader. */ virtual ~TEyeRunHeader(); /** Assignment operator for the class TEyeRunHeader. */ TEyeRunHeader& operator=(const TEyeRunHeader&); /** Clear the contents of the TEyeRunHeader. */ virtual void Clear(Option_t *option=""); /** Print the contents of the TEyeRunHeader to the specified ostream. */ virtual void Show(std::ostream& ostr=std::cout); // --- getters ... /** Get the version of the EyeEvent library used to create this * data file. */ unsigned int GetEyeEventVersion() { return fEyeEventVersion; } /** Get the version of the EVB package used to create/write this * data file. */ unsigned int GetEvbVersion() { return fEvbVersion; } /** Get the official number of the Eye which measured that event. */ unsigned int GetEyeNo() { return fEyeNumber; } /** Get the version of the MiEvent library used to create this * data file. */ unsigned int GetMiEventVersion() { return fMiEventVersion; } /** Get the bit vector indicating Mirrors present or not. */ unsigned int GetMirrorStatus() { return fMirrorStatus; } /** Get the version of the readout package which read the data * from the hardware. */ unsigned int GetReadoutVersion() { return fReadoutVersion; } /** Return the current RUN number. */ unsigned int GetRunNo() { return fRunNo; } /** Get a reference to the start time object. */ const FdRoot::TTimeStamp& GetStartTime() { return fStartTime; } /** Get the User Name. */ const TString& GetUserName() { return fUserName; } /** Get the user comment. */ const TString& GetUserComment() { return fComment; } /** Test if the specified mirror is present in the DAQ. * * @param mirror_id the mirrors id, range 1 .. 6 * * Note: This variable is set at the beginning of a RUN. So if the * configuration changes (mirrors appear/disappear), this variable * reflects only the initial conditions. */ Bool_t IsMirrorPresent(unsigned int mirror_id); // --- setters ... /** Set the user comment. */ void SetComment(const TString& comment) { fComment = comment; } /** Set the version of the 'Evb' program. */ void SetEvbVersion(unsigned int eversion) { fEvbVersion = eversion; } /** Set the actual Eye number which is also stored in the RUN header. * * Note 1: No check on the passed eye number is done !
* Note 2: The constructor of this class tries to determine the * current eye number automatically ! */ void SetEyeNo(unsigned int eye_no) { fEyeNumber = (unsigned char)eye_no; } /** Set a flag that mirror is present in this RUN. * * @param mirror_id the mirrors id, range 1 .. 6, if outside this range, * nothing will happen. */ void SetMirrorPresent(unsigned int mirror_id); /** Set the bit vector indicating Mirrors present or not. */ void SetMirrorStatus(unsigned int status) { fMirrorStatus = (unsigned char)(status & 0x3f); } /** Set the version of the 'readout' program. */ void SetReadoutVersion(unsigned int rversion) { fReadoutVersion = rversion; } /** Set the RUN number of the current RUN. */ void SetRunNo(unsigned int run_no) { fRunNo = run_no; } /** Set version dependent information about data format and data creators * in the RUN header. * * Note: As the version of the 'readout' and 'Evb' programs cannot * determined automatically, they must be set explicitely ! */ void SetVersionInformation(); /** Set the start time of the current RUN. */ void SetStartTime(const FdRoot::TTimeStamp& t) { fStartTime = t; } /** Set User name. */ void SetUserName(const TString& user) { fUserName = user; } protected: /** Get the version number code verbosely. */ static const std::string GetVersionCodeVerbosely(unsigned int); private: UChar_t fEyeNumber; // Eye number (1..4) UChar_t fMirrorStatus; // bit for each mirror in DAQ UInt_t fRunNo; // run number of current RUN FdRoot::TTimeStamp fStartTime; // time when the RUN was started TString fUserName; // name of the user who did DAQ TString fComment; // RUN specific comment string UInt_t fEvbVersion; // version of the event builder UInt_t fEyeEventVersion; // version of the MiEvent data fmt. UInt_t fMiEventVersion; // version of the MiEvent data fmt. UInt_t fReadoutVersion; // version of the readout program ClassDef(TEyeRunHeader,EyeEVENTVERSIONv2) }; #endif // _EyeRunHeader_hh_