Project
Loading...
Searching...
No Matches
EventsPerBcCalibrator.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_FT0TVXPERBCID
13#define O2_FT0TVXPERBCID
14
15#include <bitset>
16#include <array>
17#include <limits>
18#include <TH1F.h>
19
28#include "TH1F.h"
29#include "Rtypes.h"
30
31namespace o2::ft0
32{
34 EventsPerBcContainer(int32_t minAmplitudeSideA, int32_t minAmplitudeSideC, int32_t minSumOfAmplitude) : mMinAmplitudeSideA(minAmplitudeSideA), mMinAmplitudeSideC(minAmplitudeSideC), mMinSumOfAmplitude(minSumOfAmplitude) {}
35
36 size_t getEntries() const { return entries; }
37 void print() const;
38 void fill(const o2::dataformats::TFIDInfo& ti, const gsl::span<const o2::ft0::Digit> data);
39 void merge(const EventsPerBcContainer* prev);
40
41 const int32_t mMinAmplitudeSideA;
42 const int32_t mMinAmplitudeSideC;
43 const int32_t mMinSumOfAmplitude;
44
45 std::array<double, o2::constants::lhc::LHCMaxBunches> mTvx{0.0};
46 size_t entries{0};
49
51};
52
53class EventsPerBcCalibrator final : public o2::calibration::TimeSlotCalibration<o2::ft0::EventsPerBcContainer>
54{
56 using TFType = o2::calibration::TFType;
57 using EventsHistogram = std::array<double, o2::constants::lhc::LHCMaxBunches>;
58
59 public:
60 EventsPerBcCalibrator(uint32_t minNumberOfEntries, int32_t minAmplitudeSideA, int32_t minAmplitudeSideC, int32_t minSumOfAmplitude);
61
62 bool hasEnoughData(const Slot& slot) const override;
63 void initOutput() override;
64 void finalizeSlot(Slot& slot) override;
65 Slot& emplaceNewSlot(bool front, TFType tstart, TFType tend) override;
66
67 const std::vector<EventsPerBc>& getTvxPerBc() { return mTvxPerBcs; }
68 std::vector<std::unique_ptr<o2::ccdb::CcdbObjectInfo>>& getTvxPerBcCcdbInfo() { return mTvxPerBcInfos; }
69
70 private:
71 const uint32_t mMinNumberOfEntries;
72 const int32_t mMinAmplitudeSideA;
73 const int32_t mMinAmplitudeSideC;
74 const int32_t mMinSumOfAmplitude;
75
76 std::vector<EventsPerBc> mTvxPerBcs;
77 std::vector<std::unique_ptr<o2::ccdb::CcdbObjectInfo>> mTvxPerBcInfos;
78
79 ClassDefOverride(EventsPerBcCalibrator, 1);
80};
81} // namespace o2::ft0
82
83#endif
2D messeageable histo class
Header to collect LHC related constants.
Slot & emplaceNewSlot(bool front, TFType tstart, TFType tend) override
void finalizeSlot(Slot &slot) override
const std::vector< EventsPerBc > & getTvxPerBc()
bool hasEnoughData(const Slot &slot) const override
std::vector< std::unique_ptr< o2::ccdb::CcdbObjectInfo > > & getTvxPerBcCcdbInfo()
GLboolean * data
Definition glcorearb.h:298
uint32_t TFType
Definition TimeSlot.h:29
void merge(const EventsPerBcContainer *prev)
ClassDefNV(EventsPerBcContainer, 1)
EventsPerBcContainer(int32_t minAmplitudeSideA, int32_t minAmplitudeSideC, int32_t minSumOfAmplitude)
void fill(const o2::dataformats::TFIDInfo &ti, const gsl::span< const o2::ft0::Digit > data)
std::array< double, o2::constants::lhc::LHCMaxBunches > mTvx