Back to home page

sPhenix code displayed by LXR

 
 

    


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

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