StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bfcMixer_TpcSvtSsd.C
1 //
3 // Macro for running chain with different inputs
4 //
5 // Owner: Yuri Fisyak
6 //
7 // $Id: bfcMixer_TpcSvtSsd.C,v 1.16 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_TpcSvtSsd(const Int_t Nevents=500,Int_t isSvtIn=1, Int_t isSsdIn=1,
17  const Char_t *daqfile="/star/rcf/test/daq/2007/113/8113044/st_physics_8113044_raw_1040042.daq",
18  const Char_t *tagfile="/star/rcf/test/embedding/2007ProductionMinBias/FullField/P08if/2007/113/8113044/st_physics_8113044_raw_1040042.tags.root",
19  const Double_t pt_low=0.1,
20  const Double_t pt_high=5.0,
21  const Double_t eta_low=-1.1,
22  const Double_t eta_high=1.1,
23  const Double_t vzlow=-175.0,
24  const Double_t vzhigh=175.0,
25  const Int_t pid=8,
26  const Double_t mult = 100.,
27  const std::vector<Int_t> triggers = 0,
28  const Char_t* prodName = "P08icAuAu",
29  const Char_t* mode="flatpt"
30 ) {
31  // Separate DB timestamp to add it in both chain1 and chain3
32  TString DbVP06idpp("DbV20060729 ");
33  TString DbVP07icCuCu("DbV20070518 ");
34  TString DbVP08icAuAu("DbV20080418 ");
35 
36  // production chains for P06id - p+p 200 GeV (Run6)
37  TString prodP06idpp("pp2006b ITTF OSpaceZ2 OGridLeak3D VFMCE -VFPPVnoCTB -hitfilt");
38 
39  // production chain for P07ib
40 // TString prodP07ib("P2005b DbV20070518 MakeEvent ITTF Iana ToF spt SsdIt SvtIt pmdRaw SCEbyE OGridLeak OShortR OSpaceZ2 ssd_daq");// KeepSvtHit hitfilt skip1row");
41 
42  // production chain for P07ic - Cu+Cu 200 GeV (Run5)
43  TString prodP07icCuCu("P2005b DbV20070518 MakeEvent ITTF ToF ssddat spt SsdIt SvtIt pmdRaw OGridLeak OShortR OSpaceZ2 KeepSvtHit skip1row VFMCE -VFMinuit -hitfilt");
44 
45  // production chain for P08if
46 // TString prodP08if("B2007g DbV20080418 adcOnly MakeEvent ITTF Iana ToF spt SsdIt SvtIt pmdRaw SCEbyE OShortR trgd Corr5 OSpaceZ2 ssd_daq KeepSvtHit -hitfilt VFMCE");// KeepSvtHit hitfilt skip1row");
47 
48  // Production chain for P08ic Au+Au 200 GeV (Run7)
49  TString prodP08icAuAu("B2007g ITTF adcOnly IAna KeepSvtHit VFMCE -hitfilt l3onl emcDY2 fpd ftpc trgd ZDCvtx svtIT ssdIT Corr5 -dstout");
50 
51  TString geomP06id("ry2006");
52  TString geomP07ic("ry2005f");
53  TString geomP08ic("ry2007g");
54 // TString chain1Opt("in magF tpcDb adcOnly NoDefault -ittf NoOutput");
55  TString chain1Opt("in magF tpcDb NoDefault -ittf NoOutput");
56  TString chain2Opt("NoInput PrepEmbed gen_T geomT sim_T trs -ittf -tpc_daq nodefault");
57 
58  TString chain3Opt("");
59  if( prodName == "P06idpp") {
60  chain1Opt.Prepend(DbVP06idpp);
61  chain2Opt += " "; chain2Opt += geomP06id;
62  chain3Opt = prodP06idpp ;
63  }
64  else if( prodName == "P07ic" ){
65  chain1Opt.Prepend(DbVP07icCuCu);
66  chain2Opt += " "; chain2Opt += geomP07ic;
67  chain3Opt = prodP07icCuCu;
68  }
69  else if ( prodName == "P08icAuAu" ){
70  chain1Opt.Prepend(DbVP08icAuAu);
71  chain2Opt += " "; chain2Opt += geomP08ic;
72  chain3Opt = prodP08icAuAu ;
73  }
74  else{
75  cout << "Choice prodName does not correspond to known chain. Processing impossible. " << endl;
76  return;
77  }
78  // chain3Opt += " Embedding onlraw GeantOut MiniMcMk McAna IdTruth -in NoInput,useInTracker EmbeddingShortCut";
79 // chain3Opt += " Embedding onlraw McEvent McEvOut GeantOut MiniMcMk McAna IdTruth -in NoInput,useInTracker -hitfilt EmbeddingShortCut";
80  chain3Opt += " TpcMixer Embedding onlraw McEvent McEvOut GeantOut MiniMcMk McAna IdTruth -in NoInput,useInTracker -hitfilt -TrsPileUp -TrsToF";
81  // chain3Opt += " Embedding onlraw McEvent McEvOut GeantOut IdTruth -in NoInput -hitfilt EmbeddingShortCut";
82 
83  if (isSvtIn) chain3Opt += " SvtEmbed";
84  if (isSsdIn) {
85  chain1Opt += ",ssddat";
86  chain2Opt += ",ssd,McEvent,-spt";
87  chain3Opt += ",SsdEmbed";
88  }
89 
90  if( prodName == "P06idpp") {
91  chain3Opt.Prepend(DbVP06idpp);
92  chain3Opt += " "; chain3Opt += geomP06id;
93  }
94  else if( prodName == "P07ic" ){
95  chain3Opt.Prepend(DbVP07icCuCu);
96  chain3Opt += " "; chain3Opt += geomP07ic;
97  }
98  else if ( prodName == "P08icAuAu" ){
99  chain3Opt.Prepend(DbVP08icAuAu);
100  chain3Opt += " "; chain3Opt += geomP08ic;
101  }
102  else{
103  cout << "Choice prodName does not correspond to known chain. Processing impossible. " << endl;
104  return;
105  }
106 
107  // Dynamically link some shared libs
108  gROOT->LoadMacro("bfc.C");
109  if (gClassTable->GetID("StBFChain") < 0) Load();
110  //______________Create the main chain object______________________________________
111  Chain = new StChain("Embedding");
112  //________________________________________________________________________________
113  bfc(-1,chain1Opt,daqfile);
114  chain1 = chain;
115  chain1->SetName("One");
116  Chain->cd();
117  //________________________________________________________________________________
118  bfc(-1,chain2Opt);
119  chain2 = chain;
120  chain2->SetName("Two");
121  Chain->cd();
122  if (chain2->GetOption("TRS")){
123  StTrsMaker *trsMk = (StTrsMaker *) chain2->GetMaker("Trs");
124  if (! trsMk) {
125  cout << "Cannot find Trs in chain2" << endl;
126  return;
127  }
128  trsMk->setNormalFactor(1.05);
129  trsMk->SetMode(0);
130  }
131  //________________________________________________________________________________
132  // gSystem->Load("StFtpcMixerMaker");
133  // StFtpcMixerMaker *ftpcmixer = new StFtpcMixerMaker("FtpcMixer","daq","trs");
134  //________________________________________________________________________________
135  TString OutputFileName(gSystem->BaseName(daqfile));
136  OutputFileName.ReplaceAll("*","");
137  OutputFileName.ReplaceAll(".daq","");
138  // OutputFileName.Append("_emb.root");
139  OutputFileName.Append(".root");
140  bfc(-1,chain3Opt,0,OutputFileName);
141  chain3 = chain;
142  chain3->SetName("Three");
143  Chain->cd();
144  Chain->cd();
145  //________________________________________________________________________________
146  {
147  TDatime t;
148  gMessMgr->QAInfo() << Form("Run is started at Date/Time %i/%i",t.GetDate(),t.GetTime()) << endm;
149  }
150  gMessMgr->QAInfo() << Form("Run on %s in %s",gSystem->HostName(),gSystem->WorkingDirectory()) << endm;
151  gMessMgr->QAInfo() << Form("with %s", Chain->GetCVS()) << endm;
152  // embedded particle set
153  StPrepEmbedMaker *embMk = (StPrepEmbedMaker *) Chain->Maker("PrepEmbed");
154  if (! embMk) return;
155  embMk->SetTagFile(tagfile);
156  // pTlow,ptHigh,etaLow,etaHigh,phiLow,phiHigh
157  embMk->SetOpt( pt_low, pt_high, eta_low, eta_high, 0., 6.283185, mode);
158  // pid, mult
159  embMk->SetPartOpt( pid,mult);
160 
161  // Set Skip mode (default is OFF)
162  embMk->SetSkipMode(kFALSE) ;
163 
164  // Make trigger and z-vertex cuts (only if SkipMode is true)
165  // Trigger cut
166  // Can put multiple trigger id's
167  if ( !triggers.empty() ){
168  for(std::vector<Int_t>::iterator iter = triggers.begin(); iter != triggers.end(); iter++){
169  embMk->SetTrgOpt((*iter)) ;
170  }
171  }
172 
173  // z-vertex cuts
174  embMk->SetZVertexCut(vzlow, vzhigh) ;
175 
176  TAttr::SetDebug(0);
177  Chain->SetAttr(".Privilege",0,"*" ); //All makers are NOT priviliged
178  Chain->SetAttr(".Privilege",1,"StBFChain::*" ); //StBFChain is priviliged
179  Chain->SetAttr(".Privilege",1,"StIOInterFace::*" ); //All IO makers are priviliged
180  Chain->SetAttr(".Privilege",1,"St_geant_Maker::*"); //It is also IO maker
181  Chain->SetAttr(".Privilege",1,"StPrepEmbedMaker::*"); //It is also IO maker
182  StMaker *SsdEmbed = Chain->Maker("SsdEmbed");
183  if (SsdEmbed) {
184  cout << "SsdEmbed has been found ----------------------------------------" << endl;
185  SsdEmbed->SetInput("SsdRealData","One/.make/SpaStrip/.data/spa_strip");
186  SsdEmbed->SetInput("SsdSimuData","Two/.make/SpaStrip/.data/spa_strip");
187  StMaker *SsdPoint = Chain->Maker("SsdPoint");
188  if (SsdPoint) {
189  cout << "SsdPoint has been found----------------------------------------" << endl;
190  SsdPoint->SetInput("SpaStrip","SsdEmbed");
191  }
192  }
193  // Chain->SetDEBUG(0);
194  if (Nevents < 0) return;
195  Int_t iInit = Chain->Init();
196  if (iInit >= kStEOF) {Chain->FatalErr(iInit,"on init"); return;}
197  StMaker *treeMk = Chain->GetMaker("outputStream");
198 
199  Chain->EventLoop(Nevents,treeMk);
200  gMessMgr->QAInfo() << "Run completed " << endm;
201  gSystem->Exec("date");
202 }
203 
204 // $Log: bfcMixer_TpcSvtSsd.C,v $
205 // Revision 1.16 2013/04/28 14:41:31 fisyak
206 // Clean up after retirement of St_tpcdaq_Maker, StRTSClient and StMixer
207 //
208 // Revision 1.15 2013/04/24 15:27:28 fisyak
209 // Retire tpcdaq, StMixer, bug #2580
210 //
211 // Revision 1.14 2010/11/24 19:15:37 hmasui
212 // Separate DbV timestamp from the main chain string in order to include it into chain1
213 //
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