StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunJetFinderOnPythia.C
1 //
2 // Pibero Djawotho <pibero@tamu.edu>
3 // Texas A&M University
4 // 17 Dec 2009
5 //
6 
7 void RunJetFinderOnPythia(int nevents = 1000,
8  const char* pythiafile = "/star/u/pibero/iucf/embedding/P10ic/Jet_pp200_2009/pythia/pt11_15_10146091_1.pythia.root",
9  const char* jetfile = "jets.root")
10 {
11  // Load shared libraries
12  gROOT->Macro("loadMuDst.C");
13  gROOT->Macro("LoadLogger.C");
14 
15  gSystem->Load("StDetectorDbMaker");
16  gSystem->Load("StTpcDb");
17  gSystem->Load("StDbUtilities");
18  gSystem->Load("StMcEvent");
19  gSystem->Load("StMcEventMaker");
20  gSystem->Load("StDaqLib");
21  gSystem->Load("StEmcRawMaker");
22  gSystem->Load("StEmcADCtoEMaker");
23  gSystem->Load("StEpcMaker");
24  gSystem->Load("StEmcSimulatorMaker");
25  gSystem->Load("StDbBroker");
26  gSystem->Load("St_db_Maker");
27  gSystem->Load("StEEmcUtil");
28  gSystem->Load("StEEmcDbMaker");
29  gSystem->Load("StSpinDbMaker");
30  gSystem->Load("StEmcTriggerMaker");
31  gSystem->Load("StTriggerUtilities");
32  gSystem->Load("StMCAsymMaker");
33  gSystem->Load("StRandomSelector");
34  gSystem->Load("libfastjet.so");
35  gSystem->Load("libCDFConesPlugin.so");
36  gSystem->Load("libEECambridgePlugin.so");
37  gSystem->Load("libJadePlugin.so");
38  gSystem->Load("libNestedDefsPlugin.so");
39  gSystem->Load("libSISConePlugin.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  cout << "Loading shared libraries done" << endl;
48 
49  // Create chain
50  StChain* chain = new StChain;
51 
52  // STAR database: Dummy. Not used for PYTHIA jets, but required by StJetMaker.
53  St_db_Maker* starDb = new St_db_Maker("StarDb","MySQL:StarDb");
54  starDb->SetDateTime(20090628,53220); // Run 10179006
55 
56  // Endcap database
57  StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
58 
59  // Read Pythia records
60  St_pythia_Maker* pythia = new St_pythia_Maker;
61  pythia->SetFile(pythiafile);
62 
63  // Pythia4pMaker
64  StPythiaFourPMaker* pythia4pMaker = new StPythiaFourPMaker;
65 
66  // Instantiate the JetMaker
67  StJetMaker2009* jetmaker = new StJetMaker2009;
68  jetmaker->setJetFile(jetfile);
69 
70  //------------------------------------------------------------------------------------
71 
72  // Set analysis cuts for particle jets branch
73  StAnaPars* anaparsParticle = new StAnaPars;
74  anaparsParticle->useMonteCarlo = true;
75 
76  // MC cuts
77  anaparsParticle->addMcCut(new StjMCParticleCutStatus(1)); // final state particles
78 
79  // Jet cuts
80  anaparsParticle->addJetCut(new StProtoJetCutPt(3,200));
81  anaparsParticle->addJetCut(new StProtoJetCutEta(-100,100));
82 
83  //------------------------------------------------------------------------------------
84 
85  // Set analysis cuts for parton jets branch
86  StAnaPars* anaparsParton = new StAnaPars;
87  anaparsParton->useMonteCarlo = true;
88 
89  // MC cuts
90  anaparsParton->addMcCut(new StjMCParticleCutParton);
91 
92  // Jet cuts
93  anaparsParton->addJetCut(new StProtoJetCutPt(3,200));
94  anaparsParton->addJetCut(new StProtoJetCutEta(-100,100));
95 
96  //------------------------------------------------------------------------------------
97 
98  for (float coneRadius = 0.4; coneRadius < 0.8; coneRadius += 0.1) {
99  // Set cone jet finder parameters
100  StConePars* conepars = new StConePars;
101  conepars->setGridSpacing(105,-3.0,3.0,120,-TMath::Pi(),TMath::Pi());
102  conepars->setConeRadius(coneRadius);
103  conepars->setSeedEtMin(0.5);
104  conepars->setAssocEtMin(0.1);
105  conepars->setSplitFraction(0.5);
106  conepars->setPerformMinimization(true);
107  conepars->setAddMidpoints(true);
108  conepars->setRequireStableMidpoints(true);
109  conepars->setDoSplitMerge(true);
110  conepars->setDebug(false);
111 
112  int iConeRadius = coneRadius*100;
113  jetmaker->addBranch(Form("ParticleConeJetsR%03d",iConeRadius),anaparsParticle,conepars);
114  jetmaker->addBranch(Form("PartonConeJetsR%03d",iConeRadius),anaparsParton,conepars);
115  }
116 
117  //------------------------------------------------------------------------------------
118 
119  // Run
120  chain->Init();
121  chain->EventLoop(nevents);
122 }
void setConeRadius(double v)
Set cone radius:
Definition: StConePars.h:65
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