FairRoot/PandaRoot
PndMvdPastaDigi.h
Go to the documentation of this file.
1 /*
2  * PndMvdPastaDigi.h
3  *
4  * Created on: 23.09.2017
5  * Author: Stockmanns
6  */
7 
8 #ifndef MVD_MVDTESTBEAM_PASTATB_PNDMVDPASTADIGIFULL_H_
9 #define MVD_MVDTESTBEAM_PASTATB_PNDMVDPASTADIGIFULL_H_
10 
11 #include "Rtypes.h"
12 #include "TObject.h"
13 
14 #include <ostream>
15 
16  class RunSummary : public TObject
17  {
18  public :
19  RunSummary();
21  int fCrcMatchCount;
24  std::vector<ULong64_t> fAllCountedFrames;
26 
31 
32  ClassDef(RunSummary, 1);
33  };
34 
35  class ThresholdDataFullMode : public TObject
36  {
37  public :
40  int t_coarse;
41  int t_soc;
42  int t_eoc;
43  int channelId;
44  int tacId;
45 
47  out << "t_coarse: " << data.t_coarse << " t_soc " << data.t_soc << " t_eoc " << data.t_eoc <<
48  " channelId " << data.channelId << " tacId " << data.tacId;
49  return out;
50  }
52  };
53 
54  class FrameHeader : public TObject
55  {
56  public :
57  FrameHeader();
59  ULong64_t frameId;
60  int nEvents;
62 
63  };
64 
65 class PndMvdPastaDigi : public TObject {
66 public:
67 
69 
72  fFrameHeader(header), fTimeBranch(time), fEnergyBranch(energy)
73  {
74  fToT = CalcTot();
76  };
77 
78  virtual ~PndMvdPastaDigi();
79 
82  void SetHeader (FrameHeader header) { fFrameHeader = header; }
83 
84  ULong64_t CalcTimeStamp(){
85  ULong64_t timeStamp = fFrameHeader.frameId * 1024 + fTimeBranch.t_coarse;
86  fTimeStamp = timeStamp;
87  return timeStamp;
88  }
89 
90  int CalcTot(){
92 
93  if (tot < 0){
94  tot += 1024;
95  }
96  fToT = tot;
97  return tot;
98  }
99 
100  int GetTot(){ return fToT; }
101 
102  ULong64_t GetTimeStamp(){ return fTimeStamp; };
103  int GetChannelId(branchId id);
104 
105 
107  out << std::dec << " Header: nHits " << digi.fFrameHeader.nEvents << " frameId: " << digi.fFrameHeader.frameId << std::endl;
108  out << "TimeBranch: " << digi.fTimeBranch << std::endl;
109  out << "EnergyBranch: " << digi.fEnergyBranch << std::endl;
110  return out;
111  }
112 
113 private:
117  ULong64_t fTimeStamp;
118  int fToT;
119 
121 };
122 
123 #endif /* MVD_MVDTESTBEAM_PASTATB_PNDMVDPASTADIGIFULL_H_ */
ThresholdDataFullMode fTimeBranch
ClassDef(FrameHeader, 1)
FrameHeader fFrameHeader
TClonesArray * digi
void SetTimeBranch(ThresholdDataFullMode time)
void SetEnergyBranch(ThresholdDataFullMode energy)
virtual ~PndMvdPastaDigi()
ULong64_t fTimeStamp
ClassDef(PndMvdPastaDigi, 1)
int fWrongFrameCount
count of all frames where the expected frame ID did not match the frameID in the header ...
int fWrongHitCount
count of all frames where the hits in the header do not match the data
int fSingleWordFrames
count of all frames with just one word. This is an error a frame has at least two words ...
PndMvdPastaDigi(FrameHeader header, ThresholdDataFullMode time, ThresholdDataFullMode energy)
friend std::ostream & operator<<(std::ostream &out, const PndMvdPastaDigi &digi)
ULong64_t frameId
void SetHeader(FrameHeader header)
ULong64_t GetTimeStamp()
int fAllPartialResets
count of all partial resets detected
int fMissingFrames
count of all missing frames (not very reliable)
int fCrcErrorCount
count of all frames with wrong CRC
std::vector< ULong64_t > fAllCountedFrames
counts all frames within a partial reset
TFile * out
Definition: reco_muo.C:20
ThresholdDataFullMode fEnergyBranch
ClassDef(ThresholdDataFullMode, 1)
ULong64_t CalcTimeStamp()
ClassDef(RunSummary, 1)
int fSuperFrameCount
count of frame counter overflow (should not happen because the frame counter is HUGE ...
friend std::ostream & operator<<(std::ostream &out, const ThresholdDataFullMode &data)
int GetChannelId(branchId id)
int fCrcMatchCount
count of all frames with correct CRC
Double_t energy
Definition: plot_dirc.C:15