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

#include <NearlinePlotMaker.h>

Public Member Functions

 NearlineProcessingPedestal ()
 
void AddFile (std::string fileName, int run)
 
TGraph * GetGraph ()
 
TCanvas * GetPedestalCanvas (TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
 
void PrintPedestalPlots (std::string plot_dir, int Ndays, TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
 
 NearlineProcessingPedestal ()
 
void AddFile (std::string fileName, int run)
 
TGraph * GetGraph ()
 
TCanvas * GetPedestalCanvas (TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
 
void PrintPedestalPlots (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 GetPedestalFileName (std::string done_file_name)
 
static std::string GetPlotName (int Ndays)
 
static std::string MakePedestalPlotsHTML (std::string relative_plot_dir, int Ndays)
 
static std::string GetPedestalFileName (std::string done_file_name)
 
static std::string GetPlotName (int Ndays)
 
static std::string MakePedestalPlotsHTML (std::string relative_plot_dir, int Ndays)
 

Public Attributes

std::vector< std::stringfPedestalStrings
 
std::vector< int > fPedestalInts
 
std::vector< int > fRuns
 
TGraph * fGr
 

Detailed Description

Definition at line 1052 of file NearlinePlotMaker.h.

Constructor & Destructor Documentation

NearlineProcessingPedestal::NearlineProcessingPedestal ( )
inline

Definition at line 1071 of file NearlinePlotMaker.h.

1071  {
1072  fPedestalStrings.resize(0);
1073  fPedestalInts.resize(0);
1074  fRuns.resize(0);
1075  fGr=0;
1076  }
std::vector< std::string > fPedestalStrings
std::vector< int > fPedestalInts
NearlineProcessingPedestal::NearlineProcessingPedestal ( )
inline

Definition at line 1071 of file NearlinePlotMakerDev.h.

1071  {
1072  fPedestalStrings.resize(0);
1073  fPedestalInts.resize(0);
1074  fRuns.resize(0);
1075  fGr=0;
1076  }
std::vector< std::string > fPedestalStrings
std::vector< int > fPedestalInts

Member Function Documentation

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

Definition at line 1077 of file NearlinePlotMaker.h.

1077  {
1078  if(run<=0) return;
1080  //see if this is a new version
1081  int version_index=-1;
1082  for(size_t i=0;i<fPedestalStrings.size();i++){
1083  if(version == fPedestalStrings.at(i)) version_index = i;
1084  }//versions
1085  if(version_index == -1){
1086  version_index = fPedestalStrings.size();
1087  fPedestalStrings.push_back(version);
1088  }
1089 
1090  fPedestalInts.push_back(version_index);
1091  fRuns.push_back(run);
1092  std::cerr << "INFO : " << "run " << run << " version " << version << std::endl;
1093  }
std::vector< std::string > fPedestalStrings
std::vector< int > fPedestalInts
std::string string
Definition: nybbler.cc:12
static std::string GetPedestalFileName(std::string done_file_name)
version
Definition: setup.py:12
QTextStream & endl(QTextStream &s)
unsigned int run
void NearlineProcessingPedestal::AddFile ( std::string  fileName,
int  run 
)
inline

Definition at line 1077 of file NearlinePlotMakerDev.h.

1077  {
1078  if(run<=0) return;
1080  //see if this is a new version
1081  int version_index=-1;
1082  for(size_t i=0;i<fPedestalStrings.size();i++){
1083  if(version == fPedestalStrings.at(i)) version_index = i;
1084  }//versions
1085  if(version_index == -1){
1086  version_index = fPedestalStrings.size();
1087  fPedestalStrings.push_back(version);
1088  }
1089 
1090  fPedestalInts.push_back(version_index);
1091  fRuns.push_back(run);
1092  std::cerr << "INFO : " << "run " << run << " version " << version << std::endl;
1093  }
std::vector< std::string > fPedestalStrings
std::vector< int > fPedestalInts
std::string string
Definition: nybbler.cc:12
unsigned int run
static std::string GetPedestalFileName(std::string done_file_name)
version
Definition: setup.py:12
QTextStream & endl(QTextStream &s)
TGraph* NearlineProcessingPedestal::GetGraph ( )
inline

Definition at line 1095 of file NearlinePlotMakerDev.h.

1095  {
1096 
1097  fGr = new TGraph(fRuns.size());
1098  for(size_t i=0;i<fRuns.size();i++) fGr->SetPoint(i, fRuns.at(i), fPedestalInts.at(i));
1099 
1100  return fGr;
1101  }
std::vector< int > fPedestalInts
TGraph* NearlineProcessingPedestal::GetGraph ( )
inline

Definition at line 1095 of file NearlinePlotMaker.h.

1095  {
1096 
1097  fGr = new TGraph(fRuns.size());
1098  for(size_t i=0;i<fRuns.size();i++) fGr->SetPoint(i, fRuns.at(i), fPedestalInts.at(i));
1099 
1100  return fGr;
1101  }
std::vector< int > fPedestalInts
TCanvas* NearlineProcessingPedestal::GetPedestalCanvas ( TPaveText *  updateText,
int  time_ago,
int  XNow,
int  width = 1200,
int  height = 800 
)
inline

Definition at line 1103 of file NearlinePlotMaker.h.

1103  {
1104  TCanvas* can = new TCanvas("can_processing_version", "can_processing_version", width, height);
1105  can->SetRightMargin(0.20);
1106  TGraph* gr = GetGraph();
1107  // can->cd()->SetLogy();
1108  gr->Draw("A*");
1109  gr->SetTitle("Nearline Processing Pedestal");
1110  gr->GetXaxis()->SetTitle("Run Number");
1111 
1112  //Set the bin labels and range correctly
1113  gr->GetYaxis()->Set(fPedestalStrings.size(),-0.5,fPedestalStrings.size()-0.5);
1114  gr->GetYaxis()->SetRangeUser(-0.5, fPedestalStrings.size()-0.5);
1115  for(size_t i=0;i<fPedestalStrings.size();i++){
1116  gr->GetYaxis()->SetBinLabel(i+1, fPedestalStrings.at(i).c_str());
1117  }
1118 
1119  gr->Draw("A*");
1120 
1121  gPad->SetGridx();
1122  gPad->SetGridy();
1123 
1124  updateText->Draw();
1125  return can;
1126  }
std::vector< std::string > fPedestalStrings
TCanvas* NearlineProcessingPedestal::GetPedestalCanvas ( TPaveText *  updateText,
int  time_ago,
int  XNow,
int  width = 1200,
int  height = 800 
)
inline

Definition at line 1103 of file NearlinePlotMakerDev.h.

1103  {
1104  TCanvas* can = new TCanvas("can_processing_version", "can_processing_version", width, height);
1105  can->SetRightMargin(0.20);
1106  TGraph* gr = GetGraph();
1107  // can->cd()->SetLogy();
1108  gr->Draw("A*");
1109  gr->SetTitle("Nearline Processing Pedestal");
1110  gr->GetXaxis()->SetTitle("Run Number");
1111 
1112  //Set the bin labels and range correctly
1113  gr->GetYaxis()->Set(fPedestalStrings.size(),-0.5,fPedestalStrings.size()-0.5);
1114  gr->GetYaxis()->SetRangeUser(-0.5, fPedestalStrings.size()-0.5);
1115  for(size_t i=0;i<fPedestalStrings.size();i++){
1116  gr->GetYaxis()->SetBinLabel(i+1, fPedestalStrings.at(i).c_str());
1117  }
1118 
1119  gr->Draw("A*");
1120 
1121  gPad->SetGridx();
1122  gPad->SetGridy();
1123 
1124  updateText->Draw();
1125  return can;
1126  }
std::vector< std::string > fPedestalStrings
static std::string NearlineProcessingPedestal::GetPedestalFileName ( std::string  done_file_name)
inlinestatic

Definition at line 1054 of file NearlinePlotMakerDev.h.

1054  {
1055  std::ifstream in_file(done_file_name.c_str());
1056  std::string line;
1057  std::string pedestal_file="Unknown";
1058  while(std::getline(in_file, line)){
1059  // std::cerr << "INFO : " << line << std::endl;
1060  if(line.find("NEARLINE_PEDESTAL ") != std::string::npos) pedestal_file = line.substr(std::string("NEARLINE_PEDESTAL ").size());
1061 
1062  }
1063  return pedestal_file;
1064  }
def line(rflist, normalization=13700 *units.eplus)
Definition: __init__.py:701
std::string string
Definition: nybbler.cc:12
static std::string NearlineProcessingPedestal::GetPedestalFileName ( std::string  done_file_name)
inlinestatic

Definition at line 1054 of file NearlinePlotMaker.h.

1054  {
1055  std::ifstream in_file(done_file_name.c_str());
1056  std::string line;
1057  std::string pedestal_file="Unknown";
1058  while(std::getline(in_file, line)){
1059  // std::cerr << "INFO : " << line << std::endl;
1060  if(line.find("NEARLINE_PEDESTAL ") != std::string::npos) pedestal_file = line.substr(std::string("NEARLINE_PEDESTAL ").size());
1061 
1062  }
1063  return pedestal_file;
1064  }
def line(rflist, normalization=13700 *units.eplus)
Definition: __init__.py:701
std::string string
Definition: nybbler.cc:12
static std::string NearlineProcessingPedestal::GetPlotName ( int  Ndays)
inlinestatic

Definition at line 1128 of file NearlinePlotMaker.h.

1128  {
1129  char name[256];
1130  sprintf(name, "ProcessingPedestal_%.3i_days.png", Ndays);
1131  return std::string(name);
1132  }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
static std::string NearlineProcessingPedestal::GetPlotName ( int  Ndays)
inlinestatic

Definition at line 1128 of file NearlinePlotMakerDev.h.

1128  {
1129  char name[256];
1130  sprintf(name, "ProcessingPedestal_%.3i_days.png", Ndays);
1131  return std::string(name);
1132  }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
static std::string NearlineProcessingPedestal::MakePedestalPlotsHTML ( std::string  relative_plot_dir,
int  Ndays 
)
inlinestatic

Definition at line 1146 of file NearlinePlotMaker.h.

1146  {
1147 
1148  std::string output;
1149  output+="<h3>Nearline Processing Pedestal as a function of Run.</h3>\n";
1150  output+="<figure>\n";
1151  output+="<img src=\"" + relative_plot_dir + "/" + GetPlotName(Ndays) + "\" width=\"800\">\n";
1152  output+="</figure>\n";
1153  output+="<BR><BR><BR>\n";
1154 
1155  return output;
1156  }
std::string string
Definition: nybbler.cc:12
static std::string GetPlotName(int Ndays)
static std::string NearlineProcessingPedestal::MakePedestalPlotsHTML ( std::string  relative_plot_dir,
int  Ndays 
)
inlinestatic

Definition at line 1146 of file NearlinePlotMakerDev.h.

1146  {
1147 
1148  std::string output;
1149  output+="<h3>Nearline Processing Pedestal as a function of Run.</h3>\n";
1150  output+="<figure>\n";
1151  output+="<img src=\"" + relative_plot_dir + "/" + GetPlotName(Ndays) + "\" width=\"800\">\n";
1152  output+="</figure>\n";
1153  output+="<BR><BR><BR>\n";
1154 
1155  return output;
1156  }
std::string string
Definition: nybbler.cc:12
static std::string GetPlotName(int Ndays)
void NearlineProcessingPedestal::PrintPedestalPlots ( std::string  plot_dir,
int  Ndays,
TPaveText *  updateText,
int  time_ago,
int  XNow,
int  width = 1200,
int  height = 800 
)
inline

Definition at line 1135 of file NearlinePlotMaker.h.

1135  {
1136  TCanvas *can = GetPedestalCanvas(updateText, time_ago, XNow, width, height);
1137  can->Print((plot_dir + "/" + GetPlotName(Ndays)).c_str());
1138  delete can;
1139 
1140  for(size_t i=0;i<fPedestalStrings.size();i++){
1141  std::cerr << "INFO : Pedestals Used: " << fPedestalStrings.at(i) << std::endl;
1142  }
1143 
1144  }
std::vector< std::string > fPedestalStrings
static std::string GetPlotName(int Ndays)
TCanvas * GetPedestalCanvas(TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
QTextStream & endl(QTextStream &s)
void NearlineProcessingPedestal::PrintPedestalPlots ( std::string  plot_dir,
int  Ndays,
TPaveText *  updateText,
int  time_ago,
int  XNow,
int  width = 1200,
int  height = 800 
)
inline

Definition at line 1135 of file NearlinePlotMakerDev.h.

1135  {
1136  TCanvas *can = GetPedestalCanvas(updateText, time_ago, XNow, width, height);
1137  can->Print((plot_dir + "/" + GetPlotName(Ndays)).c_str());
1138  delete can;
1139 
1140  for(size_t i=0;i<fPedestalStrings.size();i++){
1141  std::cerr << "INFO : Pedestals Used: " << fPedestalStrings.at(i) << std::endl;
1142  }
1143 
1144  }
std::vector< std::string > fPedestalStrings
static std::string GetPlotName(int Ndays)
TCanvas * GetPedestalCanvas(TPaveText *updateText, int time_ago, int XNow, int width=1200, int height=800)
QTextStream & endl(QTextStream &s)

Member Data Documentation

TGraph * NearlineProcessingPedestal::fGr

Definition at line 1069 of file NearlinePlotMaker.h.

std::vector< int > NearlineProcessingPedestal::fPedestalInts

Definition at line 1067 of file NearlinePlotMaker.h.

std::vector< std::string > NearlineProcessingPedestal::fPedestalStrings

Definition at line 1066 of file NearlinePlotMaker.h.

std::vector< int > NearlineProcessingPedestal::fRuns

Definition at line 1068 of file NearlinePlotMaker.h.


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