Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:47

0001 #ifndef __ONCSSUB_IDFNALMWPC_H__
0002 #define __ONCSSUB_IDFNALMWPC_H__
0003 
0004 #include <vector>
0005 
0006 #include "oncsSubevent.h"
0007 
0008 #ifndef __CINT__
0009 class WINDOWSEXPORT oncsSub_idfnalmwpc : public  oncsSubevent_w4 {
0010 #else
0011 class oncsSub_idfnalmwpc : public  oncsSubevent_w4 {
0012 #endif
0013 
0014 public:
0015   oncsSub_idfnalmwpc( subevtdata_ptr);
0016   ~oncsSub_idfnalmwpc();
0017 
0018 
0019   int    iValue(const int n, const char *);
0020 
0021 
0022   // for a given trigger, information about the TDC
0023   int    iValue(const int trigger, const int tdc, const char * what);
0024 
0025   // this returns the wire number
0026   int    iValue(const int trigger, const int tdc, const int index);
0027 
0028   // this is the workhorse interface
0029   int    iValue(const int trigger, const int tdc, const int index, const char *what);
0030 
0031 
0032   void  dump ( OSTREAM& os = COUT) ;
0033 
0034 protected:
0035   int *decode (int *);
0036 
0037   int _decoded;
0038 
0039 #define MAXNROFTDCS 16
0040 
0041 
0042   typedef struct {
0043     int wire;
0044     int timestamp;
0045   } TDC_hit;
0046 
0047 
0048   typedef struct {
0049     int hits;
0050     short words;
0051     short TDC;
0052     short EventStatus;
0053     short trigger_nr;
0054     short triggertype;
0055     unsigned short evt_timestamp;
0056     unsigned short local_ts_upper;
0057     unsigned short local_ts_lower;
0058     unsigned long long absolute_time;
0059     std::vector<TDC_hit *> TDCHitlist;
0060   } TDCData;
0061 
0062 
0063   typedef struct {
0064     int trigger_nr;
0065     unsigned short evt_timestamp;
0066     unsigned short local_ts_upper;
0067     unsigned short local_ts_lower;
0068     unsigned long long absolute_time;
0069     TDCData td[MAXNROFTDCS];
0070   } TDCEvent;
0071 
0072   typedef struct {
0073     int spillwords;
0074     int spillcounter;
0075     short year;
0076     short month;
0077     short day;
0078     short hour;
0079     short minute;
0080     short second;
0081     int triggercount;
0082     short TDC_Status_Bits;
0083     short Spill_Link_Status_Bits;
0084   } SpillInfo;
0085 
0086 
0087   typedef struct {
0088     short spillwords;
0089     short TDC;
0090     short spilltriggercount;
0091     short spillstatus;
0092   } TDCspillheader;
0093 
0094 
0095   int tdcmask;
0096   int n_tdcs;
0097   int length;
0098 
0099   SpillInfo spillinfo;
0100 
0101   TDCspillheader tsh[MAXNROFTDCS];
0102 
0103 
0104   std::vector<TDCEvent *> TDCEventVector;
0105 
0106 };
0107 
0108 
0109 
0110 #endif