12#ifndef O2_CALIBRATION_TOFCALIB_COLLECTOR_WRITER_H
13#define O2_CALIBRATION_TOFCALIB_COLLECTOR_WRITER_H
38 TString
filename = TString::Format(
"collTOF_%d.root", mCount);
40 mfileOut.reset(TFile::Open(TString::Format(
"%s",
filename.Data()),
"RECREATE"));
41 mOutputTree = std::make_unique<TTree>(
"treeCollectedCalibInfo",
"Tree with TOF calib info for Time Slewing");
42 mOutputTree->Branch(mOutputBranchName.data(), &mPTOFCalibInfoOut);
54 auto collectedInfo = pc.inputs().get<gsl::span<o2::dataformats::CalibInfoTOF>>(
"collectedInfo");
55 auto entriesPerChannel = pc.inputs().get<gsl::span<int>>(
"entriesCh");
58 mTOFCalibInfoOut.clear();
59 if (entriesPerChannel[ich] > 0) {
60 mTOFCalibInfoOut.resize(entriesPerChannel[ich]);
61 auto subSpanVect = collectedInfo.subspan(offsetStart, entriesPerChannel[ich]);
66 offsetStart += entriesPerChannel[ich];
68 sendOutput(pc.outputs());
73 mIsEndOfStream =
true;
74 sendOutput(ec.outputs());
79 bool mIsEndOfStream =
false;
80 std::vector<o2::dataformats::CalibInfoTOF> mTOFCalibInfoOut, *mPTOFCalibInfoOut = &mTOFCalibInfoOut;
81 std::unique_ptr<TTree> mOutputTree;
82 std::string mTOFCalibInfoBranchName =
"TOFCalibInfo";
83 std::string mOutputBranchName =
"TOFCollectedCalibInfo";
84 std::unique_ptr<TFile> mfileOut =
nullptr;
99 if (!mIsEndOfStream) {
112 std::vector<InputSpec> inputs;
116 std::vector<OutputSpec> outputs;
119 "calib-tofcalib-collector-writer",
Class to store the output of the matching to TOF for calibration.
void init(o2::framework::InitContext &ic) final
void createAndOpenFileAndTree()
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(o2::framework::ProcessingContext &pc) final
TOF geo parameters (only statics)
static constexpr int NCHANNELS
constexpr o2::header::DataOrigin gDataOriginTOF
Defining PrimaryVertex explicitly as messageable.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"