Project
Loading...
Searching...
No Matches
PHOSEnergyCalibDevice.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_PHOSENERGY_CALIBDEV_H
13#define O2_CALIBRATION_PHOSENERGY_CALIBDEV_H
14
17
18#include "Framework/Task.h"
29#include "TFile.h"
30#include "TTree.h"
31
32using namespace o2::framework;
33
34namespace o2
35{
36namespace phos
37{
38
40{
41 public:
42 explicit PHOSEnergyCalibDevice(bool useCCDB, std::shared_ptr<o2::base::GRPGeomRequest> req, const std::string& outputDir, const std::string& metaFileDir, bool writeRootOutput) : mUseCCDB(useCCDB), mWriteRootOutput(writeRootOutput), mOutputDir(outputDir), mMetaFileDir(metaFileDir), mCCDBRequest(req) {}
43
44 void init(o2::framework::InitContext& ic) final;
45
47
49
50 void stop() final;
51
52 void finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj) final
53 {
55 }
56
57 protected:
60 void fillOutputTree();
61 void writeOutFile();
62
63 private:
64 static constexpr short kMaxCluInEvent = 64;
65 o2::framework::DataTakingContext mDataTakingContext{};
66 bool mUseCCDB = false;
67 bool mHasCalib = false;
68 bool mPostHistos = true;
69 bool mWriteRootOutput = true;
70 long mRunStartTime = 0;
71 float mPtMin = 1.5;
72 float mEminHGTime = 1.5;
73 float mEminLGTime = 5.;
74 float mEDigMin = 0.05;
75 float mECluMin = 0.4;
76 std::string mOutputDir;
77 std::string mFileName;
78 std::string mHistoFileName;
79 std::string mMetaFileDir;
80 std::string mLHCPeriod;
81 int mRunNumber = -1;
82 std::unique_ptr<PHOSEnergyCalibrator> mCalibrator;
83 std::unique_ptr<const BadChannelsMap> mBadMap;
84 std::unique_ptr<const CalibParams> mCalibParams;
85 std::vector<uint32_t> mOutputDigits;
86 std::unique_ptr<TFile> mFileOut;
87 std::unique_ptr<TFile> mHistoFileOut;
88 std::unique_ptr<TTree> mTreeOut;
89 std::unique_ptr<o2::dataformats::FileMetaData> mFileMetaData;
90 std::unique_ptr<o2::dataformats::FileMetaData> mHistoFileMetaData;
91 std::shared_ptr<o2::base::GRPGeomRequest> mCCDBRequest;
92};
93
94o2::framework::DataProcessorSpec getPHOSEnergyCalibDeviceSpec(bool useCCDB, const std::string& outputDir, const std::string& metaFileDir, bool writeRootOutput);
95} // namespace phos
96} // namespace o2
97
98#endif
Helper for geometry and GRP related CCDB requests.
bool finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
static GRPGeomHelper & instance()
void updateTimeDependentParams(ProcessingContext &pc)
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void init(o2::framework::InitContext &ic) final
void run(o2::framework::ProcessingContext &pc) final
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
void postHistosCCDB(o2::framework::EndOfStreamContext &ec)
PHOSEnergyCalibDevice(bool useCCDB, std::shared_ptr< o2::base::GRPGeomRequest > req, const std::string &outputDir, const std::string &metaFileDir, bool writeRootOutput)
void stop() final
This is invoked on stop.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
o2::framework::DataProcessorSpec getPHOSEnergyCalibDeviceSpec(bool useCCDB, const std::string &outputDir, const std::string &metaFileDir, bool writeRootOutput)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...