27 void bfcMixer_Jet(
const Int_t Nevents = 1000,
28 const Char_t* daqfile =
"@run10148002.list",
29 const Char_t* fzdfile =
"eliza14/SL11d_embed/10148002/pt11_15_10148002_1.fzd",
30 const Char_t* prodName =
"P11idpp200",
31 const Char_t* DbVoption =
"DbV20120622,DbV20120622_EMC_Calibrations,DbV20120622_EEMC_Calibrations")
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");
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");
44 TString prodP09igpp500(
"DbV20101215 OGGVoltErr pp2009c ITTF VFPPVnoCTB BEmcChkStat beamLine Corr4 OSpaceZ2 OGridLeak3D -dstout -evout");
47 TString prodP10icpp200(
"pp2009c ITTF VFPPVnoCTB beamLine BEmcChkStat btof fmsdat Corr4 OSpaceZ2 OGridLeak3D");
51 TString prodP11idpp200(
"DbV20120622 pp2009d ITTF Sti VFPPVnoCTB beamLine BEmcChkStat btof fmsdat Corr4 OSpaceZ2 OGridLeak3D -hitfilt");
54 prodP09igpp500 +=
" TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
55 prodP10icpp200 +=
" TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
56 prodP11idpp200 +=
" TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
58 TString geomP08ic(
"ry2008");
59 TString geomP10ih(
"ry2010");
60 TString geomP09ig(
"ry2009a");
61 TString geomP10ic(
"ry2009a");
62 TString geomP11id(
"ry2009d");
63 TString chain1Opt(
"in,magF,tpcDb,NoDefault,TpxRaw,-ittf,NoOutput");
64 TString chain2Opt(
"fzin,gen_T,geomT,sim_T,TpcRS,-ittf,-tpc_daq,nodefault");
68 if (prodName ==
"P08icpp") { chain3Opt = prodP08icpp; chain2Opt += geomP08ic; }
69 else if (prodName ==
"P08iepp") { chain3Opt = prodP08iepp; chain2Opt += geomP08ic; }
70 else if (prodName ==
"P08icAuAu9") { chain3Opt = prodP08icAuAu9; chain2Opt += geomP08ic; }
71 else if (prodName ==
"P08icdAu") { chain3Opt = prodP08icdAu; chain2Opt += geomP08ic; }
72 else if (prodName ==
"P08iedAu") { chain3Opt = prodP08iedAu; chain2Opt += geomP08ic; }
73 else if (prodName ==
"P08icAuAu200") { chain3Opt = prodP08icAuAu200; chain2Opt += geomP08ic; }
74 else if (prodName ==
"P10iapp") { chain3Opt = prodP10iapp; chain2Opt += geomP10ih; }
75 else if (prodName ==
"P10ihAuAu39") { chain3Opt = prodP10ihAuAu39; chain2Opt += geomP10ih; }
76 else if (prodName ==
"P10ihAuAu11") { chain3Opt = prodP10ihAuAu11; chain2Opt += geomP10ih; }
77 else if (prodName ==
"P10ihAuAu7") { chain3Opt = prodP10ihAuAu7; chain2Opt += geomP10ih; }
78 else if (prodName ==
"P09igpp500") { chain3Opt = prodP09igpp500; chain2Opt += geomP09ig; }
79 else if (prodName ==
"P10icpp200") { chain3Opt = prodP10icpp200; chain2Opt += geomP10ic; }
80 else if (prodName ==
"P11idpp200") { chain3Opt = prodP11idpp200; chain2Opt += geomP11id; }
82 cout <<
"Choice prodName " << prodName <<
" does not correspond to known chain. Processing impossible." << endl;
85 chain3Opt.Prepend(
' ');
86 chain3Opt.Prepend(DbVoption);
87 chain3Opt +=
",Embedding,TpcMixer,GeantOut,MiniMcMk,McAna,-in,NoInput,useInTracker,nodefault";
90 if (prodName ==
"P08icpp") { chain3Opt += geomP08ic; }
91 else if (prodName ==
"P08iepp") { chain3Opt += geomP08ic; }
92 else if (prodName ==
"P08icAuAu9") { chain3Opt += geomP08ic; }
93 else if (prodName ==
"P08icdAu") { chain3Opt += geomP08ic; }
94 else if (prodName ==
"P08iedAu") { chain3Opt += geomP08ic; }
95 else if (prodName ==
"P08icAuAu200") { chain3Opt += geomP08ic; }
96 else if (prodName ==
"P10iapp") { chain3Opt += geomP10ih; }
97 else if (prodName ==
"P10ihAuAu39") { chain3Opt += geomP10ih; }
98 else if (prodName ==
"P10ihAuAu11") { chain3Opt += geomP10ih; }
99 else if (prodName ==
"P10ihAuAu7") { chain3Opt += geomP10ih; }
100 else if (prodName ==
"P09igpp500") { chain3Opt += geomP09ig; }
101 else if (prodName ==
"P10icpp200") { chain3Opt += geomP10ic; }
102 else if (prodName ==
"P11idpp200") { chain3Opt += geomP11id; }
104 cout <<
"Choice prodName " << prodName <<
" does not correspond to known chain. Processing impossible. " << endl;
109 chain3Opt +=
",emcSim";
112 chain3Opt +=
",EEfs";
115 gROOT->LoadMacro(
"bfc.C");
116 if (gClassTable->GetID(
"StBFChain") < 0)
Load();
118 Chain =
new StChain(
"Embedding");
120 bfc(-1,chain1Opt,daqfile);
122 chain1->SetName(
"One");
123 chain1->SetAttr(
".call",
"SetActive(0)",
"St_db_Maker::");
126 bfc(-1,chain2Opt,fzdfile);
128 chain2->SetName(
"Two");
130 if (chain2->GetOption(
"TRS")){
133 cout <<
"Cannot find Trs in chain2" << endl;
136 trsMk->setNormalFactor(1.32);
143 TString OutputFileName(gSystem->BaseName(fzdfile));
144 OutputFileName.ReplaceAll(
"*",
"");
145 OutputFileName.ReplaceAll(
".fzd",
"");
147 OutputFileName.Append(
".root");
148 bfc(-1,chain3Opt,0,OutputFileName);
150 chain3->SetName(
"Three");
154 if( prodName ==
"P08icAuAu200")
156 mixer->SetInput(
"Input1",
"MixerEvent");
160 mixer->SetInput(
"Input1",
"TpxRaw/.data/Event");
163 if (chain2Opt.Contains(
"TpcRS",TString::kIgnoreCase)) {
164 mixer->SetInput(
"Input2",
"TpcRS/Event");
166 mixer->SetInput(
"Input2",
"Trs/.const/Event");
174 gSystem->Load(
"StEmcMixerMaker");
176 chain3->AddAfter(
"EmcSimulator",bemcMixer);
179 eefs->SetEmbeddingMode();
180 eefs->UseFullTower(
true);
201 chain3->AddAfter(
"eefs",chain3->GetMaker(
"tpcChain"));
202 chain3->AddAfter(
"eefs",eemcMixer);
203 chain3->AddAfter(
"eefs",eess);
207 gSystem->Load(
"StJetSkimEvent");
208 gSystem->Load(
"StMCAsymMaker");
209 gSystem->Load(
"StBfcTriggerFilterMaker");
212 TString pyfile = gSystem->BaseName(fzdfile);
213 pyfile.ReplaceAll(
".fzd",
".pythia.root");
214 pythia->SetPythiaFile(pyfile);
215 chain3->AddAfter(
"geant",pythia);
218 gSystem->Load(
"StTriggerUtilities");
225 trgsim->bemc->setConfig(StBemcTriggerSimu::kOnline);
229 trgsim->bemc->setBarrelJetPatchTh0(19);
230 trgsim->bemc->setBarrelJetPatchTh1(26);
231 trgsim->bemc->setBarrelJetPatchTh2(34);
233 trgsim->emc->setOverlapJetPatchTh0(18);
234 trgsim->emc->setOverlapJetPatchTh1(25);
235 trgsim->emc->setOverlapJetPatchTh2(33);
237 trgsim->eemc->setEndcapJetPatchTh0(17);
238 trgsim->eemc->setEndcapJetPatchTh1(24);
239 trgsim->eemc->setEndcapJetPatchTh2(31);
241 trgsim->bemc->setBarrelHighTowerTh0(11);
242 trgsim->bemc->setBarrelHighTowerTh1(15);
243 trgsim->bemc->setBarrelHighTowerTh2(18);
244 trgsim->bemc->setBarrelHighTowerTh3(24);
246 trgsim->eemc->setEndcapHighTowerTh0(16);
247 trgsim->eemc->setEndcapHighTowerTh1(25);
258 chain3->AddBefore(
"tpcChain",trgsim);
259 chain3->AddBefore(
"tpcChain",trgfilt);
268 chain3->AddBefore(
"TpcMixer",TpxRaw);
269 chain3->AddBefore(
"TpcMixer",TpcRS);
278 TString trgfile = gSystem->BaseName(fzdfile);
279 trgfile.ReplaceAll(
".fzd",
".trig.root");
280 TFile* ofile = TFile::Open(trgfile,
"recreate");
282 TH2F* hBarrelHighTowerSimu =
new TH2F(
"hBarrelHighTowerSimu",
"BEMC high tower simu;trigger patch;high tower",300,0,300,64,0,64);
283 TH2F* hBarrelPatchSumSimu =
new TH2F(
"hBarrelPatchSumSimu",
"BEMC patch sum simu;trigger patch;patch sum",300,0,300,64,0,64);
284 TH2F* hEndcapHighTowerSimu =
new TH2F(
"hEndcapHighTowerSimu",
"EEMC high tower simu;trigger patch;high tower",90,0,90,64,0,64);
285 TH2F* hEndcapPatchSumSimu =
new TH2F(
"hEndcapPatchSumSimu",
"EEMC patch sum simu;trigger patch;patch sum",90,0,90,64,0,64);
286 TH2F* hBarrelJetPatchSimu =
new TH2F(
"hBarrelJetPatchSimu",
"BEMC jet patch;jet patch;adc",18,0,18,160,0,160);
287 TH2F* hEndcapJetPatchSimu =
new TH2F(
"hEndcapJetPatchSimu",
"EEMC jet patch;jet patch;adc",6,0,6,160,0,160);
288 TH2F* hOverlapJetPatchSimu =
new TH2F(
"hOverlapJetPatchSimu",
"BEMC-EEMC-overlap;jet patch;adc",6,0,6,160,0,160);
293 puts(
"Order of makers in BFCMIXER:");
294 StMaker::lsMakers(Chain);
300 for (
int iEvent = 1; iEvent <= Nevents; ++iEvent) {
302 evnt.Start(
"QAInfo:");
304 int iMake = Chain->
Make(iEvent);
305 if (iMake ==
kStErr) ++mNFailed;
306 if (inputStream->GetMakeReturn() % 10 ==
kStEOF) {
307 inputStream->Rewind();
317 for (
int triggerpatch = 0; triggerpatch < 300; ++triggerpatch) {
318 hBarrelHighTowerSimu->Fill(triggerpatch,trgsim->bemc->getBEMC_FEE_HT_ADC()[triggerpatch]);
319 hBarrelPatchSumSimu->Fill(triggerpatch,trgsim->bemc->getBEMC_FEE_TP_ADC()[triggerpatch]);
322 for (
int jetpatch = 0; jetpatch < 18; ++jetpatch) {
323 hBarrelJetPatchSimu->Fill(jetpatch,trgsim->bemc->barrelJetPatchAdc(jetpatch));
326 for (
int triggerpatch = 0; triggerpatch < 90; ++triggerpatch) {
327 hEndcapHighTowerSimu->Fill(triggerpatch,trgsim->eemc->getOutHT(triggerpatch));
328 hEndcapPatchSumSimu->Fill(triggerpatch,trgsim->eemc->getOutTPsum(triggerpatch));
331 for (
int jetpatch = 0; jetpatch < 6; ++jetpatch) {
332 hEndcapJetPatchSimu->Fill(jetpatch,trgsim->eemc->endcapJetPatchAdc(jetpatch));
335 for (
int i = 0; i < 2; ++i) {
337 trgsim->emc->getOverlapJetPatchAdc(i,jetpatch,adc);
338 hOverlapJetPatchSimu->Fill(jetpatch,adc);
341 evnt.Stop(
"QAInfo:");
342 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:"));
344 printf(
"QAInfo:EventLoop completed code %d\n",iMake);
345 gSystem->Exec(
"date");
347 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);
358 TIter next(chain->GetMakeList());
360 while (maker = (
StMaker*)next()) {
364 maker->StartTimer(
true);
virtual void Clear(Option_t *option="")
User defined functions.
StBemcRaw * getBemcRaw()
Return the StBemcRaw pointer.
virtual Int_t GetRunNumber() const
Returns the current RunNumber.
void saveAllStEvent(Bool_t a)
Set to kTRUE if all hits are to be saved on StEvent.
virtual void setSource(const char *source)
Options are: "MuDst", "StEvent".
virtual Int_t Load()
Routine handling library loading depending on chain options.
void setEmbeddingMode(Bool_t e=true)
Sets all switches required to perform embedding.
virtual void PrintTimer(Option_t *option="")