Public Member Functions | List of all members
evd::HeaderDrawer Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-28/EventDisplay/HeaderDrawer.h"

Public Member Functions

 HeaderDrawer ()
 
 ~HeaderDrawer ()
 
void Header (evdb::View2D *view)
 
void Header (evdb::View3D *view)
 
void Text (std::string &title, std::string &run, std::string &event, std::string &date, std::string &time)
 

Detailed Description

Definition at line 17 of file HeaderDrawer.h.

Constructor & Destructor Documentation

evd::HeaderDrawer::HeaderDrawer ( )

Definition at line 22 of file HeaderDrawer.cxx.

22 { }
evd::HeaderDrawer::~HeaderDrawer ( )

Definition at line 26 of file HeaderDrawer.cxx.

26 { }

Member Function Documentation

void evd::HeaderDrawer::Header ( evdb::View2D view)

Definition at line 127 of file HeaderDrawer.cxx.

References evdb::View2D::AddText(), plot_validation_datamc::c, colors, evdb::Colors::Foreground(), updateRunHistoryTables::run, string, Text(), and plotROC::title.

Referenced by evd::HeaderPad::Draw().

128  {
131  std::string event;
134 
135  this->Text(title,run,event,date,time);
136 
138  int c = colors->Foreground(0);
139 
140  TText& titlet = view->AddText(0.03,0.80, title.c_str());
141  TText& runt = view->AddText(0.04,0.60, run.c_str());
142  TText& eventt = view->AddText(0.04,0.45, event.c_str());
143  TText& datet = view->AddText(0.04,0.25, date.c_str());
144  TText& timet = view->AddText(0.04,0.10, time.c_str());
145 
146  titlet.SetTextSize(0.13);
147  titlet.SetTextFont(62);
148  titlet.SetTextColor(c);
149 
150  runt.SetTextSize(0.12);
151  runt.SetTextFont(42);
152  runt.SetTextColor(c);
153 
154  eventt.SetTextSize(0.12);
155  eventt.SetTextFont(42);
156  eventt.SetTextColor(c);
157 
158  datet.SetTextSize(0.12);
159  datet.SetTextFont(42);
160  datet.SetTextColor(c);
161 
162  timet.SetTextSize(0.12);
163  timet.SetTextFont(42);
164  timet.SetTextColor(c);
165  }
::xsd::cxx::tree::date< char, simple_type > date
Definition: Database.h:186
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
int colors[6]
Definition: tools.h:1
TText & AddText(double x, double y, const char *text)
Definition: View2D.cxx:286
int Foreground(int i=0)
void Text(std::string &title, std::string &run, std::string &event, std::string &date, std::string &time)
enum BeamMode string
void evd::HeaderDrawer::Header ( evdb::View3D view)

Definition at line 169 of file HeaderDrawer.cxx.

References evdb::View3D::AddText(), plot_validation_datamc::c, colors, evdb::Colors::Foreground(), updateRunHistoryTables::run, string, Text(), and plotROC::title.

170  {
173  std::string event;
176 
177  this->Text(title,run,event,date,time);
178 
180  int c = colors->Foreground(0);
181 
182  TText& titlet = view->AddText(-0.98,-0.75, title.c_str());
183  TText& runt = view->AddText(-0.98,-0.80, run.c_str());
184  TText& eventt = view->AddText(-0.98,-0.85, event.c_str());
185  TText& datet = view->AddText(-0.98,-0.90, date.c_str());
186  TText& timet = view->AddText(-0.98,-0.95, time.c_str());
187 
188  titlet.SetTextSize(0.030);
189  titlet.SetTextFont(62);
190  titlet.SetTextColor(c);
191 
192  runt.SetTextSize(0.024);
193  runt.SetTextFont(42);
194  runt.SetTextColor(c);
195 
196  eventt.SetTextSize(0.024);
197  eventt.SetTextFont(42);
198  eventt.SetTextColor(c);
199 
200  datet.SetTextSize(0.024);
201  datet.SetTextFont(42);
202  datet.SetTextColor(c);
203 
204  timet.SetTextSize(0.024);
205  timet.SetTextFont(42);
206  timet.SetTextColor(c);
207  }
::xsd::cxx::tree::date< char, simple_type > date
Definition: Database.h:186
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
TText & AddText(double x, double y, const char *text)
Definition: View3D.cxx:135
int colors[6]
Definition: tools.h:1
int Foreground(int i=0)
void Text(std::string &title, std::string &run, std::string &event, std::string &date, std::string &time)
enum BeamMode string
void evd::HeaderDrawer::Text ( std::string title,
std::string run,
std::string event,
std::string date,
std::string time 
)

Definition at line 30 of file HeaderDrawer.cxx.

References febshutoff_auto::day, art::EventID::event(), evt, rawdata::RawTrigger::fTriggerMask_TriggerType, cet::getenv(), evdb::EventHolder::GetEvent(), art::DataViewImpl::getManyByType(), febshutoff_auto::hour, art::Event::id(), evdb::EventHolder::Instance(), MAX_TRIGGER_BITS, febshutoff_auto::minute, art::Event::run(), moon_position_table_new3::second, art::Event::subRun(), art::Event::time(), daqdataformats::trigIDShortStrings, art::Timestamp::value(), and Munits::year.

Referenced by Header().

35  {
36  titles = "NOvA - FNAL E929";
37 
38  //
39  // get the event
40  //
42  if (!evt) return;
43  if (getenv("BLIND_NOVA_EVD")!=NULL) return;
44 
45  int run = evt->run();
46  int srun = evt->subRun();
47 
48  //
49  // Line of text for run and event number
50  //
51  char runbuff[256];
52  sprintf(runbuff, "Run: %d / %d",run,srun);
53  runs = runbuff;
54 
55  //
56  // Unpack trigger information and make line for event number
57  //
58  char eventbuff[256];
59  int event = evt->id().event();
60  std::vector<art::Handle<std::vector<rawdata::RawTrigger> > > trigv;
61  evt->getManyByType(trigv);
62  const char* trgname="--";
63  if (!trigv.empty()) {
64  const rawdata::RawTrigger& trig = (*trigv[0])[0];
65  const int trgsrc = trig.fTriggerMask_TriggerType;
66  if (trgsrc>0 && trgsrc<MAX_TRIGGER_BITS) {
67  trgname = daqdataformats::trigIDShortStrings[trgsrc];
68  }
69  }
70  sprintf(eventbuff,"Event: %d / %s",event,trgname);
71  events = eventbuff;
72 
73  //
74  // Unpack time and date information
75  //
76  unsigned int year, month, day, dayofweek;
77  unsigned int hour, minute, second;
78  int nano;
79  //
80  // get the time stamp. art::Timestamp::value() returns a
81  // TimeValue_t which is a typedef to unsigned long long. The
82  // upper 32 bits is the seconds since 1970 epoch and the lower
83  // 32 bits is the number of nanoseconds with the current second.
84  // (This comment previously said *microseconds*, but as you can
85  // see below, it's clearly nano.)
86  //
87  unsigned long long int tsval = evt->time().value();
88  //
89  // taking it apart the masking isn't strictly necessary *if*
90  // "long" is truly 32bits but this can vary w/ compiler/platform
91  //
92  const unsigned long int mask32 = 0xFFFFFFFFUL;
93  unsigned long int lup = ( tsval >> 32 ) & mask32;
94  unsigned long int llo = tsval & mask32;
95  TTimeStamp ts(lup, (int)llo);
96 
97  ts.GetDate(kTRUE,0,&year,&month,&day);
98  ts.GetTime(kTRUE,0,&hour,&minute,&second);
99  nano = ts.GetNanoSec();
100  dayofweek = ts.GetDayOfWeek();
101 
102  // Skip first one since ROOT returns these numbers starting from 1 not 0
103  static const char* days[] = {"",
104  "Mon","Tue","Wed","Thu","Fri","Sat","Sun"
105  };
106  static const char* months[] = {"",
107  "Jan","Feb","Mar","Apr","May","Jun",
108  "Jul","Aug","Sep","Oct","Nov","Dec"
109  };
110  char datebuff[256];
111  char timebuff[256];
112  sprintf(datebuff, "UTC %s %s %u, %u",
113  days[dayofweek],
114  months[month],
115  day,
116  year);
117  sprintf(timebuff, "%.2u:%.2u:%2.9f",
118  hour,
119  minute,
120  (float)second+(float)nano/1.0E9);
121  dates = datebuff;
122  times = timebuff;
123  }
SubRunNumber_t subRun() const
Definition: Event.h:72
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
#define MAX_TRIGGER_BITS
constexpr TimeValue_t value() const
Definition: Timestamp.h:24
uint8_t fTriggerMask_TriggerType
Definition: RawTrigger.h:43
static EventHolder * Instance()
Definition: EventHolder.cxx:15
std::string getenv(std::string const &name)
const char * trigIDShortStrings[]
int evt
void getManyByType(std::vector< Handle< PROD >> &results) const
Definition: DataViewImpl.h:446
Definition: run.py:1
EventNumber_t event() const
Definition: EventID.h:116
Timestamp time() const
Definition: Event.h:61
RunNumber_t run() const
Definition: Event.h:77
void events(int which)
Definition: Cana.C:52
EventID id() const
Definition: Event.h:56
list runs
Definition: shutoffs.py:47
static constexpr Double_t year
Definition: Munits.h:185

The documentation for this class was generated from the following files: