Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_HIJetReco.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_HIJetReco.C
1 #ifndef MACRO_G4HIJETRECO_C
2 #define MACRO_G4HIJETRECO_C
3 
4 #include <GlobalVariables.C>
5 
6 #include <jetbase/FastJetAlgo.h>
7 #include <jetbase/JetReco.h>
9 #include <g4jets/TruthJetInput.h>
10 
17 
18 #include <fun4all/Fun4AllServer.h>
19 
20 R__LOAD_LIBRARY(libjetbase.so)
21 R__LOAD_LIBRARY(libg4jets.so)
22 R__LOAD_LIBRARY(libjetbackground.so)
23 
24 namespace Enable
25 {
26  bool HIJETS = false;
27  int HIJETS_VERBOSITY = 0;
28 } // namespace Enable
29 
30 namespace G4HIJETS
31 {
32  bool do_flow = false;
33  bool do_CS = false;
34 } // namespace G4HIJETS
35 
36 void HIJetReco()
37 {
38 
40 
41  //---------------
42  // Fun4All server
43  //---------------
44 
46 
47  JetReco *truthjetreco = new JetReco();
49  tji->add_embedding_flag(0); // changes depending on signal vs. embedded
50  truthjetreco->add_input(tji);
51  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Truth_r02");
52  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.3), "AntiKt_Truth_r03");
53  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.4), "AntiKt_Truth_r04");
54  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.5), "AntiKt_Truth_r05");
55  truthjetreco->set_algo_node("ANTIKT");
56  truthjetreco->set_input_node("TRUTH");
57  truthjetreco->Verbosity(verbosity);
58  se->registerSubsystem(truthjetreco);
59 
60 
61 
62  RetowerCEMC *rcemc = new RetowerCEMC();
63  rcemc->Verbosity(verbosity);
64  rcemc->set_towerinfo(true);
65  se->registerSubsystem(rcemc);
66 
67  JetReco *towerjetreco = new JetReco();
69  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWERINFO));
71  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_TowerInfo_HIRecoSeedsRaw_r02");
72  towerjetreco->set_algo_node("ANTIKT");
73  towerjetreco->set_input_node("TOWER");
74  towerjetreco->Verbosity(verbosity);
75  se->registerSubsystem(towerjetreco);
76 
78  dtb->SetBackgroundOutputName("TowerInfoBackground_Sub1");
80  dtb->SetSeedType(0);
81  dtb->SetSeedJetD(3);
82  dtb->set_towerinfo(true);
83  dtb->Verbosity(verbosity);
84  se->registerSubsystem(dtb);
85 
86 
89  casj->Verbosity(verbosity);
90  casj->set_towerinfo(true);
91  se->registerSubsystem(casj);
92 
93 
95  dtb2->SetBackgroundOutputName("TowerInfoBackground_Sub2");
97  dtb2->SetSeedType(1);
98  dtb2->SetSeedJetPt(7);
99  dtb2->Verbosity(verbosity);
100  dtb2->set_towerinfo(true);
101  se->registerSubsystem(dtb2);
102 
103 
104  SubtractTowers *st = new SubtractTowers();
106  st->Verbosity(verbosity);
107  st->set_towerinfo(true);
108  se->registerSubsystem(st);
109 
110  towerjetreco = new JetReco();
114  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.2, verbosity), "AntiKt_Tower_r02_Sub1");
115  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.3, verbosity), "AntiKt_Tower_r03_Sub1");
116  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.4, verbosity), "AntiKt_Tower_r04_Sub1");
117  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.5, verbosity), "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  if (G4HIJETS::do_CS)
124  {
125  SubtractTowersCS *stCS = new SubtractTowersCS();
127  stCS->SetAlpha(1);
128  stCS->SetDeltaRmax(0.3);
129  stCS->Verbosity(verbosity);
130  se->registerSubsystem(stCS);
131 
132  JetReco *towerjetrecoCS = new JetReco();
133  towerjetrecoCS->add_input(new TowerJetInput(Jet::CEMC_TOWER_SUB1CS));
134  towerjetrecoCS->add_input(new TowerJetInput(Jet::HCALIN_TOWER_SUB1CS));
135  towerjetrecoCS->add_input(new TowerJetInput(Jet::HCALOUT_TOWER_SUB1CS));
136  // note that CS can use the regular FastJetAlgo without extra modifications for negative-E inputs
137  towerjetrecoCS->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2, verbosity), "AntiKt_Tower_r02_Sub1CS");
138  towerjetrecoCS->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.3, verbosity), "AntiKt_Tower_r03_Sub1CS");
139  towerjetrecoCS->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.4, verbosity), "AntiKt_Tower_r04_Sub1CS");
140  towerjetrecoCS->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.5, verbosity), "AntiKt_Tower_r05_Sub1CS");
141  towerjetrecoCS->set_algo_node("ANTIKT");
142  towerjetrecoCS->set_input_node("TOWER");
143  towerjetrecoCS->Verbosity(verbosity);
144  se->registerSubsystem(towerjetrecoCS);
145  }
146 
147  return;
148 }
149 #endif