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) : mMinAmplitudeSideA(minAmplitudeSideA), mMinAmplitudeSideC(minAmplitudeSideC) {}
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
44 std::array<double, o2::constants::lhc::LHCMaxBunches> mTvx{0.0};
45 size_t entries{0};
48
50};
51
52class EventsPerBcCalibrator final : public o2::calibration::TimeSlotCalibration<o2::ft0::EventsPerBcContainer>
53{
55 using TFType = o2::calibration::TFType;
56 using EventsHistogram = std::array<double, o2::constants::lhc::LHCMaxBunches>;
57
58 public:
59 EventsPerBcCalibrator(uint32_t minNumberOfEntries, int32_t minAmplitudeSideA, int32_t minAmplitudeSideC);
60
61 bool hasEnoughData(const Slot& slot) const override;
62 void initOutput() override;
63 void finalizeSlot(Slot& slot) override;
64 Slot& emplaceNewSlot(bool front, TFType tstart, TFType tend) override;
65
66 const std::vector<EventsPerBc>& getTvxPerBc() { return mTvxPerBcs; }
67 std::vector<std::unique_ptr<o2::ccdb::CcdbObjectInfo>>& getTvxPerBcCcdbInfo() { return mTvxPerBcInfos; }
68
69 private:
70 const uint32_t mMinNumberOfEntries;
71 const int32_t mMinAmplitudeSideA;
72 const int32_t mMinAmplitudeSideC;
73
74 std::vector<EventsPerBc> mTvxPerBcs;
75 std::vector<std::unique_ptr<o2::ccdb::CcdbObjectInfo>> mTvxPerBcInfos;
76
77 ClassDefOverride(EventsPerBcCalibrator, 1);
78};
79} // namespace o2::ft0
80
81#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)
void fill(const o2::dataformats::TFIDInfo &ti, const gsl::span< const o2::ft0::Digit > data)
EventsPerBcContainer(int32_t minAmplitudeSideA, int32_t minAmplitudeSideC)
std::array< double, o2::constants::lhc::LHCMaxBunches > mTvx