#ifndef _RadioFileIO_h_ #define _RadioFileIO_h_ #include "TObject.h" #include "TFile.h" #include "AERAevent.h" #include #include /** \class RadioFileIO \brief The main class of the AERAROOTIO library which stores the event vector. \brief Store also the svn revision number and the binary file header information. \brief Include the WriteSelectedEvents functions for the converter and for Offline. \author S. Mathys, University of Wuppertal */ class RadioFileIO : public TObject { public: /** Standard constructor */ RadioFileIO(); /** Standard deconstructor */ ~RadioFileIO(); /** Get the run id stored in the binary file header */ Int_t getAeraRadioFileIORunId(); /** Get the run mode stored in the binary file header */ Int_t getAeraRadioFileIORunMode(); /** Get the file id stored in the binary file name ending */ Int_t getAeraRadioFileIOFileId(); /** Get the id of the first event in the binary file */ Int_t getAeraRadioFileIOFirstEventId(); /** Get the time in seconds of the first event in the binary file */ UInt_t getAeraRadioFileIOFirstEventTime(); /** Get the id of the last event in the binary file */ Int_t getAeraRadioFileIOLastEventId(); /** Get the time in seconds of the last event in the binary file */ UInt_t getAeraRadioFileIOLastEventTime(); /** Get the additional header information stored in the binary file header at a certain position in the vRFadd_info vector */ Int_t getAeraRadioFileIOAddInfo(Int_t add_info); /** Get the file status. 0: binary file is corrupt, 2: file is okay */ Short_t getAeraRadioFileIOStatus(); /** Get the svn revision number of the svn repository trunk */ std::string getAeraRadioFileIOSVNRev(); /** Get the pointer to an event inside the vector vAERAevents. Since just one event is written into the vector at the same time, and the vector is cleared after the event is written into the tree, all the events are at the first position. This is done to be consistent with the other classes. */ AERAevent* getAeraRadioFileEvent(); /** Set the run id stored in the binary file header */ void setAeraRadioFileIORunId(Int_t set_RFrun_id); /** Set the run mode stored in the binary file header */ void setAeraRadioFileIORunMode(Int_t set_RFrun_mode); /** Set the file id stored in the binary file name ending */ void setAeraRadioFileIOFileId(Int_t set_RFfile_id); /** Set the id of the first event in the binary file */ void setAeraRadioFileIOFirstEventId(Int_t set_RFfirst_event_id); /** Set the time in seconds of the first event in the binary file */ void setAeraRadioFileIOFirstEventTime(UInt_t set_RFfirst_event_time); /** Set the id of the last event in the binary file */ void setAeraRadioFileIOLastEventId(Int_t set_RFlast_event_id); /** Set the time in seconds of the last event in the binary file */ void setAeraRadioFileIOLastEventTime(UInt_t set_RFlast_event_time); /** Push a new value of the additional header information stored in the binary file header into the vRFadd_info vector */ void setAeraRadioFileIOAddInfo(Int_t set_RFadd_info); /** Set the file status. 0: binary file is corrupt, 2: file is okay */ void setAeraRadioFileIOStatus(Short_t set_RFstatus); /** Set the svn revision number of the svn repository trunk */ void setAeraRadioFileIOSVNRev(std::string set_RFsvn_rev); /** The function enables the write out of selected events with the converter. Arguments are the input ROOT file, the output filename in which the event should be written into and the position of the event inside the tree. */ void WriteSelectedEvents(std::string sroot_filename, std::string starget_filename, int iTreeEntry); /** The function enables the write out of selected events in Offline. Arguments are the input ROOT file, the output filename in which the event should be written into and the position of the event inside the tree. */ void WriteSelectedEventsOffline(std::string sroot_filename, TFile *fFile, int iTreeEntry); /** The function enables the write out of selected events in Offline including modified traces. Arguments are the input ROOT file, the output filename in which the event should be written into, the position of the event inside the tree and a map containing all station ids and all traces for each channel of each station. */ void WriteSelectedEventsOfflineWithTrace( std::string sroot_filename, TFile *fFile, int iTreeEntry, std::map > >& traces); /** This function stores a new instance of an event into the vAERAevents vector by a push_back */ void setAeraRadioFileEvent(); /** Clear the vAERAevents vector */ void clearAeraRadioFileEvent(); private: Int_t RFrun_id; Int_t RFrun_mode; Int_t RFfile_id; Int_t RFfirst_event_id; UInt_t RFfirst_event_time; Int_t RFlast_event_id; UInt_t RFlast_event_time; Short_t RFstatus; std::string RFsvn_rev; /** Store the additional header information */ std::vector vRFadd_info; /** Store the AERAevent objects */ std::vector vAERAevents; ClassDef( RadioFileIO,2 ) }; #endif // _RadioFile_h_