16 void bfcMixer_TpcOnly(Int_t Nevents=100,
17 const Char_t *daqfile=
"/star/rcf/test/daq/2005/051/st_physics_adc_6051006_raw_1050001.daq",
18 const Char_t *tagfile=
"/star/rcf/test/embedding/cuProductionMinBias/FullField/P07ic/2005/051/st_physics_adc_6051006_raw_1050001.tags.root",
21 Double_t eta_low=-1.3,
22 Double_t eta_high=1.3,
23 Double_t vzlow = -175.0,
24 Double_t vzhigh = 175.0,
28 std::vector<Int_t> triggers = 0,
29 const Char_t *prodName =
"P07ib",
30 const Char_t* type =
"FlatPt",
31 const bool bPythia =
false,
32 const Char_t *fzdfile=
"test.fzd"
35 TString prodP07ib(
"P2005b DbV20070518 MakeEvent ITTF Iana ToF ssddat spt SsdIt SvtIt pmdRaw SCEbyE OGridLeak OShortR OSpaceZ2");
36 TString geomP07ib(
"ry2005f");
39 TString prodP12iapp62(
"DbV20060915,pp2006b,ITTF,DbV20081215_EMC_Calibrations,DbV20081215_EEMC_Calibrations -hitfilt");
41 TString geomP12iapp62(
"ry2006h");
43 TString chain1Opt(
"in,magF,tpcDb,NoDefault,-ittf,NoOutput");
44 TString chain2Opt(
"gen_T,geomT,sim_T,trs,-ittf,-tpc_daq,nodefault");
49 chain2Opt +=
",NoInput,PrepEmbed";
53 TString chain3Opt(
"");
54 if (prodName ==
"P12iapp62") { chain3Opt = prodP12iapp62; chain2Opt += geomP12iapp62;}
55 else if (prodName ==
"P07ib") { chain3Opt = prodP07ib; chain2Opt += geomP07ib;}
57 cout <<
"Choice prodName " << prodName <<
" does not correspond to known chain. Processing impossible. " << endl;
60 chain3Opt +=
",TpcMixer,bbcSim,Embedding,onlraw,GeantOut,MiniMcMk,McAna,-in,NoInput,useInTracker,EmbeddingShortCut";
63 gROOT->LoadMacro(
"bfc.C");
64 if (gClassTable->GetID(
"StBFChain") < 0)
Load();
66 Chain =
new StChain(
"Embedding");
68 bfc(-1,chain1Opt,daqfile);
70 chain1->SetName(
"One");
74 bfc(-1,chain2Opt,fzdfile);
80 chain2->SetName(
"Two");
82 if (chain2->GetOption(
"TRS")){
85 cout <<
"Cannot find Trs in chain2" << endl;
88 trsMk->setNormalFactor(2.67);
95 TString OutputFileName(gSystem->BaseName(daqfile));
96 OutputFileName.ReplaceAll(
"*",
"");
97 OutputFileName.ReplaceAll(
".daq",
"");
99 OutputFileName.Append(
".root");
100 bfc(-1,chain3Opt,0,OutputFileName);
102 chain3->SetName(
"Three");
109 gSystem->Load(
"StEmcSimulatorMaker");
110 gSystem->Load(
"StEmcMixerMaker");
111 gSystem->Load(
"StEEmcSimulatorMaker");
116 chain3->AddAfter(
"emcRaw",bemcMixer);
117 chain3->AddAfter(
"emcRaw",bemcSim);
118 chain3->AddAfter(
"emcRaw",mcEventMaker);
119 bemcMixer->SetDebug(0);
129 chain3->AddAfter(
"emcRaw",eemcMixer);
130 chain3->AddAfter(
"emcRaw",eemcFastSim);
132 eemcFastSim->SetEmbeddingMode();
136 bool useEndcapSlowSim =
true;
137 if(useEndcapSlowSim) {
139 chain3->AddAfter(
"EEmcFastSim",slowSim);
146 gMessMgr->QAInfo() << Form(
"Run is started at Date/Time %i/%i",t.GetDate(),t.GetTime()) << endm;
148 gMessMgr->QAInfo() << Form(
"Run on %s in %s",gSystem->HostName(),gSystem->WorkingDirectory()) << endm;
149 gMessMgr->QAInfo() << Form(
"with %s", Chain->GetCVS()) << endm;
154 cout <<
"bfcMixer: Setting PID: "<<pid<<endl;
155 embMk->SetTagFile(tagfile);
157 embMk->
SetOpt( pt_low, pt_high, eta_low, eta_high, 0., 6.283185, type);
159 embMk->SetPartOpt( pid,mult);
162 embMk->SetSkipMode(kTRUE);
167 if ( !triggers.empty() ){
168 for(std::vector<Int_t>::iterator iter = triggers.begin(); iter != triggers.end(); iter++){
169 embMk->SetTrgOpt((*iter)) ;
173 embMk->SetZVertexCut(vzlow, vzhigh) ;
182 Chain->SetAttr(
".Privilege",0,
"*" );
183 Chain->SetAttr(
".Privilege",1,
"StBFChain::*" );
184 Chain->SetAttr(
".Privilege",1,
"StIOInterFace::*" );
185 Chain->SetAttr(
".Privilege",1,
"St_geant_Maker::*");
186 if(!bPythia)Chain->SetAttr(
".Privilege",1,
"StPrepEmbedMaker::*");
188 if (Nevents < 0)
return;
189 Int_t iInit = Chain->Init();
190 if (iInit >=
kStEOF) {Chain->FatalErr(iInit,
"on init");
return;}
191 StMaker *treeMk = Chain->GetMaker(
"outputStream");
192 Chain->EventLoop(Nevents,treeMk);
193 gMessMgr->QAInfo() <<
"Run completed " << endm;
194 gSystem->Exec(
"date");
197 void bfcMixer_TpcOnly(Int_t Nevents,
const Char_t *daqfile, Char_t *tagfile,
198 Double_t pt_low, Double_t pt_high, Double_t eta_low, Double_t eta_high,
199 Double_t vzlow, Double_t vzhigh, Double_t vr, Int_t pid, Double_t mult,
200 const Char_t *triggersC,
const Char_t *prodName,
const Char_t* type) {
201 std::vector<Int_t> triggers;
204 Int_t N = pm.Split(triggersC);
205 for (Int_t i = 0; i < N; i++) {
207 triggers.push_back(num.Atoi());
210 bfcMixer_TpcOnly(Nevents, daqfile, tagfile, pt_low, pt_high, eta_low, eta_high, vzlow, vzhigh, vr, pid, mult, triggers, prodName, type);
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...
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.
void setEmbeddingMode(Bool_t e=true)
Sets all switches required to perform embedding.