Project
Loading...
Searching...
No Matches
OfflineCalibSpec.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_EMCAL_OFFLINECALIB_SPEC
13#define O2_EMCAL_OFFLINECALIB_SPEC
14
15#include <string>
22#include "Framework/Task.h"
23
24#include "TFile.h"
25#include "TH1.h"
26#include "TH2.h"
27#include "THnSparse.h"
28
29namespace o2
30{
31
32namespace emcal
33{
34
43{
45
46 public:
50 OfflineCalibSpec(bool makeCellIDTimeEnergy, bool rejectCalibTriggers, bool rejectL0Trigger, std::shared_ptr<o2::emcal::CalibLoader> calibHandler) : mMakeCellIDTimeEnergy(makeCellIDTimeEnergy), mRejectCalibTriggers(rejectCalibTriggers), mRejectL0Triggers(rejectL0Trigger), mCalibrationHandler(calibHandler){};
51
53 ~OfflineCalibSpec() override = default;
54
57 void init(framework::InitContext& ctx) final;
58
62 void finaliseCCDB(framework::ConcreteDataMatcher& matcher, void* obj) final;
63
67 void run(framework::ProcessingContext& ctx) final;
68
73
74 static const char* getCTPDigitsBinding() { return "CTPDigits"; }
75 static const char* getCTPConfigBinding() { return "CTPConfig"; }
76
77 private:
79 void updateCalibObjects();
80 std::unique_ptr<TH2> mCellAmplitude;
81 std::unique_ptr<TH2> mCellTime;
82 std::unique_ptr<TH2> mCellTimeLG;
83 std::unique_ptr<TH2> mCellTimeHG;
84 std::unique_ptr<TH1> mNevents;
85 std::unique_ptr<THnSparseF> mCellTimeEnergy;
86 std::shared_ptr<CalibLoader> mCalibrationHandler;
87 GainCalibrationFactors* mGainCalibFactors;
88 bool mMakeCellIDTimeEnergy = true;
89 bool mRejectCalibTriggers = true;
90 bool mEnableGainCalib = false;
91 bool mRejectL0Triggers = false;
92 std::vector<uint64_t> mSelectedClassMasks = {};
93};
94
98o2::framework::DataProcessorSpec getEmcalOfflineCalibSpec(bool makeCellIDTimeEnergy, bool rejectCalibTriggers, bool rejectL0Trigger, uint32_t inputsubspec, bool enableGainCalib, bool ctpcfgperrun);
99
100} // namespace emcal
101
102} // namespace o2
103
104#endif // O2_EMCAL_OFFLINECALIB_SPEC
definition of CTPConfiguration and related CTP structures
definition of CTPDigit, CTPInputDigit
CCDB container for the gain calibration factors.
Task for producing offline calibration objects.
~OfflineCalibSpec() override=default
Destructor.
static const char * getCTPConfigBinding()
void finaliseCCDB(framework::ConcreteDataMatcher &matcher, void *obj) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
Write histograms to an output root file.
static const char * getCTPDigitsBinding()
void init(framework::InitContext &ctx) final
Initializing the offline calib task.
void run(framework::ProcessingContext &ctx) final
Fill histograms needed for the offline calibration.
OfflineCalibSpec(bool makeCellIDTimeEnergy, bool rejectCalibTriggers, bool rejectL0Trigger, std::shared_ptr< o2::emcal::CalibLoader > calibHandler)
Constructor.
o2::framework::DataProcessorSpec getEmcalOfflineCalibSpec(bool makeCellIDTimeEnergy, bool rejectCalibTriggers, bool rejectL0Trigger, uint32_t inputsubspec, bool enableGainCalib, bool ctpcfgperrun)
Creating offline calib spec.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...