CustomFunctions.h
Go to the documentation of this file.
1 #include "TTimeStamp.h"
2 #include "TPaveLabel.h"
3 
4 void lastUpdated(unsigned int timestamp){
5  TTimeStamp refreshTime(timestamp + 604800); // One week, change if shift is modified
6  TTimeStamp includedTime(timestamp);
7  unsigned int year, month, day, hour, minute, second;
8 
9  refreshTime.GetDate(kFALSE, 0, &year, &month, &day);
10  refreshTime.GetTime(kFALSE, 0, &hour, &minute, &second);
11 
12  TPaveLabel* pl = new TPaveLabel;
13  pl->SetX1NDC(0.50);
14  pl->SetX2NDC(0.98);
15  pl->SetY1NDC(0.95);
16  pl->SetY2NDC(1.00);
17  pl->SetFillColor(0);
18  pl->SetShadowColor(0);
19  pl->SetLineColor(0);
20  pl->SetLabel(Form("Last refreshed: %u-%02u-%02u-%02u:%02u:%02u",year,month,day,hour,minute,second));
21  pl->SetTextSize(0);
22  pl->Draw();
23 
24  includedTime.GetDate(kFALSE, 0, &year, &month, &day);
25  includedTime.GetTime(kFALSE, 0, &hour, &minute, &second);
26 
27  TPaveLabel* pl2 = new TPaveLabel;
28  pl2->SetX1NDC(0.10);
29  pl2->SetX2NDC(0.35);
30  pl2->SetY1NDC(0.95);
31  pl2->SetY2NDC(1.00);
32  pl2->SetFillColor(0);
33  pl2->SetShadowColor(0);
34  pl2->SetLineColor(0);
35  pl2->SetLabel(Form("Data up to %u-%02u-%02u-%02u:%02u:%02u",year,month,day,hour,minute,second));
36  pl2->SetTextSize(0);
37  pl2->Draw();
38 }
void lastUpdated(unsigned int timestamp)
static constexpr Double_t year
Definition: Munits.h:185