forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVertexReaderSpec.h
More file actions
63 lines (50 loc) · 1.84 KB
/
VertexReaderSpec.h
File metadata and controls
63 lines (50 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// @file VertexReaderSpec.h
#ifndef O2_ITS_VERTEXREADER
#define O2_ITS_VERTEXREADER
#include "TFile.h"
#include "TTree.h"
#include "Framework/DataProcessorSpec.h"
#include "Framework/Task.h"
#include "ITStracking/Definitions.h"
#include "DataFormatsITSMFT/ROFRecord.h"
namespace o2
{
namespace its
{
// read ITS vertices from the output tree of ITS tracking
class VertexReader : public o2::framework::Task
{
public:
VertexReader() = default;
~VertexReader() override = default;
void init(o2::framework::InitContext& ic) final;
void run(o2::framework::ProcessingContext& pc) final;
protected:
void connectTree(const std::string& filename);
void accumulate();
std::vector<o2::itsmft::ROFRecord> mVerticesROFRec, *mVerticesROFRecPtr = &mVerticesROFRec;
std::vector<Vertex> mVertices, *mVerticesPtr = &mVertices;
o2::header::DataOrigin mOrigin = o2::header::gDataOriginITS;
std::unique_ptr<TFile> mFile;
std::unique_ptr<TTree> mTree;
std::string mFileName = "";
std::string mVertexTreeName = "o2sim";
std::string mVertexBranchName = "Vertices";
std::string mVertexROFBranchName = "VerticesROF";
};
/// create a processor spec
/// read ITS vertex data from a root file
o2::framework::DataProcessorSpec getITSVertexReaderSpec();
} // namespace its
} // namespace o2
#endif /* O2_ITS_VERTEXREADER */