Belle II Software development
TOPInterimFENtupleModule.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <framework/core/HistoModule.h>
12
13#include <TTree.h>
14
15namespace Belle2 {
25
26 public:
27
32
37
42 virtual void initialize() override;
43
48 virtual void beginRun() override;
49
53 virtual void event() override;
54
59 virtual void endRun() override;
60
65 virtual void terminate() override;
66
70 virtual void defineHisto() override;
71
72 private:
73
77 enum { c_NWindow = 4, c_NModule = 16, c_NSamplePerWindow = 64, c_NWaveformSample = 256,
78 c_NSampleTBC = 256, c_NPixelPerModule = 512, c_NWindowRingBuffer = 512,
79 c_NMaxHitPerChannel = 5, c_NMaxHitEvent = 5000, c_NTotalScrod = 64
80 };
81
82 TTree* m_tree = 0;
83 unsigned m_calibrationChannel = 0;
84 bool m_saveWaveform = false;
85 bool m_useDoublePulse = true;
86 // float m_averageSamplingRate = 2.71394; /**< sampling rate with assumption of uniform interval in a unit of GHz */
88 600;
90 450;
93 float m_timePerWin = 23.581939;
95 1;
97 0;
99 int m_nHit = 0;
100 unsigned m_eventNumCopper[c_NModule] = {0};
101 unsigned m_ttuTime[c_NModule] = {0};
102 unsigned m_ttcTime[c_NModule] = {0};
103 short m_slotNum[c_NMaxHitEvent] = {0};
104 short m_pixelId[c_NMaxHitEvent] = {0};
105 short m_channelId[c_NMaxHitEvent] = {0};
106 bool m_isCalCh[c_NMaxHitEvent] = {0};
107 unsigned m_eventNum = 0;
108 short m_winNum[c_NMaxHitEvent] = {0};
109 short m_eventWinNum[c_NMaxHitEvent] = {0};
110 short m_trigWinNum[c_NMaxHitEvent] = {0};
111 short m_revo9Counter[c_NMaxHitEvent] = {0};
112 short m_winNumList[c_NMaxHitEvent][c_NWindow] = {{0}};
113 bool m_windowsInOrder[c_NMaxHitEvent] = {0};
114 unsigned char m_hitQuality[c_NMaxHitEvent] = {0};
115 bool m_isReallyJunk[c_NMaxHitEvent] = {0};
116 float m_time[c_NMaxHitEvent] = {0};
117 float m_rawTime[c_NMaxHitEvent] = {0};
118 float m_refTime[c_NMaxHitEvent] = {0};
120 0;
121 unsigned short m_sample[c_NMaxHitEvent] = {0};
122 float m_height[c_NMaxHitEvent] = {0};
123 float m_integral[c_NMaxHitEvent] = {0};
124 float m_width[c_NMaxHitEvent] = {0};
125 unsigned short m_peakSample[c_NMaxHitEvent] = {0};
126 char m_offlineFlag[c_NMaxHitEvent] = {0};
127 short m_nHitOfflineFE[c_NMaxHitEvent] = {0};
128 short m_waveformStartSample[c_NMaxHitEvent] = {0};
129 unsigned short m_nWaveformSample[c_NMaxHitEvent] = {0};
130 short m_waveform[c_NMaxHitEvent][c_NWaveformSample] = {{0}};
132 short m_nFEHeader = 0;
134 short m_nWaveform = 0;
135 unsigned m_errorFlag = 0;
137 unsigned m_eventErrorFlag = 0;
140 int m_nDebugInfo = 0;
141 unsigned short m_scrodCtime[c_NTotalScrod] = { 0 };
142 unsigned short m_phase[c_NTotalScrod] = { 0 };
143 unsigned short m_asicMask[c_NTotalScrod] = { 0 };
144 unsigned short m_eventQueuDepth[c_NTotalScrod] = { 0 };
145 unsigned short m_eventNumberByte[c_NTotalScrod] = { 0 };
154 void getReferenceTiming();
155
156 };
157
159} //namespace Belle2
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Module to produce ntuple from TOPDigits and TOPRawDigits.
unsigned short m_scrodCtime[c_NTotalScrod]
ctime recorded in scrod header
bool m_useDoublePulse
set true when you require both of double calibration pulses for reference timing
float m_calibrationPulseInterval
nominal DeltaT value (time interval of two calibration signals) in a unit of ns
short m_nWaveform
m_waveforms in TOPInterimFEInfo, # of waveformes
short m_nFEHeader
m_FEHeaders in TOPInterimFEInfo, the total # of FE headers found
short m_winNumList[c_NMaxHitEvent][c_NWindow]
list of window numbers for recorded waveform, valid only when waveform analysis is enabled
float m_integral[c_NMaxHitEvent]
"m_integral" in TOPDigit, but not available
unsigned m_eventNum
event number taken from EventMetaData
short m_slotNum[c_NMaxHitEvent]
"m_moduleID" in TOPDigit, slot number
short m_channelId[c_NMaxHitEvent]
"m_channel" in TOPDigit
short m_winNum[c_NMaxHitEvent]
"m_window" in TOPRawDigit
int m_globalRefSlotNum
slot number used to define "global" reference timing (a single reference timing in an event for all t...
short m_waveformStartSample[c_NMaxHitEvent]
start sample number of waveform segment (only for production FW)
unsigned short m_eventNumberByte[c_NTotalScrod]
least significant byte of FE event number
float m_calibrationPulseIntervalRange
tolerable shift of DeltaT from its nominal before calibration in a unit of ns
unsigned short m_sample[c_NMaxHitEvent]
(m_rawTDC+m_winNum*64)%256, for time base correction
unsigned short m_peakSample[c_NMaxHitEvent]
sample number for peak
float m_calibrationPulseThreshold2
minimum pulse height for the secon calibration pulse to be qualified as calibration signals
int m_nDebugInfo
number of ProductionEventDebug (in a unit of number of boardstack)
float m_refTime[c_NMaxHitEvent]
time of the first calibration signal as reference timing.
int m_nHit
number of hits for the event
unsigned m_errorFlag
m_errorFlags in TOPInterimFEInfo, defined in the TOPInterimFEInfo.h
float m_height[c_NMaxHitEvent]
"m_pulseHeight" in new TOPDigit (update at May, 2017)
short m_trigWinNum[c_NMaxHitEvent]
"m_lastWriteAddr" in TOPRawDigit, window # when trigger is issued
unsigned short m_eventQueuDepth[c_NTotalScrod]
trigger FIRO queue depth
char m_offlineFlag[c_NMaxHitEvent]
=-1 if the channel does not have waveform information, =0 when the hit comes from online FE,...
short m_revo9Counter[c_NMaxHitEvent]
"m_revo9Counter" in TOPRawDigit
float m_width[c_NMaxHitEvent]
"m_pulseWidth" in TOPDigit, full width at half maximum of the pulse, converted into unit of samples f...
short m_eventWinNum[c_NMaxHitEvent]
"m_firstWindow" in TOPDigit
unsigned m_eventErrorFlag
m_errorFlags in EventMetaData, 0x1 : CRC error
float m_time[c_NMaxHitEvent]
time in a unit of ns, defined as m_rawTime+64*m_winNum.
short m_waveform[c_NMaxHitEvent][c_NWaveformSample]
waveform from TOPRawWaveform, if not exist, filled with -32767
unsigned m_ttuTime[c_NModule]
counter for TTclock, stored in COPPER
short m_pixelId[c_NMaxHitEvent]
"m_pixelID" in TOPDigit
float m_timePerWin
time interval of onw window (=64 samples) [ns]
unsigned m_calibrationChannel
asic channel number where the calibration pulses are routed
short m_nHitOfflineFE[c_NMaxHitEvent]
number of hits for each pixel
float m_calibrationPulseThreshold1
minimum pulse height for the first calibration pulse to be qualified as calibration signals
unsigned char m_hitQuality[c_NMaxHitEvent]
"m_quality" in TOPDigit, =0:junk, =1:good, =2:charge sharing, =3:cross talk, =4:cal.
bool m_windowsInOrder[c_NMaxHitEvent]
"areWindowsInOrder()" ; false if the window number of all (4) windows taken from TOPRawWaveform::getR...
unsigned m_eventNumCopper[c_NModule]
event number stored in COPPER
int m_globalRefAsicNum
asic number used to define "global" reference timing.
float m_globalRefTime
refTime of the specific asic, which is specified by parameters "globalRefSlotNum" and "globalRefAsicN...
unsigned short m_phase[c_NTotalScrod]
event phase
unsigned short m_asicMask[c_NTotalScrod]
asic mask bit pattern
float m_rawTime[c_NMaxHitEvent]
"m_rawTime" [0-256] in new TOPDigit (update at May, 2017) in sample(time bin) unit
bool m_isCalCh[c_NMaxHitEvent]
true if the hit is in the calibration channel
unsigned m_ttcTime[c_NModule]
counter for TTclock, stored in COPPER
bool m_isReallyJunk[c_NMaxHitEvent]
true if pedestal jump or other invalid hit is detected, not saved
short m_nEmptyFEHeader
m_emptyFEHeaders in TOPInterimFEInfo, the total # of empty FE headers
unsigned short m_nWaveformSample[c_NMaxHitEvent]
number of waveform samples
bool m_saveWaveform
set true when you want to save waveform data
void getReferenceTiming()
Find reference timing.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
virtual void endRun() override
End-of-run action.
virtual void terminate() override
Termination action.
virtual void beginRun() override
Called when entering a new run.
virtual void defineHisto() override
Module funcions to define histograms.
Abstract base class for different kinds of events.