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
13
14#ifndef O2_CPV_DIGITREADER
15#define O2_CPV_DIGITREADER
16
17#include "TFile.h"
18#include "TTree.h"
19
21#include "Framework/Task.h"
22#include "Headers/DataHeader.h"
27
28namespace o2
29{
30namespace cpv
31{
32
34{
35 public:
36 DigitReader(bool useMC = true);
37 ~DigitReader() override = default;
38 void init(o2::framework::InitContext& ic) final;
40
41 protected:
42 void connectTree(const std::string& filename);
43
44 std::vector<o2::cpv::Digit> mDigits, *mDigitsInp = &mDigits;
45 std::vector<o2::cpv::TriggerRecord> mTRs, *mTRsInp = &mTRs;
46 // std::vector<o2::MCCompLabel> mMCTruth, *mMCTruthInp = &mMCTruth;
48
50
51 bool mUseMC = true; // use MC truth
52
53 std::unique_ptr<TFile> mFile;
54 std::unique_ptr<TTree> mTree;
55 std::string mInputFileName = "";
56 std::string mDigitTreeName = "o2sim";
57 std::string mDigitBranchName = "CPVDigit";
58 std::string mTRBranchName = "CPVDigitTrigRecords";
59 std::string mDigitMCTruthBranchName = "CPVDigitMCTruth";
60};
61
65
66} // namespace cpv
67} // namespace o2
68
69#endif /* O2_CPV_DIGITREADER */
Definition of a container to keep Monte Carlo truth external to simulation objects.
std::vector< o2::cpv::TriggerRecord > mTRs
std::string mDigitBranchName
std::vector< o2::cpv::Digit > * mDigitsInp
o2::dataformats::MCTruthContainer< o2::MCCompLabel > mMCTruth
o2::header::DataOrigin mOrigin
std::vector< o2::cpv::Digit > mDigits
void connectTree(const std::string &filename)
~DigitReader() override=default
std::vector< o2::cpv::TriggerRecord > * mTRsInp
std::unique_ptr< TFile > mFile
std::string mDigitMCTruthBranchName
void init(o2::framework::InitContext &ic) final
void run(o2::framework::ProcessingContext &pc) final
o2::dataformats::MCTruthContainer< o2::MCCompLabel > * mMCTruthInp
std::unique_ptr< TTree > mTree
A container to hold and manage MC truth information/labels.
constexpr o2::header::DataOrigin gDataOriginCPV
Definition DataHeader.h:563
framework::DataProcessorSpec getCPVDigitReaderSpec(bool useMC=true)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()