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

TDSTReader


class description - header file - source file

class TDSTReader: public TVirtualReader

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TDSTReader()
TDSTReader(const TDSTReader& reader)
~TDSTReader()
voidTObject::AbstractMethod(const char* method) const
virtual Int_tAdd(const Char_t* filename)
virtual Int_tAddEPICFile(const Char_t* filename, Int_t nentries)
Int_tAddFile(const Char_t* filename)
virtual Int_tAddFile(const Char_t* filename, Int_t nentries)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTVirtualReader::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
voidCleanEventClones()
voidCleanScalerClones()
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_tTVirtualReader::Draw(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)
TChain*GetChain(char* which = "Event")
TClonesArray*GetClone(const Char_t* bankname)
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* fName)
virtual Int_tGetEventNumber()
virtual TObjArray*TVirtualReader::GetFiles()
virtual THEADERClass*GetHEADER()
virtual Int_tGetHelicity()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual Int_tGetNFiles()
virtual TObject*TVirtualReader::GetNotify()
virtual Int_tGetNPart()
virtual Int_tGetNRows(const Char_t* bankname = "EVNT")
virtual Int_tTVirtualReader::GetNtrees()
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()
TStoreClone*GetStoreClone(const Char_t* bankname)
virtual const char*TObject::GetTitle() const
virtual TChain*GetTree(Char_t* treename = "EVNT")
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
voidInitBranches()
voidInitClones()
voidInitEPICBranch()
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
voidMakeEPICTable()
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&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_tTVirtualReader::ReadEvent(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_tTVirtualReader::SetDebugMode(Int_t mode)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
virtual voidTVirtualReader::SetNotify(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_tTVirtualReader::fDebug_ModeDefines printout, Bit 0 = STD Messages, Bit 1 = Errors, Higherbits = Debug
Int_tTVirtualReader::fCurrentEventCurrent Data Event (for use with Next() )
Int_tTVirtualReader::fCurrentScalerCurrent Scaler Event (for use with NextScaler() )
Int_tTVirtualReader::fScalerLastEvtto synchronize Event tree and Scaler tree this contain the event number of the last Physics Event. Set by SetBranchAddress
Bool_tTVirtualReader::fReadScalerTurn on or off the automatic reading of scaler branch. Default is on.
Bool_tTVirtualReader::fReadMCHDTurn on or off the reading of the MCHD bank.
Bool_tTVirtualReader::fReadGSIMTurn on or off the reading of the GSIM bank.
Bool_tTVirtualReader::fUseGSIMWhen set true, read the GSIM bank INSTEAD of the EVNT bank.
static Int_tTVirtualReader::fgInstanceCountTotal instance count.
Int_tTVirtualReader::fThisInstanceInstance count of this instance.
private:
THEADERClass*fEvntHeaderEvent Header pointer
THEADClass*fScalerHeadScaler Event Header pointer
TEPICClass*fEPICEPICClass pointer
THashListfClonesStore pointers to TClonesArray of main data
THashListfScalerClonesStore pointers to TClonesArray of scalers.
TChain*fEventChainChain of files with data. TTree points to CLASEVENT
TChain*fScalerChainChain of files with data. TTree points to SCALER
TChain*fEPICChainChain of files with data. TTree points to CLASEPIC
Int_tfCurrentEPICKeeps track of position in EPIC bank.Perhaps should be in TVirtualReader?
TArrayI*EPICTableTable storing the last physics event before each EPIC. Used in GetEPICValue

Class Description

____________________ 

TDSTReader

   Modified:   6/2005   Maurik Holtrop UNH
             Add in the PHOTON functionality.

This class is a sub-class of TClasTool. It implements an interface to the ROOT based DST that is created by the WriteRootDST program. It can be used directly for analysis, but I highly recommend that you use TClasTool for your analysis instead. This will give you all the power of this class and more and in addition provide you with more flexibility.

The class implements two chains, one for the data events and one for the scaler events. The scaler events are optional, and can be turned off. The actual scaler event implementation is minimal and does not seem to be used much.

More detailed documentation would be useful.

 
 
   

TDSTReader()
  Default Constructor.
  Default Debug mode is 1
  To change it use SetDebugMode(debugmode)
~TDSTReader()
 Default Destructor
  Destroys Chains

TDSTReader( const TDSTReader& reader )
 Copy Constructor. Note that this should not be used, since it is not reliable and
 does not necessairily do what you think it should.

Int_t Add(const Char_t *name)
 Add new files to the reader.

 The file name may use the wildcarding notation, eg "xxx*.root" means all files
 starting with xxx in the current file system directory.

 This method will return with the number of files that were actually added to
 the list of files. So 0 (zero) means the files were not found.

 case with one single file
Int_t AddFile( const Char_t *filename )
Int_t AddFile(const Char_t *filename,Int_t nentries)
  This method adds a single new file into list of files
  to be analysed. This list is stored in the TChain *fEventChain
  and separately in TChain *fScalerChain (for the scalers.)
  (These chains can be accessed directly with the GetChain(char *which) )

  The AddFile method checks if the file requested can actually be read 
  (unlike TChain::AddFile) and will return kERR_File_Not_Found on error.

  If the branches on the chain are not yet initialized, a call to AddFile
  will call InitBranches().

  Use the TDSTReader::Add() or TDSTReader::AddListOfFiles() to add
  multiple files at once.

  For nentries see the TChain::Add() method. (default works fine, so don't specify.)

  Returns a negative number when there was a problem adding the file,
  returns 0 (zero) if the file was added succesfully.

Int_t AddEPICFile(const char* filename, Int_t nentries)
 This adds a single EPIC file into the fEPICChain. If the function fails
 to add the filename, or if it contains no trees, then the function returns
 kERR_File_Not_Found. If InitEPICBranches has not yet been called the function 
 calls InitEPICBranches. On a successful add the function returns kNOERR.

 The run numbers must be added in order, otherwise if GetEPICValue is called
 it will most likely become confused and bounce back and forth between the 
 out of order runs and never return a value.
Int_t GetEntry(Int_t entry,Int_t getall)
 Get an event entry from the file(s) and load it.
 Returns the number of bytes read.

 NOTE: This WILL affect the fCurrentEvent which is set to entry.

Int_t Next()
 Next() reads next available Entry in TREE into 
 Clone Arrays. On success returns 0 otherwise -1 will
 be returned..
  fCurrentEvent = 17;
Bool_t Notify()
 This is a virtual stub. The code does nothing, but is intended to be
 replaced by your own code. You point to your own code with the SetNotify() method.
  
void InitClones()
  InitClones Initializes Clone Arrays for all Banks.
  This should only be called once. 
void CleanEventClones()
  CleanClones Cleans Clone arrays to Read new 
  Entry from the tree.
  Calls Clear() which is faster than Delete(),
  according to TClonesArray documentation Clear() should be faster.

void CleanScalerClones()
delete all scaler clone arrays
void InitBranches()
  InitBranches Initialize Branches 

 Setup Event Branches and set branch addresses
 to  ClonesArrays

 Not every file is always going to contain all branches.
 We test the presence of the branch before setting the BranchAddress,
 since setting the address on a branch that is not in the file causes a fault.

void Print(Int_t full)
 Print information about this reader. 
 With argument full=1 print even more information.
void InitEPICBranch()
 Set the Branch Address for the fEPIC pointer.
void MakeEPICTable()
 Makes a table containing the last physics event number before each
 Epic. The table is used in GetValue to search for the EPIC entry 
 corresponding to the current physics event.
void PrintEventStatus()
 For Debugging ETC, print usefull information on this event.
 (To be extended )

void PrintEPICPosition()
Print out the run number and the range of event numbers for the
current EPIC. Useful for debugging purposes.
Float_t GetEPICValue(const char *fName)
 Return the EPIC value corresponding to name for the current EPIC event
 Changes fCurrentEPIC to the Entry corresponding to the current physics
 event#. Leave this as a sequential search because it is unlikely that 
 the relevant EPIC will change rapidly enough in between calls to make 
 a binary search more effiecient. Right now this is done the "safe" way, 
 that is GetEntry is called each time fCurrentEPIC is updated. The table
 could allow you to find the right event without this call but using this
 call allows us to check the run number each time.
Int_t GetNRows(const Char_t *bankname)
   This Function returns number of rows (number of 
 entries) of specified Bank (Clones Array). The string
 argument passed to function is the name of bank.
 EVNT,ECPB,SCPB,DCPB,CCPB or LCPB.
 Any other string passed to function will return -1 
 indicating that there is no bank with that name...

Int_t GetCurrentEvent()
 Returns the number of the current event in the Next() sequence.
 This is not the "Physics event" number, which you get from the header class.
Int_t GetEventNumber()
 Return the current event number.
 This is the "Physics event" number, which you get from the header class.
Int_t GetRunNumber()
 Return the current run number.
TObject * GetBankRow(const Char_t *bankname,Int_t nrow)
 Get a specific bank given the bankname at a specific row given the row name  
GetEntries_return_t GetEntries()
 Return the number of entries in the total chain.
GetEntries_return_t GetEntriesFast()
 Return the number of entries faster. Not always
 correct, if a call to GetEntries() has not been
 done since the last file was added.
TVector3 GetPart3Vector(Int_t indx)
TVector3 GetPartVertex(Int_t indx)
Int_t GetPartID(Int_t indx)
Int_t GetPartCharge(Int_t indx)
TString GetReaderType()
TChain * GetTree(Char_t *treename)
 Returns the TTree opened by this reader.
 For the SCALER TTree the argument must start with an S
 Note that this actually passes a TChain * (a type of TTree *).
Int_t GetHelicity()
Int_t GetNFiles()
void Reset()
 Set the fCurrentEvent and the fCurrentScaler to 0.
 Thus the next Next() call will start reading at the beginning of the 
 current Chain of data files.
TChain * GetChain(char *which)
TEPICClass * GetEPICClass()
{return(fEPIC);}
THEADERClass * GetHEADER()
{return(fEvntHeader);}
Int_t GetNPart()
{ return ( fEvntHeader->GetNPGP() % 100 ); }
Int_t GetTreeNumber(void)
{return(fEventChain->GetTreeNumber());}


Author: Maurik Holtrop
Last update: ClasTool/TDSTReader:$Name: $:$Id: TDSTReader.cc,v 1.23 2007/04/05 19:55:25 holtrop Exp $
CopyLeft - This code is freely available.

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