More information on this package is here.
#ifndef __TDST_READER__
#define __TDST_READER__
#define WRITE_MCHD
#define WRITE_GSIM
#define WRITE_PHOTON
#define WRITE_VERTEX
#define WRITE_TBER
#include <iostream>
using namespace std;
#include <stdlib.h>
#include <unistd.h>
#include "TROOT.h"
#include "TSystem.h"
#include "TObject.h"
#include "TString.h"
#include "TRegexp.h"
#include "TChain.h"
#include "TFile.h"
#include "TGFileDialog.h"
#include "TTree.h"
#include "TClonesArray.h"
#include "TMatrix.h"
#include "TVector2.h"
#include "TVector3.h"
#include "TRotation.h"
#include "TLorentzVector.h"
#include "TLorentzRotation.h"
#include "TMath.h"
#include "TH1.h"
#include "TRandom.h"
#include "TString.h"
#include "TObjString.h"
#ifdef __USE_MYSQL__
#include "TSQLServer.h"
#include "TSQLRow.h"
#include "TSQLResult.h"
#endif
#include "TVirtualReader.h"
#include "THEADERClass.h"
#include "TEVNTClass.h"
#include "TECPBClass.h"
#include "TSCPBClass.h"
#include "TDCPBClass.h"
#include "TCCPBClass.h"
#include "TLCPBClass.h"
#include "THEADClass.h"
#include "TTGBIClass.h"
#include "TEPICClass.h"
#ifdef WRITE_PHOTON
#include "TSTPBClass.h"
#include "TTGPBClass.h"
#include "TTAGRClass.h"
#endif
#ifdef WRITE_MCHD
#include "TMCHDClass.h"
#endif
#ifdef WRITE_GSIM
#include "TGSIMClass.h"
#endif
#ifdef WRITE_VERTEX
#include "TVERTClass.h"
#include "TMVRTClass.h"
#endif
#ifdef WRITE_TBER
#include "TTBERClass.h"
#endif
#include "THLSClass.h"
#include "TS1STClass.h"
#include "TTRGSClass.h"
class TDSTReader : public TVirtualReader{
public:
THEADERClass *fEvntHeader;
THEADClass *fScalerHead;
TEPICClass *fEPIC;
TClonesArray *fcaDataPointer;
TClonesArray *fcaEVNTStore;
TClonesArray *fcaECPBStore;
TClonesArray *fcaSCPBStore;
TClonesArray *fcaDCPBStore;
TClonesArray *fcaCCPBStore;
TClonesArray *fcaLCPBStore;
#ifdef WRITE_PHOTON
TClonesArray *fcaSTPBStore;
TClonesArray *fcaTGPBStore;
TClonesArray *fcaTAGRStore;
#endif
#ifdef WRITE_VERTEX
TClonesArray *fcaVERTStore;
TClonesArray *fcaMVRTStore;
#endif
#ifdef WRITE_TBER
TClonesArray *fcaTBERStore;
#endif
#ifdef WRITE_TGBI
TClonesArray *fcaTGBIStore;
#endif
#ifdef WRITE_MCHD
TClonesArray *fcaMCHDStore;
#endif
#ifdef WRITE_GSIM
TClonesArray *fcaGSIMStore;
#endif
TClonesArray *fcaHLSStore;
TClonesArray *fcaS1STStore;
TClonesArray *fcaTRGSStore;
TChain *fEventChain;
TChain *fScalerChain;
TChain *fEPICChain;
Int_t fCurrentEPIC;
TArrayI *EPICTable;
public:
TDSTReader();
~TDSTReader();
TDSTReader( const TDSTReader& reader );
Int_t Add( const Char_t *filename );
Int_t AddFile(const Char_t *filename);
Int_t AddFile(const Char_t *filename,Int_t nentries);
Int_t AddEPICFile(const Char_t *filename,Int_t nentries);
void CleanEventClones();
void CleanScalerClones();
void InitClones();
void InitBranches();
void InitEPICBranch();
void MakeEPICTable();
Float_t GetEPICValue(const char* fName);
TEPICClass *GetEPICClass(){return(fEPIC);};
TObject *GetBankRow(const Char_t *bankname,Int_t nrow);
TChain *GetChain(char *which="Event");
Int_t GetCurrentEvent();
Int_t GetEntry(Int_t entry=-1, Int_t getall=0);
GetEntries_return_t GetEntries() const;
GetEntries_return_t GetEntriesFast() const;
Int_t GetEventNumber();
THEADERClass *GetHEADER(){return(fEvntHeader);};
Int_t GetHelicity();
Int_t GetNFiles();
Int_t GetNPart(){ return ( fEvntHeader->GetNPGP() % 100 ); };
Int_t GetNRows(const Char_t *bankname="EVNT");
TVector3 GetPart3Vector(Int_t indx);
Int_t GetPartID(Int_t indx);
Int_t GetPartCharge(Int_t indx);
TVector3 GetPartVertex(Int_t indx);
TString GetReaderType();
Int_t GetRunNumber();
TChain *GetTree(Char_t *treename="EVNT");
Int_t GetTreeNumber(void){return(fEventChain->GetTreeNumber());};
Int_t Next();
Bool_t Notify();
void Print(Int_t full=0);
void PrintEventStatus();
void PrintEPICPosition();
void Reset();
ClassDef(TDSTReader,1)
};
inline Int_t TDSTReader::GetNFiles(){
return(((TObjArray *)fEventChain->GetListOfFiles())->GetEntries());
}
inline void TDSTReader::Reset(){
fCurrentEvent=0;
fCurrentScaler=0;
fCurrentEPIC=0;
}
inline TChain *TDSTReader::GetChain(char *which){
if(which[0]=='S'){
return(fScalerChain);
}else{
return(fEventChain);
}
}
#endif
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