Project
Loading...
Searching...
No Matches
ClusterWriterSpec.cxx
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#include <vector>
15
22
23using namespace o2::framework;
24
25namespace o2
26{
27namespace its3
28{
29
30template <typename T>
32using CompClusType = std::vector<o2::itsmft::CompClusterExt>;
33using PatternsType = std::vector<unsigned char>;
34using ROFrameRType = std::vector<o2::itsmft::ROFRecord>;
36using ROFRecLblT = std::vector<o2::itsmft::MC2ROFRecord>;
37using namespace o2::header;
38
40{
41 // Spectators for logging
42 // this is only to restore the original behavior
43 auto compClustersSize = std::make_shared<int>(0);
44 auto compClustersSizeGetter = [compClustersSize](CompClusType const& compClusters) {
45 *compClustersSize = compClusters.size();
46 };
47 auto logger = [compClustersSize](std::vector<o2::itsmft::ROFRecord> const& rofs) {
48 LOG(info) << "ITS3ClusterWriter pulled " << *compClustersSize << " clusters, in " << rofs.size() << " RO frames";
49 };
50 return MakeRootTreeWriterSpec("its3-cluster-writer",
51 "o2clus_its.root",
52 MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Tree with ITS clusters"},
53 BranchDefinition<CompClusType>{InputSpec{"compclus", "ITS", "COMPCLUSTERS", 0},
54 "ITSClusterComp",
55 compClustersSizeGetter},
56 BranchDefinition<PatternsType>{InputSpec{"patterns", "ITS", "PATTERNS", 0},
57 "ITSClusterPatt"},
58 BranchDefinition<ROFrameRType>{InputSpec{"ROframes", "ITS", "CLUSTERSROF", 0},
59 "ITSClustersROF",
60 logger},
61 BranchDefinition<LabelsType>{InputSpec{"labels", "ITS", "CLUSTERSMCTR", 0},
62 "ITSClusterMCTruth",
63 (useMC ? 1 : 0), // one branch if mc labels enabled
64 ""},
65 BranchDefinition<ROFRecLblT>{InputSpec{"MC2ROframes", "ITS", "CLUSTERSMC2ROF", 0},
66 "ITSClustersMC2ROF",
67 (useMC ? 1 : 0), // one branch if mc labels enabled
68 ""})();
69}
70
71} // namespace its3
72} // namespace o2
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.
Configurable generator for RootTreeWriter processor spec.
Generate a processor spec for the RootTreeWriter utility.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
O2 data header classes and API, v0.1.
Definition DetID.h:49
std::vector< o2::itsmft::ROFRecord > ROFrameRType
std::vector< unsigned char > PatternsType
framework::DataProcessorSpec getClusterWriterSpec(bool useMC)
std::vector< o2::itsmft::CompClusterExt > CompClusType
std::vector< o2::itsmft::MC2ROFRecord > ROFRecLblT
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"