StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunJetFinder2009.C
1 //
2 // Pibero Djawotho <pibero@tamu.edu>
3 // Texas A&M University
4 // 10 March 2010
5 //
6 
7 void RunJetFinder2009(int nevents = 1e6,
8  const char* mudstfile = "/star/data60/reco/production2009_200Gev_Single/ReversedFullField/P10ic/2009/143/10143008/st_physics_10143008_raw_6020001.MuDst.root",
9  const char* jetfile = "st_physics_10143008_raw_6020001.jets.root",
10  const char* skimfile = "st_physics_10143008_raw_6020001.skim.root",
11  bool useL2 = false)
12 {
13  cout << "Read MuDst file:\t" << mudstfile << endl;
14  cout << "Write jet file:\t" << jetfile << endl;
15  cout << "Write skim file:\t" << skimfile << endl;
16 
17  gROOT->Macro("loadMuDst.C");
18  gROOT->Macro("LoadLogger.C");
19 
20  gSystem->Load("StTpcDb");
21  gSystem->Load("StDetectorDbMaker");
22  gSystem->Load("StDbUtilities");
23  gSystem->Load("StMcEvent");
24  gSystem->Load("StMcEventMaker");
25  gSystem->Load("StDaqLib");
26  gSystem->Load("StEmcRawMaker");
27  gSystem->Load("StEmcADCtoEMaker");
28  gSystem->Load("StEpcMaker");
29  gSystem->Load("StEmcSimulatorMaker");
30  gSystem->Load("StDbBroker");
31  gSystem->Load("St_db_Maker");
32  gSystem->Load("StEEmcUtil");
33  gSystem->Load("StEEmcDbMaker");
34  gSystem->Load("StSpinDbMaker");
35  gSystem->Load("StEmcTriggerMaker");
36  gSystem->Load("StTriggerUtilities");
37  gSystem->Load("StMCAsymMaker");
38  gSystem->Load("StRandomSelector");
39  gSystem->Load("libfastjet.so");
40  gSystem->Load("StJetFinder");
41  gSystem->Load("StJetSkimEvent");
42  gSystem->Load("StJets");
43  gSystem->Load("StJetEvent");
44  gSystem->Load("StJetMaker");
45  gSystem->Load("StTriggerFilterMaker");
46 
47  StChain* chain = new StChain;
48 
49  // MuDst reader
50  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,"",mudstfile,"",100000,"MuDst");
51 
52  // StMuDbReader...
53  StMuDbReader* db = StMuDbReader::instance();
54 
55  // Trigger filter
56  StTriggerFilterMaker* filterMaker = new StTriggerFilterMaker;
57 
58  // 2009 pp500
59  filterMaker->addTrigger(230410); // JP1
60  filterMaker->addTrigger(230411); // JP2
61  filterMaker->addTrigger(230420); // AJP
62 
63  // 2009 pp200
64  // http://www.star.bnl.gov/protected/common/common2009/trigger2009/triggers2009.html
65  // BHT3
66  filterMaker->addTrigger(240530);
67  // L2BGamma
68  filterMaker->addTrigger(240620);
69  // L2EGamma
70  filterMaker->addTrigger(240630);
71  filterMaker->addTrigger(240631);
72  // L2JetHigh
73  filterMaker->addTrigger(240650);
74  filterMaker->addTrigger(240651);
75  filterMaker->addTrigger(240652);
76  // JP1
77  filterMaker->addTrigger(240410);
78  filterMaker->addTrigger(240411);
79  // Upsilon
80  filterMaker->addTrigger(240641);
81  // Luminosity monitors
82  // BBCMB
83  filterMaker->addTrigger(240010);
84  filterMaker->addTrigger(240110);
85  filterMaker->addTrigger(240120);
86  filterMaker->addTrigger(240220);
87  // BBCMB-Cat0
88  filterMaker->addTrigger(240011);
89  filterMaker->addTrigger(240111);
90  filterMaker->addTrigger(240121);
91  filterMaker->addTrigger(240221);
92  // BBCMB-Cat1
93  filterMaker->addTrigger(240012);
94  filterMaker->addTrigger(240112);
95  filterMaker->addTrigger(240122);
96  filterMaker->addTrigger(240222);
97  // BBCMB-Cat2
98  filterMaker->addTrigger(240013);
99  filterMaker->addTrigger(240113);
100  filterMaker->addTrigger(240123);
101  filterMaker->addTrigger(240223);
102  // BBCMB-Cat3
103  filterMaker->addTrigger(240014);
104  filterMaker->addTrigger(240114);
105  filterMaker->addTrigger(240124);
106  filterMaker->addTrigger(240224);
107  // BBCMB-Cat4
108  filterMaker->addTrigger(240015);
109  filterMaker->addTrigger(240115);
110  filterMaker->addTrigger(240125);
111  filterMaker->addTrigger(240225);
112  // VPDMB
113  filterMaker->addTrigger(240020);
114  filterMaker->addTrigger(240025);
115 
116  // star database
117  St_db_Maker* starDb = new St_db_Maker("StarDb","MySQL:StarDb");
118 
119  // Endcap database
120  StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
121 
122  // Spin database
123  StSpinDbMaker* spinDb = new StSpinDbMaker;
124 
125  // Barrel ADC to energy maker
127 
128  // Trigger simulator
129  StTriggerSimuMaker* simuTrig = new StTriggerSimuMaker;
130  simuTrig->setMC(false); // Must be before individual detectors, to be passed
131  // BBC was not used in Run 9
132  //simuTrig->useBbc();
133  simuTrig->useBemc();
134  simuTrig->useEemc();
135  simuTrig->bemc->setConfig(StBemcTriggerSimu::kOffline);
136 
137  // L2 (only L2btowCalib, L2etowCalib, L2ped, L2jet in CVS as of 17 April 2010)
138  if (useL2) {
140  assert(simL2Mk);
141  simL2Mk->setSetupPath("/star/u/pibero/public/StarTrigSimuSetup/");
142  simL2Mk->setOutPath("./");
143  simuTrig->useL2(simL2Mk);
144  }
145 
146  // Add Mike's 4p maker.
147  // Here we also tag whether or not to do the swap.
148  // The classes available for correcting tower energy for tracks are:
149  // 1. StjTowerEnergyCorrectionForTracksMip
150  // 2. StjTowerEnergyCorrectionForTracksFraction
151  bool doTowerSwapFix = true;
152  StBET4pMaker* bet4pMaker = new StBET4pMaker("BET4pMaker",muDstMaker,doTowerSwapFix,new StjTowerEnergyCorrectionForTracksFraction(1.00));
153  bet4pMaker->setUseTPC(true);
154  bet4pMaker->setUseBEMC(true);
155  bet4pMaker->setUseEndcap(true);
156  bet4pMaker->setUse2003Cuts(false);
157  bet4pMaker->setUse2005Cuts(false);
158  bet4pMaker->setUse2006Cuts(true);
159 
160  // Jet maker
161  StJetMaker* jetMaker = new StJetMaker("jetMaker",muDstMaker,jetfile);
162  // Use StJetEvent format. Comment out the line below to use old StJets format.
163  jetMaker->SetTreeWriter(new StjeJetEventTreeWriter(jetfile));
164 
165  // Skim event maker
166  StJetSkimEventMaker* skimEventMaker = new StJetSkimEventMaker("StJetSkimEventMaker",muDstMaker,skimfile);
167 
168  // Set the analysis cuts (See StJetMaker/StppJetAnalyzer.h -> class StppAnaPars)
169  StppAnaPars* anapars = new StppAnaPars;
170  anapars->setFlagMin(0); // track->flag() > 0
171  anapars->setCutPtMin(0.2); // track->pt() > 0.2
172  anapars->setAbsEtaMax(2.5); // abs(track->eta()) < 2.5
173  anapars->setJetPtMin(5.0);
174  anapars->setJetEtaMax(100.0);
175  anapars->setJetEtaMin(0);
176  anapars->setJetNmin(0);
177 
178  // Setup the cone finder (See StJetFinder/StConeJetFinder.h -> class StConePars)
179  StConePars* cpars = new StConePars;
180  cpars->setGridSpacing(105,-3.0,3.0,120,-TMath::Pi(),TMath::Pi());
181  cpars->setSeedEtMin(0.5);
182  cpars->setAssocEtMin(0.1);
183  cpars->setSplitFraction(0.5);
184  cpars->setPerformMinimization(true);
185  cpars->setAddMidpoints(true);
186  cpars->setRequireStableMidpoints(true);
187  cpars->setDoSplitMerge(true);
188  cpars->setDebug(false);
189 
190  jetMaker->addAnalyzer(anapars,cpars,bet4pMaker,"ConeJets12");
191 
192  anapars->setNhits(5);
193  jetMaker->addAnalyzer(anapars,cpars,bet4pMaker,"ConeJets5");
194 
195  anapars->setNhits(1000000);
196  jetMaker->addAnalyzer(anapars,cpars,bet4pMaker,"ConeJetsEMC");
197 
198  chain->Init();
199  chain->EventLoop(nevents);
200 }
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