-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathClusterReaderSpec.h
More file actions
76 lines (59 loc) · 2.59 KB
/
ClusterReaderSpec.h
File metadata and controls
76 lines (59 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// @file ClusterReaderSpec.h
#ifndef O2_ITSMFT_CLUSTERREADER
#define O2_ITSMFT_CLUSTERREADER
#include "TFile.h"
#include "TTree.h"
#include "Framework/DataProcessorSpec.h"
#include "Framework/Task.h"
#include "Headers/DataHeader.h"
#include "DataFormatsITSMFT/CompCluster.h"
#include "SimulationDataFormat/MCCompLabel.h"
#include "SimulationDataFormat/MCTruthContainer.h"
#include "DataFormatsITSMFT/ROFRecord.h"
using namespace o2::framework;
namespace o2::its3
{
class ClusterReader : public Task
{
public:
ClusterReader(bool useMC, bool usePatterns = true);
void init(InitContext& ic) final;
void run(ProcessingContext& pc) final;
protected:
void connectTree(const std::string& filename);
std::vector<o2::itsmft::ROFRecord> mClusROFRec, *mClusROFRecPtr = &mClusROFRec;
std::vector<o2::itsmft::CompClusterExt> mClusterCompArray, *mClusterCompArrayPtr = &mClusterCompArray;
std::vector<unsigned char> mPatternsArray, *mPatternsArrayPtr = &mPatternsArray;
o2::dataformats::MCTruthContainer<o2::MCCompLabel> mClusterMCTruth, *mClusterMCTruthPtr = &mClusterMCTruth;
std::vector<o2::itsmft::MC2ROFRecord> mClusMC2ROFs, *mClusMC2ROFsPtr = &mClusMC2ROFs;
o2::header::DataOrigin mOrigin = o2::header::gDataOriginITS;
std::unique_ptr<TFile> mFile;
std::unique_ptr<TTree> mTree;
bool mUseMC = true; // use MC truth
bool mUsePatterns = true; // send patterns
std::string mDetName = "ITS"; // pretending to be ITS
std::string mDetNameLC = "its";
std::string mDetNameReal = "IT3";
std::string mFileName = "";
std::string mClusTreeName = "o2sim";
std::string mClusROFBranchName = "ClustersROF";
std::string mClusterPattBranchName = "ClusterPatt";
std::string mClusterCompBranchName = "ClusterComp";
std::string mClustMCTruthBranchName = "ClusterMCTruth";
std::string mClustMC2ROFBranchName = "ClustersMC2ROF";
};
/// create a processor spec
/// read ITS/MFT cluster data from a root file
framework::DataProcessorSpec getITS3ClusterReaderSpec(bool useMC = true, bool usePatterns = true);
} // namespace o2::its3
#endif /* O2_ITSMFT_CLUSTERREADER */