12#ifndef O2_TOFCLUSTER_SPLITTER_WRITER_H
13#define O2_TOFCLUSTER_SPLITTER_WRITER_H
36 using OutputType = std::vector<o2::tof::Cluster>;
38 std::string mBaseName;
45 TString
filename = TString::Format(
"%s_%06d.root", mBaseName.c_str(), mCount);
47 mfileOut.reset(TFile::Open(TString::Format(
"%s",
filename.Data()),
"RECREATE"));
48 mOutputTree = std::make_unique<TTree>(
"o2sim",
"Tree with TOF clusters");
49 mOutputTree->Branch(
"TOFCluster", &mPClusters);
56 mBaseName = ic.options().get<std::string>(
"output-base-name");
64 auto clusters = pc.inputs().get<OutputType>(
"clusters");
77 mIsEndOfStream =
true;
85 bool mIsEndOfStream =
false;
89 std::unique_ptr<TTree> mOutputTree;
90 std::unique_ptr<TFile> mfileOut =
nullptr;
101 mOutputTree->Write();
105 if (!mIsEndOfStream) {
117 std::vector<InputSpec> inputs;
120 std::vector<OutputSpec> outputs;
123 "tof-cluster-splitter-writer",
126 AlgorithmSpec{adaptFromTask<o2::tof::TOFClusterWriterSplitter>(nTF)},
127 Options{{
"output-base-name",
VariantType::String,
"tofclusters", {
"Name of the input file (root extension will be added)"}}}};
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void init(o2::framework::InitContext &ic) final
TOFClusterWriterSplitter(int nTF)
void run(o2::framework::ProcessingContext &pc) final
void createAndOpenFileAndTree()
constexpr o2::header::DataOrigin gDataOriginTOF
Defining PrimaryVertex explicitly as messageable.
std::vector< o2::tof::CalibInfoCluster > OutputType
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Cluster > clusters