EIC 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 <g4jets/FastJetAlgo.h>
7 #include <g4jets/JetReco.h>
8 #include <g4jets/TowerJetInput.h>
9 #include <g4jets/TruthJetInput.h>
10 
17 
18 #include <fun4all/Fun4AllServer.h>
19 
20 R__LOAD_LIBRARY(libg4jets.so)
21 R__LOAD_LIBRARY(libjetbackground.so)
22 
23 namespace Enable
24 {
25  bool HIJETS = false;
27 } // namespace Enable
28 
29 namespace G4HIJETS
30 {
31  bool do_flow = false;
32  bool do_CS = false;
33 } // namespace G4HIJETS
34 
35 void HIJetReco()
36 {
38 
39  //---------------
40  // Fun4All server
41  //---------------
42 
44 
45  JetReco *truthjetreco = new JetReco();
47  tji->add_embedding_flag(0); // changes depending on signal vs. embedded
48  truthjetreco->add_input(tji);
49  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Truth_r02");
50  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.3), "AntiKt_Truth_r03");
51  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.4), "AntiKt_Truth_r04");
52  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.5), "AntiKt_Truth_r05");
53  truthjetreco->set_algo_node("ANTIKT");
54  truthjetreco->set_input_node("TRUTH");
55  truthjetreco->Verbosity(verbosity);
56  se->registerSubsystem(truthjetreco);
57 
58  RetowerCEMC *rcemc = new RetowerCEMC();
59  rcemc->Verbosity(verbosity);
60  se->registerSubsystem(rcemc);
61 
62  JetReco *towerjetreco = new JetReco();
64  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER));
65  towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER));
66  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Tower_HIRecoSeedsRaw_r02");
67  towerjetreco->set_algo_node("ANTIKT");
68  towerjetreco->set_input_node("TOWER");
69  towerjetreco->Verbosity(verbosity);
70  se->registerSubsystem(towerjetreco);
71 
73  dtb->SetBackgroundOutputName("TowerBackground_Sub1");
75  dtb->SetSeedType(0);
76  dtb->SetSeedJetD(3);
77  dtb->Verbosity(verbosity);
78  se->registerSubsystem(dtb);
79 
82  casj->Verbosity(verbosity);
83  se->registerSubsystem(casj);
84 
86  dtb2->SetBackgroundOutputName("TowerBackground_Sub2");
88  dtb2->SetSeedType(1);
89  dtb2->SetSeedJetPt(7);
90  dtb2->Verbosity(verbosity);
91  se->registerSubsystem(dtb2);
92 
93  SubtractTowers *st = new SubtractTowers();
95  st->Verbosity(verbosity);
96  se->registerSubsystem(st);
97 
98  towerjetreco = new JetReco();
99  towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER_SUB1));
100  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER_SUB1));
101  towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER_SUB1));
102  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.2, verbosity), "AntiKt_Tower_r02_Sub1");
103  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.3, verbosity), "AntiKt_Tower_r03_Sub1");
104  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.4, verbosity), "AntiKt_Tower_r04_Sub1");
105  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.5, verbosity), "AntiKt_Tower_r05_Sub1");
106  towerjetreco->set_algo_node("ANTIKT");
107  towerjetreco->set_input_node("TOWER");
108  towerjetreco->Verbosity(verbosity);
109  se->registerSubsystem(towerjetreco);
110 
111  if (G4HIJETS::do_CS)
112  {
113  SubtractTowersCS *stCS = new SubtractTowersCS();
115  stCS->SetAlpha(1);
116  stCS->SetDeltaRmax(0.3);
117  stCS->Verbosity(verbosity);
118  se->registerSubsystem(stCS);
119 
120  JetReco *towerjetrecoCS = new JetReco();
121  towerjetrecoCS->add_input(new TowerJetInput(Jet::CEMC_TOWER_SUB1CS));
122  towerjetrecoCS->add_input(new TowerJetInput(Jet::HCALIN_TOWER_SUB1CS));
123  towerjetrecoCS->add_input(new TowerJetInput(Jet::HCALOUT_TOWER_SUB1CS));
124  // note that CS can use the regular FastJetAlgo without extra modifications for negative-E inputs
125  towerjetrecoCS->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2, verbosity), "AntiKt_Tower_r02_Sub1CS");
126  towerjetrecoCS->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.3, verbosity), "AntiKt_Tower_r03_Sub1CS");
127  towerjetrecoCS->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.4, verbosity), "AntiKt_Tower_r04_Sub1CS");
128  towerjetrecoCS->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.5, verbosity), "AntiKt_Tower_r05_Sub1CS");
129  towerjetrecoCS->set_algo_node("ANTIKT");
130  towerjetrecoCS->set_input_node("TOWER");
131  towerjetrecoCS->Verbosity(verbosity);
132  se->registerSubsystem(towerjetrecoCS);
133  }
134 
135  return;
136 }
137 #endif