File indexing completed on 2025-08-03 08:20:25
0001 #ifndef MACRO_G4JETS_C
0002 #define MACRO_G4JETS_C
0003
0004 #include <GlobalVariables.C>
0005 #include <QA.C>
0006
0007 #include <jetbase/ClusterJetInput.h>
0008 #include <jetbase/FastJetAlgo.h>
0009 #include <jetbase/JetReco.h>
0010 #include <jetbase/TowerJetInput.h>
0011 #include <jetbase/TrackJetInput.h>
0012 #include <g4jets/TruthJetInput.h>
0013
0014 #include <g4eval/JetEvaluator.h>
0015 #include <simqa_modules/QAG4SimulationJet.h>
0016
0017 #include <fun4all/Fun4AllServer.h>
0018
0019 R__LOAD_LIBRARY(libjetbase.so)
0020 R__LOAD_LIBRARY(libg4jets.so)
0021 R__LOAD_LIBRARY(libg4eval.so)
0022 R__LOAD_LIBRARY(libsimqa_modules.so)
0023
0024 namespace Enable
0025 {
0026 bool JETS = false;
0027 bool JETS_EVAL = false;
0028 bool JETS_QA = false;
0029 int JETS_VERBOSITY = 0;
0030 }
0031
0032 void JetInit() {}
0033
0034 void Jet_Reco()
0035 {
0036 int verbosity = std::max(Enable::VERBOSITY, Enable::JETS_VERBOSITY);
0037
0038 Fun4AllServer *se = Fun4AllServer::instance();
0039
0040
0041 JetReco *truthjetreco = new JetReco("TRUTHJETRECO");
0042 truthjetreco->add_input(new TruthJetInput(Jet::PARTICLE));
0043 truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Truth_r02");
0044 truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.3), "AntiKt_Truth_r03");
0045 truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.4), "AntiKt_Truth_r04");
0046 truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.5), "AntiKt_Truth_r05");
0047 truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.6), "AntiKt_Truth_r06");
0048 truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.7), "AntiKt_Truth_r07");
0049 truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.8), "AntiKt_Truth_r08");
0050 truthjetreco->set_algo_node("ANTIKT");
0051 truthjetreco->set_input_node("TRUTH");
0052 truthjetreco->Verbosity(verbosity);
0053 se->registerSubsystem(truthjetreco);
0054
0055
0056 JetReco *towerjetreco = new JetReco("TOWERJETRECO");
0057 towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER));
0058 towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER));
0059 towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER));
0060 towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Tower_r02");
0061 towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.3), "AntiKt_Tower_r03");
0062 towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.4), "AntiKt_Tower_r04");
0063 towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.5), "AntiKt_Tower_r05");
0064 towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.6), "AntiKt_Tower_r06");
0065 towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.7), "AntiKt_Tower_r07");
0066 towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.8), "AntiKt_Tower_r08");
0067 towerjetreco->set_algo_node("ANTIKT");
0068 towerjetreco->set_input_node("TOWER");
0069 towerjetreco->Verbosity(verbosity);
0070 se->registerSubsystem(towerjetreco);
0071
0072
0073 JetReco *clusterjetreco = new JetReco("CLUSTERJETRECO");
0074 clusterjetreco->add_input(new ClusterJetInput(Jet::CEMC_CLUSTER));
0075 clusterjetreco->add_input(new ClusterJetInput(Jet::HCALIN_CLUSTER));
0076 clusterjetreco->add_input(new ClusterJetInput(Jet::HCALOUT_CLUSTER));
0077 clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Cluster_r02");
0078 clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.3), "AntiKt_Cluster_r03");
0079 clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.4), "AntiKt_Cluster_r04");
0080 clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.5), "AntiKt_Cluster_r05");
0081 clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.6), "AntiKt_Cluster_r06");
0082 clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.7), "AntiKt_Cluster_r07");
0083 clusterjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.8), "AntiKt_Cluster_r08");
0084 clusterjetreco->set_algo_node("ANTIKT");
0085 clusterjetreco->set_input_node("CLUSTER");
0086 clusterjetreco->Verbosity(verbosity);
0087 se->registerSubsystem(clusterjetreco);
0088
0089
0090 JetReco *trackjetreco = new JetReco("TRACKJETRECO");
0091 trackjetreco->add_input(new TrackJetInput(Jet::TRACK, TRACKING::TrackNodeName));
0092 trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Track_r02");
0093 trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.3), "AntiKt_Track_r03");
0094 trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.4), "AntiKt_Track_r04");
0095 trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.5), "AntiKt_Track_r05");
0096 trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.6), "AntiKt_Track_r06");
0097 trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.7), "AntiKt_Track_r07");
0098 trackjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.8), "AntiKt_Track_r08");
0099 trackjetreco->set_algo_node("ANTIKT");
0100 trackjetreco->set_input_node("TRACK");
0101 trackjetreco->Verbosity(verbosity);
0102 se->registerSubsystem(trackjetreco);
0103
0104 return;
0105 }
0106
0107 void Jet_Eval(const std::string &outfilename = "g4jets_eval.root")
0108 {
0109 int verbosity = std::max(Enable::VERBOSITY, Enable::JETS_VERBOSITY);
0110
0111 Fun4AllServer *se = Fun4AllServer::instance();
0112
0113 JetEvaluator *eval = new JetEvaluator("JETEVALUATOR",
0114 "AntiKt_Tower_r03",
0115 "AntiKt_Truth_r03",
0116 outfilename);
0117 eval->Verbosity(verbosity);
0118 se->registerSubsystem(eval);
0119
0120 return;
0121 }
0122
0123
0124 void Jet_QA()
0125 {
0126 int verbosity = std::max(Enable::QA_VERBOSITY, Enable::JETS_VERBOSITY);
0127
0128 Fun4AllServer *se = Fun4AllServer::instance();
0129
0130 QAG4SimulationJet *calo_jet7 = new QAG4SimulationJet(
0131 "AntiKt_Truth_r07");
0132 calo_jet7->add_reco_jet("AntiKt_Tower_r07");
0133 calo_jet7->add_reco_jet("AntiKt_Cluster_r07");
0134 calo_jet7->add_reco_jet("AntiKt_Track_r07");
0135 calo_jet7->Verbosity(verbosity);
0136 se->registerSubsystem(calo_jet7);
0137
0138 QAG4SimulationJet *calo_jet4 = new QAG4SimulationJet(
0139 "AntiKt_Truth_r04");
0140 calo_jet4->add_reco_jet("AntiKt_Tower_r04");
0141 calo_jet4->add_reco_jet("AntiKt_Cluster_r04");
0142 calo_jet4->add_reco_jet("AntiKt_Track_r04");
0143 calo_jet4->Verbosity(verbosity);
0144 se->registerSubsystem(calo_jet4);
0145
0146 QAG4SimulationJet *calo_jet2 = new QAG4SimulationJet(
0147 "AntiKt_Truth_r02");
0148 calo_jet2->add_reco_jet("AntiKt_Tower_r02");
0149 calo_jet2->add_reco_jet("AntiKt_Cluster_r02");
0150 calo_jet2->add_reco_jet("AntiKt_Track_r02");
0151 calo_jet2->Verbosity(verbosity);
0152 se->registerSubsystem(calo_jet2);
0153
0154 return;
0155 }
0156
0157
0158 #endif