Project
Loading...
Searching...
No Matches
TrackCosmicsWriterSpec.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>
21
22using namespace o2::framework;
23
24namespace o2
25{
26namespace globaltracking
27{
28
29template <typename T>
31using TracksType = std::vector<o2::dataformats::TrackCosmics>;
32using LabelsType = std::vector<o2::MCCompLabel>;
33
35{
36 // A spectator for logging
37 auto logger = [](TracksType const& tracks) {
38 LOG(info) << "Writing " << tracks.size() << " Cosmics Tracks";
39 };
40 return MakeRootTreeWriterSpec("cosmic-track-writer",
41 "cosmics.root",
42 "cosmics",
43 -1, // do not limit number of events to store
44 100, // periodically autosave
45 BranchDefinition<TracksType>{InputSpec{"tracks", "GLO", "COSMICTRC", 0},
46 "tracks",
47 "tracks-branch-name",
48 1,
49 logger},
50 BranchDefinition<LabelsType>{InputSpec{"tracksMC", "GLO", "COSMICTRC_MC", 0},
51 "MCTruth",
52 (useMC ? 1 : 0), // one branch if mc labels enabled
53 ""})();
54}
55
57{
58 auto logger = [](std::vector<o2::dataformats::TrackCosmicsExtended> const& cosmics) {
59 LOG(info) << "Writing " << cosmics.size() << " cosmics with clusters";
60 };
61 return MakeRootTreeWriterSpec("cosmics-full-writer",
62 "o2_cosmics_full.root",
63 "cosmicsFull",
64 -1, // do not limit number of events to store
65 100, // periodically autosave
66 BranchDefinition<std::vector<o2::dataformats::TrackCosmicsExtended>>{InputSpec{"cosmics", "GLO", "COSMFULL", 0}, "cosmics", 1, logger},
67 BranchDefinition<o2::dataformats::CosmicsTFInfo>{InputSpec{"tfinfo", "GLO", "COSMFULLTF", 0}, "tfInfo", 1},
68 BranchDefinition<o2::dataformats::TFIDInfo>{InputSpec{"tfid", "GLO", "COSMFULLTFID", 0}, "tfID", 1})();
69}
70
71} // namespace globaltracking
72} // namespace o2
std::vector< o2::its::TrackITS > tracks
std::vector< o2::MCCompLabel > LabelsType
Configurable generator for RootTreeWriter processor spec.
Matched cosmic track with the raw clusters of its legs and of the road around them,...
Result of top-bottom cosmic tracks leg matching.
Generate a processor spec for the RootTreeWriter utility.
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
framework::DataProcessorSpec getTrackCosmicsWriterSpec(bool useMC)
std::vector< o2::dataformats::GlobalFwdTrack > TracksType
framework::DataProcessorSpec getCosmicsFullWriterSpec()
write cosmics with their raw clusters (cosmics-cluster-collector output) to a root file
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"