StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bfcMixer_Tpx.C
1 //
3 // Macro for running chain with different inputs
4 //
5 // Owner: Yuri Fisyak
6 //
7 // $Id: bfcMixer_Tpx.C,v 1.53 2020/01/22 15:06:31 starembd Exp $
8 //
9 // $Log: bfcMixer_Tpx.C,v $
10 // Revision 1.53 2020/01/22 15:06:31 starembd
11 // added options for Run16 dAu39 and dAu20
12 //
13 // Revision 1.52 2018/03/26 02:43:13 zhux
14 // added P17id Run16 dAu200 chain.
15 //
16 // Revision 1.51 2018/03/08 08:41:59 zhux
17 // default is flat in rapidity, not pseudo-rapidity.
18 //
19 // Revision 1.50 2018/03/08 08:40:32 zhux
20 // added P17id Run14 AuAu200 chain.
21 //
22 // Revision 1.49 2018/02/08 02:02:38 zhux
23 // added Run16 AuAu200 HFT/MTD chain.
24 //
25 // Revision 1.48 2018/01/11 19:06:26 genevb
26 // Update B/EEMC simulation chain options and maker ordering
27 //
28 // Revision 1.47 2017/11/04 03:12:53 zhux
29 // added P16ig Run14 AuAu200 st_WB chain
30 //
31 // Revision 1.46 2017/10/13 05:36:18 zhux
32 // added lines for pvranking/primemode cut switches. the default is off.
33 //
34 // Revision 1.45 2017/10/12 13:31:06 zhux
35 // add "Run9 pp500 P16ib" chain setting.
36 //
37 // Revision 1.44 2017/10/12 13:02:27 zhux
38 // added run15 pp200 pAu200 chains
39 //
40 // Revision 1.43 2017/10/02 09:28:09 zhux
41 // added chain for Run15 FXT AuAu4.5/AuAl4.9
42 //
43 // Revision 1.42 2017/10/02 04:22:05 zhux
44 // updated run14 auau200 HFT chain. removed 'NoPXLIT,NoSstIT,NoIstIT' from the chain, removed pxlhit,isthit from the chain.
45 //
46 // Revision 1.41 2017/08/09 09:13:24 zhux
47 // added run14 auau200 (p16id) chain
48 //
49 // Revision 1.40 2016/04/05 13:32:45 zhux
50 // added chain for : Run13 pp500; Run14 AuAu200 HFT & MTD; Run12 CuAu200.
51 //
52 // Revision 1.39 2015/07/11 02:04:02 zhux
53 // chain for Run14 Au+Au 14.5 added.
54 //
55 // Revision 1.38 2014/01/24 16:30:45 zhux
56 // added chain for run12 p+p 200GeV
57 //
58 // Revision 1.37 2013/04/02 00:14:43 zhux
59 // added chain for run12 U+U 193GeV
60 //
61 // Revision 1.35 2012/09/28 16:02:42 zhux
62 // Chain for Run 9 p+p 200 GeV (P11id) added; 'Embedding' option removed from Chain3 (see ticket #2419).
63 //
64 // Revision 1.34 2012/04/18 03:47:34 zhux
65 // Corrected string name for Run 11 Au+Au 19.6 GeV chain
66 //
67 // Revision 1.33 2012/04/13 17:39:11 cpowell
68 // Added chain options for P10ikAuAu62
69 //
70 // Revision 1.32 2012/03/27 15:50:44 cpowell
71 // Added chain options for P10ikAuAu39 (same as P10ihAuAu39)
72 //
73 // Revision 1.31 2012/02/17 20:47:36 fisyak
74 // Remove nodefault option from chain3
75 //
76 // Revision 1.30 2012/02/17 15:01:24 didenko
77 // add run 2011 chains
78 //
79 // Revision 1.29 2012/01/14 02:15:28 zhux
80 // Geometry tag addition in Chain3 removed, Chain2 geometry tags are all updated to the latest version (on 2011.1.14).
81 //
82 // Revision 1.28 2011/12/05 16:06:34 zhux
83 // latest geometry (y2010c) used in simulation chain (chain2) for P10ik
84 //
85 // Revision 1.27 2011/09/23 02:47:40 cpowell
86 // Chain for p+p 200 P10ic production added. Setup for W embedding included.
87 //
88 // Revision 1.26 2011/08/04 19:50:01 cpowell
89 // Flag included to embed Pythia events. This excludes StPrepEmbedmaker from the chain and runs starsim before reconstruction.
90 //
91 // Revision 1.25 2011/07/18 06:27:39 zhux
92 // The chain for p+p 500 P09ig production added
93 //
94 // Revision 1.24 2011/03/03 08:32:07 hmasui
95 // Put P10ic chain back for p+p, deleted in 1.21 by accident
96 //
98 
99 class StChain;
100 StChain *Chain=0;
101 class StBFChain;
102 StBFChain *chain1, *chain2, *chain3;
103 //_____________________________________________________________________
104 void bfcMixer_Tpx(Int_t Nevents=100,
105  const Char_t *daqfile="/star/rcf/test/daq/2009/embed/st_physics_adc_10128048_raw_1320001.daq",
106  const Char_t *tagfile="/star/rcf/test/daq/2009/embed/st_physics_adc_10128048_raw_1320001.tags.root",
107  Double_t pt_low=0.1,
108  Double_t pt_high=5.0,
109  Double_t eta_low=-1.5,
110  Double_t eta_high=1.5,
111  Double_t vzlow = -150.0,
112  Double_t vzhigh = 150.0,
113  Double_t vr = 100.0,
114  Int_t pid=9,
115  Double_t mult=100,
116  std::vector<Int_t> triggers = 0,
117  const Char_t *prodName = "P08iepp",
118  const Char_t* type = "FlatPt",
119  const bool bPythia = false,
120  const Char_t *fzdfile="test.fzd"
121  ){
122  // production chains for P08ic - p+p, Au+Au 9 GeV and d+Au
123  TString prodP08iepp("DbV20081117 B2008a ITTF IAna ppOpt l3onl emcDY2 fpd ftpc trgd ZDCvtx NosvtIT NossdIT Corr4 OSpaceZ2 OGridLeak3D VFMCE -hitfilt");
124 // TString prodP08icpp("DbV20080712,pp2008,ITTF,OSpaceZ2,OGridLeak3D,beamLine,VFMCE,TpxClu -VFPPV -hitfilt");
125 // TString prodP08icAuAu9("DbV20080709 P2008 ITTF VFMCE -hitfilt");
126 // TString prodP08icAuAu200("DbV20070101 P2008 ITTF VFMCE -hitfilt");
127 // TString prodP08icdAu("DbV20080712 P2008 ITTF OSpaceZ2 OGridLeak3D beamLine, VFMCE TpxClu -VFMinuit -hitfilt");
128  TString prodP08iedAu("DbV20090213 P2008 ITTF OSpaceZ2 OGridLeak3D beamLine VFMCE TpxClu -VFMinuit -hitfilt");
129  TString prodP10iapp("DbV20091001 pp2009c TpcRS ITTF OSpaceZ2 OGridLeak3D beamLine, VFMCE TpcRS -VFMinuit -hitfilt");
130 
131  // production chain for P10ic p+p RFF & FF
132  TString prodP10icpp200("DbV20100301 pp2009c ITTF BEmcChkStat btof Corr4 OSpaceZ2 OGridLeak3D VFMCE TpxClu -hitfilt");
133  // production chain for run 9 p+p 200 (P11id) RFF & FF
134  TString prodP11idpp200("DbV20120908,pp2009d,ITTF,BEmcChkStat,btof,fmsdat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-hitfilt");
135  // production chain for P09ig p+p 500 GeV RFF & FF
136  TString prodP09igpp500("DbV20091225 pp2009c ITTF BEmcChkStat btof Corr4 OSpaceZ2 OGridLeak3D VFMCE TpxClu -hitfilt");
137  // production chain for P11b p+p 500 GeV run 2009 st_W reproduction with fixed bug for Pt >= 20GeV (not using VFMCE)
138  TString prodP11ibpp500("DbV20110310 OGGVoltErr pp2009c ITTF VFPPVnoCTB BEmcChkStat beamLine Corr4 OSpaceZ2 OGridLeak3D");
139  prodP11ibpp500 += " VFPPVnoCTB beamLine TpxClu -VFMinuit -hitfilt";
140 
141  // BES Run10 chains
142  TString prodP10ikAuAu62("DbV20110413 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
143  TString prodP10ihAuAu39("DbV20100909 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
144  TString prodP10ikAuAu39("DbV20100909 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
145  TString prodP10ihAuAu11("DbV20100821 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
146  TString prodP10ihAuAu7("DbV20100821 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
147 
148  // Run10 Au+Au 200 GeV chain
149  TString prodP10ikAuAu200("DbV20101213 P2010a pmdReco btof BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D VFMCE TpxClu -VFMinuit -hitfilt");
150 
151  // Run11 Au+Au 200 GeV chain
152  TString prodP11idAuAu200("DbV20111124 P2011a pmdReco btof mtdDat BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D VFMCE TpxClu -VFMinuit -hitfilt");
153 
154  // Run11 Au+Au 27 GeV chain
155  TString prodP11idAuAu27("DbV20110911 P2011a btof mtddat pmdReco BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D VFMCE TpxClu -VFMinuit -hitfilt");
156 
157  // Run11 Au+Au 19.6 GeV chain
158  TString prodP11idAuAu19("DbV20110820 P2011a btof mtddat pmdReco BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D VFMCE TpxClu -VFMinuit -hitfilt");
159 
160  // Run11 pp 500 GeV chain
161  TString prodP11idpp500("DbV20110923 pp2011a btof mtddat fmsdat BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D VFMCE TpxClu -hitfilt");
162 
163  // Run12 U+U 193 GeV chain
164  TString prodP12idUU193("DbV20120921,P2012b,AgML,mtdDat,btof,fmsDat,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu -VFMinuit -hitfilt");
165 
166  // Run12 pp200 chain
167  TString prodP12idpp200("DbV20130212,pp2012b,AgML,mtdDat,btof,fmsDat,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-hitfilt");
168 
169  // Run13 pp500 chain
170  TString prodP14igpp500("DbV20140905,pp2013b,StiHftP,mtd,btof,fmsDat,fgt,fgtPoint,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-hitfilt");
171 
172  // Run14 AuAu15 chain
173  TString prodP14iiAuAu15("DbV20150110,P2014a,btof,mtd,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
174 
175  // Run14 AuAu200 chain (P15ic) (NO PXL/IST hits)
176  TString prodP15icAuAu200("DbV20150316,P2014a,btof,mtd,mtdCalib,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
177 
178  // Run14 AuAu200 MTD chain
179  TString prodP15ieAuAu200("DbV20150504,P2014a,btof,mtd,mtdCalib,pxlHit,istHit,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
180 
181  // Run12 CuAu200 chain
182  TString prodP15ieCuAu200("DbV20150529,P2012b,AgML,mtd,btof,fmsDat,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
183 
184  // Run14 AuAu200 chain (P16id) (NO PXL/IST hits)
185  TString prodP16idAuAu200("DbV20160418,P2014a,btof,mtd,mtdCalib,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
186 
187  // Run15 AuAu4.5 fxt chain
188  TString prodP16iaAuAu5("DbV20160126,DbV20150920_tpc_Calibrations,P2015b,mtd,btof,BEmcChkStat,CorrX,VFMCE,TpxClu,-VFMinuit,-hitfilt");
189 
190  // Run15 pp200 chains
191  TString prodP16idpp200("DbV20160418,DbV20161117_TPC_Calibrations,pp2015c,btof,mtd,mtdCalib,pp2pp,fmsDat,fmsPoint,fpsDat,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFPPVnoCTB,-VFPPV,-beamline,-hitfilt");
192 
193  // Run15 pAu200 chains
194  TString prodP16idpAu200("DbV20160710,DbV20161117_TPC_Calibrations,pp2015c,btof,mtd,mtdCalib,pp2pp,fmsDat,fmsPoint,fpsDat,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFPPVnoCTB,-VFPPV,-beamline,-hitfilt");
195 
196  // Run9 pp500 P16ib chain
197  TString prodP16ibpp500("DbV20110311,OGGVoltErr,pp2009c,ITTF,BEmcChkStat,btof,Corr4,OSpaceZ2,OGridLeak3D,DbV20151021_TOF_Calibrations,DbV20161021_tpc_Calibrations,VFMCE,TpxClu,-hitfilt");
198 
199  // Run14 AuAu200 st_WB chain (P16ig)
200  TString prodP16igAuAu200("DbV20160406,P2014a,StiCA,btof,mtd,mtdCalib,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
201 
202  // Run16 AuAu200 st_physics & st_mtd chain (P16ij)
203  TString prodP16ijAuAu200("DbV20161018,P2016a,StiCA,mtd,mtdCalib,btof,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
204 
205  // Run14 AuAu200 min. bias (P17id)
206  TString prodP17idAuAu200("DbV20150316 DbV20170712_trg_Calibrations,FiltTrg_JetCorrTrgs,P2014a,btof,mtd,mtdCalib,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
207 
208  // Run16 dAu200 chain (P17id)
209  TString prodP17iddAu200("DbV20161216,P2016a,StiCA,mtd,mtdCalib,btof,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
210 
211  // Run16 dAu39 chain (P17id)
212  TString prodP17iddAu39("DbV20170426,P2016a,StiCA,mtd,mtdCalib,btof,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
213 
214  // Run16 dAu20 chain (P17id)
215  TString prodP17iddAu20("DbV20170426,P2016a,StiCA,mtd,mtdCalib,btof,BEmcChkStat,CorrX,OSpaceZ2,OGridLeak3D,VFMCE,TpxClu,-VFMinuit,-hitfilt");
216 
217  TString geomP08ic("ry2008e");
218  TString geomP10ic("ry2009d");
219  TString geomP10ih("ry2010c");
220  TString geomP10ik(geomP10ih); // Same chain as P10ih
221  TString geomP11id("ry2011");
222  TString geomP12id("ry2012a");
223  TString geomP14ig("ry2013_1c");
224  TString geomP14ii("ry2014a");
225  TString geomP15ic("ry2014a");
226  TString geomP15ie("ry2014a");
227  TString geomP16id("ry2014a");
228  TString geomP16ia("ry2015b");
229  TString geomP16id_run15("ry2015c");
230  TString geomP16ig("ry2014a");
231  TString geomP16ij("ry2016a");
232  TString geomP17id("ry2014a");
233  TString geomP17id_run16("ry2016a");
234 
235  TString xgeom(" useXgeom");
236  TString chain1Opt("in,magF,tpcDb,NoDefault,TpxRaw,-ittf,NoOutput");
237  TString chain2Opt("gen_T,geomT,sim_T,TpcRS,-ittf,-tpc_daq,nodefault");
238  if(bPythia){
239  chain2Opt += ",fzin";
240  }
241  else {
242  chain2Opt += ",NoInput,PrepEmbed";
243  }
244  chain2Opt += " ";
245 
246  TString chain3Opt("");
247  if (prodName == "P08icpp") { chain3Opt = prodP08icpp; chain2Opt += geomP08ic;}
248  else if (prodName == "P08iepp") { chain3Opt = prodP08iepp; chain2Opt += geomP08ic;}
249  else if (prodName == "P08icAuAu9") { chain3Opt = prodP08icAuAu9; chain2Opt += geomP08ic;}
250  else if (prodName == "P08icdAu") { chain3Opt = prodP08icdAu; chain2Opt += geomP08ic;}
251  else if (prodName == "P08iedAu") { chain3Opt = prodP08iedAu; chain2Opt += geomP08ic;}
252  else if (prodName == "P08icAuAu200") { chain3Opt = prodP08icAuAu200; chain2Opt += geomP08ic;}
253  else if (prodName == "P09igpp500") { chain3Opt = prodP09igpp500; chain2Opt += geomP10ic;}
254  else if (prodName == "P11ibpp500") { chain3Opt = prodP11ibpp500; chain2Opt += geomP10ic;}
255  else if (prodName == "P10iapp") { chain3Opt = prodP10iapp; chain2Opt += geomP10ih;}
256  else if (prodName == "P10icpp200") { chain3Opt = prodP10icpp200; chain2Opt += geomP10ic;}
257  else if (prodName == "P11idpp200") { chain3Opt = prodP11idpp200; chain2Opt += geomP10ic;}
258  else if (prodName == "P10ikAuAu62") { chain3Opt = prodP10ikAuAu62; chain2Opt += geomP10ik;}
259  else if (prodName == "P10ihAuAu39") { chain3Opt = prodP10ihAuAu39; chain2Opt += geomP10ih;}
260  else if (prodName == "P10ikAuAu39") { chain3Opt = prodP10ikAuAu39; chain2Opt += geomP10ik;}
261  else if (prodName == "P10ihAuAu11") { chain3Opt = prodP10ihAuAu11; chain2Opt += geomP10ih;}
262  else if (prodName == "P10ihAuAu7") { chain3Opt = prodP10ihAuAu7; chain2Opt += geomP10ih;}
263  else if (prodName == "P10ikAuAu200") { chain3Opt = prodP10ikAuAu200; chain2Opt += geomP10ik;}
264  else if (prodName == "P11idAuAu200") { chain3Opt = prodP11idAuAu200; chain2Opt += geomP11id;}
265  else if (prodName == "P11idAuAu27") { chain3Opt = prodP11idAuAu27; chain2Opt += geomP11id;}
266  else if (prodName == "P11idAuAu19") { chain3Opt = prodP11idAuAu19; chain2Opt += geomP11id;}
267  else if (prodName == "P11idpp500") { chain3Opt = prodP11idpp500; chain2Opt += geomP11id;}
268  else if (prodName == "P12idUU193") { chain3Opt = prodP12idUU193; chain2Opt += geomP12id;}
269  else if (prodName == "P12idpp200") { chain3Opt = prodP12idpp200; chain2Opt += geomP12id;}
270  else if (prodName == "P14igpp500") { chain1Opt += xgeom; chain3Opt = prodP14igpp500; chain3Opt += ",mtdsim"; chain2Opt += geomP14ig;}
271  else if (prodName == "P14iiAuAu15") { chain1Opt += xgeom; chain3Opt = prodP14iiAuAu15; chain3Opt += ",mtdsim"; chain2Opt += geomP14ii;}
272  else if (prodName == "P15icAuAu200") { chain1Opt += xgeom; chain3Opt = prodP15icAuAu200; chain3Opt += ",mtdsim"; chain2Opt += geomP15ic;}
273  else if (prodName == "P15ieAuAu200") { chain1Opt += xgeom; chain3Opt = prodP15ieAuAu200; chain3Opt += ",mtdsim"; chain2Opt += geomP15ie;}
274  else if (prodName == "P15ieCuAu200") { chain3Opt = prodP15ieCuAu200; chain2Opt += geomP12id;}
275  else if (prodName == "P16idAuAu200") { chain1Opt += xgeom; chain3Opt = prodP16idAuAu200; chain3Opt += ",mtdsim"; chain2Opt += geomP16id;}
276  else if (prodName == "P16iaAuAu5") { chain1Opt += xgeom; chain3Opt = prodP16iaAuAu5; chain3Opt += ",mtdsim"; chain2Opt += geomP16ia;}
277  else if (prodName == "P16idpp200") { chain1Opt += xgeom; chain3Opt = prodP16idpp200; chain3Opt += ",mtdsim"; chain2Opt += geomP16id_run15;}
278  else if (prodName == "P16idpAu200") { chain1Opt += xgeom; chain3Opt = prodP16idpAu200; chain3Opt += ",mtdsim"; chain2Opt += geomP16id_run15;}
279  else if (prodName == "P16ibpp500") { chain3Opt = prodP16ibpp500; chain2Opt += geomP10ic;}
280  else if (prodName == "P16igAuAu200") { chain1Opt += xgeom; chain3Opt = prodP16igAuAu200; chain3Opt += ",mtdsim"; chain2Opt += geomP16ig;}
281  else if (prodName == "P16ijAuAu200") { chain1Opt += xgeom; chain3Opt = prodP16ijAuAu200; chain3Opt += ",mtdsim"; chain2Opt += geomP16ij;}
282  else if (prodName == "P17idAuAu200") { chain1Opt += xgeom; chain3Opt = prodP17idAuAu200; chain3Opt += ",mtdsim"; chain2Opt += geomP17id;}
283  else if (prodName == "P17iddAu200") { chain1Opt += xgeom; chain3Opt = prodP17iddAu200; chain3Opt += ",mtdsim"; chain2Opt += geomP17id_run16;}
284  else if (prodName == "P17iddAu39") { chain1Opt += xgeom; chain3Opt = prodP17iddAu39; chain3Opt += ",mtdsim"; chain2Opt += geomP17id_run16;}
285  else if (prodName == "P17iddAu20") { chain1Opt += xgeom; chain3Opt = prodP17iddAu20; chain3Opt += ",mtdsim"; chain2Opt += geomP17id_run16;}
286 
287  else {
288  cout << "Choice prodName " << prodName << " does not correspond to known chain. Processing impossible. " << endl;
289  return;
290  }
291  chain3Opt += ",TpcMixer,GeantOut,MiniMcMk,McAna,-in,NoInput,useInTracker,emcSim,BEmcMixer,EEfs,EEmcMixer";
292 
293  bool useEndcapSlowSim = true; // turn Endcap slow simu On/Off
294  if (useEndcapSlowSim) chain3Opt += ",EEss";
295 
296 
297  // Dynamically link some shared libs
298  gROOT->LoadMacro("bfc.C");
299  if (gClassTable->GetID("StBFChain") < 0) Load();
300  //______________Create the main chain object______________________________________
301  Chain = new StChain("Embedding");
302  //________________________________________________________________________________
303  bfc(-1,chain1Opt,daqfile);
304  chain1 = chain;
305  chain1->SetName("One");
306  Chain->cd();
307  //________________________________________________________________________________
308  if(bPythia){
309  bfc(-1,chain2Opt,fzdfile);
310  chain2 = chain;
311  chain2->SetName("Two");
312  Chain->cd();
313  if (chain2->GetOption("TRS")){
314  StTrsMaker *trsMk = (StTrsMaker *) chain2->GetMaker("Trs");
315  if (! trsMk) {
316  cout << "Cannot find Trs in chain2" << endl;
317  return;
318  }
319  trsMk->setNormalFactor(1.32);
320  }
321  }
322  else {
323  bfc(-1,chain2Opt);
324  chain2 = chain;
325  chain2->SetName("Two");
326  Chain->cd();
327  }
328 #if 0
329  if (chain2->GetOption("TRS")){
330  StTrsMaker *trsMk = (StTrsMaker *) chain2->GetMaker("Trs");
331  if (! trsMk) {
332  cout << "Cannot find Trs in chain2" << endl;
333  return;
334  }
335  trsMk->setNormalFactor(1.32);
336  trsMk->SetMode(0);
337  }
338 #endif
339  //________________________________________________________________________________
340  // gSystem->Load("StFtpcMixerMaker");
341  // StFtpcMixerMaker *ftpcmixer = new StFtpcMixerMaker("FtpcMixer","daq","trs");
342  //________________________________________________________________________________
343  TString OutputFileName(gSystem->BaseName(daqfile));
344  OutputFileName.ReplaceAll("*","");
345  OutputFileName.ReplaceAll(".daq","");
346  // OutputFileName.Append("_emb.root");
347  OutputFileName.Append(".root");
348  bfc(-1,chain3Opt,0,OutputFileName);
349  chain3 = chain;
350  chain3->SetName("Three");
351  Chain->cd();
352  //________________________________________________________________________________
353  StTpcMixerMaker *mixer = (StTpcMixerMaker *) chain3->Maker("TpcMixer");
354  if( prodName == "P08icAuAu200")
355  {
356  mixer->SetInput("Input1","MixerEvent");
357  }
358  else
359  {
360  mixer->SetInput("Input1","TpxRaw/.data/Event");
361  }
362 
363  if (chain2Opt.Contains("TpcRS",TString::kIgnoreCase)) {
364  mixer->SetInput("Input2","TpcRS/Event");
365  } else {
366  mixer->SetInput("Input2","Trs/.const/Event");
367  }
368  Chain->cd();
369 
370  //.............. Ensure EEmc maker order here ....................
371 
372  // EEMC fast simulator should be run, even if slow simulator is run (Ting Lin)
373  StEEmcFastMaker *eemcFastSim = (StEEmcFastMaker*) chain3->Maker("eefs");
374  if (!eemcFastSim) eemcFastSim = (StEEmcFastMaker*) chain3->Maker("EEmcFastSim");
375  if (!eemcFastSim) eemcFastSim = new StEEmcFastMaker();
376  eemcFastSim->SetEmbeddingMode();
377  // eemcFastSim->SetDebug();
378 
379  StEEmcMixerMaker* eemcMixer = (StEEmcMixerMaker *) chain3->Maker("EEmcMixer");
380  if (!eemcMixer) cout << "ERROR in finding EEMC Mixer!" << endl;
381  // eemcMixer->SetDebug();
382  chain3->AddBefore(eemcMixer->GetName(),eemcFastSim);
383 
384  if (useEndcapSlowSim) {
385  StEEmcSlowMaker *eemcSlowSim = (StEEmcSlowMaker*) chain3->Maker("eess");
386  if (!eemcSlowSim) cout << "ERROR in finding EEMC Slow Simulator!" << endl;
387  eemcSlowSim->setEmbeddingMode();
388  chain3->AddBefore(eemcMixer->GetName(),eemcSlowSim);
389  }
390 
391  StMcEventMaker* mcEventMaker = (StMcEventMaker *) chain3->Maker("StMcEventMaker");
392  if (!mcEventMaker) mcEventMaker = new StMcEventMaker();
393  chain3->AddAfter(eemcMixer->GetName(),mcEventMaker);
394 
395 
396 
397  //________________________________________________________________________________
398  {
399  TDatime t;
400  gMessMgr->QAInfo() << Form("Run is started at Date/Time %i/%i",t.GetDate(),t.GetTime()) << endm;
401  }
402  gMessMgr->QAInfo() << Form("Run on %s in %s",gSystem->HostName(),gSystem->WorkingDirectory()) << endm;
403  gMessMgr->QAInfo() << Form("with %s", Chain->GetCVS()) << endm;
404  // embedded particle set
405  if(!bPythia){
406  StPrepEmbedMaker *embMk = (StPrepEmbedMaker *) Chain->Maker("PrepEmbed");
407  if (! embMk) return;
408  cout << "bfcMixer: Setting PID: "<<pid<<endl;
409  embMk->SetTagFile(tagfile);
410  // pTlow,ptHigh,etaLow,etaHigh,phiLow,phiHigh
411  embMk->SetOpt( pt_low, pt_high, eta_low, eta_high, 0., 6.283185, type);
412  // pid, mult
413  embMk->SetPartOpt( pid,mult);
414 
415  // Default is no event selections
416  embMk->SetSkipMode(kTRUE);
417 
418  embMk->SetTemp(0.35);
419 
420  //embMk->SetRapidityMode(kFALSE); //default is 'kTRUE'
421 
422  //Switch to prime mode for nucleus (with geantID > 10000) embedding, default is 'kFALSE'
423  //embMk->SetPrimeMode(kTRUE);
424 
425  // Make trigger and z-vertex cuts (only if SkipMode is true)
426  // Trigger cut
427  // Can put multiple trigger id's
428  if ( !triggers.empty() ){
429  for(std::vector<Int_t>::iterator iter = triggers.begin(); iter != triggers.end(); iter++){
430  embMk->SetTrgOpt((*iter)) ;
431  }
432  }
433  // z-vertex cuts
434  embMk->SetZVertexCut(vzlow, vzhigh) ;
435  // vr = sqrt{vx^2 + vy^2} cut
436  embMk->SetVrCut(vr);
437 
438  //cut on VpdVz, need moretags.root
439  //embMk->SetVpdVzCutMode(kTRUE);
440  //embMk->SetVpdVzCut(3);
441 
442  //cut on PVranking, need moretags.root
443  //embMk->SetPVRankCutMode(kTRUE);
444  //embMk->SetPVRankCut(0); // pvrank > 0
445 
446  }
447 
448  TAttr::SetDebug(0);
449  Chain->SetAttr(".Privilege",0,"*" ); //All makers are NOT priviliged
450  Chain->SetAttr(".Privilege",1,"StBFChain::*" ); //StBFChain is priviliged
451  Chain->SetAttr(".Privilege",1,"StIOInterFace::*" ); //All IO makers are priviliged
452  Chain->SetAttr(".Privilege",1,"St_geant_Maker::*"); //It is also IO maker
453  if(!bPythia)Chain->SetAttr(".Privilege",1,"StPrepEmbedMaker::*"); //It is also IO maker
454  // Chain->SetDEBUG(0);
455  if (Nevents < 0) return;
456  Int_t iInit = Chain->Init();
457  if (iInit >= kStEOF) {Chain->FatalErr(iInit,"on init"); return;}
458  StMaker *treeMk = Chain->GetMaker("outputStream");
459  Chain->EventLoop(Nevents,treeMk);
460  gMessMgr->QAInfo() << "Run completed " << endm;
461  gSystem->Exec("date");
462 }
463 //________________________________________________________________________________
464 void bfcMixer_Tpx(Int_t Nevents, const Char_t *daqfile, Char_t *tagfile,
465  Double_t pt_low, Double_t pt_high, Double_t eta_low, Double_t eta_high,
466  Double_t vzlow, Double_t vzhigh, Double_t vr, Int_t pid, Double_t mult,
467  const Char_t *triggersC, const Char_t *prodName, const Char_t* type) {
468  std::vector<Int_t> triggers;
469  if (triggersC) {
470  TPMERegexp pm(":");
471  Int_t N = pm.Split(triggersC);
472  for (Int_t i = 0; i < N; i++) {
473  TString num(pm[i]);
474  triggers.push_back(num.Atoi());
475  }
476  }
477  bfcMixer_Tpx(Nevents, daqfile, tagfile, pt_low, pt_high, eta_low, eta_high, vzlow, vzhigh, vr, pid, mult, triggers, prodName, type);
478 }
Prepare GEANT Maker with input from embedding settings and DAQ event.
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...
Definition: Stypes.h:43
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237
void SetOpt(const Double_t ptlow, const Double_t pthigh, const Double_t etalow, const Double_t etahigh, const Double_t philow, const Double_t phihigh, const TString type="FlatPt")
Set geantid(pid) and multiplicity.
virtual Int_t Load()
Routine handling library loading depending on chain options.
Definition: StBFChain.cxx:117
void setEmbeddingMode(Bool_t e=true)
Sets all switches required to perform embedding.
Slow simulator for EEMC.