22 class StEventDisplayMaker; StEventDisplayMaker *dsMk = 0;
28 gSystem->Load(
"St_base");
29 gSystem->Load(
"StChain");
30 gSystem->Load(
"StUtilities");
31 gSystem->Load(
"StBFChain");
33 gSystem->Load(
"StarClassLibrary");
34 gSystem->Load(
"StAnalysisUtilities");
35 gSystem->Load(
"StV0AccMaker.so");
37 if (chain)
delete chain;
40 void bfcMixer_v4(
const Int_t Nevents=10,
41 const Char_t *file1=
"/auto/pdsfdv08/starprod/daq/2004/production62GeV/ReversedFullField/st_physics_adc_5090009_raw_2060002.daq",
42 const Char_t *file2=
"/home/starofl/embedding/GSTAR/gtest.fz",
43 const Char_t *file3=
"/home/starofl/embedding/GSTAR/st_physics_2270008_raw_0030.vertices.dat",
44 const Float_t zvertex_low=-175.0,
45 const Float_t zvertex_high=175.0,
46 const Char_t *mode=
"strange",
47 const Char_t *acc_mode=
"off" )
50 if (gClassTable->GetID(
"StBFChain") < 0) Load();
53 chain =
new StChain(
"Embedding");
59 saveMk = chain1->cd();
63 chain1->
SetFlags(
"in Physics DbV20050515 NoDefault svt_daq");
64 chain1->Set_IO_Files(file1);
72 saveMk = chain2->cd();
74 chain2->
SetFlags(
"fzin DbV20050515 gen_T geomT sim_T tpc trs -tcl -tpt -PreVtx -tpc_daq");
75 chain2->Set_IO_Files(file2);
79 if (geantMk) geantMk->SetMode(1);
81 if (chain2->GetOption(
"TRS")){
83 trsMk->setNormalFactor(1.22);
87 if (!strcmp(mode,
"strange")){
88 if (!strcmp(acc_mode,
"on")){
90 Char_t *extraMaker =
"StV0AccMaker";
91 if (gClassTable->GetID(extraMaker) < 0) gSystem->Load(extraMaker);
93 if(extraMk)
delete extraMk;
94 extraMk = chain->New(extraMaker,
"before");
96 Char_t *before =
"Trs";
97 StMaker *trsmk = chain1->GetMaker(before);
98 if (trsmk) chain1->AddBefore(before,extraMk);
99 StV0AccCuts *cuts = ((StV0AccMaker *)extraMk)->GetCutsPtr();
101 cuts->SetV0MinDecayLen(0.);
102 cuts->SetV0DaughterMinImpact(0);
103 cuts->SetV0DaughterMinHit(10.);
104 cuts->SetXiV0MaxImpact(5);
105 cuts->SetXiMinDecayLen(2.);
106 cuts->SetXiV0PiMinImpact(0.);
107 cuts->SetXiDaughterMinHit(10.);
108 cuts->SetKinkMinDecayRad(128.);
109 cuts->SetKinkMaxDecayRad(184.);
121 saveMk = chain3->cd();
131 chain3->
SetFlags(
"TpcMixer Simu NoDefault NoInput onlraw -onlcl DbV20050515 ry2005b tpc_daq tpc emcDY2 global dst Kalman event evout QA Tree GeantOut fcf ctf -Prevtx -nohits CMuDST ZDCvtx tofDat Xi2 Kink2 EST ToF svtEmbed SvtD svtdEdx xiSvt l3onl fpd eemcD pmdRaw EmbeddingShortCut");
137 TString OutputFileName(gSystem->BaseName(file1));
138 OutputFileName.ReplaceAll(
"*",
"");
139 OutputFileName.ReplaceAll(
".daq",
"");
140 OutputFileName.Append(
".root");
141 chain3->Set_IO_Files(0,OutputFileName.Data());
152 printf (
"QAInfo:Run is started at Date/Time%i/%i\n",t.GetDate(),t.GetTime());
154 printf (
"QAInfo:Run on %s in %s\n",
156 gSystem->WorkingDirectory());
157 printf (
"QAInfo: with %s\n", chain->GetCVS());
161 Int_t iInit = chain->Init();
164 treeMk = chain->GetMaker(
"tree");
166 Int_t iMake = 0, i = 1, iBad = 0;
169 FILE *fp = fopen(file3,
"r");
171 Int_t ncols, eventnumber, mult, skip=0, oldskip = 0, skiptest=0;
172 printf(
"zvertex_low = %f zvertex_high = %f\n",zvertex_low, zvertex_high);
176 EventLoop:
if (i <= Nevents && iMake !=
kStEOF && iMake !=
kStFatal) {
178 evnt.Start(
"QAInfo:");
183 ncols = fscanf(fp,
"%d %d %d %f %f %f",&eventnumber,&skip,&mult,&x,&y,&z);
186 printf(
"\nEvent number: %d Multiplicity = %d\n",eventnumber,mult);
187 printf(
"vertex in bfcMixer: %16f %16f %16f\n",x,y,z);
194 printf (
"bfcMixer: i = %i\n",i);
195 printf (
"bfcMixer: skip = %i\n",skip);
196 printf (
"bfcMixer: oldskip = %i\n",oldskip);
197 if (inpMk && skip>0) {
199 skiptest = inpMk->Skip(skip-oldskip-1);
200 printf(
"bfcMixer: skiptest1 = %i\n",skiptest);
201 skiptest = inpMk->Skip();
202 printf(
"bfcMixer: skiptest2 = %i\n",skiptest);
207 use
this to force the
vertex position to match:
210 iMake = chain->
Make(i);
211 if (treeMk && iMake ==
kStErr) {treeMk->
Make(i); iBad++;}
214 *fEvtHddr = *fEvtHddrDaq;
216 evnt.Stop(
"QAInfo:");
218 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(),
219 iMake,evnt.GetRealTime(
"QAInfo:"),evnt.GetCpuTime(
"QAInfo:"));
223 if(eventnumber == chain->GetEventNumber()){
224 printf(
"bfcMixer: Event number %d found in both .fz file and .daq file\n",eventnumber);
226 printf(
"bfcMixer: Error! Event number from .fz file: %d\n",eventnumber);
227 printf(
"bfcMixer: Error! Event number from .daq file: %d\n",chain->GetEventNumber());
228 printf(
"bfcMixer: Error! Events are out-of-sync, exiting!\n");
236 printf (
"QAInfo:Run completed ");
237 gSystem->Exec(
"date");
238 if (evMk) Event = (
StEvent *) chain->GetInputDS(
"StEvent");
241 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.