21 class StEventDisplayMaker; StEventDisplayMaker *dsMk = 0;
28 gSystem->Load(
"St_base");
29 gSystem->Load(
"StChain");
30 gSystem->Load(
"StUtilities");
31 gSystem->Load(
"StBFChain");
34 gSystem->Load(
"StAnalysisUtilities");
37 if (chain)
delete chain;
40 void bfcMixer_v4_noFTPC(
const Int_t Nevents=10,
42 const Char_t *file1=
"/star/data03/daq/2004/090/st_physics_adc_5090009_raw_2060002.daq",
44 const Char_t *file2=
"./gtest.fz",
47 const Char_t *file3=
"./st_physics_adc_5090009_raw_2060002.vertices.dat",
48 const Float_t zvertex_low=-175.0,
49 const Float_t zvertex_high=175.0,
50 const Char_t *mode=
"strange",
51 const Char_t *acc_mode=
"off" )
54 if (gClassTable->GetID(
"StBFChain") < 0) Load();
64 saveMk = chain1->cd();
68 chain1->
SetFlags(
"in Physics DbV20060421 NoDefault -ittf");
69 chain1->Set_IO_Files(file1);
77 saveMk = chain2->cd();
79 chain2->
SetFlags(
"fzin DbV20060421 gen_T geomT sim_T tpc trs -tcl -tpt -PreVtx -tpc_daq -ittf");
80 chain2->Set_IO_Files(file2);
84 if (geantMk) geantMk->SetMode(1);
86 if (chain2->GetOption(
"TRS")){
88 trsMk->setNormalFactor(1.15);
92 if (!strcmp(mode,
"strange")){
93 if (!strcmp(acc_mode,
"on")){
95 Char_t *extraMaker =
"StV0AccMaker";
96 if (gClassTable->GetID(extraMaker) < 0) gSystem->Load(extraMaker);
98 if(extraMk)
delete extraMk;
99 extraMk = chain->New(extraMaker,
"before");
101 Char_t *before =
"Trs";
102 StMaker *trsmk = chain1->GetMaker(before);
103 if (trsmk) chain1->AddBefore(before,extraMk);
104 StV0AccCuts *cuts = ((StV0AccMaker *)extraMk)->GetCutsPtr();
106 cuts->SetV0MinDecayLen(0.);
107 cuts->SetV0DaughterMinImpact(0);
108 cuts->SetV0DaughterMinHit(10.);
109 cuts->SetXiV0MaxImpact(5);
110 cuts->SetXiMinDecayLen(2.);
111 cuts->SetXiV0PiMinImpact(0.);
112 cuts->SetXiDaughterMinHit(10.);
113 cuts->SetKinkMinDecayRad(128.);
114 cuts->SetKinkMaxDecayRad(184.);
123 gSystem->Load(
"StMixerMaker");
124 StMixerMaker *mixer =
new StMixerMaker(
"Mixer",
"daq",
"trs");
125 chain1->SetInput(
"Input1",
"StDAQReader");
126 chain2->SetInput(
"Input2",
"Event");
127 mixer->writeFile(
"mixer.trs",Nevents);
134 saveMk = chain3->cd();
144 chain3->
SetFlags(
"Simu NoDefault NoInput onlraw -onlcl ry2005b,tpc_daq,tpcI,svt_daq,SvtD,Physics,Idst,l0,tags,Tree,evout l3onl fcf emcDY2 fpd trgd ZDCvtx DbV20060421 useCDV ITTF tofDat -SvtIT MuDST -trg VFMinuit");
153 TString OutputFileName(gSystem->BaseName(file1));
154 OutputFileName.ReplaceAll(
"*",
"");
155 OutputFileName.ReplaceAll(
".daq",
"");
156 OutputFileName.Append(
".root");
157 cout <<
"AAR - Setting file output to: " <<OutputFileName.Data()<<endl;
159 chain3->Set_IO_Files(0,OutputFileName.Data());
164 StMaker *tpcdaqMk = chain3->GetMaker(
"tpc_raw");
167 cout <<
" Error: no tpc daq maker. End. "<<endl;
170 tpcdaqMk->SetMode(1);
171 tpcdaqMk->SetInput(
"Event",
"MixerEvent");
175 cout <<
"AAR - going to file"<<endl;
180 printf (
"QAInfo:Run is started at Date/Time%i/%i\n",t.GetDate(),t.GetTime());
182 printf (
"QAInfo:Run on %s in %s\n",
184 gSystem->WorkingDirectory());
185 printf (
"QAInfo: with %s\n", chain->GetCVS());
188 cout <<
"AAR - initializing the chain"<<endl;
192 cout <<
"AAR - in init if"<<endl;
193 Int_t iInit = chain->Init();
194 cout <<
"AAR - init value"<<iInit<<endl;
197 cout <<
"AAR - Getting Tree"<<endl;
199 treeMk = chain->GetMaker(
"tree");
201 Int_t iMake = 0, i = 1, iBad = 0;
203 cout <<
"AAR - Setting IOMaker"<<endl;
206 FILE *fp = fopen(file3,
"r");
208 Int_t ncols, eventnumber, mult, skip=0, oldskip = 0, skiptest=0;
209 printf(
"zvertex_low = %f zvertex_high = %f\n",zvertex_low, zvertex_high);
214 cout <<
"AAR - Entering Event Loop"<<endl;
215 EventLoop:
if (i <= Nevents && iMake !=
kStEOF && iMake !=
kStFatal) {
217 evnt.Start(
"QAInfo:");
222 ncols = fscanf(fp,
"%d %d %d %f %f %f",&eventnumber,&skip,&mult,&x,&y,&z);
225 printf(
"\nEvent number: %d Multiplicity = %d\n",eventnumber,mult);
226 printf(
"vertex in bfcMixer: %16f %16f %16f\n",x,y,z);
233 printf (
"bfcMixer: i = %i\n",i);
234 printf (
"bfcMixer: skip = %i\n",skip);
235 printf (
"bfcMixer: oldskip = %i\n",oldskip);
236 if (inpMk && skip>0) {
238 skiptest = inpMk->Skip(skip-oldskip-1);
239 printf(
"bfcMixer: skiptest1 = %i\n",skiptest);
240 skiptest = inpMk->Skip();
241 printf(
"bfcMixer: skiptest2 = %i\n",skiptest);
246 use
this to force the
vertex position to match:
249 iMake = chain->Make(i);
250 if (treeMk && iMake ==
kStErr) {treeMk->
Make(i); iBad++;}
253 *fEvtHddr = *fEvtHddrDaq;
255 evnt.Stop(
"QAInfo:");
257 printf (
"QAInfo: Done with Event [no. %d/run %d/evt. %d/Date.Time%d.%d/sta %d] Real Time = %10.2f seconds Cpu Time = %10.2f seconds \n", i,chain->
GetRunNumber(),chain->GetEventNumber(),chain->GetDate(), chain->GetTime(),
258 iMake,evnt.GetRealTime(
"QAInfo:"),evnt.GetCpuTime(
"QAInfo:"));
262 if(eventnumber == chain->GetEventNumber()){
263 printf(
"bfcMixer: Event number %d found in both .fz file and .daq file\n",eventnumber);
265 printf(
"bfcMixer: Error! Event number from .fz file: %d\n",eventnumber);
266 printf(
"bfcMixer: Error! Event number from .daq file: %d\n",chain->GetEventNumber());
267 printf(
"bfcMixer: Error! Events are out-of-sync, exiting!\n");
275 printf (
"QAInfo:Run completed ");
276 gSystem->Exec(
"date");
277 if (evMk) Event = (
StEvent *) chain->GetInputDS(
"StEvent");
280 printf (
"\nQAInfo:Run is finished at Date/Time%i/%i\n",t.GetDate(),t.GetTime());
virtual Int_t Instantiate()
Maker-instantiation handler.
virtual void Clear(Option_t *option="")
User defined functions.
void SetFlags(const Char_t *Chain="gstar tfs")
Scan all flags, check if they are correct, manipulate the comment if necessary.
virtual Int_t GetRunNumber() const
Returns the current RunNumber.
virtual Int_t Load()
Routine handling library loading depending on chain options.
virtual void SetActive(Bool_t k=kTRUE)
Setters for flags and switches.