More information on this package is here.
#include "TVirtualReader.h"

TVirtualReader


class description - header file - source file

class TVirtualReader: public TObject

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TVirtualReader()
TVirtualReader(const TVirtualReader&)
~TVirtualReader()
voidTObject::AbstractMethod(const char* method) const
virtual Int_tAdd(const Char_t* filename)
virtual Int_tAddEPICFile(const Char_t* filename, Int_t nentries)
virtual Int_tAddFile(const Char_t* filename, Int_t nentries = TChain::kBigNumber)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidBrowse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual Int_tDraw(const char* varexp, const char* selection, Option_t* option = "", Int_t nentries = 1234567890, Int_t firstentry = 0)
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual TObject*GetBankRow(const Char_t* bankname, Int_t nrow)
virtual Int_tGetCurrentEvent()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Long64_tGetEntries() const
virtual Long64_tGetEntriesFast() const
virtual Int_tGetEntry(Int_t entry = -1, Int_t getall = 0)
virtual TEPICClass*GetEPICClass()
virtual Float_tGetEPICValue(const Char_t* fName)
virtual Int_tGetEventNumber()
virtual TObjArray*GetFiles()
virtual THEADERClass*GetHEADER()
virtual Int_tGetHelicity()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual Int_tGetNFiles()
virtual TObject*GetNotify()
virtual Int_tGetNPart()
virtual Int_tGetNRows(const Char_t* bankname = "EVNT")
virtual Int_tGetNtrees()
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual TVector3GetPart3Vector(Int_t indx)
virtual Int_tGetPartCharge(Int_t indx)
virtual Int_tGetPartID(Int_t indx)
virtual TVector3GetPartVertex(Int_t indx)
virtual TStringGetReaderType()
virtual Int_tGetRunNumber()
virtual const char*TObject::GetTitle() const
virtual TChain*GetTree(Char_t* treename = "EVENT")
virtual Int_tGetTreeNumber()
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Int_tNext()
virtual Bool_tNotify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TVirtualReader&operator=(const TVirtualReader&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Int_t full = 0)
virtual voidPrintEPICPosition()
virtual voidPrintEventStatus()
virtual Int_tTObject::Read(const char* name)
virtual Int_tReadEvent(Int_t event, Int_t runnum = 0)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidReset()
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
Int_tSetDebugMode(Int_t mode)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
virtual voidSetNotify(TObject* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
public:
Int_tfDebug_ModeDefines printout, Bit 0 = STD Messages, Bit 1 = Errors, Higherbits = Debug
Int_tfCurrentEventCurrent Data Event (for use with Next() )
Int_tfCurrentScalerCurrent Scaler Event (for use with NextScaler() )
Int_tfScalerLastEvtto synchronize Event tree and Scaler tree this contain the event number of the last Physics Event. Set by SetBranchAddress
Bool_tfReadScalerTurn on or off the automatic reading of scaler branch. Default is on.
Bool_tfReadMCHDTurn on or off the reading of the MCHD bank.
Bool_tfReadGSIMTurn on or off the reading of the GSIM bank.
Bool_tfUseGSIMWhen set true, read the GSIM bank INSTEAD of the EVNT bank.
static Int_tfgInstanceCountTotal instance count.
Int_tfThisInstanceInstance count of this instance.

Class Description

____________________ 

TVirtualReader

TVirtualReader is the underlying class from which all reader implementations in ClasTool must inherit. Many of the methods of this class are dummies that must be overridden by the real function of the reader class that inherits from TVirtualReader.

Some functions will be implemented in this class rather than in TClasTool if they are "closer to the data", in other words, these functions would be useful for different readers (general enough) yet are specific enough that some DST formats would need an alternate implementation.

Note that to be useful, each method that is relevant for physics analysis (i.e. all the public methods) must have a call implementation in TClasTool. Otherwise calls to that method must be done on the pointer to the reader, which is highly in elegant. That is the "price we pay" for a design that allows different readers using a pointer to the reader instead of inheriting from the reader.

 
 
   

TVirtualReader()
~TVirtualReader()
Int_t Add(const Char_t *filename)
 Add new files to the list of files to be analyzed.
 The filename may use wildcards to add multiple files all at once.
 returns the actual number of files added or zero.
 Actually adds files by repeated calls to AddFile().
Int_t AddFile(const Char_t *filename,Int_t nentries)
 Add a single file to the list of files to be analyzed.
 Returns a negative number if the files could not be opened.
 On first file opened, must initialize the reader.
Int_t AddEPICFile(const Char_t *filename, Int_t nentries)
 Add a single file to the list of epic files to be analyzed.
 Returns a negative number if the files could not be opened.
 On first file opened, must initialize the reader.
Int_t Next()
 Read the next event and make the contends available.
Int_t GetNFiles()
 Returns the number of files in the current list of files to be analyzed.
void Reset()
 Main reset of class. Clean up and return to reading the very first event.
Int_t ReadEvent(Int_t event,Int_t runnum)
 Read a specific event from the run with runnum.
 THIS IS EXPENSIVE! We need to SEARCH for that specific event. 
 Usually you want to use Next() or GetEntry() which are both quite a bit faster.

 Returns the event number of the event actually read. Since it is possible the 
 event is not found

 Specify runnum if you want to search for a runnum other than the current one.

 This is the "generic" version you may which to override.
 This is currently the stupid way to do this, should be a binary search.
 It is the user's responsibility to load files with different runnumbers in 
 sequential order.
Int_t GetEntry(Int_t entry,Int_t getall)
 Find a specific event in the list of events. The n-th event is returned,
 not the event with event_number = entry! For that use the ReadEvent() method.
GetEntries_return_t GetEntries()
 Return total number of entries in the chain.
GetEntries_return_t GetEntriesFast()
 Fast way to return the number of entries in the chain by regurgitating a
 stored value. This value may not be accurate. (See TChain::GetEntriesFast )
Float_t GetEPICValue(const Char_t *fName)
Returns the EPIC value associated with fName
void Browse(TBrowser *B)
 Browse the class with Browser b.
Int_t Draw(const char *varexp, const char *selection, Option_t *option ,Int_t nentries, Int_t firstentry)
 Same as the TChain::Draw command, allows you to make instant plots of variables in the 
 files. This is harder to implement and so not all readers will support this!
TObjArray * GetFiles(void)
 Return a TObjArray containing a list of the currently attached files. See TChain::GetFiles()
Int_t GetNtrees(void)
 Return the number of trees attached. See TChain::GetNtrees()
Int_t GetTreeNumber(void)
 Return the number of the current tree being read. See TChain::GetTreeNum()
Bool_t Notify()
 Routine that will call the Notify set by SetNotify.
void SetNotify(TObject *obj)
 This cannot be implemented here, it must be implemented in the
 actual reader.  
 The argument must be a class that is derived from TObject and has
 a sensible Notify() method.
 The SetNotify call will set a hook to call the Notify() of your 
 class whenever a new file is opened. I.e. the first file, or when
 you go from the first to the second, etc. This is useful for 
 initializations that depend on the file being there already, and 
 it is useful for detecting runnumber changes.
Int_t GetNPart()
 Get the number of particles in this event. Calls GetNRows("EVNT")
TVector3 GetPart3Vector(Int_t indx)
 Return the momentum 3 vector for a particle at index indx, for this event.
TVector3 GetPartVertex(Int_t indx)
 Return the vertex 3 vector for a particle at index indx, for this event.
Int_t GetPartID(Int_t indx)
 Return the particle ID (SEB style) for the particle at index indx for this event.
Int_t GetPartCharge(Int_t indx)
 Return the charge of the particle at index indx for this event.
TString GetReaderType()
 Return the type of the reader that is implemented.
TEPICClass * GetEPICClass()
Return current EPIC
THEADERClass * GetHEADER()
 Return the HEADER bank for the current event.
Int_t GetHelicity()
 Return the helicity of the current event: -1 or 1 for proper helicity, 0 for error.
TChain * GetTree(char *treename)
 Return a pointer to the TChain. 
 If reader is not capable of returning a TChain, it will return NULL.
void Print(Int_t full)
 Print to the screen a summary of the status for this event. Useful for debugging.
void PrintEventStatus()
 Print to the screen a summary of the status for this event. Useful for debugging.
void PrintEPICPosition()
Print the position of current EPIC
Int_t GetNRows(const Char_t *bankname)
 Return the number of rows for the bank with "bankname" for this event.
TObject * GetBankRow(const Char_t *bankname,Int_t nrow)
 Return a pointer to the ClasBank bank object with name "bankname" at row nrow.
Int_t GetEventNumber()
 Return the current number of the event from the HEADER. I.e. the actual event number.
Int_t GetRunNumber()
 Return the current run number of the event from the HEADER. 
Int_t GetCurrentEvent()
 Return the current number of the event in the sequence, i.e. the n-th event number.
TVirtualReader()
TObject * GetNotify(void)
{return NULL;}
Int_t SetDebugMode( Int_t mode )
{ return ( fDebug_Mode = mode ); }


Author: Maurik Holtrop
Last update: VirtualReader/TVirtualReader:$Name: $:$Id: TVirtualReader.cc,v 1.12 2007/03/01 22:27:00 holtrop Exp $
CopyLeft - This code is freely available.

ROOT Home page - ClasTool Class index - Class Hierarchy - Top of the page