Project
Loading...
Searching...
No Matches
ClustersReaderSpec.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
18
19#ifndef DETECTORS_HMPID_WORKFLOW_INCLUDE_HMPIDWORKFLOW_CLUSTERSREADERSPEC_H_
20#define DETECTORS_HMPID_WORKFLOW_INCLUDE_HMPIDWORKFLOW_CLUSTERSREADERSPEC_H_
21
22// ROOT
23#include <TFile.h>
24#include <TTree.h>
25
27#include "Framework/Task.h"
29
30#include "HMPIDBase/Common.h"
31#include "HMPIDBase/Geo.h"
35
36namespace o2
37{
38namespace hmpid
39{
40
42{
43 public:
44 ClusterReaderTask() = default;
45 // : mReadFile(readFile) {}
46 ~ClusterReaderTask() override = default;
47
48 void init(framework::InitContext& ic) final;
49
50 void run(framework::ProcessingContext& pc) final;
51 // void endOfStream(framework::EndOfStreamContext& ec) override;
52
53 private:
54 bool mReadFile = false;
55 void initFileIn(const std::string& filename);
56
57 long mClustersReceived;
58 ExecutionTimer mExTimer;
59
60 std::unique_ptr<TFile> mFile; // root file with Clusters
61 std::unique_ptr<TTree> mTree; // tree inside the file
62 std::vector<o2::hmpid::Trigger> mClusterTriggersFromFile, *mClusterTriggersFromFilePtr = &mClusterTriggersFromFile;
63 std::vector<o2::hmpid::Cluster> mClustersFromFile, *mClustersFromFilePtr = &mClustersFromFile;
64
65 unsigned long mNumberOfEntries = 0; // number of entries from TTree
66 unsigned long mCurrentEntry = 0; // index of current entry
67
68 // void strToFloatsSplit(std::string s, std::string delimiter, float* res, int maxElem = 7);
69};
70
72
73} // end namespace hmpid
74} // end namespace o2
75
76#endif
Definition of the HMPID cluster finder.
~ClusterReaderTask() override=default
void init(framework::InitContext &ic) final
void run(framework::ProcessingContext &pc) final
HMPID Derived class for the Time of Workflows.
Definition Common.h:34
o2::framework::DataProcessorSpec getClusterReaderSpec()
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()