00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020
00021
00022
00023
00024
00025
00027 TBrowser *b = 0;
00028 class StChain;
00029 StChain *chain=0;
00030 void Load(){
00031 gSystem->Load("St_base");
00032 gSystem->Load("libm");
00033 gSystem->Load("StUtilities");
00034 gSystem->Load("StChain");
00035 gSystem->Load("xdf2root");
00036 gSystem->Load("St_Tables");
00037 gSystem->Load("StDbLib");
00038 gSystem->Load("StDbBroker");
00039 gSystem->Load("St_db_Maker");
00040 gSystem->Load("StarClassLibrary");
00041 gSystem->Load("StTrsMaker");
00042 }
00043 void TrsRead(const Int_t Nevents=1)
00044 {
00045 if (gClassTable->GetID("StChain") < 0) Load();
00046 chain = new StChain("trs");
00047 chain->SetDebug();
00048
00049
00050
00051 const char* mainDB = "$STAR/StDb";
00052 St_db_Maker *dbMk = new St_db_Maker("db",mainDB);
00053 dbMk->SetDebug();
00054 chain->SetInput("params","db:StDb/params");
00055
00056 const char* calibDB = "$STAR_ROOT/calib";
00057 St_db_Maker *calibMk = new St_db_Maker("calib",calibDB);
00058 chain->SetInput("calib","calib:calib");
00059 calibMk->SetDebug();
00060 StTrsMaker *tpc_raw = new StTrsMaker("Trs");
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 tpc_raw->readFile("test.trs");
00081
00082
00083 int iInit = chain->Init();
00084 if (iInit) chain->Fatal(iInit,"on init");
00085 gBenchmark->Start("trs");
00086
00087 for (Int_t i =1; i <= Nevents; i++){
00088 if (chain->Make(i)) break;
00089
00090 if (i != Nevents) chain->Clear();
00091 printf ("===========================================\n");
00092 printf ("=========================================== Done with Event no. %d\n",i);
00093 printf ("===========================================\n");
00094 }
00095 if (Nevents > 1) {
00096 chain->Finish();
00097 gBenchmark->Print("trs");
00098 }
00099 else b = new TBrowser;
00100
00101 }