Project
Loading...
Searching...
No Matches
ClusterReaderSpec.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_ITSMFT_CLUSTERREADER
15#define O2_ITSMFT_CLUSTERREADER
16
17#include "TFile.h"
18#include "TTree.h"
19
21#include "Framework/Task.h"
22#include "Headers/DataHeader.h"
28
29using namespace o2::framework;
30
31namespace o2
32{
33namespace itsmft
34{
35
36class ClusterReader : public Task
37{
38 public:
39 ClusterReader() = delete;
40 ClusterReader(o2::detectors::DetID id, bool useMC, bool usePatterns = true, bool triggers = true);
41 ~ClusterReader() override = default;
42 void init(InitContext& ic) final;
43 void run(ProcessingContext& pc) final;
44
45 protected:
46 void connectTree(const std::string& filename);
47
48 std::vector<o2::itsmft::ROFRecord> mClusROFRec, *mClusROFRecPtr = &mClusROFRec;
49 std::vector<o2::itsmft::CompClusterExt> mClusterCompArray, *mClusterCompArrayPtr = &mClusterCompArray;
50 std::vector<unsigned char> mPatternsArray, *mPatternsArrayPtr = &mPatternsArray;
52 std::vector<o2::itsmft::MC2ROFRecord> mClusMC2ROFs, *mClusMC2ROFsPtr = &mClusMC2ROFs;
53
55
56 std::unique_ptr<TFile> mFile;
57 std::unique_ptr<TTree> mTree;
58
59 bool mUseMC = true; // use MC truth
60 bool mUsePatterns = true; // send patterns
61 bool mTriggerOut = true; // send dummy triggers vector
62
63 std::string mDetName = "";
64 std::string mDetNameLC = "";
65 std::string mFileName = "";
66 std::string mClusTreeName = "o2sim";
67 std::string mClusROFBranchName = "ClustersROF";
68 std::string mClusterPattBranchName = "ClusterPatt";
69 std::string mClusterCompBranchName = "ClusterComp";
70 std::string mClustMCTruthBranchName = "ClusterMCTruth";
71 std::string mClustMC2ROFBranchName = "ClustersMC2ROF";
72};
73
75{
76 public:
77 ITSClusterReader(bool useMC = true, bool usePatterns = true, bool triggerOut = true)
78 : ClusterReader(o2::detectors::DetID::ITS, useMC, usePatterns, triggerOut)
79 {
81 }
82};
83
85{
86 public:
87 MFTClusterReader(bool useMC = true, bool usePatterns = true, bool triggerOut = true)
88 : ClusterReader(o2::detectors::DetID::MFT, useMC, usePatterns, triggerOut)
89 {
91 }
92};
93
96framework::DataProcessorSpec getITSClusterReaderSpec(bool useMC = true, bool usePatterns = true, bool useTriggers = true);
97framework::DataProcessorSpec getMFTClusterReaderSpec(bool useMC = true, bool usePatterns = true, bool useTriggers = true);
98
99} // namespace itsmft
100} // namespace o2
101
102#endif /* O2_ITSMFT_CLUSTERREADER */
Definition of the ITSMFT compact cluster.
Definition of the ITSMFT ROFrame (trigger) record.
Definition of a container to keep Monte Carlo truth external to simulation objects.
A container to hold and manage MC truth information/labels.
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
o2::dataformats::MCTruthContainer< o2::MCCompLabel > * mClusterMCTruthPtr
std::vector< unsigned char > * mPatternsArrayPtr
std::unique_ptr< TFile > mFile
void init(InitContext &ic) final
~ClusterReader() override=default
o2::dataformats::MCTruthContainer< o2::MCCompLabel > mClusterMCTruth
o2::header::DataOrigin mOrigin
std::vector< o2::itsmft::ROFRecord > mClusROFRec
void run(ProcessingContext &pc) final
std::vector< unsigned char > mPatternsArray
std::vector< o2::itsmft::MC2ROFRecord > * mClusMC2ROFsPtr
std::vector< o2::itsmft::MC2ROFRecord > mClusMC2ROFs
std::vector< o2::itsmft::CompClusterExt > mClusterCompArray
std::vector< o2::itsmft::ROFRecord > * mClusROFRecPtr
std::vector< o2::itsmft::CompClusterExt > * mClusterCompArrayPtr
void connectTree(const std::string &filename)
std::unique_ptr< TTree > mTree
ITSClusterReader(bool useMC=true, bool usePatterns=true, bool triggerOut=true)
MFTClusterReader(bool useMC=true, bool usePatterns=true, bool triggerOut=true)
constexpr o2::header::DataOrigin gDataOriginMFT
Definition DataHeader.h:572
constexpr o2::header::DataOrigin gDataOriginInvalid
Definition DataHeader.h:561
constexpr o2::header::DataOrigin gDataOriginITS
Definition DataHeader.h:570
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
framework::DataProcessorSpec getMFTClusterReaderSpec(bool useMC=true, bool usePatterns=true, bool useTriggers=true)
framework::DataProcessorSpec getITSClusterReaderSpec(bool useMC=true, bool usePatterns=true, bool useTriggers=true)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()