AnalysisTree
Loading...
Searching...
No Matches
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
28namespace AnalysisTree {
29
30class Track;
31class Particle;
32class Module;
33class Hit;
34class EventHeader;
35
36using BranchPointer = ANALYSISTREE_UTILS_VARIANT<HitDetector*, ModuleDetector*, TrackDetector*, EventHeader*, Particles*>;
37using ChannelPointer = ANALYSISTREE_UTILS_VARIANT<Hit*, Module*, Track*, EventHeader*, Particle*>;
38
39namespace Utils {
40
41template<typename RetType>
42struct Visitor
43#if defined(ANALYSISTREE_BOOST_VARIANT)
44 : public boost::static_visitor<RetType>
45#endif// USEBOOST
46{
47 public:
48#if defined(ANALYSISTREE_STD_VARIANT)
49 typedef RetType result_type;
50#endif
51 virtual ~Visitor() = default;
52};
53
54}// namespace Utils
55
56}// namespace AnalysisTree
57
58#endif//ANALYSISTREE_INFRA_UTILS_HPP
Cuts keep list of SimpleCuts. Logical AND is applied for all SimpleCut in the Cuts object.
Definition BranchConfig.cpp:10
Definition Utils.hpp:46