Counter_ROOT.cc
Go to the documentation of this file.
1 #include <io/Counter_ROOT.h>
2 #include <io/CounterSimData_ROOT.h>
3 #include <io/StreamerUtilities.h>
4 #include <mdet/MDetector.h>
5 
6 using namespace io;
7 
8 
9 ClassImp(Counter_ROOT)
10 
11 
13 {
14  delete fSimData;
15 }
16 
17 
20 {
21  if (this != &c) {
22  fId = c.fId;
23  fModules = c.fModules;
25  }
26  return *this;
27 }
28 
29 
31  fId(c.GetId()),
32  fModules(c.ModulesBegin(), c.ModulesEnd())
33 {
34  if (c.HasSimData())
36 }
37 
38 
39 void
41  const
42 {
43  if (!fModules.empty()) {
44  const mdet::Counter& mdCounter = det::Detector::GetInstance().GetMDetector().GetCounter(fId);
45  for (const auto& m : fModules) {
46  const int id = m.fId;
47  const auto& mdMod = mdCounter.GetModule(id);
48  const auto& mask =
49  mdMod.IsSiPM() ? mdMod.GetFrontEndSiPM().GetMask() : mdMod.GetFrontEnd().GetMask();
50  c.MakeModule(id);
51  auto& mod = c.GetModule(id);
52  mod.SetChannelMask(mask);
53  m >> mod;
54  }
55  }
56 
57  if (fSimData) {
58  c.MakeSimData();
59  *fSimData >> c.GetSimData();
60  }
61 }
Module & GetModule(const int mId)
const Module & GetModule(const int mId) const
Retrieve by id a constant module.
void ConvertCopy(T *&destination, const U &source)
Counter level event data.
Persistent Counter using ROOT.
Definition: Counter_ROOT.h:26
Counter_ROOT & operator=(const Counter_ROOT &c)
Definition: Counter_ROOT.cc:19
void DeepCopy(T *&destination, U *const source)
std::vector< Module_ROOT > fModules
Definition: Counter_ROOT.h:39
void operator>>(mevt::Counter &c) const
Definition: Counter_ROOT.cc:40
Root detector of the muon detector hierarchy.
void MakeModule(const int mId)
bool HasSimData() const
bool IsSiPM() const
double mod(const double d, const double periode)
CounterSimData & GetSimData()
constexpr double m
Definition: AugerUnits.h:121
CounterSimData_ROOT * fSimData
Definition: Counter_ROOT.h:40

, generated on Tue Sep 26 2023.