Project
Loading...
Searching...
No Matches
ClusterReaderSpec.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
13
14#ifndef O2_CPV_CLUSTERREADER
15#define O2_CPV_CLUSTERREADER
16
17#include "TFile.h"
18#include "TTree.h"
19
21#include "Framework/Task.h"
22#include "Headers/DataHeader.h"
27
28namespace o2
29{
30namespace cpv
31{
32
34{
35 public:
36 ClusterReader(bool useMC = true);
37 ~ClusterReader() override = default;
38 void init(o2::framework::InitContext& ic) final;
40
41 protected:
42 void connectTree(const std::string& filename);
43
44 std::vector<o2::cpv::Cluster> mClusters, *mClustersInp = &mClusters;
45 std::vector<o2::cpv::TriggerRecord> mTRs, *mTRsInp = &mTRs;
47
49
50 bool mUseMC = true; // use MC truth
51
52 std::unique_ptr<TFile> mFile;
53 std::unique_ptr<TTree> mTree;
54 std::string mInputFileName = "";
55 std::string mClusterTreeName = "o2sim";
56 std::string mClusterBranchName = "CPVCluster";
57 std::string mTRBranchName = "CPVClusterTrigRec";
58 std::string mClusterMCTruthBranchName = "CPVClusterTrueMC";
59};
60
64
65} // namespace cpv
66} // namespace o2
67
68#endif /* O2_CPV_CLUSTERREADER */
Definition of a container to keep Monte Carlo truth external to simulation objects.
void init(o2::framework::InitContext &ic) final
std::vector< o2::cpv::Cluster > * mClustersInp
o2::header::DataOrigin mOrigin
~ClusterReader() override=default
void connectTree(const std::string &filename)
std::vector< o2::cpv::TriggerRecord > * mTRsInp
std::vector< o2::cpv::TriggerRecord > mTRs
std::unique_ptr< TFile > mFile
std::vector< o2::cpv::Cluster > mClusters
void run(o2::framework::ProcessingContext &pc) final
o2::dataformats::MCTruthContainer< o2::MCCompLabel > mMCTruth
std::unique_ptr< TTree > mTree
o2::dataformats::MCTruthContainer< o2::MCCompLabel > * mMCTruthInp
std::string mClusterMCTruthBranchName
A container to hold and manage MC truth information/labels.
constexpr o2::header::DataOrigin gDataOriginCPV
Definition DataHeader.h:563
framework::DataProcessorSpec getCPVClusterReaderSpec(bool useMC=true)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()