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