Project
Loading...
Searching...
No Matches
PHOSL1phaseCalibrator.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_CALIBRATION_PHOSL1PHASE_CALIBRATOR_H
13#define O2_CALIBRATION_PHOSL1PHASE_CALIBRATOR_H
14
17
18#include "Framework/Task.h"
25
26using namespace o2::framework;
27
28namespace o2
29{
30namespace phos
31{
32
34{
35 public:
38
39 ~PHOSL1phaseSlot() = default;
40
41 void print() const;
42 void fill(const gsl::span<const Cell>& cells, const gsl::span<const TriggerRecord>& trs);
43 void fill(const gsl::span<const Cell>& /*cells*/){}; // not used
44 void merge(const PHOSL1phaseSlot* prev);
45 void clear();
46
47 void addMeanRms(std::array<std::array<float, 4>, 14>& sumMean, std::array<std::array<float, 4>, 14>& sumRMS, std::array<float, 14>& sumNorm);
48 void addQcHistos(std::array<unsigned int, 1400> (&sum)[5]);
49
50 void setRunStartTime(long tf) { mRunStartTime = tf; }
51
52 private:
53 static constexpr int mDDL = 14;
54 long mRunStartTime = 0;
55 float mEmin = 1.5;
56 float mTimeMin = -200.e-9;
57 float mTimeMax = 200.e-9;
58 std::array<std::array<float, 4>, mDDL> mRMS;
59 std::array<std::array<float, 4>, mDDL> mMean;
60 std::array<float, mDDL> mNorm;
61 std::array<unsigned int, 1400> mQcHisto[4];
62 BadChannelsMap* mBadMap = nullptr;
63 CalibParams* mCalibParams = nullptr;
64 ClassDefNV(PHOSL1phaseSlot, 2);
65};
66
67//==========================================================================================
68class PHOSL1phaseCalibrator final : public o2::calibration::TimeSlotCalibration<o2::phos::PHOSL1phaseSlot>
69{
71
72 public:
74 ~PHOSL1phaseCalibrator() final = default;
75
76 bool hasEnoughData(const Slot& slot) const final;
77 void initOutput() final;
78 void finalizeSlot(Slot& slot) final;
79 Slot& emplaceNewSlot(bool front, TFType tstart, TFType tend) final;
80 bool process(TFType tf, const gsl::span<const Cell>& clu, const gsl::span<const TriggerRecord>& trs);
81 void endOfStream();
82
83 int getCalibration() { return mL1phase; }
84 std::array<unsigned int, 1400>& getQcHistos() { return mQcHisto[4]; }
85
86 private:
87 static constexpr int mDDL = 14;
88 long mRunStartTime = 0;
89 std::array<std::array<float, 4>, mDDL> mRMS;
90 std::array<std::array<float, 4>, mDDL> mMean;
91 std::array<float, mDDL> mNorm;
92 int mL1phase = 0;
93 std::array<unsigned int, 1400> mQcHisto[5];
94
95 ClassDefOverride(PHOSL1phaseCalibrator, 3);
96};
97
98} // namespace phos
99} // namespace o2
100
101#endif
CCDB container for bad (masked) channels in PHOS.
Slot & emplaceNewSlot(bool front, TFType tstart, TFType tend) final
~PHOSL1phaseCalibrator() final=default
bool hasEnoughData(const Slot &slot) const final
std::array< unsigned int, 1400 > & getQcHistos()
void fill(const gsl::span< const Cell > &cells, const gsl::span< const TriggerRecord > &trs)
void addQcHistos(std::array< unsigned int, 1400 >(&sum)[5])
void merge(const PHOSL1phaseSlot *prev)
void fill(const gsl::span< const Cell > &)
void addMeanRms(std::array< std::array< float, 4 >, 14 > &sumMean, std::array< std::array< float, 4 >, 14 > &sumRMS, std::array< float, 14 > &sumNorm)
Header for data corresponding to the same hardware trigger adapted from DataFormatsEMCAL/TriggerRecor...
float sum(float s, o2::dcs::DataPointValue v)
Definition dcs-ccdb.cxx:39
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< GPUReconstructionTimeframe > tf
VectorOfTObjectPtrs other
Cluster clu
std::vector< Cell > cells