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

#include <NearlinePlotMaker.h>

Public Member Functions

 NearlineProcessingVersion ()
 
std::string GetNearlineVersionFromFileName (std::string fileName)
 
void AddFile (std::string fileName, int run)
 
TGraph * GetGraph ()
 
TCanvas * GetVersionCanvas (TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
 
void PrintVersionPlots (std::string plot_dir, int Ndays, TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
 
 NearlineProcessingVersion ()
 
std::string GetNearlineVersionFromFileName (std::string fileName)
 
void AddFile (std::string fileName, int run)
 
TGraph * GetGraph ()
 
TCanvas * GetVersionCanvas (TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
 
void PrintVersionPlots (std::string plot_dir, int Ndays, TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
 

Static Public Member Functions

static std::string GetPlotName (int Ndays)
 
static std::string MakeVersionPlotsHTML (std::string relative_plot_dir, int Ndays)
 
static std::string GetPlotName (int Ndays)
 
static std::string MakeVersionPlotsHTML (std::string relative_plot_dir, int Ndays)
 

Public Attributes

std::vector< std::stringfVersionStrings
 
std::vector< int > fVersionInts
 
std::vector< int > fRuns
 
TGraph * fGr
 

Detailed Description

Definition at line 937 of file NearlinePlotMaker.h.

Constructor & Destructor Documentation

NearlineProcessingVersion::NearlineProcessingVersion ( )
inline

Definition at line 944 of file NearlinePlotMaker.h.

944  {
945  fVersionStrings.resize(0);
946  fVersionInts.resize(0);
947  fRuns.resize(0);
948  fGr=0;
949  }
std::vector< int > fVersionInts
std::vector< std::string > fVersionStrings
NearlineProcessingVersion::NearlineProcessingVersion ( )
inline

Definition at line 944 of file NearlinePlotMakerDev.h.

944  {
945  fVersionStrings.resize(0);
946  fVersionInts.resize(0);
947  fRuns.resize(0);
948  fGr=0;
949  }
std::vector< int > fVersionInts
std::vector< std::string > fVersionStrings

Member Function Documentation

void NearlineProcessingVersion::AddFile ( std::string  fileName,
int  run 
)
inline

Definition at line 968 of file NearlinePlotMaker.h.

968  {
969  if(run<=0) return;
971  //see if this is a new version
972  int version_index=-1;
973  for(size_t i=0;i<fVersionStrings.size();i++){
974  if(version == fVersionStrings.at(i)) version_index = i;
975  }//versions
976  if(version_index == -1){
977  version_index = fVersionStrings.size();
978  fVersionStrings.push_back(version);
979  }
980 
981  fVersionInts.push_back(version_index);
982  fRuns.push_back(run);
983  std::cerr << "INFO : " << "run " << run << " version " << version << std::endl;
984  }
std::string string
Definition: nybbler.cc:12
std::string GetNearlineVersionFromFileName(std::string fileName)
version
Definition: setup.py:12
std::vector< int > fVersionInts
std::vector< std::string > fVersionStrings
QTextStream & endl(QTextStream &s)
unsigned int run
void NearlineProcessingVersion::AddFile ( std::string  fileName,
int  run 
)
inline

Definition at line 968 of file NearlinePlotMakerDev.h.

968  {
969  if(run<=0) return;
971  //see if this is a new version
972  int version_index=-1;
973  for(size_t i=0;i<fVersionStrings.size();i++){
974  if(version == fVersionStrings.at(i)) version_index = i;
975  }//versions
976  if(version_index == -1){
977  version_index = fVersionStrings.size();
978  fVersionStrings.push_back(version);
979  }
980 
981  fVersionInts.push_back(version_index);
982  fRuns.push_back(run);
983  std::cerr << "INFO : " << "run " << run << " version " << version << std::endl;
984  }
std::string string
Definition: nybbler.cc:12
std::string GetNearlineVersionFromFileName(std::string fileName)
unsigned int run
version
Definition: setup.py:12
std::vector< int > fVersionInts
std::vector< std::string > fVersionStrings
QTextStream & endl(QTextStream &s)
TGraph* NearlineProcessingVersion::GetGraph ( )
inline

Definition at line 986 of file NearlinePlotMakerDev.h.

986  {
987 
988  fGr = new TGraph(fRuns.size());
989  for(size_t i=0;i<fRuns.size();i++) fGr->SetPoint(i, fRuns.at(i), fVersionInts.at(i));
990 
991  return fGr;
992  }
std::vector< int > fVersionInts
TGraph* NearlineProcessingVersion::GetGraph ( )
inline

Definition at line 986 of file NearlinePlotMaker.h.

986  {
987 
988  fGr = new TGraph(fRuns.size());
989  for(size_t i=0;i<fRuns.size();i++) fGr->SetPoint(i, fRuns.at(i), fVersionInts.at(i));
990 
991  return fGr;
992  }
std::vector< int > fVersionInts
std::string NearlineProcessingVersion::GetNearlineVersionFromFileName ( std::string  fileName)
inline

Definition at line 951 of file NearlinePlotMaker.h.

951  {
952 
953  std::string file_location = "/lbne/data2/users/lbnedaq/nearline/";
954  size_t file_location_size = file_location.size();
955 
956  std::string output = fileName.substr(file_location_size);
957  output = output.substr(0, output.find("/"));
958 
959  if(output.size()==0){
960  output = "Unknown";
961  }
962  else if(output.find("v") != 0){
963  output = "Unknown";
964  }
965  return output;
966  }//GetNearlineVersionFromFileName
std::string string
Definition: nybbler.cc:12
std::string NearlineProcessingVersion::GetNearlineVersionFromFileName ( std::string  fileName)
inline

Definition at line 951 of file NearlinePlotMakerDev.h.

951  {
952 
953  std::string file_location = "/lbne/data2/users/lbnedaq/nearline/";
954  size_t file_location_size = file_location.size();
955 
956  std::string output = fileName.substr(file_location_size);
957  output = output.substr(0, output.find("/"));
958 
959  if(output.size()==0){
960  output = "Unknown";
961  }
962  else if(output.find("v") != 0){
963  output = "Unknown";
964  }
965  return output;
966  }//GetNearlineVersionFromFileName
std::string string
Definition: nybbler.cc:12
static std::string NearlineProcessingVersion::GetPlotName ( int  Ndays)
inlinestatic

Definition at line 1019 of file NearlinePlotMaker.h.

1019  {
1020  char name[256];
1021  sprintf(name, "ProcessingVersion_%.3i_days.png", Ndays);
1022  return std::string(name);
1023  }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
static std::string NearlineProcessingVersion::GetPlotName ( int  Ndays)
inlinestatic

Definition at line 1019 of file NearlinePlotMakerDev.h.

1019  {
1020  char name[256];
1021  sprintf(name, "ProcessingVersion_%.3i_days.png", Ndays);
1022  return std::string(name);
1023  }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
TCanvas* NearlineProcessingVersion::GetVersionCanvas ( TPaveText *  updateText,
int  time_ago,
int  XNow,
int  width = 1200,
int  height = 800 
)
inline

Definition at line 994 of file NearlinePlotMakerDev.h.

994  {
995  TCanvas* can = new TCanvas("can_processing_version", "can_processing_version", width, height);
996  can->SetRightMargin(0.20);
997  TGraph* gr = GetGraph();
998  // can->cd()->SetLogy();
999  gr->Draw("A*");
1000  gr->SetTitle("Nearline Processing Version");
1001  gr->GetXaxis()->SetTitle("Run Number");
1002 
1003  //Set the bin labels and range correctly
1004  gr->GetYaxis()->Set(fVersionStrings.size(),-0.5,fVersionStrings.size()-0.5);
1005  gr->GetYaxis()->SetRangeUser(-0.5, fVersionStrings.size()-0.5);
1006  for(size_t i=0;i<fVersionStrings.size();i++){
1007  gr->GetYaxis()->SetBinLabel(i+1, fVersionStrings.at(i).c_str());
1008  }
1009 
1010  gr->Draw("A*");
1011 
1012  gPad->SetGridx();
1013  gPad->SetGridy();
1014 
1015  updateText->Draw();
1016  return can;
1017  }
std::vector< std::string > fVersionStrings
TCanvas* NearlineProcessingVersion::GetVersionCanvas ( TPaveText *  updateText,
int  time_ago,
int  XNow,
int  width = 1200,
int  height = 800 
)
inline

Definition at line 994 of file NearlinePlotMaker.h.

994  {
995  TCanvas* can = new TCanvas("can_processing_version", "can_processing_version", width, height);
996  can->SetRightMargin(0.20);
997  TGraph* gr = GetGraph();
998  // can->cd()->SetLogy();
999  gr->Draw("A*");
1000  gr->SetTitle("Nearline Processing Version");
1001  gr->GetXaxis()->SetTitle("Run Number");
1002 
1003  //Set the bin labels and range correctly
1004  gr->GetYaxis()->Set(fVersionStrings.size(),-0.5,fVersionStrings.size()-0.5);
1005  gr->GetYaxis()->SetRangeUser(-0.5, fVersionStrings.size()-0.5);
1006  for(size_t i=0;i<fVersionStrings.size();i++){
1007  gr->GetYaxis()->SetBinLabel(i+1, fVersionStrings.at(i).c_str());
1008  }
1009 
1010  gr->Draw("A*");
1011 
1012  gPad->SetGridx();
1013  gPad->SetGridy();
1014 
1015  updateText->Draw();
1016  return can;
1017  }
std::vector< std::string > fVersionStrings
static std::string NearlineProcessingVersion::MakeVersionPlotsHTML ( std::string  relative_plot_dir,
int  Ndays 
)
inlinestatic

Definition at line 1038 of file NearlinePlotMakerDev.h.

1038  {
1039 
1040  std::string output;
1041  output+="<h3>Nearline Processing Version as a function of Run.</h3>\n";
1042  output+="<figure>\n";
1043  output+="<img src=\"" + relative_plot_dir + "/" + GetPlotName(Ndays) + "\" width=\"800\">\n";
1044  output+="</figure>\n";
1045  output+="<BR><BR><BR>\n";
1046 
1047  return output;
1048  }
std::string string
Definition: nybbler.cc:12
static std::string GetPlotName(int Ndays)
static std::string NearlineProcessingVersion::MakeVersionPlotsHTML ( std::string  relative_plot_dir,
int  Ndays 
)
inlinestatic

Definition at line 1038 of file NearlinePlotMaker.h.

1038  {
1039 
1040  std::string output;
1041  output+="<h3>Nearline Processing Version as a function of Run.</h3>\n";
1042  output+="<figure>\n";
1043  output+="<img src=\"" + relative_plot_dir + "/" + GetPlotName(Ndays) + "\" width=\"800\">\n";
1044  output+="</figure>\n";
1045  output+="<BR><BR><BR>\n";
1046 
1047  return output;
1048  }
std::string string
Definition: nybbler.cc:12
static std::string GetPlotName(int Ndays)
void NearlineProcessingVersion::PrintVersionPlots ( std::string  plot_dir,
int  Ndays,
TPaveText *  updateText,
int  time_ago,
int  XNow,
int  width = 1200,
int  height = 800 
)
inline

Definition at line 1026 of file NearlinePlotMakerDev.h.

1026  {
1027  TCanvas *can = GetVersionCanvas(updateText, time_ago, XNow, width, height);
1028  can->Print((plot_dir + "/" + GetPlotName(Ndays)).c_str());
1029  delete can;
1030 
1031  for(size_t i=0;i<fVersionStrings.size();i++){
1032  std::cerr << "INFO : Versions Used: " << fVersionStrings.at(i) << std::endl;
1033  }
1034 
1035  }
TCanvas * GetVersionCanvas(TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
static std::string GetPlotName(int Ndays)
std::vector< std::string > fVersionStrings
QTextStream & endl(QTextStream &s)
void NearlineProcessingVersion::PrintVersionPlots ( std::string  plot_dir,
int  Ndays,
TPaveText *  updateText,
int  time_ago,
int  XNow,
int  width = 1200,
int  height = 800 
)
inline

Definition at line 1026 of file NearlinePlotMaker.h.

1026  {
1027  TCanvas *can = GetVersionCanvas(updateText, time_ago, XNow, width, height);
1028  can->Print((plot_dir + "/" + GetPlotName(Ndays)).c_str());
1029  delete can;
1030 
1031  for(size_t i=0;i<fVersionStrings.size();i++){
1032  std::cerr << "INFO : Versions Used: " << fVersionStrings.at(i) << std::endl;
1033  }
1034 
1035  }
TCanvas * GetVersionCanvas(TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
static std::string GetPlotName(int Ndays)
std::vector< std::string > fVersionStrings
QTextStream & endl(QTextStream &s)

Member Data Documentation

TGraph * NearlineProcessingVersion::fGr

Definition at line 942 of file NearlinePlotMaker.h.

std::vector< int > NearlineProcessingVersion::fRuns

Definition at line 941 of file NearlinePlotMaker.h.

std::vector< int > NearlineProcessingVersion::fVersionInts

Definition at line 940 of file NearlinePlotMaker.h.

std::vector< std::string > NearlineProcessingVersion::fVersionStrings

Definition at line 939 of file NearlinePlotMaker.h.


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