StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunJetFinder2012pro_fcs.C
1 void RunJetFinder2012pro_fcs(int nevents = 100,
2 const char* indir = "./",
3 const char* MuDst = "_e45.MuDst.root",
4 const char* Jetfile = "test.jets.root",
5 const char* Uefile = "test.ueoc.root",
6 const char* Skimfile = "test.skim.root",
7 const char* geneventfile = "pi+_e45.vz0.run0.genevent.root")
8 {
9 
10 
11  cout<<"MuDst file is "<<MuDst<<endl;
12  cout<<"JetTree file is "<<Jetfile<<endl;
13  cout<<"SkimTree file is "<<Skimfile<<endl;
14  cout<<"Ue file is "<<Uefile<< endl;
15  cout<<"GeantEvent file is " <<geneventfile<< endl;
16  cout<<"\n " << endl;
17 
18  gROOT->Macro("loadMuDst.C");
19  gROOT->Macro("LoadLogger.C");
20 
21  gSystem->Load("StDetectorDbMaker");
22  gSystem->Load("StTpcDb");
23  gSystem->Load("StDbUtilities");
24  gSystem->Load("StMcEvent");
25  gSystem->Load("StMcEventMaker");
26  gSystem->Load("StDaqLib");
27  gSystem->Load("StEmcRawMaker");
28  gSystem->Load("StEmcADCtoEMaker");
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("libsiscone.so");
41  gSystem->Load("libsiscone_spherical.so");
42  gSystem->Load("libfastjetplugins.so");
43 
44  gSystem->Load("StJetFinder");
45  gSystem->Load("StJetSkimEvent");
46  gSystem->Load("StJets");
47  gSystem->Load("StJetEvent");
48  gSystem->Load("StUeEvent");
49  gSystem->Load("StJetMaker");
50 
51  gSystem->Load("libMinuit.so");
52 
53  gSystem->Load("StFcsUtil");
54  gSystem->Load("StFcsDbMaker");
55 
56  gSystem->Load( "libVMC.so");
57  gSystem->Load( "St_g2t.so" );
58  gSystem->Load( "St_geant_Maker.so" );
59 
60  gSystem->Load( "StarGeneratorUtil.so" );
61  gSystem->Load( "StarGeneratorEvent.so" );
62  gSystem->Load( "StarGeneratorBase.so" );
63 
64  gSystem->Load( "libMathMore.so" );
65  gSystem->Load( "libStarGenEventReader.so" );
66 
67 
68  StChain *chain = new StChain;
69 
70  // I/O maker to be used with .geant.root MC truth information
71 
72 // StIOMaker* ioMaker = new StIOMaker;
73 // ioMaker->SetFile(geantFile); //add as input parameter
74 // ioMaker->SetIOMode("r");
75 // ioMaker->SetBranch("*",0,"0"); // Deactivate all branches
76 // ioMaker->SetBranch("genevents",0,"r"); // Activate geant Branch
77 // ioMaker->SetBranch("geantBranch",0,"r"); // Activate geant Branch
78 
79  // Truth Particle information under new StarGenerator format
80  if(geneventfile){
81  StarGenEventReader *eventreader = new StarGenEventReader("genEvent");
82  eventreader->SetInputFile(geneventfile,"genevents","primaryEvent");
83  }
84 
85  // MuDst reader
86  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,indir, MuDst,"",1000,"MuDst");
87 
88  // MuDst DB
89  StMuDbReader* muDstDb = StMuDbReader::instance();
90 
91 // StTriggerFilterMaker* filterMaker = new StTriggerFilterMaker;
92 // //JP0
93 // filterMaker->addTrigger(380401);
94 // //JP1
95 // filterMaker->addTrigger(380402);
96 // //JP2
97 // filterMaker->addTrigger(380403);
98 // //AJP
99 // filterMaker->addTrigger(380404);
100 
101  // star database
102  St_db_Maker* starDb = new St_db_Maker("StarDb","MySQL:StarDb");
103 // starDb->SetDateTime(20090628,53220);
104 
105  // FCS DB Maker
106  StFcsDbMaker* fcsdbMaker = new StFcsDbMaker;
107 
108  // Endcap database
109  StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
110 
111  // star spin database
112  StSpinDbMaker* spinDb = new StSpinDbMaker;
113 
114  // Barrel ADC to energy maker
116  adc->saveAllStEvent(true);
117 
118  // FMS no longer in use
119  // StFmsDbMaker* fmsDb = new StFmsDbMaker;
120  // StFmsHitMaker* fmshitMk = new StFmsHitMaker();
121  // StFmsPointMaker* fmsptMk = new StFmsPointMaker("StFmsPointMaker");
122 
123 // StTriggerSimuMaker* simuTrig = new StTriggerSimuMaker;
124 // simuTrig->useOnlineDB();
125 // simuTrig->setMC(0);
126 // //simuTrig->useBbc();
127 // simuTrig->useBemc();
128 // simuTrig->useEemc();
129 // simuTrig->bemc->setConfig(StBemcTriggerSimu::kOffline);
130 //
131  StJetSkimEventMaker* skimEventMaker = new StJetSkimEventMaker("StJetSkimEventMaker", muDstMaker, Skimfile);
132 
133  // Get Pythia record
134  StMCAsymMaker* asym = new StMCAsymMaker;
135 
136 
137 //------------------------------------------------------------------------------------
138  // StJetMaker2012
139  StJetMaker2012* jetmaker = new StJetMaker2012;
140  jetmaker->setJetFile(Jetfile);
141  jetmaker->setJetFileUe(Uefile);
142 
143 //------------------------------------------------------------------------------------
144  //StAnaPars Detect Level
145  StAnaPars* anapars12 = new StAnaPars;
146  anapars12->useTpc = true;
147  anapars12->useBemc = false;
148  anapars12->useEemc = false;
149  anapars12->useFms = false;
150  anapars12->useFcsECal = true;
151  anapars12->useFcsHCal = true;
152  anapars12->randomSelectorProb = 1.00;
153 
154  // The classes available for correcting tower energy for tracks are:
155  // 1. StjTowerEnergyCorrectionForTracksMip
156  // 2. StjTowerEnergyCorrectionForTracksFraction
157  // 3. StjTowerEnergyCorrectionForTracksNull (default: no correction)
158  anapars12->setTowerEnergyCorrection(new StjTowerEnergyCorrectionForTracksFraction(1.00));
159 
160  //TPC Cuts
161  anapars12->addTpcCut(new StjTrackCutFlag(0));
162  anapars12->addTpcCut(new StjTrackCutNHits(12));
163  anapars12->addTpcCut(new StjTrackCutPossibleHitRatio(0.51));
164  anapars12->addTpcCut(new StjTrackCutDca(3));
165 
166  //DcaD pT dependent cut for pp200 run9
167  // anapars12->addTpcCut(new StjTrackCutDcaPtDependent);
168  //DcaT pT dependent cut for pp500 run11, run12
169  anapars12->addTpcCut(new StjTrackCutTdcaPtDependent);
170  //Don't Need Chi2 cut for Run12 either
171  //anapars12->addTpcCut(new StjTrackCutChi2(0,4));
172  anapars12->addTpcCut(new StjTrackCutPt(.2,200));
173  anapars12->addTpcCut(new StjTrackCutEta(-2.5,2.5));
174  anapars12->addTpcCut(new StjTrackCutLastPoint(125));
175 
176  // BEMC cuts
177  anapars12->addBemcCut(new StjTowerEnergyCutBemcStatus(1));
178  anapars12->addBemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
179  anapars12->addBemcCut(new StjTowerEnergyCutEt(0.2));
180 
181  // EEMC cuts
182  anapars12->addEemcCut(new StjTowerEnergyCutBemcStatus(1));
183  anapars12->addEemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS
184  anapars12->addEemcCut(new StjTowerEnergyCutEt(0.2));
185 
186  // FCS Cuts
187 // anapars12->addFCSEcalemcCut(new StjTowerEnergyCutEt(0.1));
188 // anapars12->addFCSHcalhcCut(new StjTowerEnergyCutEt(0.1));
189 
190  anapars12->addFCSEcalemcCut(new StjTowerEnergyCutEnergy(0.1));
191  anapars12->addFCSHcalhcCut(new StjTowerEnergyCutEnergy(0.1));
192 
193  // Jet cuts
194 // anapars12->addJetCut(new StProtoJetCutPt(1.5,1000000));
195  anapars12->addJetCut(new StProtoJetCutEta(-100,100));
196 
197 //------------------------------------------------------------------------------------
198 
199 
200  // Set analysis cuts for particle jets branch
201  StAnaPars* anaparsParticle = new StAnaPars;
202  anaparsParticle->useMonteCarlo = true;
203 
204  // MC cuts
205  anaparsParticle->addMcCut(new StjMCParticleCutStatus(1)); // final state particles
206 
207  // Jet cuts
208  anaparsParticle->addJetCut(new StProtoJetCutPt(1.5,1000000));
209  anaparsParticle->addJetCut(new StProtoJetCutEta(-100,100));
210 
211 //------------------------------------------------------------------------------------
212 
213  // Jet Area
214  StFastJetAreaPars *JetAreaPars = new StFastJetAreaPars;
215 
216  //Anti-kT R=0.6 for run12 jet finding
217  StFastJetPars* AntiKtR050Pars = new StFastJetPars;
218  AntiKtR050Pars->setJetAlgorithm(StFastJetPars::antikt_algorithm);
219  AntiKtR050Pars->setRparam(0.5); // 0.6
220  AntiKtR050Pars->setRecombinationScheme(StFastJetPars::E_scheme);
221  AntiKtR050Pars->setStrategy(StFastJetPars::Best);
222  AntiKtR050Pars->setPtMin(.1);
223  AntiKtR050Pars->setJetArea(JetAreaPars);
224 
225  //Anti-kT R=0.5 for run12 jet finding
226  StFastJetPars* AntiKtR040Pars = new StFastJetPars;
227  AntiKtR040Pars->setJetAlgorithm(StFastJetPars::antikt_algorithm);
228  AntiKtR040Pars->setRparam(0.4); // 0.5
229  AntiKtR040Pars->setRecombinationScheme(StFastJetPars::E_scheme);
230  AntiKtR040Pars->setStrategy(StFastJetPars::Best);
231  AntiKtR040Pars->setPtMin(.1);
232  AntiKtR040Pars->setJetArea(JetAreaPars);
233 
234  jetmaker->addBranch("AntiKtR050NHits12",anapars12,AntiKtR050Pars);
235  jetmaker->addBranch("AntiKtR040NHits12",anapars12,AntiKtR040Pars);
236  jetmaker->addBranch("AntiKtR050Particle",anaparsParticle,AntiKtR050Pars);
237  jetmaker->addBranch("AntiKtR040Particle",anaparsParticle,AntiKtR040Pars);
238  StOffAxisConesPars *off050 = new StOffAxisConesPars(0.5);
239  StOffAxisConesPars *off060 = new StOffAxisConesPars(0.6);
240  jetmaker->addUeBranch("OffAxisConesR050", off050);
241  jetmaker->addUeBranch("OffAxisConesR060", off060);
242 
243  // Run
244  chain->Init();
245  chain->EventLoop(nevents);
246 }
static const int Best
automatic selection of the best (based on N)
static const int E_scheme
Definition: StFastJetPars.h:89
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.