testREventImpl.cc
Go to the documentation of this file.
2 #include <fwk/CentralConfig.h>
3 #include <evt/Event.h>
4 #include <revt/REvent.h>
5 #include <revt/Header.h>
6 
7 #include <det/Detector.h>
8 #include <rdet/RDetector.h>
9 
10 #include <iostream>
11 
12 #include <utl/TimeStamp.h>
13 #include <utl/UTCDateTime.h>
14 
15 #include <tst/Verify.h>
16 
17 #include <cppunit/extensions/HelperMacros.h>
18 
19 using namespace std;
20 using namespace utl;
21 using namespace tst;
22 using namespace revt;
23 
24 
26 {
27  if (fIsOwnerOfEvent)
28  delete fEvent;
29 }
30 
31 
32 void
34 {
35  if (!fEvent)
36  fEvent = new evt::Event;
37  fEvent->MakeREvent();
38 
39  fwk::CentralConfig::GetInstance(BOOTSTRAPFILE);
40 
41  fTime = UTCDateTime(2011, 11, 11, 11, 11, 00).GetTimeStamp();
42  det::Detector::GetInstance().Update(fTime);
43 
44  // Add all stations in the Detector (commissioned at current time)
45  // to the REvent
46  //
47  REvent& rEvent = fEvent->GetREvent();
48  const rdet::RDetector& theRDetector = det::Detector::GetInstance().GetRDetector();
49 
50  fNStations = 0;
51  for (const auto& station : theRDetector.StationsRange()) {
52  rEvent.MakeStation(station.GetId());
53  ++fNStations;
54  }
55 
56 }
57 
58 
59 void
60 testREventImpl::setUp(evt::Event& event, const bool testIO)
61 {
62  delete fEvent;
63  fEvent = &event;
64  this->setUp();
65  fIsOwnerOfEvent = false;
66 
67  fTestIO = testIO;
68 }
69 
70 
71 void
73 {
74  Header& header = rEvent.GetHeader();
75  header.SetId(999);
76  header.SetTime(fTime);
77 }
78 
79 
80 void
82 {
83  const Header& header = rEvent.GetHeader();
84 
85  CPPUNIT_ASSERT(Verify<Equal>(header.GetId(), 999));
86  CPPUNIT_ASSERT(Verify<Equal>(header.GetTime(), fTime));
87 }
88 
89 void
91 {
92  REvent& rEvent = fEvent->GetREvent();
93  setHeaderValues(rEvent);
94  checkHeaderValues(rEvent);
95 }
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
utl::TimeStamp GetTime() const
Definition: REvent/Header.h:17
void SetTime(const utl::TimeStamp &time)
Version of the AERAEvent used by the DAQ software.
Definition: REvent/Header.h:27
Detector description interface for RDetector-related data.
Definition: RDetector.h:46
void setHeaderValues(revt::REvent &rEvent)
Header & GetHeader()
access to REvent Header
Definition: REvent.h:239
void checkHeaderValues(const revt::REvent &rEvent)
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
Header file holding the RD Event Trigger class definition (based on SD)
Definition: REvent/Header.h:14
void SetId(const int id)
Definition: REvent/Header.h:28
void MakeStation(const int stationId)
make a station with specifying Id, throw if invalid stationId
Definition: REvent.cc:94
TimeStamp GetTimeStamp() const
Definition: UTCDateTime.cc:115
int GetId() const
Definition: REvent/Header.h:21

, generated on Tue Sep 26 2023.