18std::array<float, NChannels>
RecEventScale::fe = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
19std::array<float, NTDCChannels>
RecEventScale::fa = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
23 for (
int ich = 0; ich <
NChannels; ich++) {
33 for (
int ich = 0; ich <
NChannels; ich++) {
71 for (
int ich = 0; ich <
NChannels; ich++) {
109 for (
int ich = 0; ich <
NChannels; ich++) {
110 fe[ich] = 1. / energy;
113 fa[itdc] = 1000. / energy;
120 fe[ich] = 1. / energy;
123 fe[ich] = 1. / energy;
134 fe[ich] = 1. / energy;
137 fe[ich] = 1. / energy;
145void RecEventFlat::init(
const std::vector<o2::zdc::BCRecData>* RecBC,
const std::vector<o2::zdc::ZDCEnergy>* Energy,
const std::vector<o2::zdc::ZDCTDCData>* TDCData,
const std::vector<uint16_t>* Info)
155void RecEventFlat::init(
const gsl::span<const o2::zdc::BCRecData> RecBC,
const gsl::span<const o2::zdc::ZDCEnergy> Energy,
const gsl::span<const o2::zdc::ZDCTDCData> TDCData,
const gsl::span<const uint16_t> Info)
234 if (infoState == 0) {
236 LOGF(error,
"Inconsistent info stream at word %d: 0x%4u",
i, info);
239 code = info & 0x03ff;
240 uint8_t ch = (info >> 10) & 0x1f;
246 LOGF(error,
"Info about non existing channel: %u", ch);
248 }
else if (infoState == 1) {
252 LOGF(error,
"Inconsistent info stream at word %d: 0x%4u",
i, info);
256 }
else if (infoState == 2) {
258 uint32_t maph = info & 0x7fff;
259 map = (maph << 15) | map;
262 LOGF(error,
"Inconsistent info stream at word %d: 0x%4u",
i, info);
272 auto ch = myenergy.ch();
284 auto ch = mytdc.ch();
292 TDCVal[ch].push_back(mytdc.val);
308 printf(
"decodeMapInfo%08x code=%u\n", map, code);
310 for (uint8_t ch = 0; ch <
NChannels; ch++) {
311 if (map & (0x1 << ch)) {
384 LOG(error) <<
"Not managed info code: " << code;
387 mDecodedInfo.emplace_back((code & 0x03ff) | ((ch & 0x1f) << 10));
393 const static float xc[4] = {-1.75, 1.75, -1.75, 1.75};
394 const static float yc[4] = {-1.75, -1.75, 1.75, 1.75};
395 static float c[2] = {0};
407 if (e[0] < -1000000 || e[1] < -1000000 || e[2] < -1000000 || e[3] < -1000000) {
408 c[0] = -std::numeric_limits<float>::infinity();
409 c[1] = -std::numeric_limits<float>::infinity();
417 for (
int i = 0;
i < 4;
i++) {
421 w[
i] = std::sqrt(e[
i]);
423 c[0] +=
w[
i] * xc[
i];
424 c[1] +=
w[
i] * yc[
i];
427 c[0] = -std::numeric_limits<float>::infinity();
428 c[1] = -std::numeric_limits<float>::infinity();
441 const static float xc[4] = {-1.75, 1.75, -1.75, 1.75};
442 const static float yc[4] = {-1.75, -1.75, 1.75, 1.75};
443 static float c[2] = {0};
455 if (e[0] < -1000000 || e[1] < -1000000 || e[2] < -1000000 || e[3] < -1000000) {
456 c[0] = -std::numeric_limits<float>::infinity();
457 c[1] = -std::numeric_limits<float>::infinity();
465 for (
int i = 0;
i < 4;
i++) {
469 w[
i] = std::sqrt(e[
i]);
471 c[0] +=
w[
i] * xc[
i];
472 c[1] +=
w[
i] * yc[
i];
475 c[0] = -std::numeric_limits<float>::infinity();
476 c[1] = -std::numeric_limits<float>::infinity();
547 const static float xc[4] = {-19.6, -14.0, -8.4, -2.8};
548 const static float xq[4] = {19.6 * 19.6, 14.0 * 14.0, 8.4 * 8.4, 2.8 * 2.8};
561 if (e[0] < -1000000 || e[1] < -1000000 || e[2] < -1000000 || e[3] < -1000000) {
562 c = -std::numeric_limits<float>::infinity();
563 d = -std::numeric_limits<float>::infinity();
571 for (
int i = 0;
i < 4;
i++) {
579 c =
c +
w[
i] * xc[
i];
580 d = d +
w[
i] * xq[
i];
583 c = -std::numeric_limits<float>::infinity();
584 d = -std::numeric_limits<float>::infinity();
592 LOGF(warn,
"%s FOP exception @ %d", __FILE__, __LINE__);
593 d = -std::numeric_limits<float>::infinity();
606 const static float xc[4] = {2.8, 8.4, 14.0, 19.6};
607 const static float xq[4] = {2.8 * 2.8, 8.4 * 8.4, 14.0 * 14.0, 19.6 * 19.6};
620 if (e[0] < -1000000 || e[1] < -1000000 || e[2] < -1000000 || e[3] < -1000000) {
621 c = -std::numeric_limits<float>::infinity();
622 d = -std::numeric_limits<float>::infinity();
630 for (
int i = 0;
i < 4;
i++) {
642 c = -std::numeric_limits<float>::infinity();
643 d = -std::numeric_limits<float>::infinity();
651 LOGF(warn,
"%s FOP exception @ %d", __FILE__, __LINE__);
652 d = -std::numeric_limits<float>::infinity();
691 bool is_hit =
triggers & (0x1 << ic);
712 const std::array<bool, NChannels>* maps[
MsgEnd];
734 for (int32_t imsg = 0; imsg <
MsgEnd; imsg++) {
736 if (maps[imsg] ==
nullptr) {
740 for (int32_t isig = 0; isig <
NChannels; isig++) {
741 if (maps[imsg]->
at(isig) ==
true) {
766 int nhit =
NtdcV(itdc);
767 if (
NtdcA(itdc) != nhit) {
768 fprintf(stderr,
"Mismatch in TDC %d data length Val=%d Amp=%d values\n", itdc,
NtdcV(itdc),
NtdcA(ich));
771 for (int32_t ipos = 0; ipos < nhit; ipos++) {
Class to decode the reconstructed ZDC event (single BC with signal in one of detectors)
GLsizei const GLfloat * value
GLubyte GLubyte GLubyte GLubyte w
const int TDCSignal[NTDCChannels]
constexpr int NChPerModule
constexpr int NTDCChannels
constexpr std::string_view MsgText[]
constexpr std::string_view ChannelNames[]
constexpr int NDigiChannels
uint16_t bc
bunch crossing ID of interaction
void getRef(int &firste, int &ne, int &firstt, int &nt, int &firsti, int &ni)
void centroidZPA(float &x, float &rms)
uint64_t mEntry
Event quality information (decoded)
FirstEntry mStopT
Last + 1 energy.
std::array< bool, NChannels > tdcPileM1C
11 TDC in-bunch pile-up error
gsl::span< const o2::zdc::BCRecData > mRecBC
TDC pile-up correction flag (TODO)
std::array< bool, NChannels > isBeg
N info.
std::array< bool, NChannels > tdcSigE
17 TDC pile-up in bunch -3 error
std::array< bool, 4 > mComputed
Interpolated samples.
std::array< bool, NChannels > adcMissingwTDC
8 Pile-up detection from TM trigger bit
std::array< bool, NChannels > tdcPileM2E
14 TDC pile-up in bunch -2 corrected
std::array< bool, NChannels > tdcPedOr
– Event pedestal for TDC
std::array< bool, NChannels > adcPedQC
3 Orbit pedestal for ADC
gsl::span< const o2::zdc::ZDCTDCData > mTDCData
ZDC energy.
std::array< bool, NChannels > tdcPileM3E
16 TDC pile-up in bunch -3 corrected
std::array< bool, NChannels > tdcPileEvC
9 Missing ADC even if TDC is present
void decodeInfo(uint8_t ch, uint16_t code)
FirstEntry mFirstT
First energy.
int NtdcV(uint8_t ich) const
std::array< bool, NChannels > tdcPedMissing
1 QC pedestal for TDC
std::array< bool, NChannels > tdcPileM3C
15 TDC pile-up in bunch -2 error
void printDecodedMessages() const
std::vector< float > TDCVal[NTDCChannels]
signal in ZDCs
std::array< bool, NChannels > genericE
Centroid computed.
std::map< uint8_t, float > ezdc
pattern of channels with autotrigger bit
std::array< bool, NChannels > isEnd
Beginning of sequence.
BCRecData mCurB
End of sequence.
float EZDC(uint8_t ich) const
std::array< bool, NChannels > adcPedMissing
4 QC pedestal for ADC
void centroidZNC(float &x, float &y)
gsl::span< const o2::zdc::ZDCEnergy > mEnergy
Interaction record and references to data.
uint32_t triggers
pattern of decoded energies
FirstEntry mFirstI
First TDC.
void clearBitmaps()
18 Missing TDC signal correction
int NtdcA(uint8_t ich) const
std::array< bool, NChannels > pilePed
6 Anomalous offset from pedestal info
uint32_t mTriggerMask
Verbosity level.
uint32_t ezdcDecoded
pattern of channels acquired
void init(const std::vector< o2::zdc::BCRecData > *RecBC, const std::vector< o2::zdc::ZDCEnergy > *Energy, const std::vector< o2::zdc::ZDCTDCData > *TDCData, const std::vector< uint16_t > *Info)
Trigger mask for printout.
std::array< bool, NChannels > tdcPedEv
0 Generic error
std::vector< uint16_t > mDecodedInfo
Event quality information.
gsl::span< const uint16_t > mInfo
ZDC TDC.
std::array< bool, NChannels > offPed
5 Missing pedestal for ADC
std::array< bool, NChannels > tdcPileEvE
10 TDC in-bunch pile-up corrected
std::array< bool, NChannels > tdcPileM1E
12 TDC pile-up in bunch -1 corrected
FirstEntry mStopI
Last + 1 TDC.
std::array< bool, NChannels > pileTM
7 Pile-up detection from pedestal info
std::array< bool, NChannels > tdcPedQC
– Orbit pedestal for TDC
FirstEntry mStopE
First info.
uint64_t mNEntries
Current entry.
FirstEntry mFirstE
Number of entries.
std::array< bool, NChannels > adcPedEv
2 Missing pedestal for ADC
std::vector< float > TDCAmp[NTDCChannels]
TDC values.
std::array< bool, NChannels > adcPedOr
– Event pedestal for ADC
void centroidZNA(float &x, float &y)
void decodeMapInfo(uint32_t ch, uint16_t code)
void centroidZPC(float &x, float &rms)
std::array< bool, NChannels > tdcPileM2C
13 TDC pile-up in bunch -1 error
static void setNucleonEnergyZP(float energy)
static void setNucleonEnergy(float energy)
static std::array< float, NChannels > fe
static void setNucleonEnergyZN(float energy)
static std::array< float, NTDCChannels > fa
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
uint64_t const void const *restrict const msg