GamR  0.0.0
GammaROOT
Loading...
Searching...
No Matches
Event.hh
Go to the documentation of this file.
1#ifndef GAMROOT_TREE_EVENT_HH
2#define GAMROOT_TREE_EVENT_HH
3
4/* STD */
5#include <tuple>
6#include <vector>
7
8/* ROOT */
9#include <Rtypes.h>
10#include <TObject.h>
11
12/* GAMR */
13#include <utils/Tuples.hh>
14
15namespace GamR {
16namespace Tree {
17
18template <class... ADets>
19class TEvent : public TObject {
20public:
21 template <size_t GroupN>
22 using detector_type = typename std::tuple_element<GroupN, std::tuple<ADets...>>::type;
23 std::tuple<std::vector<ADets>...> DetGroup;
24 ULong64_t EventNum;
25
26private:
27 struct ClearVector;
28 struct EventTupleFiller;
29 struct IgnoreTObject;
30
31public:
33 {
34 auto tmp = std::tuple<ADets...>();
36 };
38
39 void SetEventNum(ULong64_t n) { EventNum = n; }
40 size_t GetNumGroups() const { return sizeof...(ADets); }
41 template <int N>
42 auto GetGroup() -> decltype(std::get<N>(DetGroup)) &
43 {
44 return std::get<N>(DetGroup);
45 }
46 auto GetGroups() -> decltype(DetGroup) & { return DetGroup; }
47 template <typename T>
48 void FillEvent(T &detdefntup)
49 {
51 }
53
55};
56
57} /* namespace Tree */
58} /* namespace GamR */
59
60#include "Event.tt"
61
62#endif
auto GetGroup() -> decltype(std::get< N >(DetGroup)) &
Definition Event.hh:42
size_t GetNumGroups() const
Definition Event.hh:40
auto GetGroups() -> decltype(DetGroup) &
Definition Event.hh:46
void SetEventNum(ULong64_t n)
Definition Event.hh:39
ULong64_t EventNum
Definition Event.hh:24
ClassDef(TEvent, 1)
void FillEvent(T &detdefntup)
Definition Event.hh:48
std::tuple< std::vector< ADets >... > DetGroup
Definition Event.hh:23
typename std::tuple_element< GroupN, std::tuple< ADets... > >::type detector_type
Definition Event.hh:22
void for_each_in_tuple(std::tuple< Ts... > &t, F f)
Applies function on each element of tuple.
Definition Tuples.hh:67
void for_both_in_tuple(T1 &t1, T2 &t2, F f)
Applies function taking both elements of tuple as arguments.
Definition Tuples.hh:83
Definition Gain.cc:19