GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NtpMCDTime.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <c.andreopoulos \at cern.ch>
7  University of Liverpool
8 */
9 //____________________________________________________________________________
10 
11 #include <TDatime.h>
12 
14 
15 using namespace genie;
16 
18 
19 using std::endl;
20 
21 //____________________________________________________________________________
22 namespace genie {
23  ostream & operator<< (ostream& stream, const NtpMCDTime & dt)
24  {
25  dt.PrintToStream(stream);
26  return stream;
27  }
28 }
29 //____________________________________________________________________________
31 TObject()
32 {
33  this->Init();
34 }
35 //____________________________________________________________________________
37 TObject()
38 {
39  this->Copy(dt);
40 }
41 //____________________________________________________________________________
43 {
44 
45 }
46 //____________________________________________________________________________
47 void NtpMCDTime::PrintToStream(ostream & stream) const
48 {
49  stream
50  << "DATE (dd/mm/yyyy): " << day << "/" << month << "/" << year
51  << ", TIME (hr:min:sec): " << hour << ":" << min << ":" << sec << endl;
52 }
53 //____________________________________________________________________________
54 void NtpMCDTime::Copy(const NtpMCDTime & dt)
55 {
56  year = dt.year;
57  month = dt.month;
58  day = dt.day;
59  hour = dt.hour;
60  min = dt.min;
61  sec = dt.sec;
62  val = dt.val;
63 }
64 //____________________________________________________________________________
65 void NtpMCDTime::Init(void)
66 {
67  year = 0;
68  month = 0;
69  day = 0;
70  hour = 0;
71  min = 0;
72  sec = 0;
73  val = 0;
74 }
75 //____________________________________________________________________________
76 void NtpMCDTime::Now(void)
77 {
78  TDatime t;
79 
80  year = t.GetYear();
81  month = t.GetMonth();
82  day = t.GetDay();
83  hour = t.GetHour();
84  min = t.GetMinute();
85  sec = t.GetSecond();
86  val = t.Get();
87 }
88 //____________________________________________________________________________
void Init(void)
Definition: NtpMCDTime.cxx:65
UInt_t val
sec since 1st Jan 1995 as in TDatime
Definition: NtpMCDTime.h:58
MINOS-style Ntuple Class to hold the date and time that the event ntuple was generated.
Definition: NtpMCDTime.h:33
void Copy(const NtpMCDTime &dt)
Definition: NtpMCDTime.cxx:54
void Now(void)
Definition: NtpMCDTime.cxx:76
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
ClassImp(CacheBranchFx)
void PrintToStream(ostream &stream) const
Definition: NtpMCDTime.cxx:47
virtual ~NtpMCDTime()
Definition: NtpMCDTime.cxx:42