MQinoMiNtpReader.hh

Go to the documentation of this file.
00001 
00030 #ifndef _Q_QINOMINTPREADER_HH
00031 #define _Q_QINOMINTPREADER_HH
00032 
00033 #include "QFileReader.hh"
00034 #include "QCuore.hh"
00035 #include "QTime.hh"
00036 #include <cmath>
00037 #include <cstdio>
00038 #include <cstdlib>
00039 #include <cstring>
00040 #include <ctime>
00041 #include <sys/time.h>
00042 #include <map>
00043 
00044 #define MAX_PAR 25
00045 /*
00046 struct ntp_t{
00047         short ch;
00048         short part;
00049         int ev;
00050         int meas;
00051         unsigned int utime;
00052         unsigned int ftime;
00053         float tdamp;
00054         float fdamp;
00055         float secpeakamp;
00056         float tvl;
00057         float tvr;
00058         float delay;
00059         float spdelay;
00060         float baseline;
00061         float baselineRMS;
00062         float maxmin;
00063         float rt;
00064         float dt;
00065         float afamp;
00066         float aftv;
00067         int type;
00068 };
00069 */
00070 class MQinoMiNtpReader: public QFileReader{
00071 
00072         public:
00073 
00074                 MQinoMiNtpReader(QSequence* s);
00075 
00076                 virtual ~MQinoMiNtpReader();
00077 
00078 
00079         QEvent* Fill(QEvent* ev);
00080 
00081        void Close();
00082 
00083        void Open(const std::string& filename);
00084 
00085        int GetNextEvNumber() { return 0; }
00086            //QTime time();
00087 private:
00088 
00089 
00090        std::vector<std::string>::iterator fFileIter;
00091        struct ntp_t {
00092                Int_t Parami[4];
00093                UInt_t UTime;
00094                UInt_t FTime;
00095                Float_t Paramf[MAX_PAR];
00096 
00097        };
00098 
00099 
00100        struct ntp_head {
00101                Int_t          Start_Event;
00102                Int_t          Measure_Number;
00103                UInt_t         Start_Time;
00104                char           Start_Date[25];
00105                Float_t        Duration;
00106        };
00107 
00108 
00109 
00110        union head_t {
00111                Float_t val;
00112                UInt_t  uival;
00113                Int_t  ival;
00114                Short_t  sival[2];
00115                UShort_t  usival[2]; // MARIA 100210
00116                Char_t  str[4];
00117        };
00118 
00119        //      struct ntp_t fNtp;
00120        ntp_t Ntp;
00121        ntp_head Ntph;
00122        head_t Head;
00123        Float_t header[6];
00124 
00125 
00126        FILE *fp;
00127        Float_t my_bugger[MAX_PAR];
00128        Float_t my_mc[3];
00129        Int_t Measure_time,n_comments,Time_offset,n_elem;
00130 
00131 
00132        // Descriptions map, readed from PMEA fields.
00133        // string: description (meaningfull text)
00134        // int: index in the ntupla
00135        //std::map<std::string, int> fDescriptions;
00136        //  pair: first: index in the ntupla
00137        //        second: data type (8-> unsigned long int )
00138        std::map<std::string, std::pair < int, int> > fDescriptions;
00139        int fNMeanings;
00140         
00141        friend class MQinoMiCompleteDataReader;
00142        friend class MQinoMiCompleteDataReaderFast;
00143 
00144 };
00145 
00146 #endif
00147 

Generated on Tue Nov 16 10:49:59 2010 for CUORE Software by  doxygen 1.5.6