StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bfcMixer_Jet.C
1 //
3 // $Id: bfcMixer_Jet.C,v 1.1 2021/02/18 02:48:31 starembd Exp $
4 //
5 // $Log: bfcMixer_Jet.C,v $
6 // Revision 1.1 2021/02/18 02:48:31 starembd
7 // bfcMixer for Jet embedding
8 //
9 //
10 // JET EMBEDDING MACRO
11 //
12 // Pibero Djawotho <pibero@tamu.edu>
13 // Texas A&M University
14 // 27 July 2011
15 //
17 
18 class StChain;
19 StChain* Chain = 0;
20 
21 class StBFChain;
22 StBFChain* chain1 = 0;
23 StBFChain* chain2 = 0;
24 StBFChain* chain3 = 0;
25 
26 //_____________________________________________________________________
27 void bfcMixer_Jet(const Int_t Nevents = 10,
28  const Char_t* daqfile = "@run16078031.list",
29  const Char_t* fzdfile = "pt15_20_16078031_1.fzd",
30  const Char_t* prodName = "P16idpp200RFF",
31  const Char_t* DbVoption = "DbV20160418"){
32 
33  // Production chains for P08ic - p+p, Au+Au 9 GeV and d+Au
34  TString prodP08iepp("DbV20081117 B2008a ITTF IAna ppOpt l3onl emcDY2 fpd ftpc trgd ZDCvtx NosvtIT NossdIT Corr4 OSpaceZ2 OGridLeak3D VFMCE -hitfilt");
35  TString prodP08iedAu("DbV20090213 P2008 ITTF OSpaceZ2 OGridLeak3D beamLine VFMCE TpxClu -VFMinuit -hitfilt");
36  TString prodP10iapp("DbV20091001 pp2009c TpcRS ITTF OSpaceZ2 OGridLeak3D beamLine, VFMCE TpcRS -VFMinuit -hitfilt");
37 
38  // BES Run10 chains
39  TString prodP10ihAuAu39("DbV20100909 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
40  TString prodP10ihAuAu11("DbV20100821 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
41  TString prodP10ihAuAu7("DbV20100821 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
42 
43  // Run 9 500 GeV chain for W from Jan Balewski
44  TString prodP09igpp500("DbV20101215 OGGVoltErr pp2009c ITTF VFPPVnoCTB BEmcChkStat beamLine Corr4 OSpaceZ2 OGridLeak3D -dstout -evout");
45 
46  // Run 9 200 GeV chain for jet embedding
47  TString prodP10icpp200("pp2009c ITTF VFPPVnoCTB beamLine BEmcChkStat btof fmsdat Corr4 OSpaceZ2 OGridLeak3D");
48 
49  // Run 9 200 GeV FF chain
50  // NOTE: "Sti" needs to be added for this chain to work !!!
51  TString prodP11idpp200FF("DbV20120622 pp2009d ITTF Sti VFPPVnoCTB beamLine BEmcChkStat btof fmsdat Corr4 OSpaceZ2 OGridLeak3D -hitfilt");
52 
53  // Run 9 pp200 RFF chain
54  // Added "Sti" just in case
55  TString prodP11idpp200RFF("DbV20120908 pp2009d ITTF Sti VFPPVnoCTB beamLine BEmcChkStat btof fmsdat Corr4 OSpaceZ2 OGridLeak3D -hitfilt");
56 
57  //Run12 pp500 RFF chain
58  // Will not run without Sti !!!
59  TString prodP12iapp500RFF("DbV20121219 pp2012b Sti AgML mtdDat btof fmsDat VFPPVnoCTB beamline BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D -hitfilt");
60  // Run12 pp500 P13ib production
61  TString prodP13ibpp500RFF("DbV20130212 pp2012b AgML mtdDat btof fmsDat VFPPVnoCTB useBTOF4Vtx beamline BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D -evout -hitfilt");
62 
63  // Run13 pp500 P14ia production
64  TString prodP14iapp500RFF("DbV20140222 DbV20160325_EMC_Calibrations DbV20170831_TRG_Calibrations pp2013a mtd btof Sti fmsDat fgt fgtPoint VFPPVnoCTB beamline BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D -hitfilt"); //Amilkar: Same as official production but include "Sti" to activate Sti tool kit (if not there is an error check StGenericVertexMaker/StPPVertexFinder.cxx line 124). Also add the PPV boost http://www.star.bnl.gov/HyperNews-star/protected/get/starpwgc/4154.html. 13 Sep 2018 remove DbV20160325_tracker_Calibrations
65  //Zilong has in the run 12 request "DbV20160325_EMC_Calibrations DbV20160325_TRG_Calibrations", https://drupal.star.bnl.gov/STAR/system/files/Run12pp500EmbeddingRequest.pdf
66 
67  // Run13 pp500 P14ig production TEST 30 Sep 2018
68  TString prodP14igpp500RFF("DbV20140905 DbV20160325_EMC_Calibrations DbV20170831_TRG_Calibrations pp2013b mtd btof Sti fmsDat fgt fgtPoint VFPPVnoCTB beamline StiHftP BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D -hitfilt -evout"); // //Amilkar:Same as official production but include "Sti" to activate Sti tool kit (if not there is an error check StGenericVertexMaker/StPPVertexFinder.cxx line 124). Also add the PPV boost http://www.star.bnl.gov/HyperNews-star/protected/get/starpwgc/4154.html. The production was not doen with PPV boost so the embedding should not also. Contacted Jinlong for the exact date of the run 13 gain calibration was uploaded 20160930, (update 4 Oct 2018) but using DbV20161001_EMC_Calibrations does not work.
69 
70  // Run15 pp200 P16id production
71  //TString prodP16idpp200RFF("DbV20160418 DbV20181115_EMC_Calibrations DbV20170831_TRG_Calibrations pp2015c btof mtd mtdCalib pp2pp fmsDat fmsPoint fpsDat BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt");
72 
73  // Run15 pp200 P16id production
74 // TString prodP16idpp200RFF("DbV20160418 DbV20190702_EMC_Calibrations DbV20170831_TRG_Calibrations pp2015c btof mtd mtdCalib pp2pp fmsDat fmsPoint fpsDat BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt");
75 // TString prodP16idpp200RFF("DbV20160418 DbV20190702_EMC_Calibrations DbV20190702_EEMC_Calibrations DbV20190702_TRG_Calibrations pp2015c Sti mtd mtdCalib pp2pp BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt");
76 
77 // TString prodP16idpp200RFF("DbV20160418 DbV20190702_EMC_Calibrations DbV20190702_EEMC_Calibrations DbV20190702_TRG_Calibrations pp2015c btof mtd mtdCalib pp2pp fmsDat fmsPoint fpsDat BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt"); // use in 20190928
78  TString prodP16idpp200RFF("DbV20160418 DbV20190702_EMC_Calibrations DbV20190702_EEMC_Calibrations DbV20190702_TRG_Calibrations pp2015c btof Sti mtd mtdCalib pp2pp fmsDat fmsPoint fpsDat BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt"); // use in 20191205 add Sti
79 
80  //TString prodP16idpp200RFF("DbV20160310 DbV20181115_EMC_Calibrations DbV20170831_TRG_Calibrations pp2015c btof mtd mtdCalib pp2pp fmsDat fmsPoint fpsDat BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt");
81 
82  // Run15 pAu200 P16id production
83  TString prodP16idpAu200RFF("DbV20160710 pp2015c btof mtd mtdCalib pp2pp fmsDat fmsPoint fpsDat BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt");
84 
85 
86  // Additional tags needed for embedding
87  prodP09igpp500 += " TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
88  prodP10icpp200 += " TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
89  prodP11idpp200FF += " TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
90  prodP11idpp200RFF += " TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
91  prodP12iapp500RFF += " TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
92  prodP13ibpp500RFF += " TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
93  prodP14iapp500RFF += " TpxClu ";
94  prodP14igpp500RFF += " TpxClu ";
95  prodP16idpp200RFF += " TpxClu -VFMinuit VFPPVnoCTB beamLine";
96  prodP16idpAu200RFF+= " TpxClu ";
97 
98  TString geomP08ic("ry2008");
99  TString geomP10ih("ry2010");
100  TString geomP09ig("ry2009a");
101  TString geomP10ic("ry2009a");
102  TString geomP11id("ry2009d");
103  TString geomP12ia("ry2012a");
104  TString geomP13ib("ry2012a");
105  TString geomP14ia("ry2013_2c");
106  TString geomP14ig("ry2013_1c");
107  TString geomP16id("ry2015c");
108 
109  TString chain1Opt("in,magF,tpcDb,NoDefault,TpxRaw,-ittf,NoOutput");
110  TString chain2Opt("fzin,gen_T,geomT,sim_T,TpcRS,-ittf,-tpc_daq,nodefault");
111  chain2Opt += " ";
112 
113  TString chain3Opt;
114  if (prodName == "P08icpp") { chain3Opt = prodP08icpp; chain2Opt += geomP08ic; }
115  else if (prodName == "P08iepp") { chain3Opt = prodP08iepp; chain2Opt += geomP08ic; }
116  else if (prodName == "P08icAuAu9") { chain3Opt = prodP08icAuAu9; chain2Opt += geomP08ic; }
117  else if (prodName == "P08icdAu") { chain3Opt = prodP08icdAu; chain2Opt += geomP08ic; }
118  else if (prodName == "P08iedAu") { chain3Opt = prodP08iedAu; chain2Opt += geomP08ic; }
119  else if (prodName == "P08icAuAu200") { chain3Opt = prodP08icAuAu200; chain2Opt += geomP08ic; }
120  else if (prodName == "P10iapp") { chain3Opt = prodP10iapp; chain2Opt += geomP10ih; }
121  else if (prodName == "P10ihAuAu39") { chain3Opt = prodP10ihAuAu39; chain2Opt += geomP10ih; }
122  else if (prodName == "P10ihAuAu11") { chain3Opt = prodP10ihAuAu11; chain2Opt += geomP10ih; }
123  else if (prodName == "P10ihAuAu7") { chain3Opt = prodP10ihAuAu7; chain2Opt += geomP10ih; }
124  else if (prodName == "P09igpp500") { chain3Opt = prodP09igpp500; chain2Opt += geomP09ig; }
125  else if (prodName == "P10icpp200") { chain3Opt = prodP10icpp200; chain2Opt += geomP10ic; }
126  else if (prodName == "P11idpp200FF") { chain3Opt = prodP11idpp200FF; chain2Opt += geomP11id; }
127  else if (prodName == "P11idpp200RFF"){ chain3Opt = prodP11idpp200RFF; chain2Opt += geomP11id; }
128  else if (prodName == "P12iapp500RFF") { chain3Opt = prodP12iapp500RFF; chain2Opt += geomP12ia; }
129  else if (prodName == "P13ibpp500RFF") { chain3Opt = prodP13ibpp500RFF; chain2Opt += geomP13ib; }
130  else if (prodName == "P14iapp500RFF") { chain1Opt += " useXgeom"; chain3Opt = prodP14iapp500RFF; chain2Opt += geomP14ia; }
131  else if (prodName == "P14igpp500RFF") { chain3Opt = prodP14igpp500RFF; chain2Opt += geomP14ig; }
132  else if (prodName == "P16idpp200RFF") { chain1Opt += " useXgeom"; chain3Opt = prodP16idpp200RFF; chain2Opt += geomP16id; }
133  else if (prodName == "P16idpAu200RFF"){ chain1Opt += " useXgeom"; chain3Opt = prodP16idpAu200RFF; chain2Opt += geomP16id; }
134  else {
135  cout << "Choice prodName " << prodName << " does not correspond to known chain. Processing impossible." << endl;
136  return;
137  }
138 
139  //chain3Opt.Prepend(' ');
140  //chain3Opt.Prepend(DbVoption);
141  chain3Opt += ",TpcMixer,GeantOut,MiniMcMk,McAna,-in,NoInput,useInTracker";
142  chain3Opt += ",";
143 
144  if (prodName == "P08icpp") { chain3Opt += geomP08ic; }
145  else if (prodName == "P08iepp") { chain3Opt += geomP08ic; }
146  else if (prodName == "P08icAuAu9") { chain3Opt += geomP08ic; }
147  else if (prodName == "P08icdAu") { chain3Opt += geomP08ic; }
148  else if (prodName == "P08iedAu") { chain3Opt += geomP08ic; }
149  else if (prodName == "P08icAuAu200") { chain3Opt += geomP08ic; }
150  else if (prodName == "P10iapp") { chain3Opt += geomP10ih; }
151  else if (prodName == "P10ihAuAu39") { chain3Opt += geomP10ih; }
152  else if (prodName == "P10ihAuAu11") { chain3Opt += geomP10ih; }
153  else if (prodName == "P10ihAuAu7") { chain3Opt += geomP10ih; }
154  else if (prodName == "P09igpp500") { chain3Opt += geomP09ig; }
155  else if (prodName == "P10icpp200") { chain3Opt += geomP10ic; }
156  else if (prodName == "P11idpp200FF") { chain3Opt += geomP11id; }
157  else if (prodName == "P11idpp200RFF"){ chain3Opt += geomP11id; }
158  else if (prodName == "P12iapp500RFF"){ chain3Opt += geomP12ia; }
159  else if (prodName == "P14iapp500RFF"){ chain3Opt += geomP14ia; }
160  else if (prodName == "P14igpp500RFF"){ chain3Opt += geomP14ig; }
161  else if (prodName == "P16idpp200RFF"){ chain3Opt += geomP16id; }
162  else if (prodName == "P16idpAu200RFF"){ chain3Opt += geomP16id; }
163  else {
164  cout << "Choice prodName " << prodName << " does not correspond to known chain. Processing impossible. " << endl;
165  return;
166  }
167 
168  // Test BTof Amilkar: from Ting
169  //chain3Opt += ",vpdsim,btofSim,btofMixer,btofMatch,vpdCalib,btofCalib";
170 
171  // Add BEMC simulators to chain
172  chain3Opt += ",emcSim";
173 
174  // Add EEMC fast simulator to chain
175  chain3Opt += ",EEfs";
176 
177  // Dynamically link some shared libs
178  gROOT->LoadMacro("bfc.C");
179  if (gClassTable->GetID("StBFChain") < 0) Load();
180  //______________Create the main chain object______________________________________
181  Chain = new StChain("Embedding");
182  //________________________________________________________________________________
183  bfc(-1,chain1Opt,daqfile);
184  chain1 = chain;
185  chain1->SetName("One");
186  chain1->SetAttr(".call","SetActive(0)","St_db_Maker::"); // Use DB cache to reduce overhead
187  Chain->cd();
188  //________________________________________________________________________________
189  bfc(-1,chain2Opt,fzdfile);
190  chain2 = chain;
191  chain2->SetName("Two");
192  Chain->cd();
193  if (chain2->GetOption("TRS")){
194  StTrsMaker *trsMk = (StTrsMaker *) chain2->GetMaker("Trs");
195  if (!trsMk) {
196  cout << "Cannot find Trs in chain2" << endl;
197  return;
198  }
199  trsMk->setNormalFactor(1.32);
200  trsMk->SetMode(0);
201  }
202  //________________________________________________________________________________
203  // gSystem->Load("StFtpcMixerMaker");
204  // StFtpcMixerMaker *ftpcmixer = new StFtpcMixerMaker("FtpcMixer","daq","trs");
205  //________________________________________________________________________________
206  TString OutputFileName(gSystem->BaseName(fzdfile));
207  OutputFileName.ReplaceAll("*","");
208  OutputFileName.ReplaceAll(".fzd","");
209  // OutputFileName.Append("_emb.root");
210  OutputFileName.Append(".root");
211  bfc(-1,chain3Opt,0,OutputFileName);
212  chain3 = chain;
213  chain3->SetName("Three");
214  Chain->cd();
215  //________________________________________________________________________________
216  StTpcMixerMaker *mixer = (StTpcMixerMaker *) chain3->Maker("TpcMixer");
217  if( prodName == "P08icAuAu200")
218  {
219  mixer->SetInput("Input1","MixerEvent");
220  }
221  else
222  {
223  mixer->SetInput("Input1","TpxRaw/.data/Event");
224  }
225 
226  if (chain2Opt.Contains("TpcRS",TString::kIgnoreCase)) {
227  mixer->SetInput("Input2","TpcRS/Event");
228  } else {
229  mixer->SetInput("Input2","Trs/.const/Event");
230  }
231  Chain->cd();
232 
233  // Set BTof to embedding mode:
234  //StBTofSimMaker *btofSim = (StBTofSimMaker*)chain3->GetMaker("TofSim");
235  //btofSim->setEmbeddingMode(true);
236 
237  //StVpdCalibMaker *vpdCalib = (StVpdCalibMaker*)chain3->GetMaker("vpdCalib");
238  //vpdCalib->setUseVpdStart(kFALSE);
239 
240  //------------------------------------ EMC MIXERS ------------------------------------
241  // Add BEMC mixer to chain3
242  StEmcRawMaker* emcRaw = (StEmcRawMaker*)chain3->GetMaker("emcRaw");
243  emcRaw->getBemcRaw()->saveAllStEvent(true); // use all 4800 BEMC towers
244  gSystem->Load("StEmcMixerMaker");
245  StEmcMixerMaker* bemcMixer = new StEmcMixerMaker;
246  chain3->AddAfter("EmcSimulator",bemcMixer);
247  // Set EEMC fast and slow simulator in embedding mode
248  StEEmcFastMaker* eefs = (StEEmcFastMaker*)chain3->GetMaker("eefs");
249  eefs->SetEmbeddingMode(); // Use local StEmcCollection
250  eefs->UseFullTower(true); // Use full ETOW detector
251  StEEmcSlowMaker* eess = new StEEmcSlowMaker;
252  eess->setEmbeddingMode(true);
253  // Add EEMC mixer to chain3
254  StEEmcMixerMaker* eemcMixer = new StEEmcMixerMaker;
255  //------------------------------------------------------------------------------------
256 
257  //----------------------------- TRIGGER FILTER -----------------------------
258  // We want to achieve the following ordering for makers:
259  // 1. BBC simulator
260  // 2. BEMC simulator
261  // 3. BEMC mixer
262  // 4. EEMC fast simulator
263  // 5. EEMC slow simulator
264  // 6. EEMC mixer
265  // 7. Pythia event maker
266  // 8. Trigger simulator
267  // 9. Trigger filter
268  // 10. TPC maker
269 
270  // Place TPC chain after EMC makers
271  chain3->AddAfter("eefs",chain3->GetMaker("tpcChain"));
272  chain3->AddAfter("eefs",eemcMixer);
273  chain3->AddAfter("eefs",eess);
274 
275  // Place Pythia maker after GEANT maker
276  // and trigger filter after EMC makers
277  gSystem->Load("StMCAsymMaker");
278  gSystem->Load("StJetSkimEvent");
279  gSystem->Load("StBfcTriggerFilterMaker");
280 
282  TString pyfile = gSystem->BaseName(fzdfile);
283  pyfile.ReplaceAll(".fzd",".pythia.root");
284  pythia->SetPythiaFile(pyfile);
285  chain3->AddAfter("geant",pythia);
286 
287  // Place trigger simulator after EMC makers
288  gSystem->Load("StTriggerUtilities");
290  //trgsim->useOnlineDB();
291  trgsim->useOfflineDB();
292  trgsim->setMC(1);
293  //trgsim->setMC(2); //Amilkar Do not use
294  trgsim->useBemc();
295  //trgsim->bemc->setConfig(StBemcTriggerSimu::kOffline);
296  trgsim->bemc->setConfig(StBemcTriggerSimu::kOnline); //Amilkar
297  trgsim->useEemc();
298  trgsim->eemc->setSource("StEvent");
299 
300  /* trgsim->setOverlapJetPatchTh(0,34);
301  trgsim->setOverlapJetPatchTh(1,43);
302  trgsim->setOverlapJetPatchTh(2,66);
303 
304  trgsim->setBarrelJetPatchTh(0,34);
305  trgsim->setBarrelJetPatchTh(1,43);
306  trgsim->setBarrelJetPatchTh(2,66);
307  trgsim->setBarrelJetPatchTh(3,17); //Amilkar
308 
309  trgsim->setEndcapJetPatchTh(0,34);
310  trgsim->setEndcapJetPatchTh(1,43);
311  trgsim->setEndcapJetPatchTh(2,66);
312  trgsim->setEndcapJetPatchTh(3,17);*/ //Amilkar
313 
314  StBfcTriggerFilterMaker* trgfilt = new StBfcTriggerFilterMaker; //needed for trig filt
315  trgfilt->SetJP0();
316  //trgfilt->SetJP1(); //Amilkar: Use the lowest threshold triggers
317  //trgfilt->SetJP2(); //needed for trig filt for JP2
318  //if(Chain->GetEventNumber() >= 14082037) trgfilt->SetJP0dijet();
319  //if(Chain->GetEventNumber() >= 14082035) trgfilt->SetJP1dijet();
320  //trgfilt->SetBAJP();
321  trgfilt->SetBHT2();
322  trgfilt->SetEHT0();
323 
324  chain3->AddBefore("tpcChain",trgsim);
325  chain3->AddBefore("tpcChain",trgfilt);
326 
327  // Move these makers after trigger decision
328  // *** VERY IMPORTANT ***
329  // The order of TpxRaw and TpcRS *must* be preserved
330  // or the embedding will *not* work. [RT# 2299]
331  // http://www.star.bnl.gov/rt2/Ticket/Display.html?id=2299
332  StTpcRSMaker* TpcRS = (StTpcRSMaker*)chain2->GetMaker("TpcRS");
333  StTpcHitMaker* TpxRaw = (StTpcHitMaker*)chain1->GetMaker("TpxRaw");
334  chain3->AddBefore("TpcMixer",TpxRaw);
335  chain3->AddBefore("TpcMixer",TpcRS);
336 
337  //--------------------------------------------------------------------------
338  TString trgfile = gSystem->BaseName(fzdfile);
339  trgfile.ReplaceAll(".fzd",".trig.root");
340  TFile* ofile = TFile::Open(trgfile,"recreate");
341  assert(ofile);
342  TH2F* hBarrelHighTowerSimu = new TH2F("hBarrelHighTowerSimu","BEMC high tower simu;trigger patch;high tower",300,0,300,64,0,64);
343  TH2F* hBarrelPatchSumSimu = new TH2F("hBarrelPatchSumSimu","BEMC patch sum simu;trigger patch;patch sum",300,0,300,64,0,64);
344  TH2F* hEndcapHighTowerSimu = new TH2F("hEndcapHighTowerSimu","EEMC high tower simu;trigger patch;high tower",90,0,90,64,0,64);
345  TH2F* hEndcapPatchSumSimu = new TH2F("hEndcapPatchSumSimu","EEMC patch sum simu;trigger patch;patch sum",90,0,90,64,0,64);
346  TH2F* hBarrelJetPatchSimu = new TH2F("hBarrelJetPatchSimu","BEMC jet patch;jet patch;adc",18,0,18,160,0,160);
347  TH2F* hEndcapJetPatchSimu = new TH2F("hEndcapJetPatchSimu","EEMC jet patch;jet patch;adc",6,0,6,160,0,160);
348  TH2F* hOverlapJetPatchSimu = new TH2F("hOverlapJetPatchSimu","BEMC-EEMC-overlap;jet patch;adc",6,0,6,160,0,160);
349  //--------------------------------------------------------------------------
350  // Initialize chain
351  Chain->Init();
352  PrintTimer(Chain);
353  puts("Order of makers in BFCMIXER:");
354  StMaker::lsMakers(Chain);
355  // Event loop
356  int mNTotal = 0;
357  int mNFailed = 0;
358  TBenchmark evnt;
359  StIOMaker* inputStream = (StIOMaker*)chain1->GetMaker("inputStream");
360  for (int iEvent = 1; iEvent <= Nevents; ++iEvent) {
361  evnt.Reset();
362  evnt.Start("QAInfo:");
363  Chain->Clear();
364  int iMake = Chain->Make(iEvent);
365  if (iMake == kStErr) ++mNFailed;
366  if (inputStream->GetMakeReturn() % 10 == kStEOF) {
367  inputStream->Rewind();
368  --iEvent;
369  continue;
370  }
371  if (iMake % 10 == kStEOF || iMake % 10 == kStFatal) break;
372  ++mNTotal;
373  PrintTimer(Chain);
374  //--------------------------------------------------------------------------
375  // BEMC high towers and trigger patches
376  for (int triggerpatch = 0; triggerpatch < 300; ++triggerpatch) {
377  hBarrelHighTowerSimu->Fill(triggerpatch,trgsim->bemc->getBEMC_FEE_HT_ADC()[triggerpatch]);
378  hBarrelPatchSumSimu->Fill(triggerpatch,trgsim->bemc->getBEMC_FEE_TP_ADC()[triggerpatch]);
379  } // for triggerpatch
380  // BEMC jet patches
381  for (int jetpatch = 0; jetpatch < 18; ++jetpatch) {
382  hBarrelJetPatchSimu->Fill(jetpatch,trgsim->bemc->barrelJetPatchAdc(jetpatch));
383  } // for jetpatch
384  // EEMC high towers and trigger patches
385  for (int triggerpatch = 0; triggerpatch < 90; ++triggerpatch) {
386  hEndcapHighTowerSimu->Fill(triggerpatch,trgsim->eemc->getOutHT(triggerpatch));
387  hEndcapPatchSumSimu->Fill(triggerpatch,trgsim->eemc->getOutTPsum(triggerpatch));
388  } // for triggerpatch
389  // EEMC jet patches
390  for (int jetpatch = 0; jetpatch < 6; ++jetpatch) {
391  hEndcapJetPatchSimu->Fill(jetpatch,trgsim->eemc->endcapJetPatchAdc(jetpatch));
392  } // for jetpatch
393  // BEMC-EEMC-overlap jet patches
394  for (int i = 0; i < 2; ++i) {
395  int jetpatch, adc;
396  trgsim->emc->getOverlapJetPatchAdc(i,jetpatch,adc);
397  hOverlapJetPatchSimu->Fill(jetpatch,adc);
398  } // for i
399  //--------------------------------------------------------------------------
400  evnt.Stop("QAInfo:");
401  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",iEvent,Chain->GetRunNumber(),Chain->GetEventNumber(),Chain->GetDate(),Chain->GetTime(),chain3->GetMakeReturn(),evnt.GetRealTime("QAInfo:"),evnt.GetCpuTime("QAInfo:"));
402  } // End event loop
403  printf("QAInfo:EventLoop completed code %d\n",iMake);
404  gSystem->Exec("date");
405  TDatime t;
406  printf("QAInfo:Run is finished at Date/Time %i/%i; Total events processed: %i and not completed: %i\n",t.GetDate(),t.GetTime(),mNTotal,mNFailed);
407  //--------------------------------------------------------------------------
408  ofile->Write();
409  ofile->Close();
410  //--------------------------------------------------------------------------
411 }
412 
413 // Print timers for all makers in chain
414 class StMaker;
415 void PrintTimer(StMaker* chain)
416 {
417  TIter next(chain->GetMakeList());
418  StMaker* maker;
419  while (maker = (StMaker*)next()) {
420  maker->PrintTimer();
421  PrintTimer(maker);
422  // Hack to reset timer
423  maker->StartTimer(true);
424  maker->StopTimer();
425  }
426 }
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
StBemcRaw * getBemcRaw()
Return the StBemcRaw pointer.
Definition: StEmcRawMaker.h:95
Definition: Stypes.h:43
virtual Int_t Make()
Definition: StChain.cxx:110
virtual Int_t GetRunNumber() const
Returns the current RunNumber.
Definition: StMaker.cxx:1054
void saveAllStEvent(Bool_t a)
Set to kTRUE if all hits are to be saved on StEvent.
Definition: StBemcRaw.h:178
virtual void setSource(const char *source)
Options are: &quot;MuDst&quot;, &quot;StEvent&quot;.
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.
Definition: Stypes.h:44
virtual void PrintTimer(Option_t *option="")
Definition: StMaker.cxx:1098