StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bfcMixer_TpcSvtSsd2005.C
1 //
3 // Macro for running chain with different inputs
4 //
5 // Owner: Yuri Fisyak
6 //
7 // $Id: bfcMixer_TpcSvtSsd2005.C,v 1.5 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_TpcSvtSsd2005(const Int_t Nevents=100,Int_t isSvtIn=1, Int_t isSsdIn=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 Double_t pt_low=0.1,
20  const Double_t pt_high=5.0,
21  const Double_t eta_low=-1.0,
22  const Double_t eta_high=1.0,
23  const Int_t pid=9,
24  const Double_t mult = 0.1) {
25  // production chain for P07ib
26  TString prodP07ib("P2005b DbV20070518 MakeEvent ITTF Iana ToF spt SsdIt SvtIt pmdRaw SCEbyE OGridLeak OShortR OSpaceZ2 ssd_daq");// KeepSvtHit hitfilt skip1row");
27  TString geomP07ib("ry2005f");
28  TString chain1Opt("in magF tpcDb NoDefault -ittf NoOutput");
29  TString chain2Opt("NoInput PrepEmbed gen_T geomT sim_T trs -ittf -tpc_daq nodefault");
30  chain2Opt += " "; chain2Opt += geomP07ib;
31  TString chain3Opt = prodP07ib;
32  chain3Opt += " TpcMixer Embedding onlraw GeantOut MiniMcMk McAna IdTruth -in NoInput,useInTracker EmbeddingShortCut";
33  if (isSvtIn) chain3Opt += " SvtEmbed";
34  if (isSsdIn) {
35  chain1Opt += ",ssddat";
36  chain2Opt += ",ssd,McEvent,-spt";
37  chain3Opt += ",SsdEmbed";
38  }
39  chain3Opt += " "; chain3Opt += geomP07ib;
40  // Dynamically link some shared libs
41  gROOT->LoadMacro("bfc.C");
42  if (gClassTable->GetID("StBFChain") < 0) Load();
43  //______________Create the main chain object______________________________________
44  Chain = new StChain("Embedding");
45  //________________________________________________________________________________
46  bfc(-1,chain1Opt,daqfile);
47  chain1 = chain;
48  chain1->SetName("One");
49  Chain->cd();
50  //________________________________________________________________________________
51  bfc(-1,chain2Opt);
52  chain2 = chain;
53  chain2->SetName("Two");
54  Chain->cd();
55  if (chain2->GetOption("TRS")){
56  StTrsMaker *trsMk = (StTrsMaker *) chain2->GetMaker("Trs");
57  if (! trsMk) {
58  cout << "Cannot find Trs in chain2" << endl;
59  return;
60  }
61  trsMk->setNormalFactor(2.67);
62  }
63  //________________________________________________________________________________
64  // gSystem->Load("StFtpcMixerMaker");
65  // StFtpcMixerMaker *ftpcmixer = new StFtpcMixerMaker("FtpcMixer","daq","trs");
66  //________________________________________________________________________________
67  TString OutputFileName(gSystem->BaseName(daqfile));
68  OutputFileName.ReplaceAll("*","");
69  OutputFileName.ReplaceAll(".daq","");
70  // OutputFileName.Append("_emb.root");
71  OutputFileName.Append(".root");
72  bfc(-1,chain3Opt,0,OutputFileName);
73  chain3 = chain;
74  chain3->SetName("Three");
75  Chain->cd();
76  Chain->cd();
77  //________________________________________________________________________________
78  {
79  TDatime t;
80  gMessMgr->QAInfo() << Form("Run is started at Date/Time %i/%i",t.GetDate(),t.GetTime()) << endm;
81  }
82  gMessMgr->QAInfo() << Form("Run on %s in %s",gSystem->HostName(),gSystem->WorkingDirectory()) << endm;
83  gMessMgr->QAInfo() << Form("with %s", Chain->GetCVS()) << endm;
84  // embedded particle set
85  StPrepEmbedMaker *embMk = (StPrepEmbedMaker *) Chain->Maker("PrepEmbed");
86  if (! embMk) return;
87  embMk->SetTagFile(tagfile);
88  // pTlow,ptHigh,etaLow,etaHigh,phiLow,phiHigh
89  embMk->SetOpt( pt_low, pt_high, eta_low, eta_high, 0., 6.283185);
90  // pid, mult
91  embMk->SetPartOpt( pid,mult);
92  TAttr::SetDebug(0);
93  Chain->SetAttr(".Privilege",0,"*" ); //All makers are NOT priviliged
94  Chain->SetAttr(".Privilege",1,"StBFChain::*" ); //StBFChain is priviliged
95  Chain->SetAttr(".Privilege",1,"StIOInterFace::*" ); //All IO makers are priviliged
96  Chain->SetAttr(".Privilege",1,"St_geant_Maker::*"); //It is also IO maker
97  Chain->SetAttr(".Privilege",1,"StPrepEmbedMaker::*"); //It is also IO maker
98  StMaker *SsdEmbed = Chain->Maker("SsdEmbed");
99  if (SsdEmbed) {
100  cout << "SsdEmbed has been found ----------------------------------------" << endl;
101  SsdEmbed->SetInput("SsdRealData","One/.make/SpaStrip/.data/spa_strip");
102  SsdEmbed->SetInput("SsdSimuData","Two/.make/SpaStrip/.data/spa_strip");
103  StMaker *SsdPoint = Chain->Maker("SsdPoint");
104  if (SsdPoint) {
105  cout << "SsdPoint has been found----------------------------------------" << endl;
106  SsdPoint->SetInput("SpaStrip","SsdEmbed");
107  }
108  }
109  // Chain->SetDEBUG(0);
110  if (Nevents < 0) return;
111  Int_t iInit = Chain->Init();
112  if (iInit >= kStEOF) {Chain->FatalErr(iInit,"on init"); return;}
113  StMaker *treeMk = Chain->GetMaker("outputStream");
114  Chain->EventLoop(Nevents,treeMk);
115  gMessMgr->QAInfo() << "Run completed " << endm;
116  gSystem->Exec("date");
117 }
118 
119 
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