00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027
00028
00029
00030
00031
00032
00034 TBrowser *b = 0;
00035 class StChain;
00036 StChain *chain=0;
00037 class St_geant_Maker;
00038 St_geant_Maker *geant=0;
00039 void Load(){
00040 gSystem->Load("St_base");
00041 gSystem->Load("libm");
00042 gSystem->Load("StUtilities");
00043 gSystem->Load("StChain");
00044 gSystem->Load("xdf2root");
00045 gSystem->Load("St_Tables");
00046 gSystem->Load("StDbLib");
00047 gSystem->Load("StDbBroker");
00048 gSystem->Load("St_db_Maker");
00049 gSystem->Load("StarClassLibrary");
00050 gSystem->Load("geometry");
00051 gSystem->Load("St_g2t");
00052 gSystem->Load("St_geant_Maker");
00053 gSystem->Load("StTrsMaker");
00054 }
00055 void TrsWrite(const Int_t Nevents=1)
00056 {
00057 if (gClassTable->GetID("StChain") < 0) Load();
00058 chain = new StChain("trs");
00059 chain->SetDebug();
00060 chain->SetInput("EvtHddr",".make/geant/.const/EvtHddr");
00061
00062
00063
00064
00065 const char* mainDB = "$STAR/StDb";
00066 St_db_Maker *dbMk = new St_db_Maker("db",mainDB);
00067 dbMk->SetDebug();
00068 chain->SetInput("params","db:StDb/params");
00069
00070 const char* calibDB = "$STAR_ROOT/calib";
00071 St_db_Maker *calibMk = new St_db_Maker("calib",calibDB);
00072 chain->SetInput("calib","calib:calib");
00073 calibMk->SetDebug();
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 geant = new St_geant_Maker("geant");
00094 geant->SetNwGEANT(10 000 000);
00095 geant->SetDebug();
00096 geant->SetIwtype(1);
00097 TString InFile("/afs/rhic.bnl.gov/star/tpc/trstest/trs_muon_10cmdrift_good.fzd");
00098 geant->SetInputFile(InFile.Data());
00099 chain->SetInput("geom","geant:geom");
00100
00101
00102 StTrsMaker *tpc_raw = new StTrsMaker("Trs");
00103 tpc_raw->writeFile("test.trs",Nevents);
00104
00105
00106 int iInit = chain->Init();
00107
00108 if (iInit) chain->Fatal(iInit,"on init");
00109 gBenchmark->Start("trs");
00110
00111 for (Int_t i =1; i <= Nevents; i++){
00112 if (chain->Make(i)) break;
00113 if (i != Nevents) chain->Clear();
00114 printf ("===========================================\n");
00115 printf ("=========================================== Done with Event no. %d\n",i);
00116 printf ("===========================================\n");
00117 }
00118 if (Nevents > 1) {
00119 chain->Finish();
00120 gBenchmark->Print("trs");
00121 }
00122 else b = new TBrowser;
00123 }