EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_Jets.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_Jets.C
1 #pragma once
2 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
5 #include <g4jets/FastJetAlgo.h>
6 #include <g4jets/JetReco.h>
7 #include <g4jets/TowerJetInput.h>
8 #include <g4jets/TrackJetInput.h>
9 #include <g4jets/TruthJetInput.h>
10 #include <g4eval/JetEvaluator.h>
11 R__LOAD_LIBRARY(libg4jets.so)
12 R__LOAD_LIBRARY(libg4eval.so)
13 #endif
14 
15 void JetInit() {}
16 
17 void Jet_Reco(int verbosity = 0) {
18 
19  gSystem->Load("libg4jets.so");
20 
22 
23  // truth particle level jets
24  JetReco *truthjetreco = new JetReco("TRUTHJETRECO");
25  truthjetreco->add_input(new TruthJetInput(Jet::PARTICLE));
26  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.2),"AntiKt_Truth_r02");
27  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.3),"AntiKt_Truth_r03");
28  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.4),"AntiKt_Truth_r04");
29  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.5),"AntiKt_Truth_r05");
30  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.6),"AntiKt_Truth_r06");
31  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.7),"AntiKt_Truth_r07");
32  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.8),"AntiKt_Truth_r08");
33  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,1.0),"AntiKt_Truth_r10");
34  truthjetreco->set_algo_node("ANTIKT");
35  truthjetreco->set_input_node("TRUTH");
36  truthjetreco->Verbosity(verbosity);
37  se->registerSubsystem(truthjetreco);
38  /*
39  // tower jets
40  JetReco *towerjetreco = new JetReco("TOWERJETRECO");
41  towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER));
42  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER));
43  towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER));
44  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.2),"AntiKt_Tower_r02");
45  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.3),"AntiKt_Tower_r03");
46  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.4),"AntiKt_Tower_r04");
47  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.5),"AntiKt_Tower_r05");
48  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.6),"AntiKt_Tower_r06");
49  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.7),"AntiKt_Tower_r07");
50  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.8),"AntiKt_Tower_r08");
51  towerjetreco->set_algo_node("ANTIKT");
52  towerjetreco->set_input_node("TOWER");
53  towerjetreco->Verbosity(verbosity);
54  se->registerSubsystem(towerjetreco);
55 
56  // cluster jets
57  JetReco *clusterjetreco = new JetReco("CLUSTERJETRECO");
58  clusterjetreco->add_input(new ClusterJetInput(Jet::CEMC_CLUSTER));
59  clusterjetreco->add_input(new ClusterJetInput(Jet::HCALIN_CLUSTER));
60  clusterjetreco->add_input(new ClusterJetInput(Jet::HCALOUT_CLUSTER));
61  clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.2),"AntiKt_Cluster_r02");
62  clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.3),"AntiKt_Cluster_r03");
63  clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.4),"AntiKt_Cluster_r04");
64  clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.5),"AntiKt_Cluster_r05");
65  clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.6),"AntiKt_Cluster_r06");
66  clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.7),"AntiKt_Cluster_r07");
67  clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.8),"AntiKt_Cluster_r08");
68  clusterjetreco->set_algo_node("ANTIKT");
69  clusterjetreco->set_input_node("CLUSTER");
70  clusterjetreco->Verbosity(verbosity);
71  se->registerSubsystem(clusterjetreco);
72  */
73  // track jets
74  JetReco *trackjetreco = new JetReco("TRACKJETRECO");
75  trackjetreco->add_input(new TrackJetInput(Jet::TRACK));
76  trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.2),"AntiKt_Track_r02");
77  trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.3),"AntiKt_Track_r03");
78  trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.4),"AntiKt_Track_r04");
79  trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.5),"AntiKt_Track_r05");
80  trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.6),"AntiKt_Track_r06");
81  trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.7),"AntiKt_Track_r07");
82  trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,0.8),"AntiKt_Track_r08");
83  trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT,1.0),"AntiKt_Track_r10");
84  trackjetreco->set_algo_node("ANTIKT");
85  trackjetreco->set_input_node("TRACK");
86  trackjetreco->Verbosity(verbosity);
87  se->registerSubsystem(trackjetreco);
88 
89  return;
90 }
91 
92 void Jet_Eval(std::string outfilename = "g4jets_eval.root",
93  int verbosity = 0) {
94 
95  gSystem->Load("libg4eval.so");
96 
98 
99  JetEvaluator* eval = new JetEvaluator("JETEVALUATOR",
100  //"AntiKt_Tower_r03",
101  "AntiKt_Track_r03",
102  "AntiKt_Truth_r03",
103  outfilename);
104  eval->Verbosity(verbosity);
105  se->registerSubsystem(eval);
106 
107  return;
108 }