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