11 std::cout <<
"\n\nChecking Actual Dates for new files...\n\n";
14 TDatime *
TNow =
new TDatime;
15 TDatime *
SRtime =
new TDatime;
16 int XNowGMT = TNowGMT->Convert(kTRUE);
17 int XNow = TNow ->Convert(kFALSE);
22 int XDayAgo = XNow - 60*60*24;
23 int X4DyAgo = XNow - 60*60*24*4;
24 int XWekAgo = XNow - 60*60*24*7;
25 int X2HrAgo = XNow - 60*60*2;
26 int X8HrAgo = XNow - 60*60*8;
29 unsigned int year = 0;
30 unsigned short int month = 0;
31 unsigned short int day = 0;
45 unsigned int yearEnd = 0;
46 unsigned short int monthEnd = 0;
47 unsigned short int dayEnd = 0;
53 gSystem->Setenv(
"TZ",
"UTC");
54 gStyle->SetTimeOffset(0);
56 const unsigned int Npoint = 1440;
65 inDay.open(
"NewFarDetFiles.txt");
66 out_file.open (
"NewFarDetOnMonFiles.txt");
69 inDay.open(
"NewNearDetFiles.txt");
70 out_file.open (
"NewNearDetOnMonFiles.txt");
72 else cout <<
" invalid detector type in CheckTrueDate " <<
endl;
77 TFile fileD(filenameD);
79 TTree *
header = (TTree*)fileD.Get(
"Header");
81 header->SetBranchAddress(
"StartYear", &year);
82 header->SetBranchAddress(
"StartMonth", &month);
83 header->SetBranchAddress(
"StartDay", &day);
84 header->SetBranchAddress(
"StartHour", &Hour);
85 header->SetBranchAddress(
"EndYear", &yearEnd);
86 header->SetBranchAddress(
"EndMonth", &monthEnd);
87 header->SetBranchAddress(
"EndDay", &dayEnd);
88 header->SetBranchAddress(
"EndHour", &HourEnd);
89 header->SetBranchAddress(
"Run", &run);
90 header->SetBranchAddress(
"Subrun", &subrun);
94 Min = (Hour-
hour)*60.0;
95 min = (Hour-
hour)*60.0;
99 SRtime->Set(year,month,day,hour,min,sec);
102 if(timeOpt == 0 && Xsrtime > XDayAgo) out_file << filenameD <<
std::endl;
103 if(timeOpt == 1 && Xsrtime > X2HrAgo) out_file << filenameD <<
std::endl;
104 if(timeOpt == 2 && Xsrtime > X8HrAgo) out_file << filenameD <<
std::endl;
105 if(timeOpt == 3 && Xsrtime > XWekAgo) out_file << filenameD <<
std::endl;
106 if(timeOpt == 4 && Xsrtime > X4DyAgo) out_file << filenameD <<
std::endl;
void CheckTrueDate(int idet, int timeOpt)
out_file
Append EOF lines.
static float min(const float a, const float b, const float c)
static constexpr Double_t year