QwAnalysis
MQwV775TDC.h
Go to the documentation of this file.
1 /**********************************************************\
2 * File: MQwV775TDC.h *
3 * *
4 * Author: P. M. King *
5 * J. H. Lee *
6 * Time-stamp: <2010-04-12 12:12> *
7 \**********************************************************/
8 
9 
10 #ifndef __MQwV775TDC__
11 #define __MQwV775TDC__
12 
13 #include "Rtypes.h"
14 #include <cstdlib>
15 #include <iostream>
16 
17 ///
18 /// \ingroup QwAnalysis
19 class MQwV775TDC{
20  /******************************************************************
21  * Class: MQwV775TDC
22  * Mix-in class containing decoding functions for the V775TDC
23  * 32-bit dataword.
24  * The functions in this class will decode a single word
25  * of V775TDC data and provide the components of the word
26  * through member functions.
27  *
28  * The decoding of the CAEN V792 ADC is nearly identical;
29  * the 792 does not use the "DataValidBit", so it is
30  * disabled in this version to allow this class to work
31  * for both the ADC and TDC.
32  ******************************************************************/
33  public:
34  MQwV775TDC();
35  ~MQwV775TDC();
36 
37  void DecodeTDCWord(UInt_t &word, const UInt_t roc_id=0);
38 
39  Bool_t IsValidDataword() {return fV775ValidFlag;};
40  Bool_t IsHeaderword() {return fV775HeaderFlag;};
41 
42  UInt_t GetTDCSlotNumber() {return fV775SlotNumber;};
44  UInt_t GetTDCData() {return fV775Dataword;};
46 
47  UInt_t GetTDCEventNumber() {return fV775EventNumber;};
48  UInt_t GetTDCTriggerTime();
49 
50  void SetReferenceParameters(Double_t mindiff, Double_t maxdiff,
51  Double_t offset, Double_t shift){
52  // Do nothing, but keep this function to behave like
53  // the MQwF1TDC class.
54  };
55 
56  Double_t SubtractReference(Double_t rawtime, Double_t reftime);
57  Bool_t CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t num_words);
58  void PrintTDCHeader(Bool_t flag) ;
59  void PrintTDCData(Bool_t flag) ;
60 
61  private:
62  static const UInt_t kV775Mask_SlotNumber;
63  static const UInt_t kV775Mask_WordType;
64 
65  static const UInt_t kV775Mask_CrateNumber;
66  static const UInt_t kV775Mask_HitChannels;
67 
68  static const UInt_t kV775Mask_EventCounter;
69 
70  static const UInt_t kV775Mask_ChannelNumber;
71  static const UInt_t kV775Mask_DataValidBit;
72  static const UInt_t kV775Mask_UnderthresholdBit;
73  static const UInt_t kV775Mask_OverflowBit;
74  static const UInt_t kV775Mask_Dataword;
75 
76  static const UInt_t kV775WordType_NotValid;
77  static const UInt_t kV775WordType_Header;
78  static const UInt_t kV775WordType_Tail;
79  static const UInt_t kV775WordType_Datum;
80 
83 
86  UInt_t fV775Dataword;
89 
90 };
91 
92 #endif
UInt_t fV775EventNumber
Definition: MQwV775TDC.h:88
UInt_t GetTDCChannelNumber()
Definition: MQwV775TDC.h:43
static const UInt_t kV775Mask_ChannelNumber
Definition: MQwV775TDC.h:70
UInt_t GetTDCData()
Definition: MQwV775TDC.h:44
static const UInt_t kV775Mask_EventCounter
Definition: MQwV775TDC.h:68
static const UInt_t kV775Mask_Dataword
Definition: MQwV775TDC.h:74
static const UInt_t kV775Mask_HitChannels
Definition: MQwV775TDC.h:66
static const UInt_t kV775WordType_NotValid
Definition: MQwV775TDC.h:76
void PrintTDCHeader(Bool_t flag)
Definition: MQwV775TDC.cc:115
static const UInt_t kV775Mask_WordType
Definition: MQwV775TDC.h:63
UInt_t GetTDCMaxChannels()
Definition: MQwV775TDC.h:45
static const UInt_t kV775WordType_Header
Definition: MQwV775TDC.h:77
void SetReferenceParameters(Double_t mindiff, Double_t maxdiff, Double_t offset, Double_t shift)
Definition: MQwV775TDC.h:50
UInt_t fV775Dataword
Definition: MQwV775TDC.h:86
static const UInt_t kV775Mask_CrateNumber
Definition: MQwV775TDC.h:65
UInt_t GetTDCTriggerTime()
Definition: MQwV775TDC.cc:94
void DecodeTDCWord(UInt_t &word, const UInt_t roc_id=0)
Definition: MQwV775TDC.cc:53
UInt_t fV775MaxChannelsPerModule
Definition: MQwV775TDC.h:87
static const UInt_t kV775Mask_DataValidBit
Definition: MQwV775TDC.h:71
UInt_t fV775ChannelNumber
Definition: MQwV775TDC.h:85
void PrintTDCData(Bool_t flag)
Definition: MQwV775TDC.cc:121
UInt_t GetTDCSlotNumber()
Definition: MQwV775TDC.h:42
UInt_t fV775SlotNumber
Definition: MQwV775TDC.h:84
Double_t SubtractReference(Double_t rawtime, Double_t reftime)
Definition: MQwV775TDC.cc:86
static const UInt_t kV775Mask_OverflowBit
Definition: MQwV775TDC.h:73
static const UInt_t kV775WordType_Tail
Definition: MQwV775TDC.h:78
Bool_t fV775HeaderFlag
Definition: MQwV775TDC.h:82
UInt_t GetTDCEventNumber()
Definition: MQwV775TDC.h:47
Bool_t CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t num_words)
Definition: MQwV775TDC.cc:107
Bool_t fV775ValidFlag
Definition: MQwV775TDC.h:81
static const UInt_t kV775WordType_Datum
Definition: MQwV775TDC.h:79
static const UInt_t kV775Mask_SlotNumber
Definition: MQwV775TDC.h:62
Bool_t IsHeaderword()
Definition: MQwV775TDC.h:40
Bool_t IsValidDataword()
Definition: MQwV775TDC.h:39
static const UInt_t kV775Mask_UnderthresholdBit
Definition: MQwV775TDC.h:72