Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_JetVal.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_JetVal.C
1 #pragma once
2 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
3 #include <fun4all/SubsysReco.h>
7 
10 #include <fun4all/Fun4AllServer.h>
11 
12 #include <phool/PHRandomSeed.h>
13 #include <phool/recoConsts.h>
14 
15 #include <g4jets/FastJetAlgo.h>
16 #include <g4jets/JetReco.h>
17 #include <g4jets/TowerJetInput.h>
18 #include <g4jets/TruthJetInput.h>
19 
21 
28 
29 #include <jetunderlyingevent/JetUnderlyingEvent.h>
30 
31 R__LOAD_LIBRARY(libfun4all.so)
32 R__LOAD_LIBRARY(libg4jets.so)
33 R__LOAD_LIBRARY(libjetbackground.so)
34 R__LOAD_LIBRARY(JetUnderlyingEvent.so)
35 R__LOAD_LIBRARY(libg4centrality.so)
36 R__LOAD_LIBRARY(libg4dst.so)
37 
38 namespace Enable
39 {
40  bool HIJETS = true;
41  int HIJETS_VERBOSITY = 1;
42 } // namespace Enable
43 
44 namespace G4HIJETS
45 {
46  bool do_flow = false;
47  bool do_CS = false;
48 } // namespace G4HIJETS
49 #endif
50 
51 
52 void Fun4All_JetVal( const char *filelistcalo = "dst_calo_cluster.list",
53  const char *filelistbbc = "dst_bbc_g4hit.list",
54  const char *outname = "output_test.root")
55 
56 {
57 
58 
60  int verbosity = 0;
61 
62  se->Verbosity(verbosity);
64 
66  cent->Verbosity(0);
67  cent->GetCalibrationParameters().ReadFromFile("centrality", "xml", 0, 0, string(getenv("CALIBRATIONROOT")) + string("/Centrality/"));
68  se->registerSubsystem( cent );
69 
70  RetowerCEMC *rcemc = new RetowerCEMC();
71  rcemc->Verbosity(verbosity);
72  se->registerSubsystem(rcemc);
73 
74  JetReco *towerjetreco = new JetReco();
76  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER));
77  towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER));
78  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Tower_HIRecoSeedsRaw_r02");
79  towerjetreco->set_algo_node("ANTIKT");
80  towerjetreco->set_input_node("TOWER");
81  towerjetreco->Verbosity(verbosity);
82  se->registerSubsystem(towerjetreco);
83 
85  dtb->SetBackgroundOutputName("TowerBackground_Sub1");
87  dtb->SetSeedType(0);
88  dtb->SetSeedJetD(3);
89  dtb->Verbosity(verbosity);
90  se->registerSubsystem(dtb);
91 
94  casj->Verbosity(verbosity);
95  se->registerSubsystem(casj);
96 
98  dtb2->SetBackgroundOutputName("TowerBackground_Sub2");
100  dtb2->SetSeedType(1);
101  dtb2->SetSeedJetPt(7);
102  dtb2->Verbosity(verbosity);
103  se->registerSubsystem(dtb2);
104 
105  SubtractTowers *st = new SubtractTowers();
107  st->Verbosity(verbosity);
108  se->registerSubsystem(st);
109 
110  towerjetreco = new JetReco();
111  towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER_SUB1));
112  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER_SUB1));
113  towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER_SUB1));
114  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.2, 1), "AntiKt_Tower_r02_Sub1");
115  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.3, 1), "AntiKt_Tower_r03_Sub1");
116  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.4, 1), "AntiKt_Tower_r04_Sub1");
117  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.5, 1), "AntiKt_Tower_r05_Sub1");
118  towerjetreco->set_algo_node("ANTIKT");
119  towerjetreco->set_input_node("TOWER");
120  towerjetreco->Verbosity(verbosity);
121  se->registerSubsystem(towerjetreco);
122 
123 
124 
125  JetUnderlyingEvent *myJetVal = new JetUnderlyingEvent("name",outname);
126  se->registerSubsystem(myJetVal);
127 
128  Fun4AllInputManager *in2 = new Fun4AllDstInputManager("DSTcalo");
129  in2->AddListFile(filelistcalo,1);
130  se->registerInputManager(in2);
131 
132  Fun4AllInputManager *in3 = new Fun4AllDstInputManager("DSTbbc");
133  in3->AddListFile(filelistbbc,1);
134  se->registerInputManager(in3);
135 
136 
137 
138  se->run(-1);
139  se->End();
140 
141  gSystem->Exit(0);
142  return 0;
143 
144 }