Project
Loading...
Searching...
No Matches
RecPoint.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#ifndef ALICEO2_FDD_RECPOINT_H
15#define ALICEO2_FDD_RECPOINT_H
16
23
24namespace o2
25{
26namespace fdd
27{
29
30 int mPMNumber = -1; // channel Id
31 int adcId = -1; // QTC chain
32 double mTime = -20000; // time in ps, 0 at the LHC clk center
33 double mChargeADC = -20000; // charge [channels]
34
35 ChannelDataFloat() = default;
36 ChannelDataFloat(int Channel, double Time, double Charge, int AdcId)
37 {
38 mPMNumber = Channel;
39 mTime = Time;
40 mChargeADC = Charge;
41 adcId = AdcId;
42 }
43
44 void print() const;
45
47};
48
50{
51 public:
52 enum TimeTypeIndex : int { TimeA,
54 RecPoint() = default;
55 RecPoint(const std::array<int, 2>& collisiontime, int first, int ne,
57 : mCollisionTimePs(collisiontime)
58 {
59 mRef.setFirstEntry(first);
60 mRef.setEntries(ne);
61 mIntRecord = iRec;
62 mTriggers = triggers;
63 }
64 ~RecPoint() = default;
65
66 float getCollisionTime(TimeTypeIndex type) const { return mCollisionTimePs[type]; }
67 float getCollisionTimeA() const { return getCollisionTime(TimeA); }
68 float getCollisionTimeC() const { return getCollisionTime(TimeC); }
70 void setCollisionTime(Float_t time, TimeTypeIndex type) { mCollisionTimePs[type] = time; }
71
72 const o2::fdd::Triggers getTrigger() const { return mTriggers; }
73 o2::InteractionRecord getInteractionRecord() const { return mIntRecord; };
74 gsl::span<const ChannelDataFloat> getBunchChannelData(const gsl::span<const ChannelDataFloat> tfdata) const
75 {
76 // extract the span of channel data for this bunch from the whole TF data
77 return mRef.getEntries() ? gsl::span<const ChannelDataFloat>(tfdata).subspan(mRef.getFirstEntry(), mRef.getEntries()) : gsl::span<const ChannelDataFloat>();
78 }
79 short static constexpr sDummyCollissionTime = 32767;
80 int getFirstEntry() const { return mRef.getFirstEntry(); }
81 int getEntriesInCurrentBC() const { return mRef.getEntries(); }
82
83 private:
85 o2::InteractionRecord mIntRecord;
86 o2::fdd::Triggers mTriggers; // pattern of triggers in this BC
87 std::array<int, 2> mCollisionTimePs = {sDummyCollissionTime, sDummyCollissionTime}; // in picoseconds
88
89 ClassDefNV(RecPoint, 3);
90};
91} // namespace fdd
92} // namespace o2
93#endif
Container class to store values of single FDD channel.
int16_t time
Definition RawEventData.h:4
Class to refer to the 1st entry and N elements of some group in the continuous container.
~RecPoint()=default
bool isValidTime(TimeTypeIndex type) const
Definition RecPoint.h:69
float getCollisionTimeA() const
Definition RecPoint.h:67
gsl::span< const ChannelDataFloat > getBunchChannelData(const gsl::span< const ChannelDataFloat > tfdata) const
Definition RecPoint.h:74
const o2::fdd::Triggers getTrigger() const
Definition RecPoint.h:72
void setCollisionTime(Float_t time, TimeTypeIndex type)
Definition RecPoint.h:70
float getCollisionTimeC() const
Definition RecPoint.h:68
o2::InteractionRecord getInteractionRecord() const
Definition RecPoint.h:73
float getCollisionTime(TimeTypeIndex type) const
Definition RecPoint.h:66
RecPoint()=default
int getEntriesInCurrentBC() const
Definition RecPoint.h:81
static short constexpr sDummyCollissionTime
Definition RecPoint.h:79
int getFirstEntry() const
Definition RecPoint.h:80
RecPoint(const std::array< int, 2 > &collisiontime, int first, int ne, o2::InteractionRecord iRec, o2::fdd::Triggers triggers)
Definition RecPoint.h:55
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
struct o2::upgrades_utils::@459 fdd
Collision labels.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
ClassDefNV(ChannelDataFloat, 1)
ChannelDataFloat(int Channel, double Time, double Charge, int AdcId)
Definition RecPoint.h:36