Project
Loading...
Searching...
No Matches
RecPoints.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef ALICEO2_FT0_RECPOINTS_H
16#define ALICEO2_FT0_RECPOINTS_H
17
23#include <array>
24#include "Rtypes.h"
25#include <TObject.h>
26#include <gsl/span>
27#include <string>
28#include <utility>
29#include <map>
30namespace o2
31{
32namespace ft0
33{
34
36
37 int ChId = -1; // channel Id
38 int ChainQTC = -1; // QTC chain
39 float CFDTime = -20000; // time in ps, 0 at the LHC clk center
40 float QTCAmpl = -20000; // Amplitude mV
41
42 ChannelDataFloat() = default;
43 ChannelDataFloat(int iPmt, float time, float charge, int chainQTC)
44 {
45 ChId = iPmt;
46 CFDTime = time;
48 ChainQTC = chainQTC;
49 }
50
51 void print() const;
52 bool operator==(const ChannelDataFloat&) const = default;
53
55};
56
58{
59
60 public:
65
66 // Enum for trigger nits specified in rec-points and AOD data
67 enum ETriggerBits { kOrA = 0, // OrA time-trigger signal
68 kOrC = 1, // OrC time-trigger signal
69 kSemiCentral = 2, // Semi-central amplitude-trigger signal
70 kCentral = 3, // Central amplitude-trigger signal
71 kVertex = 4, // Vertex time-trigger signal
72 kIsActiveSideA = 5, // Side-A has at least one channel active
73 kIsActiveSideC = 6, // Side-C has at least one channel active
74 kIsFlangeEvent = 7 // Flange event at Side-C, at least one channel has time which corresponds to -82 cm area
75 };
76 static const inline std::map<unsigned int, std::string> sMapTriggerBits = {
77 {ETriggerBits::kOrA, "OrA"},
78 {ETriggerBits::kOrC, "OrC"},
79 {ETriggerBits::kSemiCentral, "Semicentral"},
80 {ETriggerBits::kCentral, "Central"},
81 {ETriggerBits::kVertex, "Vertex"},
82 {ETriggerBits::kIsActiveSideA, "IsActiveSideA"},
83 {ETriggerBits::kIsActiveSideC, "IsActiveSideC"},
84 {ETriggerBits::kIsFlangeEvent, "IsFlangeEvent"}};
85
86 enum ETechnicalBits { kLaser = 0, // indicates the laser was triggered in this BC
87 kOutputsAreBlocked = 1, // indicates that laser-induced pulses should arrive from detector to FEE in this BC (and trigger outputs are blocked)
88 kDataIsValid = 2, // data is valid for processing
89 };
90 static const inline std::map<unsigned int, std::string> sMapTechnicalBits = {
91 {ETechnicalBits::kLaser, "Laser"},
92 {ETechnicalBits::kOutputsAreBlocked, "OutputsAreBlocked"},
93 {ETechnicalBits::kDataIsValid, "DataIsValid"}};
94
96 o2::InteractionRecord mIntRecord; // Interaction record (orbit, bc)
97 RecPoints() = default;
98 RecPoints(const std::array<short, 4>& collisiontime,
99 int first, int ne, o2::InteractionRecord iRec, o2::fit::Triggers chTrig)
100 : mCollisionTime(collisiontime)
101 {
102 ref.setFirstEntry(first);
103 ref.setEntries(ne);
104 mIntRecord = iRec;
105 mTriggers = chTrig;
106 }
107 RecPoints(int chDataFirstEntryPos,
108 int chDataNEntries,
110 const std::array<short, 4>& arrTimes,
111 const o2::fit::Triggers& digitTriggers,
112 uint8_t extraTriggerWord) : mIntRecord(ir), mCollisionTime(arrTimes), mTriggers(digitTriggers)
113 {
114 ref.setFirstEntry(chDataFirstEntryPos);
115 ref.setEntries(chDataNEntries);
116 initRecPointTriggers(digitTriggers, extraTriggerWord);
117 }
118
119 ~RecPoints() = default;
120
121 short getCollisionTime(int side) const { return mCollisionTime[side]; }
123 short getCollisionTimeA() const { return getCollisionTime(kTimeA); }
124 short getCollisionTimeC() const { return getCollisionTime(kTimeC); }
126 void setCollisionTime(short time, int side) { mCollisionTime[side] = time; }
127
128 short getVertex() const { return getCollisionTime(kTimeVertex); }
129 void setVertex(short vertex) { mCollisionTime[kTimeVertex] = vertex; }
130
131 o2::fit::Triggers getTrigger() const { return mTriggers; }
132 void setTriggers(o2::fit::Triggers trig) { mTriggers = trig; }
133 uint8_t getTechnicalWord() const { return mTechnicalWord; }
134 static constexpr uint8_t makeExtraTrgWord(bool isActiveA = true, bool isActiveC = true, bool isFlangeEvent = true)
135 {
136 return (static_cast<uint8_t>(isActiveA) << kIsActiveSideA) |
137 (static_cast<uint8_t>(isActiveC) << kIsActiveSideC) |
138 (static_cast<uint8_t>(isFlangeEvent) << kIsFlangeEvent);
139 }
140
142 gsl::span<const ChannelDataFloat> getBunchChannelData(const gsl::span<const ChannelDataFloat> tfdata) const;
143 short static constexpr sDummyCollissionTime = 32767;
144
145 void print() const;
146 bool operator==(const RecPoints&) const = default;
147
148 private:
149 void initRecPointTriggers(const o2::fit::Triggers& digitTriggers, uint8_t extraTrgWord = 0)
150 {
151 const auto digitTriggerWord = digitTriggers.getTriggersignals();
152 const auto trgAndTechWordPair = o2::fit::Triggers::parseDigitTriggerWord(digitTriggerWord, true);
153 mTriggers.setTriggers(trgAndTechWordPair.first | extraTrgWord);
154 mTechnicalWord = trgAndTechWordPair.second;
155 }
156
157 std::array<short, 4> mCollisionTime = {sDummyCollissionTime,
161 o2::fit::Triggers mTriggers; // pattern of triggers in this BC
162 uint8_t mTechnicalWord{0}; // field for keeping ETechnicalBits
163 ClassDefNV(RecPoints, 4);
164};
165} // namespace ft0
166} // namespace o2
167#endif
Class to describe fired and stored channels for the BC and to refer to channel data.
int16_t charge
Definition RawEventData.h:5
uint64_t vertex
Definition RawEventData.h:9
int16_t time
Definition RawEventData.h:4
Class to refer to the 1st entry and N elements of some group in the continuous container.
uint32_t side
Definition RawData.h:0
uint8_t getTriggersignals() const
Definition Triggers.h:95
void setTriggers(uint8_t trgsig, uint8_t chanA, uint8_t chanC, int32_t aamplA, int32_t aamplC, int16_t atimeA, int16_t atimeC)
Definition Triggers.h:103
static constexpr std::pair< uint8_t, uint8_t > parseDigitTriggerWord(uint8_t digitWord, bool shiftTechBitsToBegin=false)
Definition Triggers.h:73
short getCollisionTimeA() const
Definition RecPoints.h:123
static constexpr uint8_t makeExtraTrgWord(bool isActiveA=true, bool isActiveC=true, bool isFlangeEvent=true)
Definition RecPoints.h:134
o2::dataformats::RangeReference< int, int > ref
Definition RecPoints.h:95
uint8_t getTechnicalWord() const
Definition RecPoints.h:133
static short constexpr sDummyCollissionTime
Definition RecPoints.h:143
void print() const
Definition RecPoints.cxx:35
short getCollisionTimeC() const
Definition RecPoints.h:124
bool isValidTime(int side) const
Definition RecPoints.h:125
static const std::map< unsigned int, std::string > sMapTechnicalBits
Definition RecPoints.h:90
short getVertex() const
Definition RecPoints.h:128
static const std::map< unsigned int, std::string > sMapTriggerBits
Definition RecPoints.h:76
o2::fit::Triggers getTrigger() const
Definition RecPoints.h:131
RecPoints(int chDataFirstEntryPos, int chDataNEntries, const o2::InteractionRecord &ir, const std::array< short, 4 > &arrTimes, const o2::fit::Triggers &digitTriggers, uint8_t extraTriggerWord)
Definition RecPoints.h:107
short getCollisionTimeMean() const
Definition RecPoints.h:122
short getCollisionTime(int side) const
Definition RecPoints.h:121
o2::InteractionRecord getInteractionRecord() const
Definition RecPoints.h:141
void setTriggers(o2::fit::Triggers trig)
Definition RecPoints.h:132
RecPoints(const std::array< short, 4 > &collisiontime, int first, int ne, o2::InteractionRecord iRec, o2::fit::Triggers chTrig)
Definition RecPoints.h:98
void setVertex(short vertex)
Definition RecPoints.h:129
bool operator==(const RecPoints &) const =default
void setCollisionTime(short time, int side)
Definition RecPoints.h:126
o2::InteractionRecord mIntRecord
Definition RecPoints.h:96
~RecPoints()=default
gsl::span< const ChannelDataFloat > getBunchChannelData(const gsl::span< const ChannelDataFloat > tfdata) const
Definition RecPoints.cxx:29
struct o2::upgrades_utils::@461 ft0
structure to keep V0C information
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static constexpr double DummyTime
ChannelDataFloat(int iPmt, float time, float charge, int chainQTC)
Definition RecPoints.h:43
ClassDefNV(ChannelDataFloat, 1)
bool operator==(const ChannelDataFloat &) const =default
o2::InteractionRecord ir(0, 0)