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"){
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 prodP11idpp200FF(
"DbV20120622 pp2009d ITTF Sti VFPPVnoCTB beamLine BEmcChkStat btof fmsdat Corr4 OSpaceZ2 OGridLeak3D -hitfilt");
55 TString prodP11idpp200RFF(
"DbV20120908 pp2009d ITTF Sti VFPPVnoCTB beamLine BEmcChkStat btof fmsdat Corr4 OSpaceZ2 OGridLeak3D -hitfilt");
59 TString prodP12iapp500RFF(
"DbV20121219 pp2012b Sti AgML mtdDat btof fmsDat VFPPVnoCTB beamline BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D -hitfilt");
61 TString prodP13ibpp500RFF(
"DbV20130212 pp2012b AgML mtdDat btof fmsDat VFPPVnoCTB useBTOF4Vtx beamline BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D -evout -hitfilt");
64 TString prodP14iapp500RFF(
"DbV20140222 DbV20160325_EMC_Calibrations DbV20170831_TRG_Calibrations pp2013a mtd btof Sti fmsDat fgt fgtPoint VFPPVnoCTB beamline BEmcChkStat Corr4 OSpaceZ2 OGridLeak3D -hitfilt");
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");
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");
83 TString prodP16idpAu200RFF(
"DbV20160710 pp2015c btof mtd mtdCalib pp2pp fmsDat fmsPoint fpsDat BEmcChkStat -evout CorrX OSpaceZ2 OGridLeak3D -hitfilt");
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 ";
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");
109 TString chain1Opt(
"in,magF,tpcDb,NoDefault,TpxRaw,-ittf,NoOutput");
110 TString chain2Opt(
"fzin,gen_T,geomT,sim_T,TpcRS,-ittf,-tpc_daq,nodefault");
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; }
135 cout <<
"Choice prodName " << prodName <<
" does not correspond to known chain. Processing impossible." << endl;
141 chain3Opt +=
",TpcMixer,GeantOut,MiniMcMk,McAna,-in,NoInput,useInTracker";
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; }
164 cout <<
"Choice prodName " << prodName <<
" does not correspond to known chain. Processing impossible. " << endl;
172 chain3Opt +=
",emcSim";
175 chain3Opt +=
",EEfs";
178 gROOT->LoadMacro(
"bfc.C");
179 if (gClassTable->GetID(
"StBFChain") < 0)
Load();
181 Chain =
new StChain(
"Embedding");
183 bfc(-1,chain1Opt,daqfile);
185 chain1->SetName(
"One");
186 chain1->SetAttr(
".call",
"SetActive(0)",
"St_db_Maker::");
189 bfc(-1,chain2Opt,fzdfile);
191 chain2->SetName(
"Two");
193 if (chain2->GetOption(
"TRS")){
196 cout <<
"Cannot find Trs in chain2" << endl;
199 trsMk->setNormalFactor(1.32);
206 TString OutputFileName(gSystem->BaseName(fzdfile));
207 OutputFileName.ReplaceAll(
"*",
"");
208 OutputFileName.ReplaceAll(
".fzd",
"");
210 OutputFileName.Append(
".root");
211 bfc(-1,chain3Opt,0,OutputFileName);
213 chain3->SetName(
"Three");
217 if( prodName ==
"P08icAuAu200")
219 mixer->SetInput(
"Input1",
"MixerEvent");
223 mixer->SetInput(
"Input1",
"TpxRaw/.data/Event");
226 if (chain2Opt.Contains(
"TpcRS",TString::kIgnoreCase)) {
227 mixer->SetInput(
"Input2",
"TpcRS/Event");
229 mixer->SetInput(
"Input2",
"Trs/.const/Event");
244 gSystem->Load(
"StEmcMixerMaker");
246 chain3->AddAfter(
"EmcSimulator",bemcMixer);
249 eefs->SetEmbeddingMode();
250 eefs->UseFullTower(
true);
271 chain3->AddAfter(
"eefs",chain3->GetMaker(
"tpcChain"));
272 chain3->AddAfter(
"eefs",eemcMixer);
273 chain3->AddAfter(
"eefs",eess);
277 gSystem->Load(
"StMCAsymMaker");
278 gSystem->Load(
"StJetSkimEvent");
279 gSystem->Load(
"StBfcTriggerFilterMaker");
282 TString pyfile = gSystem->BaseName(fzdfile);
283 pyfile.ReplaceAll(
".fzd",
".pythia.root");
284 pythia->SetPythiaFile(pyfile);
285 chain3->AddAfter(
"geant",pythia);
288 gSystem->Load(
"StTriggerUtilities");
291 trgsim->useOfflineDB();
296 trgsim->bemc->setConfig(StBemcTriggerSimu::kOnline);
324 chain3->AddBefore(
"tpcChain",trgsim);
325 chain3->AddBefore(
"tpcChain",trgfilt);
334 chain3->AddBefore(
"TpcMixer",TpxRaw);
335 chain3->AddBefore(
"TpcMixer",TpcRS);
338 TString trgfile = gSystem->BaseName(fzdfile);
339 trgfile.ReplaceAll(
".fzd",
".trig.root");
340 TFile* ofile = TFile::Open(trgfile,
"recreate");
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);
353 puts(
"Order of makers in BFCMIXER:");
354 StMaker::lsMakers(Chain);
360 for (
int iEvent = 1; iEvent <= Nevents; ++iEvent) {
362 evnt.Start(
"QAInfo:");
364 int iMake = Chain->
Make(iEvent);
365 if (iMake ==
kStErr) ++mNFailed;
366 if (inputStream->GetMakeReturn() % 10 ==
kStEOF) {
367 inputStream->Rewind();
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]);
381 for (
int jetpatch = 0; jetpatch < 18; ++jetpatch) {
382 hBarrelJetPatchSimu->Fill(jetpatch,trgsim->bemc->barrelJetPatchAdc(jetpatch));
385 for (
int triggerpatch = 0; triggerpatch < 90; ++triggerpatch) {
386 hEndcapHighTowerSimu->Fill(triggerpatch,trgsim->eemc->getOutHT(triggerpatch));
387 hEndcapPatchSumSimu->Fill(triggerpatch,trgsim->eemc->getOutTPsum(triggerpatch));
390 for (
int jetpatch = 0; jetpatch < 6; ++jetpatch) {
391 hEndcapJetPatchSimu->Fill(jetpatch,trgsim->eemc->endcapJetPatchAdc(jetpatch));
394 for (
int i = 0; i < 2; ++i) {
396 trgsim->emc->getOverlapJetPatchAdc(i,jetpatch,adc);
397 hOverlapJetPatchSimu->Fill(jetpatch,adc);
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:"));
403 printf(
"QAInfo:EventLoop completed code %d\n",iMake);
404 gSystem->Exec(
"date");
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);
417 TIter next(chain->GetMakeList());
419 while (maker = (
StMaker*)next()) {
423 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="")