GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TFragment.h
Go to the documentation of this file.
1// Author: Peter C. Bender 06/14
2
3/** \addtogroup Sorting
4 * @{
5 */
6
7#ifndef TFRAGMENT_H
8#define TFRAGMENT_H
9
10#include "TDetectorHit.h"
11#include "TPPG.h"
12
13#include <iostream>
14#include <vector>
15#include <ctime>
16
17#include "Rtypes.h"
18
19/////////////////////////////////////////////////////////////////
20///
21/// \class TFragment
22///
23/// This Class contains all of the information in an event
24/// fragment
25///
26/////////////////////////////////////////////////////////////////
27
28class TFragment : public TDetectorHit {
29public:
30 TFragment();
31 TFragment(const TFragment&) = default;
32 TFragment(TFragment&&) = default;
33 ~TFragment() = default;
34
35 TFragment& operator=(const TFragment&) = default; // use default assignment operator (to shut up gcc 9.1)
36 TFragment& operator=(TFragment&&) = default; // use default move assignment operator (to shut up gcc 9.1)
37
38 //////////////////// basic setter functions ////////////////////
39
40 void SetAcceptedChannelId(UShort_t value) { fAcceptedChannelId = value; }
41 void SetCcLong(Int_t value) { fCcLong = value; }
42 void SetCcShort(Int_t value) { fCcShort = value; }
43 void SetChannelId(UInt_t value) { fChannelId = value; }
44 void SetModuleType(UShort_t value) { fModuleType = value; }
45 void SetDeadTime(UShort_t value) { fDeadTime = value; }
46 void SetDetectorType(UShort_t value) { fDetectorType = value; }
48 void SetDaqId(Int_t value) { fDaqId = value; }
49 void SetFragmentId(Int_t value) { fFragmentId = value; }
50 void SetDaqTimeStamp(time_t value) { fDaqTimeStamp = value; }
51 void SetNetworkPacketNumber(Int_t value) { fNetworkPacketNumber = value; }
52 void SetNumberOfFilters(UShort_t)
53 {
54 std::cerr << "Error, " << __PRETTY_FUNCTION__ << " called, TFragment shouldn't have a number of filters." << std::endl; // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
55 }
56 void SetNumberOfPileups(Short_t value) { fNumberOfPileups = value; }
57 void SetNumberOfWords(UShort_t value) { fNumberOfWords = value; }
58 void SetTriggerBitPattern(Int_t value) { fTriggerBitPattern = value; }
59 void SetTriggerId(Long_t value) { fTriggerId.push_back(value); }
60 void SetZc(Int_t value) { fZc = value; }
61
62 //////////////////// basic getter functions ////////////////////
63
64 UShort_t GetAcceptedChannelId() const { return fAcceptedChannelId; }
65 Int_t GetCcLong() const { return fCcLong; }
66 Int_t GetCcShort() const { return fCcShort; }
67 UInt_t GetChannelId() const { return fChannelId; }
68 Long64_t GetEntryNumber() const { return fEntryNumber; }
69 UShort_t GetModuleType() const { return fModuleType; }
70 UShort_t GetDeadTime() const { return fDeadTime; }
71 UShort_t GetDetectorType() const { return fDetectorType; }
72 Int_t GetDaqId() const { return fDaqId; }
73 Int_t GetFragmentId() const { return fFragmentId; }
74 time_t GetDaqTimeStamp() const { return fDaqTimeStamp; }
76 UShort_t GetNumberOfFilters() const { return fNumberOfWords - 9; }
77 Short_t GetNumberOfPileups() const { return fNumberOfPileups; }
78 UShort_t GetNumberOfWords() const { return fNumberOfWords; }
79 Int_t GetTriggerBitPattern() const { return fTriggerBitPattern; }
80 Long_t GetTriggerId(size_t iter = 0) const
81 {
82 if(iter < fTriggerId.size()) {
83 return fTriggerId[iter];
84 }
85 return 0;
86 }
87 Int_t GetZc() const { return fZc; }
88
89 //////////////////// advanced getter functions ////////////////////
90
91 TPPG* GetPPG();
92 double GetTZero() const;
93 ULong64_t GetTimeInCycle();
94 ULong64_t GetCycleNumber();
95 Int_t Get4GCfd() const;
96
97 //////////////////// misc. functions ////////////////////
98 bool IsDetector(const char* prefix, Option_t* opt = "CA") const;
99
100 void Clear(Option_t* opt = "") override;
101 void Print(Option_t* opt = "") const override;
102
103 void Print(std::ostream& out) const override;
104
105 TObject* Clone(const char* name = "") const override;
106
107 bool operator<(const TFragment& rhs) const { return (GetTimeStamp() < rhs.GetTimeStamp()); }
108 bool operator>(const TFragment& rhs) const { return (GetTimeStamp() > rhs.GetTimeStamp()); }
109
110 Int_t GetSharcMesyBoard() const;
111
112private:
113 //////////////////// data members, sorted by size (as far as possible) to reduce padding ////////////////////
114 time_t fDaqTimeStamp; ///< Timestamp of the Daq event
115 Int_t fDaqId; ///< Daq ID
116 Int_t fFragmentId; ///< Channel Trigger ID ??? not needed anymore ???
117 Int_t fTriggerBitPattern; ///< PrimaryFilterPattern in Griffin DAQ
118 Int_t fNetworkPacketNumber; ///< Network packet number
119 UInt_t fChannelId; ///< Threshold crossing counter for a channel
120 UInt_t fAcceptedChannelId; ///< Accepted threshold crossing counter for a channel
121
122 /// Added to combine Grif Fragment ////
123
124 UShort_t fDeadTime; ///< Deadtime from trigger
125 UShort_t fModuleType; ///< Data Type (GRIF-16, 4G, etc.)
126 UShort_t fDetectorType; ///< Detector Type (PACES,HPGe, etc.)
127 Short_t fNumberOfPileups; ///< Number of piled up hits 1-3
128
129 std::vector<Long_t> fTriggerId; ///< PrimaryFilterID in Griffin DAQ
130
131 //////////////////// transient members ////////////////////
132 TPPG* fPPG; //!<! Programmable pattern generator value
133
134 Long64_t fEntryNumber; //!<! Entry number in fragment tree
135 Int_t fZc; //!<! Zero-crossing value from 4G (saved in separate branch)
136 Int_t fCcShort; //!<! Short integration over waveform peak from 4G (saved in separate branch)
137 Int_t fCcLong; //!<! Long integration over waveform tail from 4G (saved in separate branch)
138 UShort_t fNumberOfWords; //!<! Number of non-waveform words in fragment, only used for check while parsing the fragment
139
140 static Long64_t fNumberOfFragments;
141
142 // int NumberOfHits; //!<! transient member to count the number of pile-up hits in the original fragment
143 // int HitIndex; //!<! transient member indicating which pile-up hit this is in the original fragment
144
145 /// \cond CLASSIMP
146 ClassDefOverride(TFragment, 8) // NOLINT(readability-else-after-return)
147 /// \endcond
148};
149/*! @} */
150#endif // TFRAGMENT_H
virtual Long64_t GetTimeStamp(Option_t *="") const
UShort_t fDeadTime
Added to combine Grif Fragment ////.
Definition TFragment.h:124
Int_t fDaqId
Daq ID.
Definition TFragment.h:115
Long64_t GetEntryNumber() const
Definition TFragment.h:68
Int_t GetCcLong() const
Definition TFragment.h:65
TObject * Clone(const char *name="") const override
Definition TFragment.cxx:45
void SetZc(Int_t value)
Definition TFragment.h:60
TFragment & operator=(const TFragment &)=default
void SetDaqTimeStamp(time_t value)
Definition TFragment.h:50
UInt_t fChannelId
Threshold crossing counter for a channel.
Definition TFragment.h:119
bool IsDetector(const char *prefix, Option_t *opt="CA") const
void SetTriggerBitPattern(Int_t value)
Definition TFragment.h:58
void SetDaqId(Int_t value)
Definition TFragment.h:48
Int_t GetFragmentId() const
Definition TFragment.h:73
UShort_t GetNumberOfFilters() const
Definition TFragment.h:76
void SetTriggerId(Long_t value)
Definition TFragment.h:59
ULong64_t GetTimeInCycle()
Definition TFragment.cxx:67
Long64_t fEntryNumber
! Entry number in fragment tree
Definition TFragment.h:134
Int_t GetNetworkPacketNumber() const
Definition TFragment.h:75
Int_t GetZc() const
Definition TFragment.h:87
double GetTZero() const
Definition TFragment.cxx:53
void Print(Option_t *opt="") const override
Definition TFragment.cxx:98
time_t fDaqTimeStamp
Timestamp of the Daq event.
Definition TFragment.h:114
void SetDeadTime(UShort_t value)
Definition TFragment.h:45
UShort_t GetModuleType() const
Definition TFragment.h:69
void SetNetworkPacketNumber(Int_t value)
Definition TFragment.h:51
Int_t GetTriggerBitPattern() const
Definition TFragment.h:79
void SetModuleType(UShort_t value)
Definition TFragment.h:44
std::vector< Long_t > fTriggerId
PrimaryFilterID in Griffin DAQ.
Definition TFragment.h:129
void SetCcShort(Int_t value)
Definition TFragment.h:42
Int_t fTriggerBitPattern
PrimaryFilterPattern in Griffin DAQ.
Definition TFragment.h:117
void SetFragmentId(Int_t value)
Definition TFragment.h:49
UShort_t fNumberOfWords
! Number of non-waveform words in fragment, only used for check while parsing the fragment
Definition TFragment.h:138
void SetAcceptedChannelId(UShort_t value)
Definition TFragment.h:40
Int_t fCcShort
! Short integration over waveform peak from 4G (saved in separate branch)
Definition TFragment.h:136
void SetEntryNumber()
Definition TFragment.h:47
TFragment & operator=(TFragment &&)=default
UShort_t GetDeadTime() const
Definition TFragment.h:70
Int_t fNetworkPacketNumber
Network packet number.
Definition TFragment.h:118
TFragment(const TFragment &)=default
UShort_t GetAcceptedChannelId() const
Definition TFragment.h:64
Int_t GetDaqId() const
Definition TFragment.h:72
UInt_t GetChannelId() const
Definition TFragment.h:67
Short_t fNumberOfPileups
Number of piled up hits 1-3.
Definition TFragment.h:127
UShort_t fModuleType
Data Type (GRIF-16, 4G, etc.)
Definition TFragment.h:125
Int_t Get4GCfd() const
Definition TFragment.cxx:62
Int_t fZc
! Zero-crossing value from 4G (saved in separate branch)
Definition TFragment.h:135
Int_t GetSharcMesyBoard() const
void SetChannelId(UInt_t value)
Definition TFragment.h:43
UInt_t fAcceptedChannelId
Accepted threshold crossing counter for a channel.
Definition TFragment.h:120
Long_t GetTriggerId(size_t iter=0) const
Definition TFragment.h:80
ULong64_t GetCycleNumber()
Definition TFragment.cxx:79
void SetNumberOfFilters(UShort_t)
Definition TFragment.h:52
void Clear(Option_t *opt="") override
Definition TFragment.cxx:17
UShort_t fDetectorType
Detector Type (PACES,HPGe, etc.)
Definition TFragment.h:126
Short_t GetNumberOfPileups() const
Definition TFragment.h:77
void SetDetectorType(UShort_t value)
Definition TFragment.h:46
TFragment(TFragment &&)=default
Int_t fFragmentId
Channel Trigger ID ??? not needed anymore ???
Definition TFragment.h:116
void SetCcLong(Int_t value)
Definition TFragment.h:41
time_t GetDaqTimeStamp() const
Definition TFragment.h:74
Int_t fCcLong
! Long integration over waveform tail from 4G (saved in separate branch)
Definition TFragment.h:137
void SetNumberOfPileups(Short_t value)
Definition TFragment.h:56
bool operator>(const TFragment &rhs) const
Definition TFragment.h:108
UShort_t GetDetectorType() const
Definition TFragment.h:71
~TFragment()=default
TPPG * fPPG
! Programmable pattern generator value
Definition TFragment.h:132
TPPG * GetPPG()
Definition TFragment.cxx:90
static Long64_t fNumberOfFragments
Definition TFragment.h:140
bool operator<(const TFragment &rhs) const
Definition TFragment.h:107
void SetNumberOfWords(UShort_t value)
Definition TFragment.h:57
UShort_t GetNumberOfWords() const
Definition TFragment.h:78
Int_t GetCcShort() const
Definition TFragment.h:66
Definition TPPG.h:130