Project
Loading...
Searching...
No Matches
PrimaryVertexWriterSpec.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 vertexing
28{
29
30template <typename T>
32
34
35using namespace o2::header;
36
37DataProcessorSpec getPrimaryVertexWriterSpec(bool disableMatching, bool useMC)
38{
39 auto logger = [](std::vector<PVertex> const& v) {
40 LOG(info) << "PrimaryVertexWriter pulled " << v.size() << " vertices";
41 };
42 auto inpID = disableMatching ? InputSpec{"vttrackID", "GLO", "PVTX_CONTID", 0} : InputSpec{"vttrackID", "GLO", "PVTX_TRMTC", 0};
43 auto inpIDRef = disableMatching ? InputSpec{"v2tref", "GLO", "PVTX_CONTIDREFS", 0} : InputSpec{"v2tref", "GLO", "PVTX_TRMTCREFS", 0};
44 return MakeRootTreeWriterSpec("primary-vertex-writer",
45 "o2_primary_vertex.root",
46 MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Tree with Primary Vertices"},
47 BranchDefinition<std::vector<PVertex>>{InputSpec{"vertices", "GLO", "PVTX", 0}, "PrimaryVertex", logger},
48 BranchDefinition<std::vector<V2TRef>>{inpIDRef, "PV2TrackRefs"},
49 BranchDefinition<std::vector<GIndex>>{inpID, "PVTrackIndices"},
50 BranchDefinition<std::vector<Label>>{InputSpec{"labels", "GLO", "PVTX_MCTR", 0}, "PVMCTruth", (useMC ? 1 : 0), ""})();
51}
52
53} // namespace vertexing
54} // namespace o2
Configurable generator for RootTreeWriter processor spec.
Primary vertex finder helper classes.
Class to refer to the 1st entry and N elements of some group in the continuous container.
Generate a processor spec for the RootTreeWriter utility.
const GLdouble * v
Definition glcorearb.h:832
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
O2 data header classes and API, v0.1.
Definition DetID.h:49
framework::DataProcessorSpec getPrimaryVertexWriterSpec(bool disableMatching, bool useMC)
create a processor spec
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"