StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunJetFinder2.C
1 void RunJetFinder2(int nevents = 100,
2  const char* mudstfile = "/star/data54/reco/ppProductionTrans/FullField/P06ie/2006/117/7117002/st_physics_7117002_raw_1040035.MuDst.root",
3  const char* jetfile = "blah.jet.root",
4  const char* skimfile = "blah.skim.root")
5 {
6  cout << "Read MuDst file:\t" << mudstfile << endl;
7  cout << "Write jet file:\t" << jetfile << endl;
8  cout << "Write skim file:\t" << skimfile << endl;
9 
10  gROOT->Macro("loadMuDst.C");
11  gROOT->Macro("LoadLogger.C");
12 
13  gSystem->Load("StTpcDb");
14  gSystem->Load("StDetectorDbMaker");
15  gSystem->Load("StDbUtilities");
16  gSystem->Load("StMcEvent");
17  gSystem->Load("StMcEventMaker");
18  gSystem->Load("StDaqLib");
19  gSystem->Load("StEmcRawMaker");
20  gSystem->Load("StEmcADCtoEMaker");
21  gSystem->Load("StEpcMaker");
22  gSystem->Load("StEmcSimulatorMaker");
23  gSystem->Load("StDbBroker");
24  gSystem->Load("St_db_Maker");
25  gSystem->Load("StEEmcUtil");
26  gSystem->Load("StEEmcDbMaker");
27  gSystem->Load("StSpinDbMaker");
28  gSystem->Load("StEmcTriggerMaker");
29  gSystem->Load("StTriggerUtilities");
30  gSystem->Load("StMCAsymMaker");
31  gSystem->Load("libfastjet.so");
32  gSystem->Load("StJetFinder");
33  gSystem->Load("StJetSkimEvent");
34  gSystem->Load("StJets");
35  gSystem->Load("StJetEvent");
36  gSystem->Load("StJetMaker");
37 
38  StChain* chain = new StChain;
39 
40  // MuDst reader
41  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,"",mudstfile,"",100000,"MuDst");
42 
43  //StMuDbReader...
44  StMuDbReader* db = StMuDbReader::instance();
45 
46  //StMuDst2StEventMaker
47  //StMuDst2StEventMaker* eventMaker = new StMuDst2StEventMaker("MuDst2StEvent");
48 
49  // STAR database
50  St_db_Maker* starDb = new St_db_Maker("StarDb","MySQL:StarDb");
51 
52  // Endcap database
53  StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
54 
55  // Spin database
56  StSpinDbMaker* spinDb = new StSpinDbMaker;
57 
58  // Barrel ADC to energy maker
60 
61  // Trigger simulator
62  StTriggerSimuMaker* simuTrig = new StTriggerSimuMaker;
63  simuTrig->setMC(false); // Must be before individual detectors, to be passed
64  simuTrig->useBbc();
65  simuTrig->useBemc();
66  simuTrig->bemc->setConfig(StBemcTriggerSimu::kOffline);
68  assert(simL2Mk);
69  simL2Mk->setSetupPath("/afs/rhic.bnl.gov/star/users/kocolosk/public/StarTrigSimuSetup/");
70  simL2Mk->setOutPath("./");
71  simuTrig->useL2(simL2Mk);
72 
73  // Add Mike's 4p maker.
74  // Here we also tag whether or not to do the swap.
75  // The classes available for correcting tower energy for tracks are:
76  // 1. StjTowerEnergyCorrectionForTracksMip
77  // 2. StjTowerEnergyCorrectionForTracksFraction
78  bool doTowerSwapFix = true;
79  StBET4pMaker* bet4pMaker = new StBET4pMaker("BET4pMaker",muDstMaker,doTowerSwapFix,new StjTowerEnergyCorrectionForTracksFraction(1.00));
80  bet4pMaker->setUseTPC(true);
81  bet4pMaker->setUseBEMC(true);
82  bet4pMaker->setUseEndcap(true);
83  bet4pMaker->setUse2003Cuts(false);
84  bet4pMaker->setUse2005Cuts(false);
85  bet4pMaker->setUse2006Cuts(true);
86 
87  // Jet maker
88  StJetMaker* jetMaker = new StJetMaker("jetMaker",muDstMaker,jetfile);
89 
90  // Skim event maker
91  StJetSkimEventMaker* skimEventMaker = new StJetSkimEventMaker("StJetSkimEventMaker",muDstMaker,skimfile);
92 
93  //Instantiate Jet Histogram Maker
94  //StJetHistMaker* jetHistMaker = new StJetHistMaker(muDstMaker, histfile.Data() );
95 
96  // Set the analysis cuts (See StJetMaker/StppJetAnalyzer.h -> class StppAnaPars)
97  StppAnaPars* anapars = new StppAnaPars;
98  anapars->setFlagMin(0); // track->flag() > 0
99  anapars->setCutPtMin(0.2); // track->pt() > 0.2
100  anapars->setAbsEtaMax(1.6); // abs(track->eta()) < 1.6
101  anapars->setJetPtMin(5.0);
102  anapars->setJetEtaMax(100.0);
103  anapars->setJetEtaMin(0);
104  anapars->setJetNmin(0);
105 
106  // Setup the cone finder (See StJetFinder/StConeJetFinder.h -> class StConePars)
107  StConePars* cpars = new StConePars;
108  cpars->setGridSpacing(105,-3.0,3.0,120,-TMath::Pi(),TMath::Pi());
109  cpars->setSeedEtMin(0.5);
110  cpars->setAssocEtMin(0.1);
111  cpars->setSplitFraction(0.5);
112  cpars->setPerformMinimization(true);
113  cpars->setAddMidpoints(true);
114  cpars->setRequireStableMidpoints(true);
115  cpars->setDoSplitMerge(true);
116  cpars->setDebug(false);
117 
118  jetMaker->addAnalyzer(anapars,cpars,bet4pMaker,"ConeJets12");
119 
120  anapars->setNhits(5);
121  jetMaker->addAnalyzer(anapars,cpars,bet4pMaker,"ConeJets5");
122 
123  anapars->setNhits(1000000);
124  jetMaker->addAnalyzer(anapars,cpars,bet4pMaker,"ConeJetsEMC");
125 
126  chain->Init();
127  chain->EventLoop(nevents);
128 }
void setAddMidpoints(bool v)
Add seeds at midpoints?
Definition: StConePars.h:56
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
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
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