00001
00002
00003
00004
00005
00006
00007
00008
00010
00011
00012 class StChain;
00013 class StBFChain;
00014 StChain *chain=0;
00015 class StMaker;
00016 StMaker *treeMk=0;
00017 StBFChain *chain1, *chain2, *chain3;
00018 class StEvent;
00019 StEvent *Event;
00020 class St_geant_Maker;
00021 class StIOMaker;
00022 class StEventDisplayMaker; StEventDisplayMaker *dsMk = 0;
00023 class StMixerMaker;
00024
00025 class StEvtHddr;
00026
00027 void Load(){
00028 gSystem->Load("St_base");
00029 gSystem->Load("StChain");
00030 gSystem->Load("StUtilities");
00031 gSystem->Load("StBFChain");
00032
00033 gSystem->Load("StarClassLibrary");
00034 gSystem->Load("StAnalysisUtilities");
00035 #if 0
00036 gSystem->Load("StV0AccMaker.so");
00037 #endif
00038 if (chain) delete chain;
00039 }
00040
00041 void bfcMixer_FullPythia(const Int_t Nevents=10,
00042 const Char_t *file1="/star/institutions/uky/rfatemi/AuAu62/st_physics_5086073_raw_3020008.daq",
00043 const Char_t *file2="/star/institutions/bnl/fisyak/bug1970/evgen.1.nt"
00044 #if 0
00045 const Char_t *file2="/star/institutions/uky/rfatemi/AuAu62/simulation_62/starlightrpii_1.fz",
00046 const Char_t *file3="/home/starofl/embedding/GSTAR/st_physics_2270008_raw_0030.vertices.dat",
00047 const Float_t zvertex_low=-175.0,
00048 const Float_t zvertex_high=175.0,
00049 const Char_t *mode="strange",
00050 const Char_t *acc_mode="off"
00051 #endif
00052 )
00053 {
00054
00055 if (gClassTable->GetID("StBFChain") < 0) Load();
00056
00057
00058 chain = new StChain("Embedding");
00059
00060 StMaker *saveMk = 0;
00061
00062
00063 chain1 = new StBFChain("One");
00064 saveMk = chain1->cd();
00065
00066
00067
00068 chain1->SetFlags("in Physics DbV20050515 NoDefault");
00069 chain1->Set_IO_Files(file1);
00070 chain1->Load();
00071 chain1->Instantiate();
00072
00073 saveMk->cd();
00074
00075
00076 chain2 = new StBFChain("Two");
00077 saveMk = chain2->cd();
00078 chain2->SetFlags("ntin DbV20050515 gen_T geomT sim_T tpc trs -tcl -tpt -PreVtx -tpc_daq");
00079 chain2->Set_IO_Files(file2);
00080 chain2->Load();
00081 chain2->Instantiate();
00082 St_geant_Maker *geantMk = chain2->GetMaker("geant");
00083 if (geantMk) geantMk->SetMode(1);
00084
00085 if (chain2->GetOption("TRS")){
00086 StTrsMaker *trsMk = (StTrsMaker *) chain2->GetMaker("Trs");
00087 trsMk->setNormalFactor(1.22);
00088 }
00089 #if 0
00090
00091 if (!strcmp(mode,"strange")){
00092 if (!strcmp(acc_mode,"on")){
00093
00094 Char_t *extraMaker = "StV0AccMaker";
00095 if (gClassTable->GetID(extraMaker) < 0) gSystem->Load(extraMaker);
00096 StMaker *extraMk = (StMaker *)chain1->GetMaker(extraMaker);
00097 if(extraMk) delete extraMk;
00098 extraMk = chain->New(extraMaker,"before");
00099 if (extraMk) {
00100 Char_t *before = "Trs";
00101 StMaker *trsmk = chain1->GetMaker(before);
00102 if (trsmk) chain1->AddBefore(before,extraMk);
00103 StV0AccCuts *cuts = ((StV0AccMaker *)extraMk)->GetCutsPtr();
00104 cuts->SetFilter();
00105 cuts->SetV0MinDecayLen(0.);
00106 cuts->SetV0DaughterMinImpact(0);
00107 cuts->SetV0DaughterMinHit(10.);
00108 cuts->SetXiV0MaxImpact(5);
00109 cuts->SetXiMinDecayLen(2.);
00110 cuts->SetXiV0PiMinImpact(0.);
00111 cuts->SetXiDaughterMinHit(10.);
00112 cuts->SetKinkMinDecayRad(128.);
00113 cuts->SetKinkMaxDecayRad(184.);
00114 }
00115 }
00116 }
00117
00118 #endif
00119 saveMk->cd();
00120
00121
00122 gSystem->Load("StMixerMaker");
00123 StMixerMaker *mixer = new StMixerMaker("Mixer","daq","trs");
00124 chain1->SetInput("Input1","StDAQReader");
00125 chain2->SetInput("Input2","Event");
00126
00127
00128
00129
00130
00131
00132 chain3 = new StBFChain("Three");
00133 saveMk = chain3->cd();
00134
00135
00136
00137
00138
00139
00140
00141 chain3->SetFlags("Simu NoDefault NoInput onlraw -onlcl DbV20050515 ry2005d tpc_daq tpc event cdst Kalman Tree evout useCDV Xi2 V02 Kink2 CMuDst analysis MiniMcMk");
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 TString OutputFileName(gSystem->BaseName(file1));
00152 OutputFileName.ReplaceAll("*","");
00153 OutputFileName.ReplaceAll(".daq","");
00154 OutputFileName.Append(".root");
00155 chain3->Set_IO_Files(0,OutputFileName.Data());
00156 chain3->Load();
00157 chain3->Instantiate();
00158 St_geant_Maker *geantMk = (St_geant_Maker *) chain->GetMaker("geant");
00159 geantMk->SetActive(kTRUE);
00160 StMaker *tpcdaqMk = chain3->GetMaker("tpc_raw");
00161 tpcdaqMk->SetMode(1);
00162 tpcdaqMk->SetInput("Event","MixerEvent");
00163
00164
00165
00166
00167 saveMk->cd();
00168 {
00169 TDatime t;
00170 printf ("QAInfo:Run is started at Date/Time%i/%i\n",t.GetDate(),t.GetTime());
00171 }
00172 printf ("QAInfo:Run on %s in %s\n",
00173 gSystem->HostName(),
00174 gSystem->WorkingDirectory());
00175 printf ("QAInfo: with %s\n", chain->GetCVS());
00176
00177
00178 if (Nevents >= 0) {
00179 Int_t iInit = chain->Init();
00180 }
00181 geantMk->Do("GSPREAD 0.1 0.1 30.");
00182
00183 treeMk = chain->GetMaker("tree");
00184 TBenchmark evnt;
00185 Int_t iMake = 0, i = 1, iBad = 0;
00186
00187 StIOMaker *inpMk = (StIOMaker *)chain1->GetMaker("inputStream");
00188 #if 0
00189
00190
00191 Float_t x = -0.13;
00192 Float_t y = 0.08;
00193 Float_t z = 0.0;
00194 Int_t ncols, eventnumber, mult, skip=0, oldskip = 0, skiptest=0;
00195 printf("zvertex_low = %f zvertex_high = %f\n",zvertex_low, zvertex_high);
00196
00197
00198 #endif
00199
00200 chain->SetAttr(".Privilege",0,"*" );
00201 chain->SetAttr(".Privilege",1,"StIOInterFace::*" );
00202 chain->SetAttr(".Privilege",1,"St_geant_Maker::*");
00203
00204
00205 inpMk->SetActive(kFALSE);
00206 while(iMake == kStOk) {
00207 inpMk->Clear();
00208 chain->Clear();
00209 int iretDaq = inpMk->Make();
00210
00211 if ( (iretDaq!=kStOk) && (iretDaq!= kStEOF) ) {
00212 inpMk->Close();
00213 inpMk->Open();
00214 iretDaq = inpMk->Make();
00215 }
00216 if (iretDaq) break;
00217 iMake = chain->Make();
00218 }
00219
00220
00221 gMessMgr->QAInfo() << "Run completed " << endm;
00222 gSystem->Exec("date");
00223 fflush(stdout);
00224 }
00225