Project
Loading...
Searching...
No Matches
TOFClusterWriterSpec.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
19
20using namespace o2::framework;
21
22namespace o2
23{
24namespace tof
25{
26template <typename T>
28using OutputType = std::vector<o2::tof::Cluster>;
29using MultType = std::vector<int>;
31using namespace o2::header;
32
34{
35 // Spectators for logging
36 auto logger = [](OutputType const& indata) {
37 LOG(debug) << "RECEIVED CLUSTERS SIZE " << indata.size();
38 };
39 auto loggerMult = [](MultType const& inmult) {
40 LOG(debug) << "RECEIVED N BC SIZE " << inmult.size();
41 };
42 auto loggerMCLabels = [](LabelsType const& labeldata) {
43 LOG(debug) << "TOF GOT " << labeldata.getNElements() << " LABELS ";
44 };
45 return MakeRootTreeWriterSpec("TOFClusterWriter",
46 "tofclusters.root",
47 "o2sim",
48 BranchDefinition<OutputType>{InputSpec{"clusters", gDataOriginTOF, "CLUSTERS", 0},
49 "TOFCluster",
50 "tofclusters-branch-name",
51 1,
52 logger},
53 BranchDefinition<MultType>{InputSpec{"clustersMult", gDataOriginTOF, "CLUSTERSMULT", 0},
54 "TOFClusterMult",
55 "tofclustersmult-branch-name",
56 1,
57 loggerMult},
58 BranchDefinition<LabelsType>{InputSpec{"labels", gDataOriginTOF, "CLUSTERSMCTR", 0},
59 "TOFClusterMCTruth",
60 "clusterlabels-branch-name",
61 (useMC ? 1 : 0), // one branch if mc labels enabled
62 loggerMCLabels})();
63}
64} // namespace tof
65} // namespace o2
Definition of the TOF cluster.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Configurable generator for RootTreeWriter processor spec.
std::ostringstream debug
Generate a processor spec for the RootTreeWriter utility.
constexpr o2::header::DataOrigin gDataOriginTOF
Definition DataHeader.h:575
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
O2 data header classes and API, v0.1.
Definition DetID.h:49
std::vector< o2::tof::CalibInfoCluster > OutputType
std::vector< int > MultType
o2::framework::DataProcessorSpec getTOFClusterWriterSpec(bool useMC)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"