Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
NearlineProcessingTime Struct Reference

#include <NearlinePlotMaker.h>

Public Member Functions

 NearlineProcessingTime (std::string file_name, int Ndays)
 
 NearlineProcessingTime (std::string file_name, int Ndays)
 

Static Public Member Functions

static TDatime GetDateTime (std::string date, int Ndays)
 
static std::string GetDoneFileName (std::string file_name)
 
static std::string GetEVDDoneFileName (std::string file_name)
 
static TDatime GetDateTime (std::string date, int Ndays)
 
static std::string GetDoneFileName (std::string file_name)
 
static std::string GetEVDDoneFileName (std::string file_name)
 

Public Attributes

TDatime fStartDate
 
TDatime fEndNearlineAnaDate
 
TDatime fEndNearlineMuonDate
 
TDatime fEndDate
 

Static Public Attributes

static TDatime const InvalidDateTime = TDatime(1995,00,00,00,00,00)
 

Detailed Description

Definition at line 1159 of file NearlinePlotMaker.h.

Constructor & Destructor Documentation

NearlineProcessingTime::NearlineProcessingTime ( std::string  file_name,
int  Ndays 
)

Definition at line 1175 of file NearlinePlotMaker.h.

1175  {
1176 
1181 
1182  std::ifstream in_file(file_name.c_str());
1183  std::string line;
1184 
1185  std::string start = "";
1186  std::string end_nearline_ana = "";
1187  std::string end_nearline_muon = "";
1188  std::string end = "";
1189 
1190  while(std::getline(in_file, line)){
1191  if(line.find("START_DATE ") != std::string::npos) start = line.substr(std::string("START_DATE ").size());
1192  if(line.find("END_NEARLINE_ANA ") != std::string::npos) end_nearline_ana = line.substr(std::string("END_NEARLINE_ANA ").size());
1193  if(line.find("END_NEARLINE_MUON ") != std::string::npos) end_nearline_muon = line.substr(std::string("END_NEARLINE_MUON ").size());
1194  if(line.find("END_DATE ") != std::string::npos) end = line.substr(std::string("END_DATE ").size());
1195  }
1196 
1197  in_file.close();
1198 
1199  if(start != "") fStartDate = GetDateTime(start, Ndays);
1200  if(end_nearline_ana != "") fEndNearlineAnaDate = GetDateTime(end_nearline_ana, Ndays);
1201  if(end_nearline_muon != "") fEndNearlineMuonDate = GetDateTime(end_nearline_muon, Ndays);
1202  if(end != "") fEndDate = GetDateTime(end, Ndays);
1203 
1204 }
def line(rflist, normalization=13700 *units.eplus)
Definition: __init__.py:701
std::string string
Definition: nybbler.cc:12
static TDatime GetDateTime(std::string date, int Ndays)
QCString file_name
static TDatime const InvalidDateTime
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
NearlineProcessingTime::NearlineProcessingTime ( std::string  file_name,
int  Ndays 
)

Member Function Documentation

TDatime NearlineProcessingTime::GetDateTime ( std::string  date,
int  Ndays 
)
static

Definition at line 1207 of file NearlinePlotMaker.h.

1207  {
1208  std::string temp_file_name = "/tmp/NearlineDate_" + std::to_string(Ndays) + ".txt";
1209  std::string command = "date -d \"" + date + "\" +\"%Y-%m-%d %T\" > " + temp_file_name;
1210  int retval = system(command.c_str());
1211  std::ifstream temp_file(temp_file_name.c_str());
1212  std::string new_date;
1213  std::getline(temp_file, new_date);
1214  temp_file.close();
1215  TDatime date_time(new_date.c_str());
1216  return date_time;
1217 }
std::string string
Definition: nybbler.cc:12
int command
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
static TDatime NearlineProcessingTime::GetDateTime ( std::string  date,
int  Ndays 
)
static
static std::string NearlineProcessingTime::GetDoneFileName ( std::string  file_name)
static
std::string NearlineProcessingTime::GetDoneFileName ( std::string  file_name)
static

lbne/data2/users/lbnedaq/nearline/v04_36_01/011/011425/lbne_r011425_sr01_20160217T083237_nearline_hists.root lbne/data2/users/lbnedaq/nearline/v04_36_01/011/011425/lbne_r011425_sr01_20160217T083237.root.DONE

Definition at line 1219 of file NearlinePlotMaker.h.

1219  {
1220 
1221  ///lbne/data2/users/lbnedaq/nearline/v04_36_01/011/011425/lbne_r011425_sr01_20160217T083237_nearline_hists.root
1222  ///lbne/data2/users/lbnedaq/nearline/v04_36_01/011/011425/lbne_r011425_sr01_20160217T083237.root.DONE
1223 
1224  std::string file_name_done = file_name.substr(0, file_name.find("_nearline")) + ".root.DONE";
1225  return file_name_done;
1226 
1227 }
std::string string
Definition: nybbler.cc:12
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
QCString file_name
std::string NearlineProcessingTime::GetEVDDoneFileName ( std::string  file_name)
static

lbne/data2/users/lbnedaq/nearline/v04_36_01/011/011425/lbne_r011425_sr01_20160217T083237_nearline_hists.root lbne/data2/users/lbnedaq/nearline_evd/v04_36_01/011/011425_01/lbne_r011425_sr01_20160217T083237.rootEVD.DONE

Definition at line 1229 of file NearlinePlotMaker.h.

1229  {
1230 
1231 
1232  ///lbne/data2/users/lbnedaq/nearline/v04_36_01/011/011425/lbne_r011425_sr01_20160217T083237_nearline_hists.root
1233  ///lbne/data2/users/lbnedaq/nearline_evd/v04_36_01/011/011425_01/lbne_r011425_sr01_20160217T083237.rootEVD.DONE
1234 
1235  std::string prefix_dir = file_name.substr(0, file_name.find("/nearline/")); // = "/lbne/data2/users/lbnedaq"
1236  std::string suffix_dir = file_name.substr(file_name.find("/v"), std::string("/v04_36_01/011/011425").size());
1237  std::string short_file_name = file_name.substr(file_name.find(suffix_dir)+suffix_dir.size()+1);
1238  std::string file_name_done = prefix_dir + "/nearline_evd" + suffix_dir + "_01/" + short_file_name;
1239  file_name_done = file_name_done.substr(0, file_name_done.find("_nearline")) + ".rootEVD.DONE";
1240 
1241  return file_name_done;
1242 }
std::string string
Definition: nybbler.cc:12
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
QCString file_name
static std::string NearlineProcessingTime::GetEVDDoneFileName ( std::string  file_name)
static

Member Data Documentation

TDatime NearlineProcessingTime::fEndDate

Definition at line 1164 of file NearlinePlotMaker.h.

TDatime NearlineProcessingTime::fEndNearlineAnaDate

Definition at line 1162 of file NearlinePlotMaker.h.

TDatime NearlineProcessingTime::fEndNearlineMuonDate

Definition at line 1163 of file NearlinePlotMaker.h.

TDatime NearlineProcessingTime::fStartDate

Definition at line 1161 of file NearlinePlotMaker.h.

const TDatime NearlineProcessingTime::InvalidDateTime = TDatime(1995,00,00,00,00,00)
static

Definition at line 1170 of file NearlinePlotMaker.h.


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