StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunJetFinder2009emb.C
1 //
2 // Pibero Djawotho <pibero@tamu.edu>
3 // Texas A&M University
4 // 4 Dec 2011
5 //
6 
7 void RunJetFinder2009emb(int nevents = 1e6,
8  const char* mudstfile = "../eliza17/SL11d_embed/10120032/pt11_15_*.MuDst.root",
9  const char* geantfile = "../eliza17/SL11d_embed/10120032/pt11_15_*.geant.root",
10  const char* jetfile = "jets.root",
11  const char* skimfile = "skim.root",
12  bool useL2 = true)
13 {
14  cout << "Read MuDst file:\t" << mudstfile << endl;
15  cout << "Read geant file:\t" << geantfile << endl;
16  cout << "Write jet file:\t" << jetfile << endl;
17  cout << "Write skim file:\t" << skimfile << endl;
18 
19  gROOT->Macro("loadMuDst.C");
20  gROOT->Macro("LoadLogger.C");
21 
22  gSystem->Load("StDetectorDbMaker");
23  gSystem->Load("StTpcDb");
24  gSystem->Load("StDbUtilities");
25  gSystem->Load("StMcEvent");
26  gSystem->Load("StMcEventMaker");
27  gSystem->Load("StDaqLib");
28  gSystem->Load("StEmcRawMaker");
29  gSystem->Load("StEmcADCtoEMaker");
30  gSystem->Load("StPreEclMaker");
31  gSystem->Load("StEmcSimulatorMaker");
32  gSystem->Load("StDbBroker");
33  gSystem->Load("St_db_Maker");
34  gSystem->Load("StEEmcUtil");
35  gSystem->Load("StEEmcDbMaker");
36  gSystem->Load("StSpinDbMaker");
37  gSystem->Load("StEmcTriggerMaker");
38  gSystem->Load("StTriggerUtilities");
39  gSystem->Load("StMCAsymMaker");
40  gSystem->Load("StRandomSelector");
41  gSystem->Load("fastjet-install/lib/libfastjet.so");
42  gSystem->Load("fastjet-install/lib/libfastjettools.so");
43  gSystem->Load("fastjet-install/lib/libsiscone.so");
44  gSystem->Load("fastjet-install/lib/libsiscone_spherical.so");
45  gSystem->Load("fastjet-install/lib/libfastjetplugins.so");
46  gSystem->Load("StJetFinder");
47  gSystem->Load("StJetSkimEvent");
48  gSystem->Load("StJets");
49  gSystem->Load("StJetEvent");
50  gSystem->Load("StJetMaker");
51  gSystem->Load("StEEmcSimulatorMaker");
52 
53  // Create chain
54  StChain* chain = new StChain;
55 
56  // I/O maker
57  StIOMaker* ioMaker = new StIOMaker;
58  ioMaker->SetFile(geantfile);
59  ioMaker->SetIOMode("r");
60  ioMaker->SetBranch("*",0,"0"); // Deactivate all branches
61  ioMaker->SetBranch("geantBranch",0,"r"); // Activate geant Branch
62 
63  // StMcEvent maker
64  StMcEventMaker* mcEventMaker = new StMcEventMaker;
65  mcEventMaker->doPrintEventInfo = false;
66  mcEventMaker->doPrintMemoryInfo = false;
67 
68  // MuDst reader
69  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,"",mudstfile,"",100000,"MuDst");
70 
71  // MuDst DB
72  StMuDbReader* muDstDb = StMuDbReader::instance();
73 
74  // star database
75  St_db_Maker* starDb = new St_db_Maker("StarDb","MySQL:StarDb");
76 
77  // Endcap database
78  StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
79 
80  // Barrel ADC to energy maker
82  adc2e->saveAllStEvent(true);
83 
84  // Trigger simulator
85  // -- StL2_2009EmulatorMaker must run before StTriggerSimuMaker?
86  StL2_2009EmulatorMaker* simL2Mk = 0;
87  if (useL2) {
88  simL2Mk = new StL2_2009EmulatorMaker;
89  simL2Mk->setSetupPath("/home/pibero/public/StarTrigSimuSetup/");
90  simL2Mk->setOutPath("../eliza14/L2/");
91  }
92  StTriggerSimuMaker* simuTrig = new StTriggerSimuMaker;
93  simuTrig->setMC(2); // 0=data, 1=simulation, 2=embedding
94  simuTrig->useBemc();
95  simuTrig->useEemc();
96  simuTrig->bemc->setConfig(StBemcTriggerSimu::kOffline);
97  if (useL2) simuTrig->useL2(simL2Mk);
98 
99  // Set trigger thresholds using run 10180030
100  simuTrig->setBarrelJetPatchTh(0,20);
101  simuTrig->setBarrelJetPatchTh(1,28);
102  simuTrig->setBarrelJetPatchTh(2,36);
103 
104  simuTrig->setOverlapJetPatchTh(0,19);
105  simuTrig->setOverlapJetPatchTh(1,26);
106  simuTrig->setOverlapJetPatchTh(2,34);
107 
108  simuTrig->setEndcapJetPatchTh(0,18);
109  simuTrig->setEndcapJetPatchTh(1,25);
110  simuTrig->setEndcapJetPatchTh(2,32);
111 
112  simuTrig->setBarrelHighTowerTh(0,11);
113  simuTrig->setBarrelHighTowerTh(1,15);
114  simuTrig->setBarrelHighTowerTh(2,18);
115  simuTrig->setBarrelHighTowerTh(3,25);
116 
117  simuTrig->setEndcapHighTowerTh(0,16);
118  simuTrig->setEndcapHighTowerTh(1,25);
119 
120  // Define triggers using run 10180030
121  // triggerIndex,name,triggerId,onbits,offbits,onbits1,onbits2,onbits3,offbits1,offbits2,offbits3
122  simuTrig->emc->defineTrigger(1,"BHT3",240530,0x00000001,0x2da11477,0x12c3a299,0xa6a96c01,0xc81b8346,0xc3887411,0x9011b0b1,0x3c7f7e17);
123  simuTrig->emc->defineTrigger(5,"L2JetHigh",240652,0x00000002,0x8c8d4c11,0x63235304,0xd41b4de0,0xe256967e,0xb895a59f,0x299d9bfb,0x077c6927);
124  simuTrig->emc->defineTrigger(18,"JP1",240411,0x00000040,0x5a488156,0xff7eacd8,0x57f9d3db,0x58073140,0x00000016,0x57ef7ff4,0x00000016);
125 
126  // Set LD301 registers
127  simuTrig->setLastDsmRegister(0,1696); // BBCMBLive-PS-lo
128  simuTrig->setLastDsmRegister(1,24); // BBCMBLive-PS-hi
129  simuTrig->setLastDsmRegister(2,20); // VPDMBLive-PS-Lo
130  simuTrig->setLastDsmRegister(3,0); // VPDMBLive-PS-hi
131  simuTrig->setLastDsmRegister(4,1000); // ZDCMB-PS-lo
132  simuTrig->setLastDsmRegister(5,0); // ZDCMB-PS-hi
133  simuTrig->setLastDsmRegister(6,0); // BBC-Live-Det-Select
134  simuTrig->setLastDsmRegister(7,0); // VPD-Live-Det-Select
135  simuTrig->setLastDsmRegister(8,7); // Output-Bit1-Select
136  simuTrig->setLastDsmRegister(9,11); // Output-Bit2-Select
137  simuTrig->setLastDsmRegister(10,1); // JP1-Select
138  simuTrig->setLastDsmRegister(11,13); // FMS-Fast-Select
139  simuTrig->setLastDsmRegister(12,3); // FMS-led-FPE-Select
140  simuTrig->setLastDsmRegister(13,4); // FMS-Slow-Select
141  simuTrig->setLastDsmRegister(14,100); // FMS-Fast-Single-PS
142 
143  // Get Pythia record
144  StMCAsymMaker* asym = new StMCAsymMaker;
145 
146  // Skim event maker
147  StJetSkimEventMaker* skimEventMaker = new StJetSkimEventMaker("StJetSkimEventMaker",muDstMaker,skimfile);
148  skimEventMaker->addSimuTrigger(240530); // BHT3
149  skimEventMaker->addSimuTrigger(240652); // L2JetHigh
150  skimEventMaker->addSimuTrigger(240411); // JP1
151 
152  // Jet maker
153  StJetMaker2009* jetmaker = new StJetMaker2009;
154  jetmaker->setJetFile(jetfile);
155 
156  //------------------------------------------------------------------------------------
157 
158  // Set analysis cuts for 12-point branch
159  StAnaPars* anapars12 = new StAnaPars;
160  anapars12->useTpc = true;
161  anapars12->useBemc = true;
162  anapars12->useEemc = true;
163  anapars12->randomSelectorProb = 1.00;
164 
165  const double randomAccept = 0.93;
166 
167  // The classes available for correcting tower energy for tracks are:
168  // 1. StjTowerEnergyCorrectionForTracksMip
169  // 2. StjTowerEnergyCorrectionForTracksFraction
170  // 3. StjTowerEnergyCorrectionForTracksNull (no correction)
171  anapars12->setTowerEnergyCorrection(new StjTowerEnergyCorrectionForTracksFraction(1.00));
172 
173  // TPC cuts
174  anapars12->addTpcCut(new StjTrackCutFlag(0));
175  anapars12->addTpcCut(new StjTrackCutNHits(12));
176  anapars12->addTpcCut(new StjTrackCutPossibleHitRatio(0.51));
177  anapars12->addTpcCut(new StjTrackCutDca(3));
178  anapars12->addTpcCut(new StjTrackCutTdcaPtDependent);
179  anapars12->addTpcCut(new StjTrackCutPt(0.2,200));
180  anapars12->addTpcCut(new StjTrackCutEta(-2.5,2.5));
181  anapars12->addTpcCut(new StjTrackCutLastPoint(125));
182  anapars12->addTpcCut(new StjTrackCutRandomAccept(randomAccept));
183 
184  // BEMC cuts
185  anapars12->addBemcCut(new StjTowerEnergyCutBemcStatus(1));
186  anapars12->addBemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
187  anapars12->addBemcCut(new StjTowerEnergyCutEt(0.2));
188 
189  // EEMC cuts
190  anapars12->addEemcCut(new StjTowerEnergyCutBemcStatus(1));
191  anapars12->addEemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
192  anapars12->addEemcCut(new StjTowerEnergyCutEt(0.2));
193 
194  // Jet cuts
195  anapars12->addJetCut(new StProtoJetCutPt(5,200));
196  anapars12->addJetCut(new StProtoJetCutEta(-100,100));
197 
198  //------------------------------------------------------------------------------------
199 
200  // Set analysis cuts for 5-point branch
201  StAnaPars* anapars5 = new StAnaPars;
202  anapars5->useTpc = true;
203  anapars5->useBemc = true;
204  anapars5->useEemc = true;
205  anapars5->randomSelectorProb = 1.00;
206 
207  // The classes available for correcting tower energy for tracks are:
208  // 1. StjTowerEnergyCorrectionForTracksMip
209  // 2. StjTowerEnergyCorrectionForTracksFraction
210  // 3. StjTowerEnergyCorrectionForTracksNull (no correction)
211  anapars5->setTowerEnergyCorrection(new StjTowerEnergyCorrectionForTracksFraction(1.00));
212 
213  // TPC cuts
214  anapars5->addTpcCut(new StjTrackCutFlag(0));
215  anapars5->addTpcCut(new StjTrackCutNHits(5));
216  anapars5->addTpcCut(new StjTrackCutPossibleHitRatio(0.51));
217  anapars5->addTpcCut(new StjTrackCutDca(3));
218  anapars5->addTpcCut(new StjTrackCutTdcaPtDependent);
219  anapars5->addTpcCut(new StjTrackCutPt(0.2,200));
220  anapars5->addTpcCut(new StjTrackCutEta(-2.5,2.5));
221  anapars5->addTpcCut(new StjTrackCutRandomAccept(randomAccept));
222 
223  // BEMC cuts
224  anapars5->addBemcCut(new StjTowerEnergyCutBemcStatus(1));
225  anapars5->addBemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
226  anapars5->addBemcCut(new StjTowerEnergyCutEt(0.2));
227 
228  // EEMC cuts
229  anapars5->addEemcCut(new StjTowerEnergyCutBemcStatus(1));
230  anapars5->addEemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
231  anapars5->addEemcCut(new StjTowerEnergyCutEt(0.2));
232 
233  // Jet cuts
234  anapars5->addJetCut(new StProtoJetCutPt(5,200));
235  anapars5->addJetCut(new StProtoJetCutEta(-100,100));
236 
237  //------------------------------------------------------------------------------------
238 
239  // Set analysis cuts for EMC branch
240  StAnaPars* anaparsEMC = new StAnaPars;
241  anaparsEMC->useTpc = true;
242  anaparsEMC->useBemc = true;
243  anaparsEMC->useEemc = true;
244 
245  // TPC cuts
246  anaparsEMC->addTpcCut(new StjTrackCutFlag(0));
247  anaparsEMC->addTpcCut(new StjTrackCutNHits(1000000));
248 
249  // BEMC cuts
250  anaparsEMC->addBemcCut(new StjTowerEnergyCutBemcStatus(1));
251  anaparsEMC->addBemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
252  anaparsEMC->addBemcCut(new StjTowerEnergyCutEt(0.2));
253 
254  // EEMC cuts
255  anaparsEMC->addEemcCut(new StjTowerEnergyCutBemcStatus(1));
256  anaparsEMC->addEemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
257  anaparsEMC->addEemcCut(new StjTowerEnergyCutEt(0.2));
258 
259  // Jet cuts
260  anaparsEMC->addJetCut(new StProtoJetCutPt(5,200));
261  anaparsEMC->addJetCut(new StProtoJetCutEta(-100,100));
262 
263  //------------------------------------------------------------------------------------
264 
265  // Set analysis cuts for particle jets branch
266  StAnaPars* anaparsParticle = new StAnaPars;
267  anaparsParticle->useMonteCarlo = true;
268 
269  // MC cuts
270  anaparsParticle->addMcCut(new StjMCParticleCutStatus(1)); // final state particles
271 
272  // Jet cuts
273  anaparsParticle->addJetCut(new StProtoJetCutPt(1.5,200));
274  anaparsParticle->addJetCut(new StProtoJetCutEta(-100,100));
275 
276  // Set analysis cuts for parton jets branch
277  StAnaPars* anaparsParton = new StAnaPars;
278  anaparsParton->useMonteCarlo = true;
279 
280  // MC cuts
281  anaparsParton->addMcCut(new StjMCParticleCutParton);
282 
283  // Jet cuts
284  anaparsParton->addJetCut(new StProtoJetCutPt(1.5,200));
285  anaparsParton->addJetCut(new StProtoJetCutEta(-100,100));
286 
287  // Set STAR midpoint R=0.7 parameters
288  StConePars* StarMidpointR070Pars = new StConePars;
289  StarMidpointR070Pars->setGridSpacing(105,-3.0,3.0,120,-TMath::Pi(),TMath::Pi());
290  StarMidpointR070Pars->setConeRadius(0.7);
291  StarMidpointR070Pars->setSeedEtMin(0.5);
292  StarMidpointR070Pars->setAssocEtMin(0.1);
293  StarMidpointR070Pars->setSplitFraction(0.5);
294  StarMidpointR070Pars->setPerformMinimization(true);
295  StarMidpointR070Pars->setAddMidpoints(true);
296  StarMidpointR070Pars->setRequireStableMidpoints(true);
297  StarMidpointR070Pars->setDoSplitMerge(true);
298  StarMidpointR070Pars->setDebug(false);
299 
300  // Set CDF midpoint R=0.7 parameters
301  const double coneRadius = 0.7;
302 
303  StFastJetPars* CdfMidpointR070Pars = new StFastJetPars;
304  CdfMidpointR070Pars->setJetAlgorithm(StFastJetPars::plugin_algorithm);
305  CdfMidpointR070Pars->setRparam(coneRadius);
306  CdfMidpointR070Pars->setRecombinationScheme(StFastJetPars::E_scheme);
307  CdfMidpointR070Pars->setStrategy(StFastJetPars::plugin_strategy);
308  CdfMidpointR070Pars->setPtMin(1.5);
309 
310  const double overlapThreshold = 0.75;
311  const double seedThreshold = 0.5;
312  const double coneAreaFraction = 1.0;
313 
314  StPlugin* cdf = new StCDFMidPointPlugin(coneRadius,overlapThreshold,seedThreshold,coneAreaFraction);
315  CdfMidpointR070Pars->setPlugin(cdf);
316 
317  // Set anti-kt R=0.6 parameters
318  StFastJetPars* AntiKtR060Pars = new StFastJetPars;
319  AntiKtR060Pars->setJetAlgorithm(StFastJetPars::antikt_algorithm);
320  AntiKtR060Pars->setRparam(0.6);
321  AntiKtR060Pars->setRecombinationScheme(StFastJetPars::E_scheme);
322  AntiKtR060Pars->setStrategy(StFastJetPars::Best);
323  AntiKtR060Pars->setPtMin(1.5);
324 
325  // Set anti-kt R=0.5 parameters
326  StFastJetPars* AntiKtR050Pars = new StFastJetPars;
327  AntiKtR050Pars->setJetAlgorithm(StFastJetPars::antikt_algorithm);
328  AntiKtR050Pars->setRparam(0.5);
329  AntiKtR050Pars->setRecombinationScheme(StFastJetPars::E_scheme);
330  AntiKtR050Pars->setStrategy(StFastJetPars::Best);
331  AntiKtR050Pars->setPtMin(1.5);
332 
333  jetmaker->addBranch("CdfMidpointR070NHits12",anapars12,CdfMidpointR070Pars);
334  jetmaker->addBranch("CdfMidpointR070NHits5",anapars5,CdfMidpointR070Pars);
335  jetmaker->addBranch("CdfMidpointR070EMC",anaparsEMC,CdfMidpointR070Pars);
336  jetmaker->addBranch("AntiKtR060NHits12",anapars12,AntiKtR060Pars);
337  jetmaker->addBranch("AntiKtR060NHits5",anapars5,AntiKtR060Pars);
338  jetmaker->addBranch("AntiKtR060EMC",anaparsEMC,AntiKtR060Pars);
339  jetmaker->addBranch("AntiKtR050NHits12",anapars12,AntiKtR050Pars);
340  jetmaker->addBranch("AntiKtR050NHits5",anapars5,AntiKtR050Pars);
341  jetmaker->addBranch("AntiKtR050EMC",anaparsEMC,AntiKtR050Pars);
342  jetmaker->addBranch("CdfMidpointR070Particle",anaparsParticle,CdfMidpointR070Pars);
343  jetmaker->addBranch("CdfMidpointR070Parton",anaparsParton,CdfMidpointR070Pars);
344  jetmaker->addBranch("AntiKtR060Particle",anaparsParticle,AntiKtR060Pars);
345  jetmaker->addBranch("AntiKtR060Parton",anaparsParton,AntiKtR060Pars);
346  jetmaker->addBranch("AntiKtR050Particle",anaparsParticle,AntiKtR050Pars);
347  jetmaker->addBranch("AntiKtR050Parton",anaparsParton,AntiKtR050Pars);
348 
349  //------------------------------------------------------------------------------------
350 
351  chain->Init();
352  chain->EventLoop(nevents);
353 }
void setConeRadius(double v)
Set cone radius:
Definition: StConePars.h:65
void setBarrelJetPatchTh(int i, int value)
Use these setters to overwrite thresholds from the database (2009)
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
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
Definition: StIOInterFace.h:35
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
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...
void setSeedEtMin(double v)
minimum et threshold to be considered a seed
Definition: StConePars.h:44
Bool_t doPrintMemoryInfo
lots of screen output
void setAssocEtMin(double v)
minimum et threshold to be considered for addition to the seed
Definition: StConePars.h:47
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