-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.cpp
98 lines (82 loc) · 1.64 KB
/
event.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "!_All_include.h"
#include "event.h"
event::event()
{
_arr.clear();
}
event::event(const muon m, const int index_k, const int index_m): _index_k(index_k), _index_m(index_m), _m(m)
{
_arr.clear();
}
std::vector < std::pair < int , std::vector < std::pair < int, std::vector < int > > > > > event::GetArr() const
{
return _arr;
}
muon event::GetMuon() const
{
return _m;
}
long long event::GetKitIndex() const
{
return _index_k;
}
long long event::GetMuonIndex() const
{
return _index_m;
}
bool event::GetFlag() const
{
return _flag;
}
int event::GetCountOfDetectors() const
{
return _count_d;
}
int event::GetCountOfLayers() const
{
return _count_l;
}
int event::GetCountOfPixels() const
{
return _count_p;
}
void event::SetMuon(const muon m)
{
_m = m;
}
void event::SetKitIndex(const long long index_k)
{
if (index_k != 0)
std::cout << "errrrrr " << index_k << std::endl;
_index_k = index_k;
_arr.clear();
}
void event::SetMuonIndex(const long long index_m)
{
_index_m = index_m;
}
void event::SetArr(std::vector < std::pair < int, std::vector < std::pair < int, std::vector < int > > > > > arr)
{
if (GetFlag())
_arr = arr;
else
_arr.clear();
UpdateCounts();
}
void event::SetFlag(const bool flag)
{
_flag = flag;
_arr.clear();
}
void event::UpdateCounts()
{
_count_d = 0;
_count_l = _arr.size();
_count_p = 0;
for (int i = 0; i < (int)_arr.size(); ++i)
{
_count_d += _arr[i].second.size();
for (int j = 0; j < (int)_arr[i].second.size(); ++j)
_count_p += _arr[i].second[j].second.size();
}
}