Project
Loading...
Searching...
No Matches
DigitReaderSpec.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_IOTOF_DIGITREADER
13#define O2_IOTOF_DIGITREADER
14
15#include "TFile.h"
16#include "TTree.h"
19#include "Framework/Task.h"
20#include "Headers/DataHeader.h"
23
24namespace o2::iotof
25{
26
28{
29 public:
30 TF3DigitReader() = delete;
31 TF3DigitReader(o2::detectors::DetID id, bool useMC, bool useCalib);
32 ~TF3DigitReader() override = default;
33 void init(o2::framework::InitContext& ic) final;
35
36 protected:
37 void connectTree(const std::string& filename);
38
39 std::vector<o2::iotof::Digit> mDigits, *mDigitsPtr = &mDigits;
40 std::vector<o2::itsmft::ROFRecord> mDigROFRec, *mDigROFRecPtr = &mDigROFRec;
41 std::vector<o2::itsmft::MC2ROFRecord> mDigMC2ROFs, *mDigMC2ROFsPtr = &mDigMC2ROFs;
43
44 std::unique_ptr<TFile> mFile;
45 std::unique_ptr<TTree> mTree;
46
47 bool mUseMC = true; // use MC truth
48 bool mUseCalib = true; // send calib data
49
50 std::string mDetName = "";
51 std::string mDetNameLC = "";
52 std::string mFileName = "";
53 std::string mDigTreeName = "o2sim";
54 std::string mDigitBranchName = "Digit";
55 std::string mDigROFBranchName = "DigitROF";
56 std::string mCalibBranchName = "Calib";
57
58 std::string mDigtMCTruthBranchName = "DigitMCTruth";
59 std::string mDigtMC2ROFBranchName = "DigitMC2ROF";
60 // static constexpr o2::detectors::DetID mDetID = o2::header::gDataOriginTF3;
61};
62
65o2::framework::DataProcessorSpec getIOTOFDigitReaderSpec(bool useMC = true, bool useCalib = false, std::string defname = "iotofdigits.root");
66
67} // namespace o2::iotof
68
69#endif /* O2_IOTOF_DigitREADER */
Definition of IOTOF digit class.
Definition of the ITSMFT ROFrame (trigger) record.
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
std::unique_ptr< TFile > mFile
std::vector< o2::itsmft::ROFRecord > mDigROFRec
~TF3DigitReader() override=default
std::vector< o2::itsmft::MC2ROFRecord > * mDigMC2ROFsPtr
std::vector< o2::iotof::Digit > * mDigitsPtr
std::vector< o2::itsmft::ROFRecord > * mDigROFRecPtr
std::vector< o2::iotof::Digit > mDigits
void init(o2::framework::InitContext &ic) final
void connectTree(const std::string &filename)
o2::header::DataOrigin mOrigin
void run(o2::framework::ProcessingContext &pc) final
std::vector< o2::itsmft::MC2ROFRecord > mDigMC2ROFs
std::unique_ptr< TTree > mTree
constexpr o2::header::DataOrigin gDataOriginTF3
Definition DataHeader.h:587
o2::framework::DataProcessorSpec getIOTOFDigitReaderSpec(bool useMC=true, bool useCalib=false, std::string defname="iotofdigits.root")
std::string filename()