Project
Loading...
Searching...
No Matches
FV0ChannelTimeOffsetSlotContainer.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
12#ifndef O2_FV0CHANNELTIMEOFFSETSLOTCONTAINER_H
13#define O2_FV0CHANNELTIMEOFFSETSLOTCONTAINER_H
14
15#include <array>
16#include <vector>
17#include <gsl/span>
20#include "FV0Base/Constants.h"
21#include "Rtypes.h"
22#include <boost/histogram.hpp>
23namespace o2::fv0
24{
25
27{
28
29 // ranges to be discussed
30 static constexpr int HISTOGRAM_RANGE = 2000;
31 static constexpr unsigned int NUMBER_OF_HISTOGRAM_BINS = 2 * HISTOGRAM_RANGE;
32
33 using BoostHistogramType = boost::histogram::histogram<std::tuple<boost::histogram::axis::integer<>,
34 boost::histogram::axis::integer<>>,
35 boost::histogram::unlimited_storage<std::allocator<char>>>;
36
37 public:
38 explicit FV0ChannelTimeOffsetSlotContainer(std::size_t minEntries);
39 [[nodiscard]] bool hasEnoughEntries() const;
40 void fill(const gsl::span<const FV0CalibrationInfoObject>& data);
41 [[nodiscard]] int16_t getMeanGaussianFitValue(std::size_t channelID) const;
43 void print() const;
44 static int sGausFitBins;
45 void updateFirstCreation(std::uint64_t creation)
46 {
47 if (creation < mFirstCreation) {
48 mFirstCreation = creation;
49 }
50 }
52 {
53 mFirstCreation = std::numeric_limits<std::uint64_t>::max();
54 }
55 std::uint64_t getFirstCreation() const
56 {
57 return mFirstCreation;
58 }
59 FV0ChannelTimeCalibrationObject generateCalibrationObject(long, long, const std::string&) const;
60
61 private:
62 std::size_t mMinEntries;
63 std::array<uint64_t, Constants::nFv0Channels> mEntriesPerChannel{};
64 BoostHistogramType mHistogram;
65 std::uint64_t mFirstCreation = std::numeric_limits<std::uint64_t>::max();
66
67 ClassDefNV(FV0ChannelTimeOffsetSlotContainer, 2);
68};
69
70} // namespace o2::fv0
71
72#endif // O2_FV0CHANNELTIMEOFFSETSLOTCONTAINER_H
General constants in FV0.
uint8_t channelID
Definition RawEventData.h:8
void fill(const gsl::span< const FV0CalibrationInfoObject > &data)
void merge(FV0ChannelTimeOffsetSlotContainer *prev)
FV0ChannelTimeCalibrationObject generateCalibrationObject(long, long, const std::string &) const
GLboolean * data
Definition glcorearb.h:298