Belle II Software development
trgtopTRD2TTSConverterModule.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/Module.h>
12#include <framework/datastore/StoreArray.h>
13#include <string>
14
15
16#define NUMBER_OF_TOP_SLOTS 16
17#define MIN_NUMBER_OF_TIMESTAMPS 5
18
19namespace Belle2 {
24 class TOPDigit;
25 class TOPRawDigit;
27 class TRGTOPTimeStamp;
28
36
38
39 public:
40
41 // see TOPDatabaseImporter and TOPRawDigitConverterModule
42 static constexpr int numberOfWindows[] = {0, 428, 852, 1280, 1708, 2132, 2560, 2988, 3412};
43
44 // *64*0.375/8 = 8 * 0.375 = 3
45 static constexpr int timeOfWindows[] = {0, 428 * 3, 852 * 3, 1280 * 3, 1708 * 3, 2132 * 3, 2560 * 3, 2988 * 3, 3412 * 3};
46
48 static constexpr int latencyL1 = 611;
49
51 static constexpr int timeCorrection = 14;
52
54 static constexpr int revo9CounterMax = 1280 * 9;
55
60
62 virtual ~TRGTOPTRD2TTSConverterModule() override;
63
65 virtual void initialize() override;
66
68 virtual void beginRun() override;
69
71 virtual void event() override;
72
74 virtual void endRun() override;
75
77 virtual void terminate() override;
78
80 std::string version() const;
81
82 protected:
83
85
86 private:
87
89 int slot;
90 int value;
91 const Belle2::TOPDigit* refDigit;
92 };
93
94 std::vector<interimTimeStamp> m_interimTimeStamps[NUMBER_OF_TOP_SLOTS];
95
96 struct timeOrder {
97 inline bool operator()(interimTimeStamp const& a, interimTimeStamp const& b)
98 {
99 double i = a.value;
100 double j = b.value;
101 return i < j;
102 }
103 };
104
105
110
111 bool m_addRelations = false;
112
114
115 int m_minNumberOfTimeStamps;
116
119
120 StoreArray<TRGTOPTimeStampsSlot> m_TRGTOPTimeStampsSlots;
121 StoreArray<TRGTOPTimeStamp> m_TRGTOPTimeStamps;
122
123 };
124
125}
Module()
Constructor.
Definition Module.cc:30
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Class to store TOP digitized hits (output of TOPDigitizer or raw data unpacker) relations to TOPSimHi...
Definition TOPDigit.h:24
Class to store unpacked raw data (hits in feature-extraction format) It provides also calculation of ...
Definition TOPRawDigit.h:24
static constexpr int latencyL1
L1 latency in FTSW clock cycles.
StoreArray< TOPRawDigit > m_rawDigits
collection of raw digits
std::string m_outputTimeStampsSlotName
name of TOPTRGTimeStampsSlot store array
bool m_requireMinNumberOfTimeStamps
switch ON/OFF min number of timestamps requirement for individual slots
virtual void initialize() override
Initialize the Module.
std::string m_outputTimeStampName
name of TOPTRGTimeStamp store array
virtual void event() override
This method is the core of the module.
static constexpr int revo9CounterMax
max number of FTSW clocks in revo9 cycle
virtual void endRun() override
This method is called if the current run ends.
virtual void terminate() override
This method is called at the end of the event processing.
TRGTOPTRD2TTSConverterModule()
Constructor: Sets the description, the properties and the parameters of the module.
std::string m_inputRawDigitsName
name of TOPRawDigit store array
int m_eventNumber
Event number (according to L1/global)
virtual void beginRun() override
Called when entering a new run.
static constexpr int timeCorrection
time correction in ns (estimated by comparing trigger readout with main readout
StoreArray< TOPDigit > m_convertedDigits
collection of raw digits
bool m_addRelations
switch ON/OFF relations to TOPRawDigits
std::string m_inputConvertedDigitsName
name of TOPRawDigit store array
std::string version() const
returns version of TRGTOPTRD2TTSConverterModule.
Abstract base class for different kinds of events.