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