AnalysisTree
Toggle main menu visibility
Loading...
Searching...
No Matches
infra
Utils.hpp
1
/* Copyright (C) 2019-2021 GSI, Universität Tübingen, MEPhI
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Viktor Klochkov, Eugeny Kashirin, Ilya Selyuzhenkov */
4
#ifndef ANALYSISTREE_INFRA_UTILS_HPP
5
#define ANALYSISTREE_INFRA_UTILS_HPP
6
7
#ifndef __has_include
8
#define __has_include(MACRO) 0
9
#endif
10
11
#if __has_include(<variant>) && __cplusplus > 201402L
12
#include <variant>
13
#define ANALYSISTREE_STD_VARIANT 1
14
#define ANALYSISTREE_UTILS_VARIANT std::variant
15
#define ANALYSISTREE_UTILS_VISIT std::visit
16
#define ANALYSISTREE_UTILS_GET std::get
17
#elif __has_include(<boost/variant.hpp>)
18
#include <boost/variant.hpp>
19
#include <boost/variant/static_visitor.hpp>
20
#define ANALYSISTREE_BOOST_VARIANT 1
21
#define ANALYSISTREE_UTILS_VARIANT boost::variant
22
#define ANALYSISTREE_UTILS_VISIT boost::apply_visitor
23
#define ANALYSISTREE_UTILS_GET boost::get
24
#endif
25
26
#include "Detector.hpp"
27
28
namespace
AnalysisTree
{
29
30
class
Track
;
31
class
Particle
;
32
class
Module
;
33
class
Hit
;
34
class
EventHeader
;
35
class
Container
;
36
37
using
BranchPointer = ANALYSISTREE_UTILS_VARIANT<HitDetector*, ModuleDetector*, TrackDetector*, EventHeader*, Particles*, GenericDetector*>;
38
using
ChannelPointer = ANALYSISTREE_UTILS_VARIANT<Hit*, Module*, Track*, EventHeader*, Particle*, Container*>;
39
40
namespace
Utils {
41
42
template
<
typename
RetType>
43
struct
Visitor
44
#if defined(ANALYSISTREE_BOOST_VARIANT)
45
:
public
boost::static_visitor<RetType>
46
#endif
// USEBOOST
47
{
48
public
:
49
#if defined(ANALYSISTREE_STD_VARIANT)
50
typedef
RetType result_type;
51
#endif
52
virtual
~Visitor
() =
default
;
53
};
54
55
}
// namespace Utils
56
57
}
// namespace AnalysisTree
58
59
#endif
//ANALYSISTREE_INFRA_UTILS_HPP
AnalysisTree::Container
A class to store any number of integers, floats and bools.
Definition
Container.hpp:18
AnalysisTree::EventHeader
Definition
EventHeader.hpp:18
AnalysisTree::Hit
Definition
Hit.hpp:16
AnalysisTree::Module
Definition
Module.hpp:15
AnalysisTree::Particle
Definition
Particle.hpp:11
AnalysisTree::Track
A class for a generic track with determined momentum.
Definition
Track.hpp:22
AnalysisTree
Cuts keep list of SimpleCuts. Logical AND is applied for all SimpleCut in the Cuts object.
Definition
BranchConfig.cpp:10
AnalysisTree::Utils::Visitor
Definition
Utils.hpp:47
Generated by
1.17.0