StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bfcMixer_Unified.C
1 //
3 // Macro for running chain with different inputs
4 //
5 // Owner: Yuri Fisyak
6 //
7 // $Id: bfcMixer_Unified.C,v 1.7 2013/04/28 14:41:31 fisyak Exp $
8 //
10 
11 class StChain;
12 StChain *Chain=0;
13 class StBFChain;
14 StBFChain *chain1, *chain2, *chain3;
15 //_____________________________________________________________________
16 void bfcMixer_Unified(const Int_t Nevents=1,
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",
19  const Float_t pt_low=-0.1,
20  const Float_t pt_high=5.0,
21  const Int_t pid=9,
22  const Double_t mult = 0.1,
23  const Char_t *mode="strange",
24  const Char_t *acc_mode="off" ) {
25  // production chain and geometry for P07ib
26  TString prodP07ib("P2005b DbV20070518 MakeEvent ITTF Iana ToF ssddat spt SsdIt SvtIt pmdRaw SCEbyE OGridLeak OShortR OSpaceZ2");// KeepSvtHit hitfilt skip1row");
27  TString geomP07ib("ry2005f");
28 
29  // production chain and geometry for P07id 20 GeV AuAu (2001) reproduction
30  TString prodP07id20GeV("ry2001 in tpc_daq tpcI fcf ITTF noSsdIt ftpc IAna VFMinuit l3onl emcDY2 ZDCvtx Physics Idst l0 tags Tree evout hitfilt corr4 OSpaceZ2 OGridLeak3D");
31  TString geomP07id20GeV("ry2001");
32 
33  // production chain P07id st_gamma express stream (2007 Au+Au)
34  TString prodP07idStGamma("DbV20071012 P2007 ITTF pmdReco -SsdIt -SvtIt -dstout");
35  TString geomP07idStGamma("ry2007");
36 
37  // Here you choose your production options and geometry from those strings defined above
38  TString prod = prodP07idStGamma;
39  TString geom = geomP07idStGamma;
40 
41  TString chain1Opt("in magF tpcDb NoDefault -ittf NoOutput adcOnly");
42  TString chain2Opt("NoInput PrepEmbed gen_T geomT sim_T trs -ittf -tpc_daq nodefault");
43  chain2Opt += " "; chain2Opt += geom;
44  TString chain3Opt = prod;
45  chain3Opt += " TpcMixer Embedding onlraw GeantOut MiniMcMk -in NoInput,useInTracker EmbeddingShortCut";
46  chain3Opt += " "; chain3Opt += geom;
47  // Dynamically link some shared libs
48  gROOT->LoadMacro("bfc.C");
49  if (gClassTable->GetID("StBFChain") < 0) Load();
50  //______________Create the main chain object______________________________________
51  Chain = new StChain("Embedding");
52  //________________________________________________________________________________
53  bfc(-1,chain1Opt,daqfile);
54  chain1 = chain;
55  chain1->SetName("One");
56  Chain->cd();
57  //________________________________________________________________________________
58  bfc(-1,chain2Opt);
59  chain2 = chain;
60  chain2->SetName("Two");
61  Chain->cd();
62  if (chain2->GetOption("TRS")){
63  StTrsMaker *trsMk = (StTrsMaker *) chain2->GetMaker("Trs");
64  if (! trsMk) {
65  cout << "Cannot find Trs in chain2" << endl;
66  return;
67  }
68  trsMk->setNormalFactor(2.67);
69  }
70  //________________________________________________________________________________
71  // gSystem->Load("StFtpcMixerMaker");
72  // StFtpcMixerMaker *ftpcmixer = new StFtpcMixerMaker("FtpcMixer","daq","trs");
73  //________________________________________________________________________________
74  TString OutputFileName(gSystem->BaseName(daqfile));
75  OutputFileName.ReplaceAll("*","");
76  OutputFileName.ReplaceAll(".daq","");
77  OutputFileName.Append("_emb.root");
78  bfc(-1,chain3Opt,0,OutputFileName);
79  chain3 = chain;
80  chain3->SetName("Three");
81  Chain->cd();
82  Chain->cd();
83  //________________________________________________________________________________
84  {
85  TDatime t;
86  gMessMgr->QAInfo() << Form("Run is started at Date/Time %i/%i",t.GetDate(),t.GetTime()) << endm;
87  }
88  gMessMgr->QAInfo() << Form("Run on %s in %s",gSystem->HostName(),gSystem->WorkingDirectory()) << endm;
89  gMessMgr->QAInfo() << Form("with %s", Chain->GetCVS()) << endm;
90  // embedded particle set
91  StPrepEmbedMaker *embMk = (StPrepEmbedMaker *) Chain->Maker("PrepEmbed");
92  if (! embMk) return;
93  embMk->SetTagFile(tagfile);
94  // pTlow,ptHigh,etaLow,etaHigh,phiLow,phiHigh
95  embMk->SetOpt( pt_low, pt_high, -1.3, 1.3, 0., 6.28);
96  // pid, mult
97  embMk->SetPartOpt( pid,mult);
98  TAttr::SetDebug(0);
99  Chain->SetAttr(".Privilege",0,"*" ); //All makers are NOT priviliged
100  Chain->SetAttr(".Privilege",1,"StBFChain::*" ); //StBFChain is priviliged
101  Chain->SetAttr(".Privilege",1,"StIOInterFace::*" ); //All IO makers are priviliged
102  Chain->SetAttr(".Privilege",1,"St_geant_Maker::*"); //It is also IO maker
103  Chain->SetAttr(".Privilege",1,"StPrepEmbedMaker::*"); //It is also IO maker
104  // Chain->SetDEBUG(0);
105  if (Nevents < 0) return;
106  Int_t iInit = Chain->Init();
107  if (iInit >= kStEOF) {Chain->FatalErr(iInit,"on init"); return;}
108  StMaker *treeMk = Chain->GetMaker("outputStream");
109  Chain->EventLoop(Nevents,treeMk);
110  gMessMgr->QAInfo() << "Run completed " << endm;
111  gSystem->Exec("date");
112 }
113 
114 // $Log: bfcMixer_Unified.C,v $
115 // Revision 1.7 2013/04/28 14:41:31 fisyak
116 // Clean up after retirement of St_tpcdaq_Maker, StRTSClient and StMixer
117 //
118 // Revision 1.6 2013/04/24 15:27:28 fisyak
119 // Retire tpcdaq, StMixer, bug #2580
120 //
121 // Revision 1.5 2010/02/18 23:55:30 fisyak
122 // Add EmbeddingShortCut to chain3 for embedding with Trs
123 //
124 // Revision 1.4 2009/02/23 20:58:03 fisyak
125 // Add to production chain Iana option to turn on dE/dx. V0, Xi, ...
126 //
127 // Revision 1.3 2008/01/22 14:52:26 lbarnby
128 // Add adcOnly option. Enables efficient processing of st_gamma daq files
129 //
130 // Revision 1.2 2008/01/15 15:34:31 lbarnby
131 // Added arguments for pt limits, PID and multiplicity fractino or number and removed Zzvertex limit arguments as they were not being used
132 //
133 // Revision 1.1 2007/12/22 01:19:57 lbarnby
134 // Initial revision with P07id chains for Y7 200 GeV Au+Au st_gamma and 20 GeV Au+Au reproduction
135 //
Prepare GEANT Maker with input from embedding settings and DAQ event.
Definition: Stypes.h:43
virtual Int_t Load()
Routine handling library loading depending on chain options.
Definition: StBFChain.cxx:117