Project
Loading...
Searching...
No Matches
TRDDigitReaderSpec.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_TRDTRAPSIMULATORRAWREADERSPEC_H
13#define O2_TRDTRAPSIMULATORRAWREADERSPEC_H
14
16#include "Framework/Task.h"
20
21#include "TFile.h"
22#include "TTree.h"
23
24#include <memory>
25#include <string>
26
27namespace o2
28{
29namespace trd
30{
31
33{
34 public:
35 TRDDigitReaderSpec(bool useMC, bool useTriggerRecords, int subSpec) : mUseMC(useMC), mUseTriggerRecords(useTriggerRecords), mSubSpec(subSpec) {}
36 ~TRDDigitReaderSpec() override = default;
37 void init(o2::framework::InitContext& ic) override;
38 void run(o2::framework::ProcessingContext& pc) override;
39
40 private:
41 void connectTree();
42 bool mUseMC = false;
43 bool mUseTriggerRecords = true;
44 unsigned int mSubSpec = 1;
45 std::unique_ptr<TFile> mFile;
46 std::unique_ptr<TTree> mTreeDigits;
47 std::string mFileName = "trddigits.root";
48 std::string mDigitTreeName = "o2sim";
49 std::string mDigitBranchName = "TRDDigit";
50 std::string mTriggerRecordBranchName = "TriggerRecord";
51 std::string mMCLabelsBranchName = "TRDMCLabels";
52 std::vector<o2::trd::Digit> mDigits, *mDigitsPtr = &mDigits;
53 std::vector<o2::trd::TriggerRecord> mTriggerRecords, *mTriggerRecordsPtr = &mTriggerRecords;
55};
56
57o2::framework::DataProcessorSpec getTRDDigitReaderSpec(bool useMC, bool trigRec = true, int dataSubspec = 1);
58
59} // end namespace trd
60} // end namespace o2
61
62#endif // O2_TRDTRAPSIMULATORTRACKLETWRITER_H
A special IO container - splitting a given vector to enable ROOT IO.
TRDDigitReaderSpec(bool useMC, bool useTriggerRecords, int subSpec)
void init(o2::framework::InitContext &ic) override
void run(o2::framework::ProcessingContext &pc) override
~TRDDigitReaderSpec() override=default
o2::framework::DataProcessorSpec getTRDDigitReaderSpec(bool useMC, bool trigRec=true, int dataSubspec=1)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...