Public Member Functions | Public Attributes | Friends | List of all members
NearlineFileInfo Struct Reference

Public Member Functions

 NearlineFileInfo (TFile *fp, std::string headerTreeName=NearlineInstanceLabel+"/Header", std::string versionHistName=NearlineInstanceLabel+"/hist_nearline_version")
 
void getHeaderInfo (TFile *fp, std::string headerTreeName)
 
void getNearlineVersion (TFile *fp, std::string versionHistName)
 

Public Attributes

bool HasHeader
 
unsigned int Run
 
unsigned int Subrun
 
int FirstEvent
 
int LastEvent
 
int Nevents
 
unsigned int StartYear
 
unsigned int EndYear
 
unsigned int StartMonth
 
unsigned int EndMonth
 
unsigned int StartDay
 
unsigned int EndDay
 
double StartHour
 
double EndHour
 
unsigned long long int StartTime
 
unsigned long long int EndTime
 
int ThisNearlineMinorVersion
 
int ThisNearlineMajorVersion
 

Friends

std::ostream & operator<< (std::ostream &os, NearlineFileInfo &rhs)
 

Detailed Description

Definition at line 22 of file NearlineSummariser.cxx.

Constructor & Destructor Documentation

NearlineFileInfo::NearlineFileInfo ( TFile *  fp,
std::string  headerTreeName = NearlineInstanceLabel + "/Header",
std::string  versionHistName = NearlineInstanceLabel + "/hist_nearline_version" 
)
inline

Definition at line 45 of file NearlineSummariser.cxx.

45  :
46  HasHeader(false),
47  Run(0),
48  Subrun(0),
49  FirstEvent(1e9),
50  LastEvent(-1),
51  Nevents(0),
52  StartYear(0),
53  EndYear(0),
54  StartMonth(0),
55  EndMonth(0),
56  StartDay(0),
57  EndDay(0),
58  StartHour(0.0),
59  EndHour(0.0),
60  StartTime(-1), // this is an unsigned int so it will default to a huge number
61  EndTime(0),
64  {
65 
66  getHeaderInfo(fp, headerTreeName);
67  getNearlineVersion(fp, versionHistName);
68 
69  }//constructor
unsigned long long int EndTime
unsigned long long int StartTime
void getHeaderInfo(TFile *fp, std::string headerTreeName)
void getNearlineVersion(TFile *fp, std::string versionHistName)

Member Function Documentation

void NearlineFileInfo::getHeaderInfo ( TFile *  fp,
std::string  headerTreeName 
)
inline

Definition at line 71 of file NearlineSummariser.cxx.

71  {
72  TTree *Header = (TTree*) fp->Get(headerTreeName.c_str());
73  if(!Header){
74  std::cout << "NearlineSummariser: ERROR: " << fp->GetName() << " doesn't contain header tree: " << headerTreeName << std::endl;
75  return;
76  }
77 
78  Header->SetBranchAddress("Run",&Run);
79  Header->SetBranchAddress("Subrun",&Subrun);
80  Header->SetBranchAddress("FirstEvent",&FirstEvent);
81  Header->SetBranchAddress("LastEvent",&LastEvent);
82  Header->SetBranchAddress("Nevents",&Nevents);
83  Header->SetBranchAddress("StartYear",&StartYear);
84  Header->SetBranchAddress("StartMonth",&StartMonth);
85  Header->SetBranchAddress("StartDay",&StartDay);
86  Header->SetBranchAddress("StartHour",&StartHour);
87  Header->SetBranchAddress("EndYear",&EndYear);
88  Header->SetBranchAddress("EndMonth",&EndMonth);
89  Header->SetBranchAddress("EndDay",&EndDay);
90  Header->SetBranchAddress("EndHour",&EndHour);
91 
92  Header->GetEntry(0);
93 
94  HasHeader = true;
95 
96  }//getHeaderInfo
QTextStream & endl(QTextStream &s)
void NearlineFileInfo::getNearlineVersion ( TFile *  fp,
std::string  versionHistName 
)
inline

Definition at line 98 of file NearlineSummariser.cxx.

98  {
99 
100  TH1* hist = (TH1*) fp->Get(versionHistName.c_str());
101 
102  if(!hist){
103  std::cout << "NearlineSummariser: ERROR: " << fp->GetName() << " doesn't contain version number hist: " << versionHistName << std::endl;
104  return;
105  }
106 
107  ThisNearlineMinorVersion = hist->GetBinContent(1);
108  ThisNearlineMajorVersion = hist->GetBinContent(2);
109 
110  }//getNearlineVersion
QTextStream & endl(QTextStream &s)

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
NearlineFileInfo rhs 
)
friend

Definition at line 112 of file NearlineSummariser.cxx.

112  {
113  os << "Run " << rhs.Run
114  << " StartYear " << rhs.StartYear
115  << " StartMonth " << rhs.StartMonth
116  << " StartDay " << rhs.StartDay
117  << " StartHour " << rhs.StartHour
118  << " StartTime " << rhs.StartTime;
119  return os;
120  }//operator <<
unsigned long long int StartTime

Member Data Documentation

unsigned int NearlineFileInfo::EndDay

Definition at line 35 of file NearlineSummariser.cxx.

double NearlineFileInfo::EndHour

Definition at line 37 of file NearlineSummariser.cxx.

unsigned int NearlineFileInfo::EndMonth

Definition at line 33 of file NearlineSummariser.cxx.

unsigned long long int NearlineFileInfo::EndTime

Definition at line 39 of file NearlineSummariser.cxx.

unsigned int NearlineFileInfo::EndYear

Definition at line 31 of file NearlineSummariser.cxx.

int NearlineFileInfo::FirstEvent

Definition at line 27 of file NearlineSummariser.cxx.

bool NearlineFileInfo::HasHeader

Definition at line 24 of file NearlineSummariser.cxx.

int NearlineFileInfo::LastEvent

Definition at line 28 of file NearlineSummariser.cxx.

int NearlineFileInfo::Nevents

Definition at line 29 of file NearlineSummariser.cxx.

unsigned int NearlineFileInfo::Run

Definition at line 25 of file NearlineSummariser.cxx.

unsigned int NearlineFileInfo::StartDay

Definition at line 34 of file NearlineSummariser.cxx.

double NearlineFileInfo::StartHour

Definition at line 36 of file NearlineSummariser.cxx.

unsigned int NearlineFileInfo::StartMonth

Definition at line 32 of file NearlineSummariser.cxx.

unsigned long long int NearlineFileInfo::StartTime

Definition at line 38 of file NearlineSummariser.cxx.

unsigned int NearlineFileInfo::StartYear

Definition at line 30 of file NearlineSummariser.cxx.

unsigned int NearlineFileInfo::Subrun

Definition at line 26 of file NearlineSummariser.cxx.

int NearlineFileInfo::ThisNearlineMajorVersion

Definition at line 43 of file NearlineSummariser.cxx.

int NearlineFileInfo::ThisNearlineMinorVersion

Definition at line 42 of file NearlineSummariser.cxx.


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