StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunJetFinder.C
1 void RunJetFinder(
2  int nevents = 100,
3  const char* file = "/star/data30/reco/ppProductionLong/FullField/P06ie/2006/140/7140051/st_physics_7140051_raw_2020002.MuDst.root",
4  const char* outFile = "blah.jet.root",
5  const char* skimFile = "blah.jetSkim.root"
6  )
7 {
8  setMacroPath();
9  gROOT->Macro("LoadJetLibraries.C");
10 
11  chain= new StChain("StChain");
12 
13  StMuDstMaker* muDstMaker = new StMuDstMaker(0, 0, "", file, "", 100000, "MuDst");
14 
15  St_db_Maker *dbMk = new St_db_Maker("StarDb", "MySQL:StarDb");
16 
17  StEEmcDbMaker* eemcb = new StEEmcDbMaker("eemcDb");
18 
19  StSpinDbMaker* spDbMaker = new StSpinDbMaker("spinDb");
20 
21  StEmcADCtoEMaker *adc = new StEmcADCtoEMaker("Eread");
22 
23  StTriggerSimuMaker *simuTrig = new StTriggerSimuMaker("StarTrigSimu");
24  simuTrig->setMC(false);
25  simuTrig->useBbc();
26  simuTrig->useBemc();
27  simuTrig->bemc->setConfig(StBemcTriggerSimu::kOffline);
29  assert(simL2Mk);
30  simL2Mk->setSetupPath("./StRoot/StJetMaker/StarTrigSimuSetup/");
31  char outPath[200];
32  sprintf(outPath,"./out/");
33  simL2Mk->setOutPath(outPath);
34  simuTrig->useL2(simL2Mk);
35 
36  bool doTowerSwapFix = true;
37  StBET4pMaker* bet4pMaker = new StBET4pMaker("BET4pMaker",muDstMaker, doTowerSwapFix);
38  bet4pMaker->setUse2003Cuts(false);
39  bet4pMaker->setUseEndcap(true);
40  bet4pMaker->setUse2006Cuts(true);
41 
42  StJetMaker* emcJetMaker = new StJetMaker("emcJetMaker", muDstMaker, outFile);
43 
44  StJetSkimEventMaker* skimEventMaker = new StJetSkimEventMaker("StJetSkimEventMaker",muDstMaker, skimFile);
45 
46  StppAnaPars* anapars = new StppAnaPars();
47  anapars->setFlagMin(0);
48  anapars->setNhits(5);
49  anapars->setCutPtMin(0.2);
50  anapars->setAbsEtaMax(2.0);
51  anapars->setJetPtMin(3.5);
52  anapars->setJetEtaMax(100.0);
53  anapars->setJetEtaMin(0);
54  anapars->setJetNmin(0);
55 
56  StConePars* cpars = new StConePars();
57  double pi = atan(1.0)*4.0;
58  cpars->setGridSpacing(105, -3.0, 3.0, 120, -pi, pi); //include EEMC
59  cpars->setConeRadius(0.7);
60  cpars->setSeedEtMin(0.5);
61  cpars->setAssocEtMin(0.1);
62  cpars->setSplitFraction(0.5);
63  cpars->setPerformMinimization(true);
64  cpars->setAddMidpoints(true);
65  cpars->setRequireStableMidpoints(true);
66  cpars->setDoSplitMerge(true);
67  cpars->setDebug(false);
68  emcJetMaker->addAnalyzer(anapars, cpars, bet4pMaker, "ConeJets5");
69 
70  anapars->setNhits(12);
71  emcJetMaker->addAnalyzer(anapars, cpars, bet4pMaker, "ConeJets12");
72 
73  anapars->setNhits(10000000);
74  emcJetMaker->addAnalyzer(anapars, cpars, bet4pMaker, "ConeJetsEMC");
75 
76  chain->Init();
77 
78  for (Int_t iev = 0; iev < nevents; ++iev) {
79 
80  if(iev % 1 == 0) {
81  cout << "****************************************** " << endl;
82  cout << "Working on eventNumber " << iev << endl;
83  cout << "****************************************** " << endl;
84  }
85  chain->Clear();
86  int iret = chain->Make(iev);
87  if (iret && iret!=kStSkip) {
88  cout << "Bad return code!" << endl;
89  break;
90  }
91  }
92 
93  chain->Finish();
94 
95 }
96 
97 void setMacroPath()
98 {
99  TString path(gROOT->GetMacroPath());
100  path = TString(gSystem->Getenv("STAR")) + "/StRoot/StJetMaker/macros:" + path;
101  path = "./StRoot/StJetMaker/macros:" + path;
102  path = "./StJetMaker/macros:" + path;
103  path = "./macros:" + path;
104  path = "../macros:" + path;
105  path = ".:" + path;
106  gROOT->SetMacroPath(path);
107 }
void setConeRadius(double v)
Set cone radius:
Definition: StConePars.h:65
void setAddMidpoints(bool v)
Add seeds at midpoints?
Definition: StConePars.h:56
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
void setSplitFraction(double v)
split jets if E_shared/E_neighbor&gt;splitFraction
Definition: StConePars.h:50
void setGridSpacing(int nEta, double etaMin, double etaMax, int nPhi, double phiMin, double phiMax)
Set the grid spacing:
Definition: StConePars.h:36
virtual Int_t Finish()
Definition: StChain.cxx:85
void setDoSplitMerge(bool v)
Do Split/Merge step?
Definition: StConePars.h:59
void setDebug(bool v)
Toggle debug streams on/off.
Definition: StConePars.h:68
void setSeedEtMin(double v)
minimum et threshold to be considered a seed
Definition: StConePars.h:44
Definition: Stypes.h:49
virtual Int_t Make()
Definition: StChain.cxx:110
void setAssocEtMin(double v)
minimum et threshold to be considered for addition to the seed
Definition: StConePars.h:47
void setRequireStableMidpoints(bool v)
Require stable midpoints?
Definition: StConePars.h:62
void setPerformMinimization(bool v)
Let jet wander to minimum?
Definition: StConePars.h:53