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_TRK_DIGITREADER
13#define O2_TRK_DIGITREADER
14
15#include "TFile.h"
16#include "TTree.h"
21#include "Framework/Task.h"
22#include "Headers/DataHeader.h"
25
26using namespace o2::framework;
27
28namespace o2
29{
30namespace trk
31{
32
33class DigitReader : public Task
34{
35 public:
36 DigitReader() = delete;
37 DigitReader(o2::detectors::DetID id, bool useMC, bool useCalib);
38 ~DigitReader() override = default;
39 void init(InitContext& ic) final;
40 void run(ProcessingContext& pc) final;
41
42 protected:
43 void connectTree(const std::string& filename);
44
45 std::vector<o2::itsmft::Digit> mDigits, *mDigitsPtr = &mDigits;
46 std::vector<o2::itsmft::GBTCalibData> mCalib, *mCalibPtr = &mCalib;
47 std::vector<o2::itsmft::ROFRecord> mDigROFRec, *mDigROFRecPtr = &mDigROFRec;
48 std::vector<o2::itsmft::MC2ROFRecord> mDigMC2ROFs, *mDigMC2ROFsPtr = &mDigMC2ROFs;
49
51
52 std::unique_ptr<TFile> mFile;
53 std::unique_ptr<TTree> mTree;
54
55 bool mUseMC = true; // use MC truth
56 bool mUseCalib = true; // send calib data
57
58 std::string mDetName = "";
59 std::string mDetNameLC = "";
60 std::string mFileName = "";
61 std::string mDigTreeName = "o2sim";
62 std::string mDigitBranchName = "Digit";
63 std::string mDigROFBranchName = "DigitROF";
64 std::string mCalibBranchName = "Calib";
65
66 std::string mDigtMCTruthBranchName = "DigitMCTruth";
67 std::string mDigtMC2ROFBranchName = "DigitMC2ROF";
68};
69
71{
72 public:
73 TRKDigitReader(bool useMC = true, bool useCalib = false)
74 : DigitReader(o2::detectors::DetID::TRK, useMC, useCalib)
75 {
77 }
78};
79
82framework::DataProcessorSpec getTRKDigitReaderSpec(bool useMC = true, bool useCalib = false, std::string defname = "trkdigits.root");
83
84} // namespace trk
85} // namespace o2
86
87#endif /* O2_TRK_DigitREADER */
Definition of the ITSMFT digit.
Calibration data from GBT data.
Definition of the ITSMFT ROFrame (trigger) record.
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
std::string mDigtMC2ROFBranchName
void run(ProcessingContext &pc) final
std::vector< o2::itsmft::MC2ROFRecord > * mDigMC2ROFsPtr
std::unique_ptr< TTree > mTree
std::vector< o2::itsmft::ROFRecord > * mDigROFRecPtr
std::vector< o2::itsmft::Digit > * mDigitsPtr
std::string mDigtMCTruthBranchName
std::vector< o2::itsmft::Digit > mDigits
o2::header::DataOrigin mOrigin
std::string mDigitBranchName
std::vector< o2::itsmft::GBTCalibData > * mCalibPtr
~DigitReader() override=default
std::string mCalibBranchName
std::unique_ptr< TFile > mFile
void init(InitContext &ic) final
std::vector< o2::itsmft::ROFRecord > mDigROFRec
std::string mDigROFBranchName
std::vector< o2::itsmft::GBTCalibData > mCalib
void connectTree(const std::string &filename)
std::vector< o2::itsmft::MC2ROFRecord > mDigMC2ROFs
TRKDigitReader(bool useMC=true, bool useCalib=false)
constexpr o2::header::DataOrigin gDataOriginTRK
Definition DataHeader.h:584
constexpr o2::header::DataOrigin gDataOriginInvalid
Definition DataHeader.h:561
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
framework::DataProcessorSpec getTRKDigitReaderSpec(bool useMC=true, bool useCalib=false, std::string defname="trkdigits.root")
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()