SEvent_ROOT.cc
Go to the documentation of this file.
1 #include <io/SEvent_ROOT.h>
2 #include <io/SEventSimData_ROOT.h>
3 #include <io/EventTrigger_ROOT.h>
4 #include <io/Meteo_ROOT.h>
5 #include <sevt/SEvent.h>
6 
7 using namespace io;
8 
9 
10 ClassImp(SEvent_ROOT)
11 
12 
14 SEvent_ROOT::operator=(const SEvent_ROOT& e)
15 {
16  if (this != &e) {
17  fStations = e.fStations;
18  DeepCopy(fSimData, e.fSimData);
19  DeepCopy(fTrigger, e.fTrigger);
20  fHeader = e.fHeader;
21  fNErrorZeroStations = e.fNErrorZeroStations;
22  DeepCopy(fMeteo, e.fMeteo);
23  }
24  return *this;
25 }
26 
27 
29  fStations(e.StationsBegin(), e.StationsEnd()),
30  fHeader(e.GetHeader()),
31  fNErrorZeroStations(e.GetNErrorZeroStations())
32 {
33  if (e.HasSimData())
35  if (e.HasTrigger())
37  if (e.HasMeteo())
39 }
40 
41 
43 {
44  delete fSimData;
45  delete fTrigger;
46  delete fMeteo;
47 }
48 
49 
50 void
52  const
53 {
54  for (const auto& st : fStations) {
55  e.MakeStation(st.fId);
56  st >> e.GetStation(st.fId);
57  }
58  if (fSimData) {
59  if (!e.HasSimData())
60  e.MakeSimData();
61  *fSimData >> e.GetSimData();
62  }
63  if (fTrigger) {
64  if (!e.HasTrigger())
65  e.MakeTrigger();
66  *fTrigger >> e.GetTrigger();
67  }
68  fHeader >> e.GetHeader();
70  if (fMeteo) {
71  if (!e.HasMeteo())
72  e.MakeMeteo();
73  *fMeteo >> e.GetMeteo();
74  }
75 }
void MakeMeteo()
Definition: SEvent.cc:122
Meteo & GetMeteo()
Definition: SEvent.h:181
void ConvertCopy(T *&destination, const U &source)
Interface class to access to the SD part of an event.
Definition: SEvent.h:39
EventTrigger & GetTrigger()
Get the object with central trigger data, throw if n.a.
Definition: SEvent.h:148
EventTrigger_ROOT * fTrigger
Definition: SEvent_ROOT.h:42
void operator>>(sevt::SEvent &e) const
Definition: SEvent_ROOT.cc:51
Persistent SEvent using ROOT.
Definition: SEvent_ROOT.h:29
Meteo_ROOT * fMeteo
Definition: SEvent_ROOT.h:45
bool HasSimData() const
check whether the SimData object exists
Definition: SEvent.h:143
unsigned int fNErrorZeroStations
Definition: SEvent_ROOT.h:44
void DeepCopy(T *&destination, U *const source)
void SetNErrorZeroStations(const unsigned int n)
Set number of error zero stations.
Definition: SEvent.h:133
void MakeSimData()
Create the SimData object.
Definition: SEvent.cc:112
bool HasTrigger() const
check whether the central trigger object exists
Definition: SEvent.h:153
void MakeTrigger()
Create the central trigger object.
Definition: SEvent.cc:102
void MakeStation(const int stationId)
make a station with specifying Id, throw if invalid stationId
Definition: SEvent.cc:65
SEventSimData & GetSimData()
Get the object with simulated data, throw if n.a.
Definition: SEvent.h:138
Station & GetStation(const int stationId)
retrieve station by id throw utl::NonExistentComponentException if n.a.
Definition: SEvent.h:116
sevt::Header & GetHeader()
Definition: SEvent.h:155
std::vector< Station_ROOT > fStations
Definition: SEvent_ROOT.h:40
SEventSimData_ROOT * fSimData
Definition: SEvent_ROOT.h:41
sevtHeader_ROOT fHeader
Definition: SEvent_ROOT.h:43
bool HasMeteo() const
Definition: SEvent.h:177

, generated on Tue Sep 26 2023.