NtpInterface Class Reference

#include <NtpInterface.h>

List of all members.

Public Member Functions

void AddFile (const char *file)
Int_t GetEntries ()
NtpStRecordGetEntry (Int_t ievt)
NtpStRecordGetCurrentRecord ()
void ResetChain ()

Static Public Member Functions

static NtpInterfaceInstance ()
static Bool_t TouchData ()
static void LoadData (const char *file)
static void Reset ()
static Int_t GetNumRecords ()
static NtpStRecordGetRecord (Int_t ievt)
static Int_t GetNumEvents (NtpStRecord *record)

Private Member Functions

 NtpInterface ()
virtual ~NtpInterface ()

Private Attributes

TChain * fChain
NtpStRecordfNtpRecord

Detailed Description

Definition at line 9 of file NtpInterface.h.


Constructor & Destructor Documentation

NtpInterface::NtpInterface (  )  [private]

Definition at line 23 of file NtpInterface.cxx.

References fChain, and fNtpRecord.

00023                            : 
00024   fChain(0),
00025   fNtpRecord(0)
00026 {
00027   std::cout << " *** NtpInterface::NtpInterface() *** " << std::endl;
00028 
00029   if( !fChain ){
00030     fChain = new TChain("NtpSt","chain");
00031     fChain->SetBranchAddress("NtpStRecord",&fNtpRecord);
00032   }
00033 }

NtpInterface::~NtpInterface (  )  [private, virtual]

Definition at line 35 of file NtpInterface.cxx.

00036 {
00037 
00038 }


Member Function Documentation

void NtpInterface::AddFile ( const char *  file  ) 

Definition at line 72 of file NtpInterface.cxx.

References fChain.

Referenced by LoadData().

00073 {
00074   std::cout << " adding files from: " << file << std::endl;
00075 
00076   fChain->Add(file);
00077 
00078   std::cout << "   ... total entries=" << fChain->GetEntries() << std::endl;
00079   
00080   return;
00081 }

NtpStRecord* NtpInterface::GetCurrentRecord (  )  [inline]

Definition at line 29 of file NtpInterface.h.

References fNtpRecord.

00029 { return fNtpRecord; }

Int_t NtpInterface::GetEntries (  ) 

Definition at line 101 of file NtpInterface.cxx.

References fChain.

Referenced by GetNumRecords().

00102 {
00103   return fChain->GetEntries();
00104 }

NtpStRecord * NtpInterface::GetEntry ( Int_t  ievt  ) 

Definition at line 95 of file NtpInterface.cxx.

References fChain, and fNtpRecord.

Referenced by GetRecord().

00096 {
00097   fChain->GetEntry(ievt);
00098   return fNtpRecord;
00099 }

Int_t NtpInterface::GetNumEvents ( NtpStRecord record  )  [static]

Definition at line 61 of file NtpInterface.cxx.

References NtpStRecord::evt.

Referenced by NtpEventViewer::controlNext(), NtpEventViewer::Find(), and NtpTimingNtuple::Run().

00062 {
00063   TClonesArray* eventArray  = (TClonesArray*)(ntpRecord->evt);
00064   return 1+eventArray->GetLast();
00065 }

Int_t NtpInterface::GetNumRecords (  )  [static]
NtpStRecord * NtpInterface::GetRecord ( Int_t  ievt  )  [static]

Definition at line 56 of file NtpInterface.cxx.

References GetEntry(), and Instance().

Referenced by NtpEventViewer::Display(), NtpEventViewer::Find(), NtpEventViewer::PassFail(), and NtpTimingNtuple::Run().

00057 {
00058   return NtpInterface::Instance()->GetEntry(ievt);
00059 }

NtpInterface * NtpInterface::Instance ( void   )  [static]

Definition at line 14 of file NtpInterface.cxx.

Referenced by GetNumRecords(), GetRecord(), LoadData(), and Reset().

00015 {
00016   if( !fgInterface ){
00017     fgInterface = new NtpInterface();
00018   }
00019 
00020   return fgInterface;
00021 }

void NtpInterface::LoadData ( const char *  file  )  [static]

Definition at line 46 of file NtpInterface.cxx.

References AddFile(), and Instance().

00047 {
00048   return NtpInterface::Instance()->AddFile(file);
00049 }

void NtpInterface::Reset (  )  [static]

Definition at line 67 of file NtpInterface.cxx.

References Instance(), and ResetChain().

00068 {
00069   return NtpInterface::Instance()->ResetChain();
00070 }

void NtpInterface::ResetChain (  ) 

Definition at line 83 of file NtpInterface.cxx.

References fChain, and fNtpRecord.

Referenced by Reset().

00084 {
00085   std::cout << " resetting..." << std::endl;
00086 
00087   fChain->Reset();
00088   fChain->SetBranchAddress("NtpStRecord",&fNtpRecord);
00089 
00090   std::cout << "   ... total entries=" << fChain->GetEntries() << std::endl;
00091   
00092   return;
00093 }

Bool_t NtpInterface::TouchData (  )  [static]

Definition at line 40 of file NtpInterface.cxx.

References GetNumRecords().

Referenced by NtpEventViewer::Display(), and NtpEventViewer::PassFail().

00041 {
00042   if( NtpInterface::GetNumRecords()>0 ) return true;
00043   else return false;
00044 }


Member Data Documentation

TChain* NtpInterface::fChain [private]

Definition at line 38 of file NtpInterface.h.

Referenced by AddFile(), GetEntries(), GetEntry(), NtpInterface(), and ResetChain().

Definition at line 40 of file NtpInterface.h.

Referenced by GetCurrentRecord(), GetEntry(), NtpInterface(), and ResetChain().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1