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_PHOS_DIGITREADER
15#define O2_PHOS_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 phos
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::phos::Digit> mDigits, *mDigitsInp = &mDigits;
45 std::vector<o2::phos::TriggerRecord> mTRs, *mTRsInp = &mTRs;
47
49
50 bool mUseMC = true; // use MC truth
51
52 std::unique_ptr<TFile> mFile;
53 std::unique_ptr<TTree> mTree;
54 std::string mInputFileName = "";
55 std::string mDigitTreeName = "o2sim";
56 std::string mDigitBranchName = "PHOSDigit";
57 std::string mTRBranchName = "PHOSDigitTrigRecords";
58 std::string mDigitMCTruthBranchName = "PHOSDigitMCTruth";
59};
60
64
65} // namespace phos
66} // namespace o2
67
68#endif /* O2_PHOS_DIGITREADER */
Definition of a container to keep Monte Carlo truth external to simulation objects.
A container to hold and manage MC truth information/labels.
void init(o2::framework::InitContext &ic) final
std::vector< o2::phos::Digit > * mDigitsInp
o2::dataformats::MCTruthContainer< o2::phos::MCLabel > * mMCTruthInp
std::unique_ptr< TFile > mFile
std::vector< o2::phos::TriggerRecord > * mTRsInp
void connectTree(const std::string &filename)
std::vector< o2::phos::Digit > mDigits
~DigitReader() override=default
void run(o2::framework::ProcessingContext &pc) final
o2::dataformats::MCTruthContainer< o2::phos::MCLabel > mMCTruth
std::vector< o2::phos::TriggerRecord > mTRs
std::string mDigitMCTruthBranchName
std::unique_ptr< TTree > mTree
o2::header::DataOrigin mOrigin
constexpr o2::header::DataOrigin gDataOriginPHS
Definition DataHeader.h:574
framework::DataProcessorSpec getPHOSDigitReaderSpec(bool useMC=true)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()