Project
Loading...
Searching...
No Matches
TrackReaderSpec.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_ITS_TRACKREADER
15#define O2_ITS_TRACKREADER
16
17#include "TFile.h"
18#include "TTree.h"
19
21#include "Framework/Task.h"
22#include "Headers/DataHeader.h"
28
29namespace o2
30{
31namespace its
32{
33
35{
36 public:
37 TrackReader(bool useMC = true);
38 ~TrackReader() override = default;
39 void init(o2::framework::InitContext& ic) final;
41
42 protected:
43 void connectTree(const std::string& filename);
44
45 std::vector<o2::itsmft::ROFRecord> mROFRec, *mROFRecInp = &mROFRec;
46 std::vector<o2::itsmft::ROFRecord> mVerticesROFRec, *mVerticesROFRecInp = &mVerticesROFRec;
47 std::vector<o2::its::TrackITS> mTracks, *mTracksInp = &mTracks;
48 std::vector<Vertex> mVertices, *mVerticesInp = &mVertices;
49 std::vector<int> mClusInd, *mClusIndInp = &mClusInd;
50 std::vector<o2::MCCompLabel> mMCTruth, *mMCTruthInp = &mMCTruth;
51 std::vector<o2::MCCompLabel> mMCVertTruth, *mMCVTruthInp = &mMCTruth;
52
54
55 bool mUseMC = true; // use MC truth
56
57 std::unique_ptr<TFile> mFile;
58 std::unique_ptr<TTree> mTree;
59 std::string mInputFileName = "";
60 std::string mTrackTreeName = "o2sim";
61 std::string mROFBranchName = "ITSTracksROF";
62 std::string mTrackBranchName = "ITSTrack";
63 std::string mClusIdxBranchName = "ITSTrackClusIdx";
64 std::string mVertexBranchName = "Vertices";
65 std::string mVertexROFBranchName = "VerticesROF";
66 std::string mTrackMCTruthBranchName = "ITSTrackMCTruth";
67 std::string mTrackMCVertTruthBranchName = "ITSVertexMCTruth";
68};
69
73
74} // namespace its
75} // namespace o2
76
77#endif /* O2_ITS_TRACKREADER */
Definition of the ITSMFT ROFrame (trigger) record.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Definition of the ITS track.
std::vector< o2::MCCompLabel > mMCVertTruth
std::vector< int > mClusInd
void init(o2::framework::InitContext &ic) final
std::vector< o2::itsmft::ROFRecord > mROFRec
std::vector< o2::itsmft::ROFRecord > * mROFRecInp
o2::header::DataOrigin mOrigin
std::vector< o2::MCCompLabel > * mMCTruthInp
std::string mTrackMCTruthBranchName
std::vector< o2::itsmft::ROFRecord > mVerticesROFRec
~TrackReader() override=default
std::string mTrackBranchName
std::string mVertexROFBranchName
std::string mClusIdxBranchName
std::vector< o2::itsmft::ROFRecord > * mVerticesROFRecInp
std::unique_ptr< TTree > mTree
std::vector< o2::MCCompLabel > * mMCVTruthInp
std::unique_ptr< TFile > mFile
std::vector< o2::its::TrackITS > mTracks
std::string mTrackMCVertTruthBranchName
std::vector< Vertex > mVertices
std::vector< Vertex > * mVerticesInp
void run(o2::framework::ProcessingContext &pc) final
void connectTree(const std::string &filename)
std::vector< o2::MCCompLabel > mMCTruth
std::string mVertexBranchName
std::vector< o2::its::TrackITS > * mTracksInp
std::vector< int > * mClusIndInp
constexpr o2::header::DataOrigin gDataOriginITS
Definition DataHeader.h:570
framework::DataProcessorSpec getITSTrackReaderSpec(bool useMC=true)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()