DataDir Class Reference
[Odbcheck]

Keeps track of the directories related to processing files for ODBCheck. More...

#include <DataDir.hh>

List of all members.

Public Member Functions

 DataDir ()
Setters

Set the directory locations. Either pass the path for the directory or the user will be prompted.



void SetRawDir (const std::string &raw_dir)
void SetRawDir ()
void SetODBDir (const std::string &odb_dir)
void SetODBDir ()
void SetHistDir (const std::string &hist_dir)
void SetHistDir ()
void SetCorrDir (const std::string &corr_dir)
void SetCorrDir ()
Getters

Get path to files corresponding to run number.

Parameters:
[in] run Run number


std::string GetRawFileName (int run) const
std::string GetODBFileName (int run) const
std::string GetHistFileName (int run) const
std::string GetCorrFileName (int run) const

Static Private Member Functions

static std::string GetCanonicalRun (int run)

Private Attributes

Extensions

The extensions associated with each of the file types.



std::string fRawExt
std::string fODBExt
std::string fHistExt
std::string fCorrExt
Directories

The directories where the files are located.



std::string fRawDir
std::string fODBDir
std::string fHistDir
std::string fCorrDir
Prepensions

Each file type has certain naming conventions. These are the first few characters of a file name.



std::string fRawPre
std::string fODBPre
std::string fHistPre
std::string fCorrPre

Detailed Description

Keeps track of the directories related to processing files for ODBCheck.

The raw data, ODB files, histogram files, and correction files are all (possible) required at some point. Once those directories have been set here, with just a run number the methods of DataDir allow one to get a string that represents the path to any of these files.

Definition at line 28 of file DataDir.hh.


Constructor & Destructor Documentation

DataDir::DataDir (  ) 

Definition at line 7 of file DataDir.cc.

00007                  : fRawExt(".mid"), fODBExt(".odb"), fHistExt(".root"), fCorrExt(".odb"),
00008                      fRawDir(""), fODBDir(""), fHistDir(""), fCorrDir(""),
00009                      fRawPre("run"), fODBPre("run"), fHistPre("hist"), fCorrPre("corr") {}


Member Function Documentation

std::string DataDir::GetCanonicalRun ( int  run  )  [static, private]

Takes run number and returns in a format that can be included in a file name.

Parameters:
[in] run Run number
Returns:
String representing the run number (5 characters)

Definition at line 11 of file DataDir.cc.

Referenced by GetCorrFileName(), GetHistFileName(), GetODBFileName(), and GetRawFileName().

00011                                           {
00012   static const std::string def("00000");
00013   char num[8];
00014   if (run < 0 || run > 99999)
00015     return def;
00016   sprintf(num, "%05d", run);
00017   return std::string(num);
00018 }

std::string DataDir::GetCorrFileName ( int  run  )  const

Definition at line 67 of file DataDir.cc.

References fCorrDir, fCorrExt, fCorrPre, and GetCanonicalRun().

Referenced by ODBCheck::OutputCorrections().

00067                                                 {
00068   return fCorrDir + fCorrPre + GetCanonicalRun(run) + fCorrExt;
00069 }

std::string DataDir::GetHistFileName ( int  run  )  const

Definition at line 63 of file DataDir.cc.

References fHistDir, fHistExt, fHistPre, and GetCanonicalRun().

Referenced by ODBCheck::Check().

00063                                                 {
00064   return fHistDir + fHistPre + GetCanonicalRun(run) + fHistExt;
00065 }

std::string DataDir::GetODBFileName ( int  run  )  const

Definition at line 59 of file DataDir.cc.

References fODBDir, fODBExt, fODBPre, and GetCanonicalRun().

Referenced by ODBCheck::Check().

00059                                                {
00060   return fODBDir + fODBPre + GetCanonicalRun(run) + fODBExt;
00061 }

std::string DataDir::GetRawFileName ( int  run  )  const

Definition at line 55 of file DataDir.cc.

References fRawDir, fRawExt, fRawPre, and GetCanonicalRun().

00055                                                {
00056   return fRawDir + fRawPre + GetCanonicalRun(run) + fRawExt;
00057 }

void DataDir::SetCorrDir (  ) 

Definition at line 50 of file DataDir.cc.

References fCorrDir.

00050                          {
00051   std::cout << "Enter corrections directory: ";
00052   std::cin >> fCorrDir;
00053 }

void DataDir::SetCorrDir ( const std::string &  corr_dir  ) 

Definition at line 46 of file DataDir.cc.

References fCorrDir.

Referenced by ODBCheck::SetDirs().

00046                                                   {
00047   fCorrDir = corr_dir;
00048 }

void DataDir::SetHistDir (  ) 

Definition at line 41 of file DataDir.cc.

References fHistDir.

00041                          {
00042   std::cout << "Enter histogram directory: ";
00043   std::cin >> fHistDir;
00044 }

void DataDir::SetHistDir ( const std::string &  hist_dir  ) 

Definition at line 37 of file DataDir.cc.

References fHistDir.

Referenced by ODBCheck::SetDirs().

00037                                                   {
00038   fHistDir = hist_dir;
00039 }

void DataDir::SetODBDir (  ) 

Definition at line 32 of file DataDir.cc.

References fODBDir.

00032                         {
00033   std::cout << "Enter ODB directory: ";
00034   std::cin >> fODBDir;
00035 }

void DataDir::SetODBDir ( const std::string &  odb_dir  ) 

Definition at line 28 of file DataDir.cc.

References fODBDir.

Referenced by ODBCheck::SetDirs().

00028                                                 {
00029   fODBDir = odb_dir;
00030 }

void DataDir::SetRawDir (  ) 

Definition at line 23 of file DataDir.cc.

References fRawDir.

00023                         {
00024   std::cout << "Enter raw data directory: ";
00025   std::cin >> fRawDir;
00026 }

void DataDir::SetRawDir ( const std::string &  raw_dir  ) 

Definition at line 20 of file DataDir.cc.

References fRawDir.

Referenced by ODBCheck::SetDirs().

00020                                                 {
00021   fRawDir = raw_dir;
00022 }


Member Data Documentation

std::string DataDir::fCorrDir [private]

Definition at line 40 of file DataDir.hh.

Referenced by GetCorrFileName(), and SetCorrDir().

std::string DataDir::fCorrExt [private]

Definition at line 35 of file DataDir.hh.

Referenced by GetCorrFileName().

std::string DataDir::fCorrPre [private]

Definition at line 46 of file DataDir.hh.

Referenced by GetCorrFileName().

std::string DataDir::fHistDir [private]

Definition at line 40 of file DataDir.hh.

Referenced by GetHistFileName(), and SetHistDir().

std::string DataDir::fHistExt [private]

Definition at line 35 of file DataDir.hh.

Referenced by GetHistFileName().

std::string DataDir::fHistPre [private]

Definition at line 46 of file DataDir.hh.

Referenced by GetHistFileName().

std::string DataDir::fODBDir [private]

Definition at line 40 of file DataDir.hh.

Referenced by GetODBFileName(), and SetODBDir().

std::string DataDir::fODBExt [private]

Definition at line 35 of file DataDir.hh.

Referenced by GetODBFileName().

std::string DataDir::fODBPre [private]

Definition at line 46 of file DataDir.hh.

Referenced by GetODBFileName().

std::string DataDir::fRawDir [private]

Definition at line 40 of file DataDir.hh.

Referenced by GetRawFileName(), and SetRawDir().

std::string DataDir::fRawExt [private]

Definition at line 35 of file DataDir.hh.

Referenced by GetRawFileName().

std::string DataDir::fRawPre [private]

Definition at line 46 of file DataDir.hh.

Referenced by GetRawFileName().


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

Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1