Project
Loading...
Searching...
No Matches
PHOSHGLGRatioCalibDevice.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_PHOSHGLGRATIO_CALIBRATOR_H
13#define O2_CALIBRATION_PHOSHGLGRATIO_CALIBRATOR_H
14
17
18#include "Framework/Task.h"
20#include "PHOSBase/Mapping.h"
22#include "TH2.h"
23
24using namespace o2::framework;
25
26namespace o2
27{
28namespace phos
29{
30
32{
33
34 union PairAmp {
35 uint32_t mDataWord;
36 struct {
37 uint32_t mHGAmp : 16;
38 uint32_t mLGAmp : 16;
39 };
40 };
41
42 public:
43 explicit PHOSHGLGRatioCalibDevice(bool useCCDB, bool forceUpdate) : mUseCCDB(useCCDB), mForceUpdate(forceUpdate) {}
44 void init(o2::framework::InitContext& ic) final;
45
47
49
50 protected:
52 void fillRatios();
53 void calculateRatios();
54 void checkRatios();
55
56 private:
57 bool mUseCCDB = false;
58 bool mForceUpdate = false;
59 bool mUpdateCCDB = true;
60 static constexpr short kMinorChange = 10;
61 long mRunStartTime = 0;
62 std::unique_ptr<CalibParams> mCalibParams;
63 std::unique_ptr<const CalibParams> mOldCalibParams;
64 int mStatistics = 100000;
65 short mMinLG = 20;
66 short minimalStatistics = 100;
67 std::map<short, PairAmp> mMapPairs;
68 std::unique_ptr<TH2F> mhRatio;
69 std::array<float, o2::phos::Mapping::NCHANNELS + 1> mRatioDiff;
70};
71
72DataProcessorSpec getHGLGRatioCalibSpec(bool useCCDB, bool forceUpdate);
73
74} // namespace phos
75} // namespace o2
76
77#endif
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
void run(o2::framework::ProcessingContext &pc) final
void init(o2::framework::InitContext &ic) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
PHOSHGLGRatioCalibDevice(bool useCCDB, bool forceUpdate)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
DataProcessorSpec getHGLGRatioCalibSpec(bool useCCDB, bool forceUpdate)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...