StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bfcMixer_v5.C
1 //
3 // Macro for running chain with different inputs
4 //
5 // Owner: Yuri Fisyak
6 //
7 // $Id: bfcMixer_v5.C,v 1.3 2013/04/28 14:41:31 fisyak Exp $
8 // $Log: bfcMixer_v5.C,v $
9 // Revision 1.3 2013/04/28 14:41:31 fisyak
10 // Clean up after retirement of St_tpcdaq_Maker, StRTSClient and StMixer
11 //
12 // Revision 1.2 2013/04/24 15:27:28 fisyak
13 // Retire tpcdaq, StMixer, bug #2580
14 //
15 // Revision 1.1 2011/01/18 05:49:18 hmasui
16 // bfcMixer for different inputs
17 //
19 
20 //TBrowser *b = 0;
21 class StChain;
22 class StBFChain;
23 StChain *chain=0;
24 class StMaker;
25 StMaker *treeMk=0;
26 StBFChain *chain1, *chain2, *chain3;
27 class StEvent;
28 StEvent *Event;
29 class St_geant_Maker;
30 class StIOMaker;
31 class StEventDisplayMaker; StEventDisplayMaker *dsMk = 0;
32 //class StFtpcMixerMaker;
33 class StEvtHddr;
34 //_____________________________________________________________________
35 void Load(){
36  gSystem->Load("St_base");
37  gSystem->Load("StChain");
38  gSystem->Load("StUtilities");
39  gSystem->Load("StBFChain");
40  //Extra things to load for the acceptance filter
41  gSystem->Load("StarClassLibrary");
42  gSystem->Load("StAnalysisUtilities");
43 #if 0
44  gSystem->Load("StV0AccMaker.so");
45 #endif
46  if (chain) delete chain;
47 }
48 //_____________________________________________________________________
49 void bfcMixer_v5(const Int_t Nevents=10,
50  const Char_t *file1="/star/institutions/uky/rfatemi/AuAu62/st_physics_5086073_raw_3020008.daq",
51  const Char_t *file2="/star/institutions/uky/gorbunov/evgen.1.nt"
52 #if 0
53  const Char_t *file2="/star/institutions/uky/rfatemi/AuAu62/simulation_62/starlightrpii_1.fz",
54  const Char_t *file3="/home/starofl/embedding/GSTAR/st_physics_2270008_raw_0030.vertices.dat",
55  const Float_t zvertex_low=-175.0,
56  const Float_t zvertex_high=175.0,
57  const Char_t *mode="strange",
58  const Char_t *acc_mode="off"
59 #endif
60  )
61 {
62  // Dynamically link some shared libs
63  if (gClassTable->GetID("StBFChain") < 0) Load();
64 
65  // Create the main chain object
66  chain = new StChain("Embedding");
67 
68  StMaker *saveMk = 0;
69 
70  // Create chain1 object
71  chain1 = new StBFChain("One");
72  saveMk = chain1->cd();
73  // chain1->SetFlags("in NoDefault");
74  // chain1->SetFlags("in alltrigger NoDefault");
75  // chain1->SetFlags("in Physics DbV20020226 NoDefault");
76  chain1->SetFlags("in Physics DbV20050515 NoDefault");
77  chain1->Set_IO_Files(file1);
78  chain1->Load();
79  chain1->Instantiate();
80 
81  saveMk->cd();
82 
83  // Create chain2 object
84  chain2 = new StBFChain("Two");
85  saveMk = chain2->cd();
86  chain2->SetFlags("ntin DbV20050515 gen_T geomT sim_T ftpcT tpc trs fss -tcl -tpt -PreVtx -tpc_daq"); //
87  chain2->Set_IO_Files(file2);
88  chain2->Load();
89  chain2->Instantiate();
90  St_geant_Maker *geantMk = chain2->GetMaker("geant");
91  if (geantMk) geantMk->SetMode(1); // Mixer mode - do not modify EvtHddr
92 
93  if (chain2->GetOption("TRS")){
94  StTrsMaker *trsMk = (StTrsMaker *) chain2->GetMaker("Trs");
95  trsMk->setNormalFactor(1.22);
96  }
97 #if 0
98  // Add the acceptance filter maker before TRS
99  if (!strcmp(mode,"strange")){
100  if (!strcmp(acc_mode,"on")){
101 
102  Char_t *extraMaker = "StV0AccMaker";
103  if (gClassTable->GetID(extraMaker) < 0) gSystem->Load(extraMaker);
104  StMaker *extraMk = (StMaker *)chain1->GetMaker(extraMaker);
105  if(extraMk) delete extraMk;
106  extraMk = chain->New(extraMaker,"before");
107  if (extraMk) {
108  Char_t *before = "Trs";
109  StMaker *trsmk = chain1->GetMaker(before);
110  if (trsmk) chain1->AddBefore(before,extraMk);
111  StV0AccCuts *cuts = ((StV0AccMaker *)extraMk)->GetCutsPtr();
112  cuts->SetFilter();
113  cuts->SetV0MinDecayLen(0.);
114  cuts->SetV0DaughterMinImpact(0);
115  cuts->SetV0DaughterMinHit(10.);
116  cuts->SetXiV0MaxImpact(5);
117  cuts->SetXiMinDecayLen(2.);
118  cuts->SetXiV0PiMinImpact(0.);
119  cuts->SetXiDaughterMinHit(10.);
120  cuts->SetKinkMinDecayRad(128.);
121  cuts->SetKinkMaxDecayRad(184.);
122  }
123  }
124  }
125  // end additional maker code
126 #endif
127  saveMk->cd();
128  gSystem->Load("StFtpcMixerMaker");
129  StFtpcMixerMaker *ftpcmixer = new StFtpcMixerMaker("FtpcMixer","daq","fss");
130  ftpcmixer->SetInput("Input1","StDAQReader");
131  ftpcmixer->SetInput("Input2","Event");
132 
133  // Create chain3 object
134  chain3 = new StBFChain("Three");
135  saveMk = chain3->cd();
136 
137  // use Simu NoDefault NoInput onlraw -onlcl and standard chain options
138  // then take apart e.g. P2004/B2004 and remove corrections as well as
139  // in, physics, analyis and Event QA from Cdst, tags, SCEbyE
140  // also don't use hitfilt
141  // took out svtdEdx, emcDY2 too
142  // tested with SL06g
143  chain3->SetFlags("STpcMixer imu NoDefault NoInput onlraw -onlcl DbV20050515 ry2005d tpc_daq tpc ftpc event cdst Kalman Tree evout useCDV Xi2 V02 Kink2 CMuDst analysis MiniMcMk");
144  // P2005 DbV20050515 useCDV SCEbyE OGridLeak tofDat EST svtdEdx xiSvt pmdRaw Xi2 V02 Kink2 -dstout CMuDst OShortR OSpaceZ2 hitfilt
145  // chain3->SetFlags("NoDefault NoInput onlraw -onlcl P2005 DbV20050515 useCDV tofDat EST svtdEdx xiSvt pmdRaw Xi2 V02 Kink2 -dstout CMuDst");
146  // OShortR OSpaceZ2 hitfilt Stilibs
147  // chain3->SetFlags("NoDefault NoInput onlraw -onlcl DbV20050515 ry2005b Idst,IAna,l0,tpcI,fcf,ftpc,Tree,SvtCL,svtDb,logger,ITTF,Sti,SsdIt,SvtIt,genvtx,geant,evout,tags,bbcSim,tofsim,emcY2,EEfs,GeantOut,big,fzin,MiniMcMk");
148 
149  // StRTSClientFCF *fcfMk = (StRTSClientFCF *) chain3->GetMaker("");
150  // fcfMk->SetMode("0x1");
151 
152 
153  TString OutputFileName(gSystem->BaseName(file1));
154  OutputFileName.ReplaceAll("*","");
155  OutputFileName.ReplaceAll(".daq","");
156  OutputFileName.Append(".root");
157  chain3->Set_IO_Files(0,OutputFileName.Data());
158  chain3->Load();
159  chain3->Instantiate();
160  St_geant_Maker *geantMk = (St_geant_Maker *) chain->GetMaker("geant");
161  geantMk->SetActive(kTRUE);
162  // StMaker *ftpccluMk = chain3->GetMaker("ftpc_hits");
163  // ftpccluMk->SetInput("ftpc_raw","FtpcMixer");
164 
165  saveMk->cd();
166  {
167  TDatime t;
168  printf ("QAInfo:Run is started at Date/Time%i/%i\n",t.GetDate(),t.GetTime());
169  }
170  printf ("QAInfo:Run on %s in %s\n",
171  gSystem->HostName(),
172  gSystem->WorkingDirectory());
173  printf ("QAInfo: with %s\n", chain->GetCVS());
174 
175  // Init the chain and all its makers
176  if (Nevents >= 0) {
177  Int_t iInit = chain->Init();
178  }
179  //geantMk->Do("GSPREAD 0.1 0.1 30.");
180 
181 geantMk->Do("VSIG 0. 26.");
182 
183 geantMk->Do("VXYZ -0.13 0.08 0.0");
184 
185  // chain->SetDEBUG();
186  treeMk = chain->GetMaker("tree");
187  TBenchmark evnt;
188  Int_t iMake = 0, i = 1, iBad = 0;
189 
190  StIOMaker *inpMk = (StIOMaker *)chain1->GetMaker("inputStream");
191 #if 0
192  //comment this out cause I don't have the vertex files
193  //FILE *fp = fopen(file3,"r");
194  Float_t x = -0.13;
195  Float_t y = 0.08;
196  Float_t z = 0.0;
197  Int_t ncols, eventnumber, mult, skip=0, oldskip = 0, skiptest=0;
198  printf("zvertex_low = %f zvertex_high = %f\n",zvertex_low, zvertex_high);
199 
200  // vtxMk = (StVertexMaker*) chain3->GetMaker("vertex");
201 #endif
202 
203  chain->SetAttr(".Privilege",0,"*" ); //All makers are NOT priviliged
204  chain->SetAttr(".Privilege",1,"StIOInterFace::*" ); //All IO makers are priviliged
205  chain->SetAttr(".Privilege",1,"St_geant_Maker::*"); //It is also IO maker
206 
207 
208  inpMk->SetActive(kFALSE);
209  while(iMake == kStOk) {
210  inpMk->Clear();
211  chain->Clear();
212  int iretDaq = inpMk->Make();
213  //if (iretDaq!= kStEOF ) {
214  if ( (iretDaq!=kStOk) && (iretDaq!= kStEOF) ) {
215  inpMk->Close();
216  inpMk->Open();
217  iretDaq = inpMk->Make();
218  }
219  if (iretDaq) break;
220  iMake = chain->Make();
221  }
222 
223  // chain->EventLoop(Nevents);
224  gMessMgr->QAInfo() << "Run completed " << endm;
225  gSystem->Exec("date");
226  fflush(stdout);
227 }
228 
virtual Int_t Instantiate()
Maker-instantiation handler.
Definition: StBFChain.cxx:214
virtual void Clear(Option_t *opt)
User defined functions.
Definition: StIOMaker.cxx:252
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
void SetFlags(const Char_t *Chain="gstar tfs")
Scan all flags, check if they are correct, manipulate the comment if necessary.
Definition: StBFChain.cxx:1512
virtual Int_t Make()
Definition: StIOMaker.cxx:183
FTPC Mixer Maker, main part of FTPC embedding Framework.
virtual void Do(const Char_t *option="dcut cave x 0.1 10 10 0.03 0.03")
Executes a KUIP command.
Definition: Stypes.h:43
virtual Int_t Make()
Definition: StChain.cxx:110
Definition: AgUStep.h:26
virtual Int_t Load()
Routine handling library loading depending on chain options.
Definition: StBFChain.cxx:117
virtual void SetActive(Bool_t k=kTRUE)
Setters for flags and switches.
Definition: StMaker.h:208
Definition: Stypes.h:41