test_DetectorClocksService.cxx
Go to the documentation of this file.
1 // test_DetectorClocksService.cxx
2 
3 // David Adams
4 // September 2015
5 //
6 // This test demonstrates how to configure and use the LArSoft DetectorClocksService
7 // service outside the art framework.
8 
10 
11 #include <string>
12 #include <iostream>
15 #include "CLHEP/Random/RandomEngine.h"
17 
18 using std::string;
19 using std::cout;
20 using std::endl;
21 
22 int test_DetectorClocksService(string gname) {
23  const string myname = "test_DetectorClocksService: ";
24  cout << myname << "Starting test" << endl;
25 #ifdef NDEBUG
26  cout << myname << "NDEBUG must be off." << endl;
27  abort();
28 #endif
29  string line = "-----------------------------";
30  string scfg;
31 
33 
34  cout << myname << line << endl;
35  cout << myname << "Get DetectorClocksService service." << endl;
36  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
37 
38  cout << myname << line << endl;
39  cout << myname << "Use DetectorClocksService service." << endl;
40  cout << " TriggerTime: " << clockData.TriggerTime() << endl;
41  cout << " BeamGateTime: " << clockData.BeamGateTime() << endl;
42 
43  cout << myname << line << endl;
44  cout << "Done." << endl;
45  return 0;
46 }
47 
48 int main() {
49  string gname = "dune35t4apa_v6";
51  return 0;
52 }
int test_DetectorClocksService(string gname)
std::string string
Definition: nybbler.cc:12
static constexpr FileOnPath_t FileOnPath
static void load_services(std::string const &config)
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)