Project
Loading...
Searching...
No Matches
AODProducerHelpers.h
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
14
15
#ifndef O2_AODPRODUCER_HELPERS
16
#define O2_AODPRODUCER_HELPERS
17
18
#include <boost/functional/hash.hpp>
19
#include <boost/tuple/tuple.hpp>
20
#include <boost/unordered_map.hpp>
21
#include <
Framework/AnalysisHelpers.h
>
22
23
namespace
o2::aodhelpers
24
{
25
26
typedef
boost::tuple<int, int, int>
Triplet_t
;
27
28
struct
TripletHash
{
29
std::size_t
operator()
(
Triplet_t
const
& e)
const
30
{
31
std::size_t seed = 0;
32
boost::hash_combine(seed, e.get<0>());
33
boost::hash_combine(seed, e.get<1>());
34
boost::hash_combine(seed, e.get<2>());
35
return
seed;
36
}
37
};
38
39
struct
TripletEqualTo
{
40
bool
operator()
(
Triplet_t
const
&
x
,
Triplet_t
const
&
y
)
const
41
{
42
return
(
x
.get<0>() ==
y
.get<0>() &&
43
x
.get<1>() ==
y
.get<1>() &&
44
x
.get<2>() ==
y
.get<2>());
45
}
46
};
47
48
typedef
boost::unordered_map<Triplet_t, int, TripletHash, TripletEqualTo>
TripletsMap_t
;
49
50
template
<
typename
T>
51
auto
createTableCursor
(
framework::ProcessingContext
& pc)
52
{
53
framework::Produces<T>
c
;
54
c
.
resetCursor
(pc.
outputs
()
55
.
make
<
framework::TableBuilder
>(
framework::OutputForTable<T>::ref
()));
56
c
.setLabel(aod::label<T::ref>());
57
return
c
;
58
}
59
}
// namespace o2::aodhelpers
60
61
#endif
/* O2_AODPRODUCER_HELPERS */
AnalysisHelpers.h
c
uint32_t c
Definition
RawData.h:2
int
o2::framework::DataAllocator::make
decltype(auto) make(const Output &spec, Args... args)
Definition
DataAllocator.h:166
o2::framework::ProcessingContext
Definition
ProcessingContext.h:27
o2::framework::ProcessingContext::outputs
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
Definition
ProcessingContext.h:41
o2::framework::TableBuilder
Definition
TableBuilder.h:633
x
GLint GLenum GLint x
Definition
glcorearb.h:403
o2::aodhelpers
Definition
AODProducerHelpers.h:24
o2::aodhelpers::createTableCursor
auto createTableCursor(framework::ProcessingContext &pc)
Definition
AODProducerHelpers.h:51
o2::aodhelpers::Triplet_t
boost::tuple< int, int, int > Triplet_t
Definition
AODProducerHelpers.h:26
o2::aodhelpers::TripletsMap_t
boost::unordered_map< Triplet_t, int, TripletHash, TripletEqualTo > TripletsMap_t
Definition
AODProducerHelpers.h:48
o2::aodhelpers::TripletEqualTo
Definition
AODProducerHelpers.h:39
o2::aodhelpers::TripletEqualTo::operator()
bool operator()(Triplet_t const &x, Triplet_t const &y) const
Definition
AODProducerHelpers.h:40
o2::aodhelpers::TripletHash
Definition
AODProducerHelpers.h:28
o2::aodhelpers::TripletHash::operator()
std::size_t operator()(Triplet_t const &e) const
Definition
AODProducerHelpers.h:29
o2::framework::OutputForTable
Definition
AnalysisHelpers.h:170
o2::framework::Produces
Definition
AnalysisHelpers.h:190
o2::framework::WritingCursor::resetCursor
bool resetCursor(LifetimeHolder< TableBuilder > builder)
Definition
AnalysisHelpers.h:109
Detectors
AOD
include
AODProducerWorkflow
AODProducerHelpers.h
Generated on Tue Feb 25 2025 17:02:54 for Project by
1.9.8