Functions
test_tpcFragmentToRawDigits.cxx File Reference
#include "../tpcFragmentToRawDigits.h"
#include "dune/DuneCommon/DuneTimeConverter.h"
#include <string>
#include <iostream>
#include <iomanip>
#include <cassert>

Go to the source code of this file.

Functions

int test_tpcFragmentToRawDigits ()
 
int main ()
 

Function Documentation

int main ( void  )

Definition at line 84 of file test_tpcFragmentToRawDigits.cxx.

84  {
86 }
int test_tpcFragmentToRawDigits()
int test_tpcFragmentToRawDigits ( )

Definition at line 26 of file test_tpcFragmentToRawDigits.cxx.

26  {
27  const string myname = "test_tpcFragmentToRawDigits: ";
28  cout << myname << "Starting test" << endl;
29 #ifdef NDEBUG
30  cout << myname << "NDEBUG must be off." << endl;
31  abort();
32 #endif
33  string line = "-----------------------------";
34  string scfg;
35 
36  cout << myname << line << endl;
37  cout << myname << "Create test time" << endl;
38  //uint32_t tsec = 2208988800; // 2040
39  uint32_t tsec = 1577836800; // 2020
40  //uint32_t tsec = 1483228800; // 2017
41  uint32_t trem = 123456789;
42 
43  cout << myname << line << endl;
44  cout << myname << "Create timestamp." << endl;
46  cout << myname << DuneTimeConverter::toString(ts1) << " sec " << endl;
47  assert( ts1.timeLow() == trem );
48  assert( ts1.timeHigh() == tsec );
49 
50  cout << myname << "Create nova time." << endl;
53  cout << myname << "Nova time: " <<tnova << endl;
54  cout << myname << "Timestamp: " << setw(9) << DuneTimeConverter::toString(ts2) << " sec" << endl;
55  assert( ts2.timeHigh() == tsec );
56  int64_t lodiff = ts2.timeLow();
57  lodiff -= trem;
59  cout << myname << "Low tolerance: " << tol << endl;
60  assert( abs(lodiff) < tol );
61 
62  cout << myname << line << endl;
63  cout << myname << "Test make_art_timestamp_from_nova_timestamp." << endl;
65  cout << myname << "Timestamp: " << setw(9) << ts3.timeHigh() << "."
66  << setw(9) << ts3.timeLow() << " sec" << endl;
67  assert( ts3.timeHigh() == ts2.timeHigh() );
68  assert( ts3.timeLow() == ts2.timeLow() );
69 
70  cout << myname << line << endl;
71  cout << myname << "Test old_make_art_timestamp_from_nova_timestamp." << endl;
73  cout << myname << "Timestamp: " << DuneTimeConverter::toString(ts4) << endl;
74  assert( ts4.timeHigh() == 0 );
75  assert( ts4.timeLow() == ts2.timeHigh() );
76 
77  cout << myname << line << endl;
78  cout << myname << "Done." << endl;
79  return 0;
80 }
def line(rflist, normalization=13700 *units.eplus)
Definition: __init__.py:701
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
static art::Timestamp fromNova(uint64_t tnova)
static std::string toString(art::Timestamp tart)
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
static art::Timestamp makeTimestamp(uint32_t tsec, uint32_t trem)
T abs(T value)
unsigned int uint32_t
Definition: stdint.h:126
art::Timestamp make_art_timestamp_from_nova_timestamp(lbne::TpcNanoSlice::Header::nova_timestamp_t this_nova_timestamp)
unsigned __int64 uint64_t
Definition: stdint.h:136
art::Timestamp old_make_art_timestamp_from_nova_timestamp(lbne::TpcNanoSlice::Header::nova_timestamp_t this_nova_timestamp)
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
signed __int64 int64_t
Definition: stdint.h:135
static uint64_t toNova(art::Timestamp tart)
QTextStream & endl(QTextStream &s)
static uint64_t novaTicksPerUsec()