30 void bfcMixer_Jet2(
const Int_t Nevents = 1000,
31 const Char_t* daqfile =
"/star/data03/daq/2009/WembAll/st_zerobias_adc_10085134_raw_4450001.daq",
32 const Char_t* fzdfile =
"/star/institutions/uky/gdwebb/pp500Embedding2009/output/pTbin_4_5/st_zerobias_adc_10085134_raw_4450001.fzd",
33 const Char_t* prodName =
"P09igpp500")
36 TString prodP08iepp(
"DbV20081117 B2008a ITTF IAna ppOpt l3onl emcDY2 fpd ftpc trgd ZDCvtx NosvtIT NossdIT Corr4 OSpaceZ2 OGridLeak3D VFMCE -hitfilt");
37 TString prodP08iedAu(
"DbV20090213 P2008 ITTF OSpaceZ2 OGridLeak3D beamLine VFMCE TpxClu -VFMinuit -hitfilt");
38 TString prodP10iapp(
"DbV20091001 pp2009c TpcRS ITTF OSpaceZ2 OGridLeak3D beamLine, VFMCE TpcRS -VFMinuit -hitfilt");
41 TString prodP10ihAuAu39(
"DbV20100909 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
42 TString prodP10ihAuAu11(
"DbV20100821 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
43 TString prodP10ihAuAu7(
"DbV20100821 P2010a,btof,BEmcChkStat,Corr4,OSpaceZ2,OGridLeak3D,VFMCE TpxClu -VFMinuit -hitfilt");
46 TString prodP09igpp500(
"DbV20091225 pp2009c ITTF VFPPVnoCTB beamLine BEmcChkStat btof Corr4 OSpaceZ2 OGridLeak3D -dstout -evout");
49 TString prodP10icpp200(
"DbV20100130 pp2009c ITTF VFPPVnoCTB beamLine BEmcChkStat btof fmsdat Corr4 OSpaceZ2 OGridLeak3D");
52 prodP09igpp500 +=
" TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
53 prodP10icpp200 +=
" TpxClu -VFMinuit VFPPVnoCTB beamLine -hitfilt";
55 TString geomP08ic(
"ry2008");
56 TString geomP10ih(
"ry2010");
57 TString geomP09ig(
"ry2009a");
58 TString geomP10ic(
"ry2009a");
59 TString chain1Opt(
"in,magF,tpcDb,NoDefault,TpxRaw,-ittf,NoOutput");
60 TString chain2Opt(
"fzin,gen_T,geomT,sim_T,TpcRS,-ittf,-tpc_daq,nodefault");
64 if (prodName ==
"P08icpp") { chain3Opt = prodP08icpp; chain2Opt += geomP08ic; }
65 else if (prodName ==
"P08iepp") { chain3Opt = prodP08iepp; chain2Opt += geomP08ic; }
66 else if (prodName ==
"P08icAuAu9") { chain3Opt = prodP08icAuAu9; chain2Opt += geomP08ic; }
67 else if (prodName ==
"P08icdAu") { chain3Opt = prodP08icdAu; chain2Opt += geomP08ic; }
68 else if (prodName ==
"P08iedAu") { chain3Opt = prodP08iedAu; chain2Opt += geomP08ic; }
69 else if (prodName ==
"P08icAuAu200") { chain3Opt = prodP08icAuAu200; chain2Opt += geomP08ic; }
70 else if (prodName ==
"P10iapp") { chain3Opt = prodP10iapp; chain2Opt += geomP10ih; }
71 else if (prodName ==
"P10ihAuAu39") { chain3Opt = prodP10ihAuAu39; chain2Opt += geomP10ih; }
72 else if (prodName ==
"P10ihAuAu11") { chain3Opt = prodP10ihAuAu11; chain2Opt += geomP10ih; }
73 else if (prodName ==
"P10ihAuAu7") { chain3Opt = prodP10ihAuAu7; chain2Opt += geomP10ih; }
74 else if (prodName ==
"P09igpp500") { chain3Opt = prodP09igpp500; chain2Opt += geomP09ig; }
75 else if (prodName ==
"P10icpp200") { chain3Opt = prodP10icpp200; chain2Opt += geomP10ic; }
77 cout <<
"Choice prodName " << prodName <<
" does not correspond to known chain. Processing impossible." << endl;
80 chain3Opt +=
",Embedding,TpcMixer,GeantOut,MiniMcMk,McAna,-in,NoInput,useInTracker";
83 if (prodName ==
"P08icpp") { chain3Opt += geomP08ic; }
84 else if (prodName ==
"P08iepp") { chain3Opt += geomP08ic; }
85 else if (prodName ==
"P08icAuAu9") { chain3Opt += geomP08ic; }
86 else if (prodName ==
"P08icdAu") { chain3Opt += geomP08ic; }
87 else if (prodName ==
"P08iedAu") { chain3Opt += geomP08ic; }
88 else if (prodName ==
"P08icAuAu200") { chain3Opt += geomP08ic; }
89 else if (prodName ==
"P10iapp") { chain3Opt += geomP10ih; }
90 else if (prodName ==
"P10ihAuAu39") { chain3Opt += geomP10ih; }
91 else if (prodName ==
"P10ihAuAu11") { chain3Opt += geomP10ih; }
92 else if (prodName ==
"P10ihAuAu7") { chain3Opt += geomP10ih; }
93 else if (prodName ==
"P09igpp500") { chain3Opt += geomP09ig; }
94 else if (prodName ==
"P10icpp200") { chain3Opt += geomP10ic; }
96 cout <<
"Choice prodName " << prodName <<
" does not correspond to known chain. Processing impossible. " << endl;
101 chain3Opt +=
",emcSim";
104 chain3Opt +=
",EEfs";
107 gROOT->LoadMacro(
"bfc.C");
108 if (gClassTable->GetID(
"StBFChain") < 0)
Load();
110 Chain =
new StChain(
"Embedding");
112 bfc(-1,chain1Opt,daqfile);
114 chain1->SetName(
"One");
117 bfc(-1,chain2Opt,fzdfile);
119 chain2->SetName(
"Two");
121 if (chain2->GetOption(
"TRS")){
124 cout <<
"Cannot find Trs in chain2" << endl;
127 trsMk->setNormalFactor(1.32);
134 TString OutputFileName(gSystem->BaseName(fzdfile));
135 OutputFileName.ReplaceAll(
"*",
"");
136 OutputFileName.ReplaceAll(
".fzd",
"");
138 OutputFileName.Append(
".root");
139 bfc(-1,chain3Opt,0,OutputFileName);
141 chain3->SetName(
"Three");
148 chain3->AddBefore(
"TpcMixer",TpcRS);
149 chain3->AddBefore(
"TpcMixer",TpxRaw);
152 if( prodName ==
"P08icAuAu200")
154 mixer->SetInput(
"Input1",
"MixerEvent");
158 mixer->SetInput(
"Input1",
"TpxRaw/.data/Event");
161 if (chain2Opt.Contains(
"TpcRS",TString::kIgnoreCase)) {
162 mixer->SetInput(
"Input2",
"TpcRS/Event");
164 mixer->SetInput(
"Input2",
"Trs/.const/Event");
172 gSystem->Load(
"StEmcMixerMaker");
174 chain3->AddAfter(
"EmcSimulator",bemcMixer);
177 eefs->SetEmcCollectionLocal(
false);
178 eefs->UseFullTower(
true);
204 chain3->AddAfter(
"eefs",chain3->GetMaker(
"tpcChain"));
206 chain3->AddAfter(
"eefs",eess);
210 gSystem->Load(
"StJetSkimEvent");
211 gSystem->Load(
"StBfcTriggerFilterMaker");
214 TString pyfile = gSystem->BaseName(fzdfile);
215 pyfile.ReplaceAll(
".fzd",
".pythia.root");
216 pythia->SetPythiaFile(pyfile);
217 chain3->AddAfter(
"geant",pythia);
220 gSystem->Load(
"StTriggerUtilities");
227 trgsim->bemc->setConfig(StBemcTriggerSimu::kOnline);
231 trgsim->bemc->setBarrelJetPatchTh0(19);
232 trgsim->bemc->setBarrelJetPatchTh1(26);
233 trgsim->bemc->setBarrelJetPatchTh2(34);
235 trgsim->emc->setOverlapJetPatchTh0(18);
236 trgsim->emc->setOverlapJetPatchTh1(25);
237 trgsim->emc->setOverlapJetPatchTh2(33);
239 trgsim->eemc->setEndcapJetPatchTh0(17);
240 trgsim->eemc->setEndcapJetPatchTh1(24);
241 trgsim->eemc->setEndcapJetPatchTh2(31);
243 trgsim->bemc->setBarrelHighTowerTh0(11);
244 trgsim->bemc->setBarrelHighTowerTh1(15);
245 trgsim->bemc->setBarrelHighTowerTh2(18);
246 trgsim->bemc->setBarrelHighTowerTh3(24);
248 trgsim->eemc->setEndcapHighTowerTh0(16);
249 trgsim->eemc->setEndcapHighTowerTh1(25);
260 chain3->AddBefore(
"tpcChain",trgsim);
261 chain3->AddBefore(
"tpcChain",trgfilt);
266 gMessMgr->QAInfo() << Form(
"Run is started at Date/Time %i/%i",t.GetDate(),t.GetTime()) << endm;
268 gMessMgr->QAInfo() << Form(
"Run on %s in %s",gSystem->HostName(),gSystem->WorkingDirectory()) << endm;
269 gMessMgr->QAInfo() << Form(
"with %s", Chain->GetCVS()) << endm;
272 Chain->SetAttr(
".Privilege",0,
"*" );
273 Chain->SetAttr(
".Privilege",1,
"StBFChain::*" );
274 Chain->SetAttr(
".Privilege",1,
"StIOInterFace::*" );
275 Chain->SetAttr(
".Privilege",1,
"St_geant_Maker::*");
278 if (Nevents < 0)
return;
279 Int_t iInit = Chain->Init();
280 if (iInit >=
kStEOF) {Chain->FatalErr(iInit,
"on init");
return;}
281 StMaker *treeMk = Chain->GetMaker(
"outputStream");
282 cout <<
"Order of makers in BFCMIXER:" << endl;
283 StMaker::lsMakers(Chain);
284 Chain->EventLoop(Nevents,treeMk);
285 gMessMgr->QAInfo() <<
"Run completed " << endm;
286 gSystem->Exec(
"date");
290 int istat = chain->Init();
292 cout <<
"Chain initialization failed" << endl;
293 chain->Fatal(istat,
"during Init()");
297 cout <<
"Order of makers in BFC:" << endl;
298 StMaker::lsMakers(chain);
299 chain->EventLoop(Nevents);
301 TString trgfile = gSystem->BaseName(fzdfile);
302 trgfile.ReplaceAll(
".fzd",
".trig.root");
303 TFile* ofile = TFile::Open(trgfile,
"recreate");
305 TH2F* hBarrelHighTowerSimu =
new TH2F(
"hBarrelHighTowerSimu",
"BEMC high tower simu;trigger patch;high tower",300,0,300,64,0,64);
306 TH2F* hBarrelPatchSumSimu =
new TH2F(
"hBarrelPatchSumSimu",
"BEMC patch sum simu;trigger patch;patch sum",300,0,300,64,0,64);
307 TH2F* hEndcapHighTowerSimu =
new TH2F(
"hEndcapHighTowerSimu",
"EEMC high tower simu;trigger patch;high tower",90,0,90,64,0,64);
308 TH2F* hEndcapPatchSumSimu =
new TH2F(
"hEndcapPatchSumSimu",
"EEMC patch sum simu;trigger patch;patch sum",90,0,90,64,0,64);
309 TH2F* hBarrelJetPatchSimu =
new TH2F(
"hBarrelJetPatchSimu",
";jet patch;adc",18,0,18,160,0,160);
310 TH2F* hEndcapJetPatchSimu =
new TH2F(
"hEndcapJetPatchSimu",
";jet patch;adc",6,0,6,160,0,160);
311 TH2F* hOverlapJetPatchSimu =
new TH2F(
"hOverlapJetPatchSimu",
";jet patch;adc",6,0,6,160,0,160);
314 cout <<
"Order of makers in BFCMIXER:" << endl;
315 StMaker::lsMakers(Chain);
317 for (
int iEvent = 1; iEvent <= Nevents; ++iEvent) {
319 int status = Chain->
Make(iEvent);
320 if (status ==
kStSkip)
continue;
323 for (
int triggerpatch = 0; triggerpatch < 300; ++triggerpatch) {
324 hBarrelHighTowerSimu->Fill(triggerpatch,trgsim->bemc->getBEMC_FEE_HT_ADC()[triggerpatch]);
325 hBarrelPatchSumSimu->Fill(triggerpatch,trgsim->bemc->getBEMC_FEE_TP_ADC()[triggerpatch]);
328 for (
int jetpatch = 0; jetpatch < 18; ++jetpatch) {
329 hBarrelJetPatchSimu->Fill(jetpatch,trgsim->bemc->barrelJetPatchAdc(jetpatch));
332 for (
int triggerpatch = 0; triggerpatch < 90; ++triggerpatch) {
333 hEndcapHighTowerSimu->Fill(triggerpatch,trgsim->eemc->getOutHT(triggerpatch));
334 hEndcapPatchSumSimu->Fill(triggerpatch,trgsim->eemc->getOutTPsum(triggerpatch));
337 for (
int jetpatch = 0; jetpatch < 6; ++jetpatch) {
338 hEndcapJetPatchSimu->Fill(jetpatch,trgsim->eemc->endcapJetPatchAdc(jetpatch));
341 for (
int i = 0; i < 2; ++i) {
343 trgsim->emc->getOverlapJetPatchAdc(i,jetpatch,adc);
344 hOverlapJetPatchSimu->Fill(jetpatch,adc);
void setAddPed(Bool_t a=true)
Add pedestal offsets from DB.
virtual void Clear(Option_t *option="")
User defined functions.
StBemcRaw * getBemcRaw()
Return the StBemcRaw pointer.
void setOverwrite(Bool_t o=true)
Overwrite the muDst values.
void setDropBad(Bool_t d=true)
Drop bad channels marked as "fail" in DB.
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".
void setSmearPed(Bool_t s=true)
Smear the pedestal with sigma from DB.
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.
void setSource(const Char_t *name)
Set the source of ADC. Can be "MuDst" (default) or "StEvent".