StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunJetFinder2009pro.C
1 //
2 // Pibero Djawotho <pibero@tamu.edu>
3 // Texas A&M University
4 // 28 May 2010
5 //
6 
7 void RunJetFinder2009pro(int nevents = 1e7,
8  const char* mudstfile = "/star/data65/reco/production2009_200Gev_Single/FullField/P11id/2009/150/10150053/st_physics_10150053_raw_4030003.MuDst.root",
9  const char* jetfile = "jets.root",
10  const char* skimfile = "skim.root",
11  bool useL2 = false)
12 {
13  cout << "mudstfile = " << mudstfile << endl;
14  cout << "jetfile = " << jetfile << endl;
15  cout << "skimfile = " << skimfile << endl;
16 
17  gROOT->Macro("loadMuDst.C");
18  gROOT->Macro("LoadLogger.C");
19 
20  gSystem->Load("StDetectorDbMaker");
21  gSystem->Load("StTpcDb");
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("libCDFConesPlugin.so");
41  gSystem->Load("libEECambridgePlugin.so");
42  gSystem->Load("libJadePlugin.so");
43  gSystem->Load("libNestedDefsPlugin.so");
44  gSystem->Load("libSISConePlugin.so");
45  gSystem->Load("StJetFinder");
46  gSystem->Load("StJetSkimEvent");
47  gSystem->Load("StJets");
48  gSystem->Load("StJetEvent");
49  gSystem->Load("StJetMaker");
50  gSystem->Load("StTriggerFilterMaker");
51 
52  StChain* chain = new StChain;
53 
54  // MuDst reader
55  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,"",mudstfile,"",100000,"MuDst");
56 
57  // MuDst DB
58  StMuDbReader* muDstDb = StMuDbReader::instance();
59 
60  // Trigger filter
61  StTriggerFilterMaker* filterMaker = new StTriggerFilterMaker;
62 
63  // 2009 pp500
64  filterMaker->addTrigger(230410); // JP1
65  filterMaker->addTrigger(230411); // JP2
66  filterMaker->addTrigger(230420); // AJP
67  filterMaker->addTrigger(230531); // BHT3
68 
69  // 2009 pp200
70  // http://www.star.bnl.gov/protected/common/common2009/trigger2009/triggers2009.html
71  // L2JetHigh
72  filterMaker->addTrigger(240650);
73  filterMaker->addTrigger(240651);
74  filterMaker->addTrigger(240652);
75  // JP1
76  filterMaker->addTrigger(240410);
77  filterMaker->addTrigger(240411);
78  // L2BGamma
79  filterMaker->addTrigger(240620);
80  // L2EGamma
81  filterMaker->addTrigger(240630);
82  filterMaker->addTrigger(240631);
83  // BHT3
84  filterMaker->addTrigger(240530);
85  // BBCMB-Cat2
86  filterMaker->addTrigger(240013);
87  filterMaker->addTrigger(240113);
88  filterMaker->addTrigger(240123);
89  filterMaker->addTrigger(240223);
90  // BBCMB-Cat3
91  filterMaker->addTrigger(240014);
92  filterMaker->addTrigger(240114);
93  filterMaker->addTrigger(240124);
94  filterMaker->addTrigger(240224);
95 
96  // 2011 pp500 transverse
97  filterMaker->addTrigger(320600); // JP0
98  filterMaker->addTrigger(320601); // JP1
99  filterMaker->addTrigger(320602); // JP2*L2JetHigh
100  filterMaker->addTrigger(320603); // AJP
101  filterMaker->addTrigger(320800); // BHT2*JP1*L2Bgamma
102  filterMaker->addTrigger(320801); // BHT3*L2BW
103  filterMaker->addTrigger(320850); // EHT0*JP1*L2Egamma
104  filterMaker->addTrigger(320851); // EHT1*L2EW
105 
106  // 2011 pp500 longitudinal
107  filterMaker->addTrigger(330600); // JP0
108  filterMaker->addTrigger(330601); // JP1
109  filterMaker->addTrigger(330603); // AJP
110  filterMaker->addTrigger(330612); // JP2*L2JetHigh
111  filterMaker->addTrigger(330800); // BHT2*JP1*L2Bgamma
112  filterMaker->addTrigger(330801); // BHT3*L2BW
113  filterMaker->addTrigger(330850); // EHT0*JP1*L2Egamma
114  filterMaker->addTrigger(330851); // EHT1*L2EW
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  adc->saveAllStEvent(true);
128 
129  // Trigger simulator
130  StTriggerSimuMaker* simuTrig = new StTriggerSimuMaker;
131  simuTrig->useOnlineDB(); // for trigger definitions and thresholds
132  simuTrig->setMC(false); // Must be before individual detectors, to be passed
133  // BBC was not used in Run 9
134  //simuTrig->useBbc();
135  simuTrig->useBemc();
136  simuTrig->useEemc();
137  simuTrig->bemc->setConfig(StBemcTriggerSimu::kOffline);
138 
139  // L2 (only L2btowCalib, L2etowCalib, L2ped, L2jet in CVS as of 17 April 2010)
140  if (useL2) {
142  assert(simL2Mk);
143  simL2Mk->setSetupPath("/star/u/pibero/public/StarTrigSimuSetup/");
144  simL2Mk->setOutPath("./");
145  simuTrig->useL2(simL2Mk);
146  }
147 
148  // Skim event maker
149  StJetSkimEventMaker* skimEventMaker = new StJetSkimEventMaker("StJetSkimEventMaker",muDstMaker,skimfile);
150 
151  // Jet maker
152  StJetMaker2009* jetmaker = new StJetMaker2009;
153  jetmaker->setJetFile(jetfile);
154 
155  // Set analysis cuts for 12-point branch
156  StAnaPars* anapars12 = new StAnaPars;
157  anapars12->useTpc = true;
158  anapars12->useBemc = true;
159  anapars12->useEemc = true;
160 
161  // The classes available for correcting tower energy for tracks are:
162  // 1. StjTowerEnergyCorrectionForTracksMip
163  // 2. StjTowerEnergyCorrectionForTracksFraction
164  // 3. StjTowerEnergyCorrectionForTracksNull (default: no correction)
165  anapars12->setTowerEnergyCorrection(new StjTowerEnergyCorrectionForTracksFraction(1.00));
166 
167  // TPC cuts
168  anapars12->addTpcCut(new StjTrackCutFlag(0));
169  anapars12->addTpcCut(new StjTrackCutNHits(12));
170  anapars12->addTpcCut(new StjTrackCutPossibleHitRatio(0.51));
171  anapars12->addTpcCut(new StjTrackCutDca(3));
172  //anapars12->addTpcCut(new StjTrackCutDcaPtDependent);
173  anapars12->addTpcCut(new StjTrackCutTdcaPtDependent);
174  //anapars12->addTpcCut(new StjTrackCutChi2(0,4));
175  anapars12->addTpcCut(new StjTrackCutPt(0.2,200));
176  anapars12->addTpcCut(new StjTrackCutEta(-2.5,2.5));
177  anapars12->addTpcCut(new StjTrackCutLastPoint(125));
178 
179  // BEMC cuts
180  anapars12->addBemcCut(new StjTowerEnergyCutBemcStatus(1));
181  anapars12->addBemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
182  anapars12->addBemcCut(new StjTowerEnergyCutEt(0.2));
183 
184  // EEMC cuts
185  anapars12->addEemcCut(new StjTowerEnergyCutBemcStatus(1));
186  anapars12->addEemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
187  anapars12->addEemcCut(new StjTowerEnergyCutEt(0.2));
188 
189  // Jet cuts
190  anapars12->addJetCut(new StProtoJetCutPt(5,200));
191  anapars12->addJetCut(new StProtoJetCutEta(-100,100));
192 
193  // Set analysis cuts for 5-point branch
194  StAnaPars* anapars5 = new StAnaPars;
195  anapars5->useTpc = true;
196  anapars5->useBemc = true;
197  anapars5->useEemc = true;
198 
199  // The classes available for correcting tower energy for tracks are:
200  // 1. StjTowerEnergyCorrectionForTracksMip
201  // 2. StjTowerEnergyCorrectionForTracksFraction
202  // 3. StjTowerEnergyCorrectionForTracksNull (default: no correction)
203  anapars5->setTowerEnergyCorrection(new StjTowerEnergyCorrectionForTracksFraction(1.00));
204 
205  // TPC cuts
206  anapars5->addTpcCut(new StjTrackCutFlag(0));
207  anapars5->addTpcCut(new StjTrackCutNHits(5));
208  anapars5->addTpcCut(new StjTrackCutPossibleHitRatio(0.51));
209  anapars5->addTpcCut(new StjTrackCutDca(3));
210  //anapars5->addTpcCut(new StjTrackCutDcaPtDependent);
211  anapars5->addTpcCut(new StjTrackCutTdcaPtDependent);
212  //anapars5->addTpcCut(new StjTrackCutChi2(0,4));
213  anapars5->addTpcCut(new StjTrackCutPt(0.2,200));
214  anapars5->addTpcCut(new StjTrackCutEta(-2.5,2.5));
215 
216  // BEMC cuts
217  anapars5->addBemcCut(new StjTowerEnergyCutBemcStatus(1));
218  anapars5->addBemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
219  anapars5->addBemcCut(new StjTowerEnergyCutEt(0.2));
220 
221  // EEMC cuts
222  anapars5->addEemcCut(new StjTowerEnergyCutBemcStatus(1));
223  anapars5->addEemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
224  anapars5->addEemcCut(new StjTowerEnergyCutEt(0.2));
225 
226  // Jet cuts
227  anapars5->addJetCut(new StProtoJetCutPt(5,200));
228  //anapars5->addJetCut(new StProtoJetCutEta(0.8,2.5));
229  anapars5->addJetCut(new StProtoJetCutEta(-100,100));
230 
231  // Set analysis cuts for EMC branch
232  StAnaPars* anaparsEMC = new StAnaPars;
233  anaparsEMC->useTpc = true;
234  anaparsEMC->useBemc = true;
235  anaparsEMC->useEemc = true;
236 
237  // TPC cuts
238  anaparsEMC->addTpcCut(new StjTrackCutFlag(0));
239  anaparsEMC->addTpcCut(new StjTrackCutNHits(1000000));
240 
241  // BEMC cuts
242  anaparsEMC->addBemcCut(new StjTowerEnergyCutBemcStatus(1));
243  anaparsEMC->addBemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
244  anaparsEMC->addBemcCut(new StjTowerEnergyCutEt(0.2));
245 
246  // EEMC cuts
247  anaparsEMC->addEemcCut(new StjTowerEnergyCutBemcStatus(1));
248  anaparsEMC->addEemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
249  anaparsEMC->addEemcCut(new StjTowerEnergyCutEt(0.2));
250 
251  // Jet cuts
252  anaparsEMC->addJetCut(new StProtoJetCutPt(5,200));
253  anaparsEMC->addJetCut(new StProtoJetCutEta(-100,100));
254 
255  // Set cone jet finder parameters
256  StConePars* conepars = new StConePars;
257  conepars->setGridSpacing(105,-3.0,3.0,120,-TMath::Pi(),TMath::Pi());
258  conepars->setConeRadius(0.7);
259  conepars->setSeedEtMin(0.5);
260  conepars->setAssocEtMin(0.1);
261  conepars->setSplitFraction(0.5);
262  conepars->setPerformMinimization(true);
263  conepars->setAddMidpoints(true);
264  conepars->setRequireStableMidpoints(true);
265  conepars->setDoSplitMerge(true);
266  conepars->setDebug(false);
267 
268  // Set CDF midpoint R=0.7 parameters
269  const double coneRadius = 0.7;
270  StFastJetPars* CdfMidpointR070Pars = new StFastJetPars;
271  CdfMidpointR070Pars->setJetAlgorithm(StFastJetPars::plugin_algorithm);
272  CdfMidpointR070Pars->setRparam(coneRadius);
273  CdfMidpointR070Pars->setRecombinationScheme(StFastJetPars::E_scheme);
274  CdfMidpointR070Pars->setStrategy(StFastJetPars::plugin_strategy);
275  CdfMidpointR070Pars->setPtMin(5.0);
276 
277  const double overlapThreshold = 0.75;
278  const double seedThreshold = 0.5;
279  const double coneAreaFraction = 1.0;
280 
281  StPlugin* cdf = new StCDFMidPointPlugin(coneRadius,overlapThreshold,seedThreshold,coneAreaFraction);
282  CdfMidpointR070Pars->setPlugin(cdf);
283 
284  // Set anti-kt R=0.6 parameters
285  StFastJetPars* AntiKtR060Pars = new StFastJetPars;
286  AntiKtR060Pars->setJetAlgorithm(StFastJetPars::antikt_algorithm);
287  AntiKtR060Pars->setRparam(0.6);
288  AntiKtR060Pars->setRecombinationScheme(StFastJetPars::E_scheme);
289  AntiKtR060Pars->setStrategy(StFastJetPars::Best);
290  AntiKtR060Pars->setPtMin(5.0);
291 
292  // Set anti-kt R=0.5 parameters
293  StFastJetPars* AntiKtR050Pars = new StFastJetPars;
294  AntiKtR050Pars->setJetAlgorithm(StFastJetPars::antikt_algorithm);
295  AntiKtR050Pars->setRparam(0.5);
296  AntiKtR050Pars->setRecombinationScheme(StFastJetPars::E_scheme);
297  AntiKtR050Pars->setStrategy(StFastJetPars::Best);
298  AntiKtR050Pars->setPtMin(5.0);
299 
300  jetmaker->addBranch("CdfMidpointR070NHits12",anapars12,CdfMidpointR070Pars);
301  jetmaker->addBranch("CdfMidpointR070NHits5",anapars5,CdfMidpointR070Pars);
302  jetmaker->addBranch("CdfMidpointR070EMC",anaparsEMC,CdfMidpointR070Pars);
303  jetmaker->addBranch("AntiKtR060NHits12",anapars12,AntiKtR060Pars);
304  jetmaker->addBranch("AntiKtR060NHits5",anapars5,AntiKtR060Pars);
305  jetmaker->addBranch("AntiKtR060EMC",anaparsEMC,AntiKtR060Pars);
306  jetmaker->addBranch("AntiKtR050NHits12",anapars12,AntiKtR050Pars);
307  jetmaker->addBranch("AntiKtR050NHits5",anapars5,AntiKtR050Pars);
308  jetmaker->addBranch("AntiKtR050EMC",anaparsEMC,AntiKtR050Pars);
309 
310  // Run
311  chain->Init();
312  chain->EventLoop(nevents);
313 }
void setConeRadius(double v)
Set cone radius:
Definition: StConePars.h:65
void setAddMidpoints(bool v)
Add seeds at midpoints?
Definition: StConePars.h:56
static const int plugin_algorithm
any plugin algorithm supplied by the user
Definition: StFastJetPars.h:84
void setSplitFraction(double v)
split jets if E_shared/E_neighbor&gt;splitFraction
Definition: StConePars.h:50
static const int Best
automatic selection of the best (based on N)
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 useOnlineDB()
Choose DB to access trigger definitions and thresholds.
static const int plugin_strategy
the plugin has been used...
static const int E_scheme
Definition: StFastJetPars.h:89
void setRequireStableMidpoints(bool v)
Require stable midpoints?
Definition: StConePars.h:62
static const int antikt_algorithm
Definition: StFastJetPars.h:65
void saveAllStEvent(Bool_t a)
Set to kTRUE if all hits are to be saved on StEvent.
void setPerformMinimization(bool v)
Let jet wander to minimum?
Definition: StConePars.h:53