Project
Loading...
Searching...
No Matches
CellReaderSpec.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_CELLREADER
15#define O2_PHOS_CELLREADER
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 CellReader(bool useMC = true);
37 ~CellReader() 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::Cell> mCells, *mCellsInp = &mCells;
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 mCellTreeName = "o2sim";
56 std::string mCellBranchName = "PHOSCell";
57 std::string mTRBranchName = "PHOSCellTrigRec";
58 std::string mCellMCTruthBranchName = "PHOSCellTrueMC";
59};
60
64
65} // namespace phos
66} // namespace o2
67
68#endif /* O2_PHOS_CELLREADER */
Definition of a container to keep Monte Carlo truth external to simulation objects.
A container to hold and manage MC truth information/labels.
std::string mCellTreeName
std::vector< o2::phos::Cell > mCells
o2::dataformats::MCTruthContainer< o2::phos::MCLabel > mMCTruth
void connectTree(const std::string &filename)
std::vector< o2::phos::Cell > * mCellsInp
void init(o2::framework::InitContext &ic) final
o2::header::DataOrigin mOrigin
o2::dataformats::MCTruthContainer< o2::phos::MCLabel > * mMCTruthInp
~CellReader() override=default
std::vector< o2::phos::TriggerRecord > * mTRsInp
std::string mTRBranchName
std::string mCellMCTruthBranchName
std::vector< o2::phos::TriggerRecord > mTRs
std::unique_ptr< TFile > mFile
void run(o2::framework::ProcessingContext &pc) final
std::string mInputFileName
std::unique_ptr< TTree > mTree
std::string mCellBranchName
constexpr o2::header::DataOrigin gDataOriginPHS
Definition DataHeader.h:574
framework::DataProcessorSpec getPHOSCellReaderSpec(bool useMC=true)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()