00001
00015 #ifndef TPCFIFO_HH
00016 #define TPCFIFO_HH
00017
00018 #include "data_base.hh"
00019 #include "fifo.hh"
00020
00021 namespace larlight {
00022
00027 class tpcfifo : public fifo {
00028
00029 public:
00030
00032 tpcfifo();
00033
00035 tpcfifo(const tpcfifo& original)
00036 : fifo::fifo(original)
00037 { _plane = original._plane ; _signal = original._signal; }
00038
00040 tpcfifo(UShort_t ch,
00041 UInt_t frame,
00042 UInt_t sample,
00043 UChar_t module_address,
00044 UChar_t module_id,
00045 larlight::GEO::View_t plane,
00046 larlight::GEO::SigType_t signaltype,
00047 DATA::DATA_TYPE type,
00048 std::vector<UShort_t> wf) : fifo::fifo(ch,
00049 frame,
00050 sample,
00051 module_address,
00052 module_id,
00053 type,
00054 wf)
00055 { _plane = plane; _signal = signaltype; }
00056
00057
00059 void set_plane ( larlight::GEO::View_t plane ) { _plane=plane;}
00060
00062 void set_signal ( larlight::GEO::SigType_t signal ) { _signal=signal;}
00063
00065 larlight::GEO::View_t plane() const { return _plane; }
00066
00068 larlight::GEO::SigType_t signal() const {return _signal; }
00069
00071 virtual void clear_data();
00072
00074 ~tpcfifo(){}
00075
00076
00077 protected:
00078
00080 virtual void init_vars();
00081
00082 larlight::GEO::View_t _plane;
00083 larlight::GEO::SigType_t _signal;
00084
00086 ClassDef(tpcfifo,5)
00088 };
00089
00090
00095 class event_tpcfifo : public std::vector<larlight::tpcfifo>, public event_base {
00096
00097 public:
00098
00100 event_tpcfifo(DATA::DATA_TYPE type=DATA::FIFO);
00101
00103 event_tpcfifo(const event_tpcfifo& original)
00104 : std::vector<larlight::tpcfifo>(original),
00105 event_base(original),
00106 _event_number(original._event_number),
00107 _event_frame_number(original._event_frame_number),
00108 _module_address(original._module_address),
00109 _module_id(original._module_id),
00110 _fem_trig_frame_number(original._fem_trig_frame_number),
00111 _fem_trig_sample_number(original._fem_trig_sample_number),
00112 _checksum(original._checksum),
00113 _nwords(original._nwords)
00114 {}
00115
00117 ~event_tpcfifo(){}
00118
00120 void set_event_number(UInt_t n) { _event_number = n; }
00121
00123 void set_event_frame_number(UInt_t n) {_event_frame_number=n;}
00124
00126 void set_module_address(UChar_t n) {_module_address=n;}
00127
00129 void set_module_id(UChar_t id) {_module_id=id;}
00130
00132 void set_checksum(UInt_t sum) {_checksum=sum;}
00133
00135 void set_nwords(UInt_t n) {_nwords=n;}
00136
00138 void set_fem_trig_frame_number(UInt_t n) {_fem_trig_frame_number=n;}
00139
00141 void set_fem_trig_sample_number(UInt_t n) {_fem_trig_sample_number=n;}
00142
00144 UInt_t event_number() const { return _event_number;}
00145
00147 UInt_t event_frame_number() const {return _event_frame_number;}
00148
00150 UChar_t module_address() const {return _module_address;}
00151
00153 UChar_t module_id() const {return _module_id;}
00154
00156 UInt_t checksum() const {return _checksum;}
00157
00159 UInt_t nwords() const {return _nwords;}
00160
00162 UInt_t fem_trig_frame_number() const {return _fem_trig_frame_number;}
00163
00165 inline UInt_t fem_trig_sample_number_RAW() const {return _fem_trig_sample_number;}
00166
00168 inline UInt_t fem_trig_sample_number_2MHz() const {return _fem_trig_sample_number;}
00169
00171 inline UInt_t fem_trig_sample_number_16MHz() const {return _fem_trig_sample_number*8;}
00172
00174 inline UInt_t fem_trig_sample_number_64MHz() const {return _fem_trig_sample_number*32;}
00175
00177 virtual void clear_data();
00178
00179
00180 protected:
00181
00182 virtual void init_vars();
00184 UInt_t _event_number;
00185 UInt_t _event_frame_number;
00186 UChar_t _module_address;
00187 UChar_t _module_id;
00188
00189 UInt_t _fem_trig_frame_number;
00190 UInt_t _fem_trig_sample_number;
00191
00192 UInt_t _checksum;
00193 UInt_t _nwords;
00194
00196 ClassDef(event_tpcfifo,6)
00198 };
00199 }
00200 #endif
00201
00203