Project
Loading...
Searching...
No Matches
TRDTrackReaderSpec.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
12#ifndef O2_TRD_TRACK_READER_H
13#define O2_TRD_TRACK_READER_H
14
16
20
22#include "Framework/Task.h"
23
24#include "TFile.h"
25#include "TTree.h"
26
27#include <vector>
28#include <string>
29#include <memory>
30
31using namespace o2::framework;
32
33namespace o2
34{
35namespace trd
36{
37
38class TRDTrackReader : public Task
39{
40 public:
41 enum Mode : int {
43 TPCTRD
44 };
45
46 TRDTrackReader(bool useMC, Mode mode, bool subSpecStrict = false) : mUseMC(useMC), mMode(mode), mSubSpecStrict(subSpecStrict) {}
47 ~TRDTrackReader() override = default;
48 void init(InitContext& ic) final;
49 void run(ProcessingContext& pc) final;
50
51 private:
52 void connectTree(const std::string& filename);
53 bool mUseMC = false;
54 Mode mMode;
55 bool mSubSpecStrict = false;
56 std::unique_ptr<TFile> mFile;
57 std::unique_ptr<TTree> mTree;
58 std::string mFileName = "";
59 std::vector<o2::trd::TrackTRD> mTracks, *mTracksPtr = &mTracks;
60 std::vector<o2::trd::TrackTriggerRecord> mTrigRec, *mTrigRecPtr = &mTrigRec;
61 std::vector<o2::MCCompLabel> mLabelsMatch, *mLabelsMatchPtr = &mLabelsMatch;
62 std::vector<o2::MCCompLabel> mLabelsTrd, *mLabelsTrdPtr = &mLabelsTrd;
63};
64
66framework::DataProcessorSpec getTRDTPCTrackReaderSpec(bool useMC, bool subSpecStrict = false);
67
70
71} // namespace trd
72} // namespace o2
73
74#endif
TRDTrackReader(bool useMC, Mode mode, bool subSpecStrict=false)
void run(ProcessingContext &pc) final
~TRDTrackReader() override=default
void init(InitContext &ic) final
GLenum mode
Definition glcorearb.h:266
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
framework::DataProcessorSpec getTRDTPCTrackReaderSpec(bool useMC, bool subSpecStrict=false)
read TPC-TRD matched tracks from a root file
framework::DataProcessorSpec getTRDGlobalTrackReaderSpec(bool useMC)
read ITS-TPC-TRD matched tracks from a root file
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()