More information on this package is here.
#ifndef __TClasTool__
#define __TClasTool__
#ifndef NOSAFE
#define READER_SAFE_CHECK if(Check_Reader_Defined())
#else
#define READER_SAFE_CHECK
#endif
#define WRITE_GSIM
#include <iostream>
using namespace std;
#include <stdlib.h>
#include <unistd.h>
#include "TROOT.h"
#include "TSystem.h"
#include "TObject.h"
#include "TString.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 "THEADERClass.h"
#include "TEVNTClass.h"
#include "TECPBClass.h"
#include "TSCPBClass.h"
#include "TDCPBClass.h"
#include "TCCPBClass.h"
#include "TLCPBClass.h"
#include "THEADClass.h"
#include "TEPICClass.h"
#ifdef WRITE_GSIM
#include "TGSIMClass.h"
#endif
#include "TVERTClass.h"
#include "TMVRTClass.h"
#include "TTBERClass.h"
#include "THLSClass.h"
#include "TS1STClass.h"
#include "TTRGSClass.h"
#include "TVirtualReader.h"
#include "TDSTReader.h"
#include "TClasTool_Const.h"
namespace ClasTool{
Int_t GetTypeFromPid(Int_t pid);
Int_t GetPidFromType(Int_t type);
Float_t GetPartMassID(Int_t pid);
Float_t GetPartMassIdx(Int_t idx);
Int_t GetPartChargeID(Int_t pid);
Int_t GetPartChargeIdx(Int_t idx);
const char *GetPartNameIdx(Int_t idx);
const char *GetPartShortNameIdx(Int_t idx);
const char *GetPartName(Int_t pid);
const char *GetPartShortName(Int_t pid);
const char *GetPartSymbol(Int_t pid);
const char *GetPartSymbolIdx(Int_t idx);
static const Float_t fgParticle_Mass[]=
{
0.,
5.10998902e-04,
5.10998902e-04,
0.0,
0.13957018,
0.13957018,
0.493677,
0.493677,
0.93827200,
0.93956533,
1.875612762,
2.8092,
3.7274
};
static const Int_t fgParticle_Charge[]=
{
0,
-1,
+1,
0,
+1,
-1,
+1,
-1,
+1,
0,
+1,
+2,
+2
};
static const Int_t fgParticle_Id[]=
{
kUnknown_Id,
kElectron_Id,
kPositron_Id,
kPhoton_Id,
kPion_Plus_Id,
kPion_Minus_Id,
kKaon_Plus_Id,
kKaon_Minus_Id,
kProton_Id,
kNeutron_Id,
kDeuteron_Id,
kHe3_Id,
kHe4_Id};
static const char *fgParticle_Name[]=
{
"Unknown",
"Electron",
"Positron",
"Photon",
"Pion_Plus",
"Pion_Minus",
"Kaon_Plus",
"Kaon_Minus",
"Proton",
"Neutron",
"Deuteron",
"Helium3",
"Helium4" };
static const char *fgParticle_ShortName[]=
{
"Unkn",
"Elec",
"Pos",
"Phot",
"Pip",
"Pim",
"Kp",
"Km",
"Prot",
"Neut",
"Deut",
"He3",
"He4" };
static const char *fgParticle_Symbol[]=
{
"?",
"e^{-}",
"e^{+}",
"#gamma",
"#pi^{+}",
"#pi^{-}",
"K^{+}",
"K^{-}",
"P",
"N",
"D",
"He^{3}",
"He^{4}"};
}
class TClasTool : public TObject{
public:
TVirtualReader *fReader;
Int_t fDebug_Mode;
public:
TClasTool();
virtual ~TClasTool();
Int_t Add(const Char_t *filename);
Int_t AddFile(const Char_t *filename);
Int_t AddEPICFile(const char *filename, Int_t nentries);
Int_t Check_Reader_Defined();
Int_t Correct_ECPB_bank(TEVNTClass *e);
Int_t Correct_ECPB_bank(TECPBClass *eco);
TObject *GetBankRow(const Char_t *bankname,Int_t nrow);
Int_t GetCurrentEvent();
Double_t GetEntries();
Double_t GetEntriesFast();
Float_t GetEPICValue(const char* fName);
TEPICClass *GetEPICClass();
Int_t GetEntry(Int_t entry=-1,Int_t getall=0);
Int_t GetEventNumber();
THEADERClass *GetHEADER();
Int_t GetHelicity();
void GetInvariants(Float_t *Q2, Float_t *W2);
Int_t GetNFiles();
TObject *GetNotify();
Int_t GetNPart();
Int_t GetNRows(const Char_t *bankname="EVNT");
Int_t GetPartID(Int_t indx);
Int_t GetPartCharge(Int_t indx);
TVector3 GetPart3Vector(Int_t indx);
TLorentzVector GetPart4Vector(Int_t indx);
TVector3 GetPartVertex(Int_t indx);
TVERTClass *GetVert(Int_t part1,Int_t part2);
TVirtualReader *GetReader(void);
TChain *GetTree(Char_t *treename="EVNT");
Int_t InitDSTReader(const Char_t *readertype="ROOTDSTR");
Int_t InitDSTReader(TVirtualReader *reader);
Int_t Next();
void Print(Int_t full=0);
void PrintEventStatus();
void PrintEPICPosition();
void SetNotify(TObject *Notify);
void SetNoScalers();
void SetBeamEnergy(Float_t fbm){fEBeam=fbm;};
Float_t GetBeamEnergy(){return(fEBeam);};
TEVNTClass *GetEVNT(Int_t nrow){return (TEVNTClass *)GetBankRow("EVNT",nrow);}
TDCPBClass *GetDCPB(Int_t nrow){return (TDCPBClass *)GetBankRow("DCPB",nrow);}
protected:
Float_t fEBeam;
Int_t isReaderDefined;
TVERTClass* TClasTool::Vert_Error_Handler(Int_t NRows,Int_t track1, Int_t track2);
ClassDef(TClasTool,2)
};
#endif
Author: Maurik Holtrop
Last update: ClasTool/TClasTool:$Name: $:$Id: TClasTool.cc,v 1.15 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