forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNoiseCalibratorSpec.h
More file actions
86 lines (67 loc) · 2.53 KB
/
NoiseCalibratorSpec.h
File metadata and controls
86 lines (67 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// @file NoiseCalibratorSpec.h
#ifndef O2_MFT_NOISECALIBRATORSPEC
#define O2_MFT_NOISECALIBRATORSPEC
#include <string>
#include "CCDB/CcdbApi.h"
#include "Framework/DataProcessorSpec.h"
#include "Framework/Task.h"
#include "MFTCalibration/NoiseCalibrator.h"
#include "DetectorsBase/GRPGeomHelper.h"
using CALIBRATOR = o2::mft::NoiseCalibrator;
//#include "MFTCalibration/NoiseSlotCalibrator.h" //For TimeSlot calibration
// using CALIBRATOR = o2::mft::NoiseSlotCalibrator;
#include "DataFormatsITSMFT/NoiseMap.h"
using namespace o2::framework;
namespace o2
{
namespace mft
{
class NoiseCalibratorSpec : public Task
{
public:
NoiseCalibratorSpec(bool digits = false, std::shared_ptr<o2::base::GRPGeomRequest> req = {});
~NoiseCalibratorSpec() override = default;
void init(InitContext& ic) final;
void run(ProcessingContext& pc) final;
void endOfStream(EndOfStreamContext& ec) final;
void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) final;
private:
o2::ccdb::CcdbApi api;
void updateTimeDependentParams(ProcessingContext& pc);
void sendOutputCcdb(DataAllocator& output);
void sendOutputCcdbMerge(DataAllocator& output);
void sendOutputCcdbDcs(DataAllocator& output);
void sendOutputDcs(DataAllocator& output);
void sendOutputDcsMerge(DataAllocator& output);
void setOutputDcs(const o2::itsmft::NoiseMap& payload);
o2::itsmft::NoiseMap mNoiseMap{936};
std::unique_ptr<CALIBRATOR> mCalibrator = nullptr;
std::shared_ptr<o2::base::GRPGeomRequest> mCCDBRequest;
std::string mPath;
std::string mPathSingle;
std::string mMeta;
std::vector<std::array<int, 3>> mNoiseMapForDcs;
std::string mPathDcs;
std::string mOutputType;
double mThresh;
int64_t mStart;
int64_t mEnd;
bool mDigits = false;
bool mStopMeOnly = false; // send QuitRequest::Me instead of QuitRequest::All
};
/// create a processor spec
/// run MFT noise calibration
DataProcessorSpec getNoiseCalibratorSpec(bool useDigits);
} // namespace mft
} // namespace o2
#endif /* O2_MFT_NOISECALIBRATORSPEC */