QwAnalysis
QwPMT_Channel.h
Go to the documentation of this file.
1 /**********************************************************\
2 * File: QwPMT_Channel.h *
3 * *
4 * Author: P. M. King *
5 * Time-stamp: <2007-05-08 15:40> *
6 \**********************************************************/
7 
8 #ifndef __QwPMT_CHANNEL__
9 #define __QwPMT_CHANNEL__
10 
11 #include <vector>
12 #include "TTree.h"
13 
14 //jpan: Mersenne Twistor: A 623-diminsionally equidistributed
15 //uniform pseudorandom number generator
16 #include "TRandom3.h"
17 
18 #include "VQwDataElement.h"
19 
20 
21 
22 ///
23 /// \ingroup QwTracking
25  /******************************************************************
26  * Class: QwPMT_Channel
27  *
28  ******************************************************************/
29  public:
30  /// Default constructor
32  // Prepare the random number generator.
33  gRandom->SetSeed();
34  };
35  /// Copy constructor
37  : VQwDataElement(source)
38  { };
39  /// Constructor with name
40  QwPMT_Channel(TString name) {
41  InitializeChannel(name);
42  };
43  /// Virtual destructor
44  virtual ~QwPMT_Channel() { };
45 
46  void InitializeChannel(TString name){
47  SetElementName(name);
49  };
50 
51  void ClearEventData();
52  void RandomizeEventData(int helicity, int SlotNum, int ChanNum);
53  void EncodeEventData(std::vector<UInt_t> &TrigBuffer);
54  Int_t ProcessEvBuffer(UInt_t* buffer, UInt_t num_words_left, UInt_t subelement=0){return 0;};
55 
56  void SetValue(Double_t data) { fValue = data; };
57  Double_t GetValue() const { return fValue; };
58  void SetSubbankID(const Int_t bank_index) { fCrate = bank_index; };
59  void SetModule(const Int_t slot_num) { fModule = slot_num; };
60  Int_t GetSubbankID() const { return fCrate; };
61  Int_t GetModule() const { return fModule; };
62 
63  void ProcessEvent();
64 
65  QwPMT_Channel& operator= (const QwPMT_Channel &value);
66 
67  void ConstructHistograms(TDirectory *folder, TString &prefix);
68  void FillHistograms();
69 
70  void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector<Double_t> &values);
71  void FillTreeVector(std::vector<Double_t> &values) const;
72 
73  void PrintValue() const;
74  void PrintInfo() const;
75  void PrintErrorCounters() const {};
76 
77 
78  protected:
79 
80 
81  private:
82  static const Bool_t kDEBUG;
83 
84  /* ADC Calibration */
85  static const Double_t kPMT_VoltsPerBit;
86 
87  /* Channel information data members */
88 
89 
90  /* Ntuple array indices */
93 
94  /* Event data members */
95  Double_t fValue;
96 
97  Int_t fCrate; ///< ROC number
98  Int_t fModule; ///< slot number
99 };
100 
101 
102 
103 #endif
void PrintInfo() const
Print multiple lines of information about this data element.
Int_t fModule
slot number
Definition: QwPMT_Channel.h:98
void SetValue(Double_t data)
Definition: QwPMT_Channel.h:56
void FillTreeVector(std::vector< Double_t > &values) const
QwPMT_Channel(const QwPMT_Channel &source)
Copy constructor.
Definition: QwPMT_Channel.h:36
void ProcessEvent()
Int_t fCrate
ROC number.
Definition: QwPMT_Channel.h:97
void RandomizeEventData(int helicity, int SlotNum, int ChanNum)
QwPMT_Channel(TString name)
Constructor with name.
Definition: QwPMT_Channel.h:40
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t num_words_left, UInt_t subelement=0)
Process the CODA event buffer for this element.
Definition: QwPMT_Channel.h:54
void PrintValue() const
Print single line of value and error of this data element.
void SetModule(const Int_t slot_num)
Definition: QwPMT_Channel.h:59
Definition of the pure virtual base class of all data elements.
The pure virtual base class of all data elements.
void EncodeEventData(std::vector< UInt_t > &TrigBuffer)
Int_t GetSubbankID() const
Definition: QwPMT_Channel.h:60
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
Int_t GetModule() const
Definition: QwPMT_Channel.h:61
void SetElementName(const TString &name)
Set the name of this element.
void ClearEventData()
Clear the event data in this element.
size_t fTreeArrayIndex
Definition: QwPMT_Channel.h:91
Double_t fValue
Definition: QwPMT_Channel.h:95
static const Double_t kPMT_VoltsPerBit
Definition: QwPMT_Channel.h:85
QwPMT_Channel()
Default constructor.
Definition: QwPMT_Channel.h:31
virtual ~QwPMT_Channel()
Virtual destructor.
Definition: QwPMT_Channel.h:44
void FillHistograms()
Fill the histograms for this data element.
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
Definition: QwPMT_Channel.h:75
QwPMT_Channel & operator=(const QwPMT_Channel &value)
size_t fTreeArrayNumEntries
Definition: QwPMT_Channel.h:92
Double_t GetValue() const
Definition: QwPMT_Channel.h:57
static const Bool_t kDEBUG
Definition: QwPMT_Channel.h:75
void InitializeChannel(TString name)
Definition: QwPMT_Channel.h:46
void SetSubbankID(const Int_t bank_index)
Definition: QwPMT_Channel.h:58