StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bfcSpin2005.C
1 //
2 // Pibero Djawotho <pibero@tamu.edu>
3 // Texas A&M University
4 // 5 December 2009
5 //
6 // Example macro to use the BFC trigger filter maker.
7 // Takes as input fzd file, then processes EMC response.
8 // If event fires selected bits from EMC layer 2 DSM
9 // (which corresponds to selecting triggers), then
10 // BFC reconstruction continues. Otherwise, event
11 // is skipped. Substantial savings in processing
12 // time and disk space can be achieved when
13 // reconstruction of complex detectors like the
14 // TPC is skipped for uninteresting events.
15 //
16 
17 class StBFChain;
18 StBFChain* chain = 0;
19 
20 void bfcSpin2005(int nevents = 100,
21  const char* chainopt = "trs fss y2005h Idst IAna l0 tpcI fcf ftpc Tree logger ITTF Sti VFPPV NoSvtIt NoSsdIt bbcSim tofsim tags emcY2 EEfs evout IdTruth geantout big fzin MiniMcMk eemcDb beamLine clearmem sdt20050727",
22  const char* fzfile = "rcf10100_1_100evts.fzd")
23 {
24  gROOT->LoadMacro("bfc.C");
25  bfc(-1,chainopt,fzfile);
26 
27  // We want to achieve the following ordering for makers:
28  // 1. BBC simulator
29  // 2. EMC makers (emcY2+eefs)
30  // 3. EEMC slow simulator
31  // 4. Pythia event maker
32  // 5. Trigger simulator
33  // 6. Trigger filter
34  // 7. TPC maker
35 
36  // Use full EEMC detector
37  StEEmcFastMaker* eefs = dynamic_cast<StEEmcFastMaker*>(chain->GetMaker("eefs"));
38  assert(eefs);
39  eefs->UseFullTower(true);
40  //eefs->UseFullPreShower(true);
41  //eefs->UseFullSmdu(true);
42  //eefs->UseFullSmdv(true);
43 
44  // Place TPC chain after EMC makers
45  chain->AddAfter("eefs",chain->GetMaker("tpcChain"));
46 
47  // Place Pythia maker after GEANT maker
48  // and trigger filter after EMC makers
49  gSystem->Load("StJetSkimEvent");
50  gSystem->Load("StBfcTriggerFilterMaker");
51 
53  TString pyfile = gSystem->BaseName(fzfile);
54  pyfile.ReplaceAll(".fzd",".pythia.root");
55  pythia->SetPythiaFile(pyfile);
56  chain->AddAfter("geant",pythia);
57 
58  // Place trigger simulator after EMC makers
59  gSystem->Load("StEmcTriggerMaker");
60  StEmcTriggerMaker* emctrig = new StEmcTriggerMaker;
61 
63  trgfilt->addTrigger(96201); // 2005 HT1
64  trgfilt->addTrigger(96211); // 2005 HT2
65  trgfilt->addTrigger(96221); // 2005 JP1
66  trgfilt->addTrigger(96233); // 2005 JP2
67  chain->AddAfter("eefs",trgfilt);
68  chain->AddAfter("eefs",emctrig);
69 
70  // Run chain
71  int istat = chain->Init();
72  if (istat) {
73  cout << "Chain initialization failed" << endl;
74  chain->Fatal(istat,"during Init()");
75  }
76  // Detailed listing of makers in the chain
77  //chain->ls(0);
78  cout << "Order of makers in BFC:" << endl;
79  StMaker::lsMakers(chain);
80  chain->EventLoop(nevents);
81 }