7 void bfcMixer_Hft(Int_t Nevents=1 ,
8 const Char_t *daqfile=
"/star/data100/GRID/daq/2014/st_zerobias_adc_15167009_raw_0000011.daq",
9 const Char_t *tagfile=
"/star/data100/GRID/daq/2014/st_physics_adc_15167009_raw_1000012.tags.root",
11 Double_t pt_high=10.0,
12 Double_t eta_low=-1.5,
13 Double_t eta_high=1.5,
14 Double_t vzlow = -150.0,
15 Double_t vzhigh = 150.0,
19 std::vector<Int_t> triggers = 0,
20 const Char_t *prodName =
"P16idAuAu200hftZB",
21 const Char_t* type =
"FlatPt",
22 const bool bPythia =
true,
23 const Char_t *fzdfile=
"test_full_field_pos.fzd"
28 TString prodP16idAuAu200hft (
"DbV20160418 P2014a pxlHit istHit btof mtd mtdCalib BEmcChkStat CorrX OSpaceZ2 OGridLeak3D ODistoSmear -hitfilt -vfminuit vfmce tpxclu pxlslowsim istslowsim nosvtit nossdit" );
30 TString prodP16idAuAu200hftZB(
"DbV20160418 P2014a pxlHit istHit btof mtd mtdCalib BEmcChkStat CorrX OSpaceZ2 OGridLeak3D ODistoSmear -hitfilt vfminuit -vfmce tpxclu pxlslowsim istslowsim nosvtit nossdit" );
34 TString prodP16ijAuAu200hft (
"DbV20161018 P2016a StiCA mtd mtdCalib btof PxlHit IstHit BEmcChkStat CorrX OSpaceZ2 OGridLeak3D ODistoSmear -hitfilt -vfminuit vfmce tpxclu pxlslowsim istslowsim nosvtit nossdit ");
35 TString prodP16ijAuAu200hftZB(
"DbV20161018 P2016a StiCA mtd mtdCalib btof PxlHit IstHit BEmcChkStat CorrX OSpaceZ2 OGridLeak3D ODistoSmear -hitfilt vfminuit -vfmce tpxclu pxlslowsim istslowsim nosvtit nossdit ");
38 TString prodP17iddAu200hft (
"DbV20161216 P2016a StiCA mtd mtdCalib btof PxlHit IstHit BEmcChkStat CorrX OSpaceZ2 OGridLeak3D ODistoSmear -hitfilt -vfminuit vfmce tpxclu pxlslowsim istslowsim nosvtit nossdit ");
41 TString prodP17iddAu62hft (
"DbV20170426 P2016a StiCA mtd mtdCalib btof PxlHit IstHit BEmcChkStat CorrX OSpaceZ2 OGridLeak3D ODistoSmear -hitfilt -vfminuit vfmce tpxclu pxlslowsim istslowsim nosvtit nossdit ");
44 TString geomP16ij(
"ry2016x");
45 TString geomP16id(
"ry2014x");
46 TString geomP17id(
"ry2016x");
48 TString chain1Opt(
" in magF tpcDb NoDefault TpxRaw -ittf NoOutput");
49 TString chain2Opt(
" gen_T geomT sim_T TpcRS -ittf -tpc_daq nodefault");
50 TString chain3Opt(
"");
52 if(bPythia){ chain2Opt +=
",fzin bigbig "; }
53 else { chain2Opt +=
",NoInput,PrepEmbed "; }
55 if (prodName ==
"P16idAuAu200hft"){
56 chain2Opt += geomP16id;
57 chain3Opt += prodP16idAuAu200hft;
59 else if (prodName ==
"P16idAuAu200hftZB"){
60 chain2Opt += geomP16id;
61 chain3Opt += prodP16idAuAu200hftZB;
63 else if (prodName ==
"P16ijAuAu200hft" ) {
64 chain2Opt += geomP16ij;
65 chain3Opt += prodP16ijAuAu200hft;
67 else if (prodName ==
"P16ijAuAu200hftZB" ) {
68 chain2Opt += geomP16ij;
69 chain3Opt += prodP16ijAuAu200hftZB;
71 else if (prodName ==
"P17iddAu200hft" ) {
72 chain2Opt += geomP17id;
73 chain3Opt += prodP17iddAu200hft;
75 else if (prodName ==
"P17iddAu62hft" ) {
76 chain2Opt += geomP17id;
77 chain3Opt += prodP17iddAu62hft;
81 cout <<
"Choice prodName " << prodName <<
" does not correspond to known chain. Processing impossible. " << endl;
84 chain3Opt +=
",TpcMixer,GeantOut,MiniMcMk,McAna,-in,NoInput,useInTracker";
85 chain3Opt +=
",mcevout";
88 gROOT->LoadMacro(
"bfc.C");
89 if (gClassTable->GetID(
"StBFChain") < 0)
Load();
91 Chain =
new StChain(
"Embedding");
93 bfc(-1,chain1Opt,daqfile);
95 chain1->SetName(
"One");
99 bfc(-1,chain2Opt,fzdfile);
101 chain2->SetName(
"Two");
103 if (chain2->GetOption(
"TRS")){
106 cout <<
"Cannot find Trs in chain2" << endl;
109 trsMk->setNormalFactor(1.32);
115 chain2->SetName(
"Two");
121 if (chain2->GetOption(
"TRS")){
124 cout <<
"Cannot find Trs in chain2" << endl;
127 trsMk->setNormalFactor(1.32);
135 TString OutputFileName(gSystem->BaseName(daqfile)); {
136 OutputFileName.ReplaceAll(
"*",
"");
137 OutputFileName.ReplaceAll(
".daq",
"");
139 OutputFileName.Append(
".root");
141 bfc(-1,chain3Opt,0,OutputFileName);
143 chain3->SetName(
"Three");
147 if( prodName ==
"P08icAuAu200")
149 mixer->SetInput(
"Input1",
"MixerEvent");
153 mixer->SetInput(
"Input1",
"TpxRaw/.data/Event");
156 if (chain2Opt.Contains(
"TpcRS",TString::kIgnoreCase)) {
157 mixer->SetInput(
"Input2",
"TpcRS/Event");
159 mixer->SetInput(
"Input2",
"Trs/.const/Event");
172 istRawHitMaker->setDoEmbedding(kTRUE);
183 gSystem->Load(
"StEmcSimulatorMaker");
184 gSystem->Load(
"StEmcMixerMaker");
185 gSystem->Load(
"StEEmcSimulatorMaker");
190 chain3->AddAfter(
"emcRaw",bemcMixer);
191 chain3->AddAfter(
"emcRaw",bemcSim);
192 chain3->AddAfter(
"emcRaw",mcEventMaker);
193 bemcMixer->SetDebug(0);
203 chain3->AddAfter(
"emcRaw",eemcMixer);
204 chain3->AddAfter(
"emcRaw",eemcFastSim);
206 eemcFastSim->SetEmbeddingMode();
208 bool useEndcapSlowSim =
true;
if(useEndcapSlowSim) {
210 chain3->AddAfter(
"EEmcFastSim",slowSim);
219 gMessMgr->QAInfo() << Form(
"Run is started at Date/Time %i/%i",t.GetDate(),t.GetTime()) << endm;
221 gMessMgr->QAInfo() << Form(
"Run on %s in %s",gSystem->HostName(),gSystem->WorkingDirectory()) << endm;
222 gMessMgr->QAInfo() << Form(
"with %s", Chain->GetCVS()) << endm;
228 cout <<
"bfcMixer: Setting PID: "<<pid<<endl;
229 embMk->SetTagFile(tagfile);
231 embMk->
SetOpt( pt_low, pt_high, eta_low, eta_high, 0., 6.283185, type);
233 embMk->SetPartOpt( pid,mult);
236 embMk->SetSkipMode(kTRUE);
238 embMk->SetTemp(0.35);
248 if ( !triggers.empty() ){
249 for(std::vector<Int_t>::iterator iter = triggers.begin(); iter != triggers.end(); iter++){
250 embMk->SetTrgOpt((*iter)) ;
254 embMk->SetZVertexCut(vzlow, vzhigh) ;
269 TString checkProdName( prodName );
270 if ( checkProdName ==
"P16idAuAu200hft" || checkProdName ==
"P16ijAuAu200hft" || checkProdName ==
"P17iddAu200hft") {
273 gSystem->Load(
"StarGeneratorUtil.so" );
274 gSystem->Load(
"StarGeneratorEvent.so" );
275 gSystem->Load(
"StarGeneratorBase.so" );
276 gSystem->Load(
"StarGeneratorEmbed.so" );
279 mk->SetInputFile( tagfile );
280 chain2 -> AddBefore(
"geant", mk );
286 Chain->SetAttr(
".Privilege",0,
"*" );
287 Chain->SetAttr(
".Privilege",1,
"StBFChain::*" );
288 Chain->SetAttr(
".Privilege",1,
"StIOInterFace::*" );
289 Chain->SetAttr(
".Privilege",1,
"St_geant_Maker::*");
290 if(!bPythia)Chain->SetAttr(
".Privilege",1,
"StPrepEmbedMaker::*");
293 if (Nevents < 0)
return;
295 Int_t iInit = Chain->Init();
296 if (iInit >=
kStEOF) {Chain->FatalErr(iInit,
"on init");
return;}
297 StMaker *treeMk = Chain->GetMaker(
"outputStream");
302 TString START(gSystem->Getenv(
"EVENTS_START"));
304 int nskip = START.Atoi();
306 gMessMgr->QAInfo() <<
"SUMS is splitting this file" << endm;
307 gMessMgr->QAInfo() <<
"EVENTS_START = " << nskip << endm;
308 chain1->Skip(nskip-1);
309 gMessMgr->QAInfo() <<
"... chain 1 has been advanced... allons y" << endm;
313 Chain->EventLoop(Nevents,treeMk);
315 gMessMgr->QAInfo() <<
"Run completed " << endm;
316 gSystem->Exec(
"date");
320 void bfcMixer_Hft(Int_t Nevents,
const Char_t *daqfile, Char_t *tagfile,
321 Double_t pt_low, Double_t pt_high, Double_t eta_low, Double_t eta_high,
322 Double_t vzlow, Double_t vzhigh, Double_t vr, Int_t pid, Double_t mult,
323 const Char_t *triggersC,
const Char_t *prodName,
const Char_t* type) {
324 std::vector<Int_t> triggers;
327 Int_t N = pm.Split(triggersC);
328 for (Int_t i = 0; i < N; i++) {
330 triggers.push_back(num.Atoi());
333 bfcMixer_Hft(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.
void SetFileName(const Char_t *name)
Set the filename of the output TTree.
void setDataType(int nDataType=0)
0 - All data; 1 - non-ZS data; 2 - ZS data; 3 - ZS first data
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.