File indexing completed on 2025-08-05 08:13:05
0001 #pragma once
0002 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
0003 #include <fun4all/SubsysReco.h>
0004 #include <fun4all/Fun4AllServer.h>
0005 #include <fun4all/Fun4AllInputManager.h>
0006 #include <fun4all/Fun4AllDstInputManager.h>
0007
0008 #include <fun4all/Fun4AllDstOutputManager.h>
0009 #include <fun4all/Fun4AllOutputManager.h>
0010 #include <fun4all/Fun4AllServer.h>
0011
0012 #include <phool/PHRandomSeed.h>
0013 #include <phool/recoConsts.h>
0014
0015 #include <g4jets/FastJetAlgo.h>
0016 #include <g4jets/JetReco.h>
0017 #include <g4jets/TowerJetInput.h>
0018 #include <g4jets/TruthJetInput.h>
0019
0020 #include <jetbackground/CopyAndSubtractJets.h>
0021 #include <jetbackground/DetermineTowerBackground.h>
0022 #include <jetbackground/FastJetAlgoSub.h>
0023 #include <jetbackground/RetowerCEMC.h>
0024 #include <jetbackground/SubtractTowers.h>
0025 #include <jetbackground/SubtractTowersCS.h>
0026
0027 #include <ClusterIso.h>
0028
0029 #include <isocluster/isoCluster.h>
0030
0031 R__LOAD_LIBRARY(libfun4all.so)
0032 R__LOAD_LIBRARY(libisoCluster.so)
0033 R__LOAD_LIBRARY(libg4jets.so)
0034 R__LOAD_LIBRARY(libjetbackground.so)
0035 R__LOAD_LIBRARY(libclusteriso.so)
0036
0037 namespace Enable
0038 {
0039 bool HIJETS = false;
0040 int HIJETS_VERBOSITY = 1;
0041 }
0042
0043 namespace G4HIJETS
0044 {
0045 bool do_flow = true;
0046 bool do_CS = false;
0047 }
0048 #endif
0049
0050
0051 void Fun4All_testEtIso_Hijing(
0052 int nEvents = 1,
0053 const char *filelist1 = "dst_calo_cluster_run62_10GeVpythia.list",
0054 const char *filelist2 = "dst_truth_run62_10GeVpythia.list",
0055 const string outname = "test.root")
0056 {
0057
0058
0059
0060 Fun4AllServer *se = Fun4AllServer::instance();
0061 int verbosity = 0;
0062
0063 se->Verbosity(verbosity);
0064 recoConsts *rc = recoConsts::instance();
0065
0066
0067
0068 RetowerCEMC *rcemc = new RetowerCEMC();
0069
0070 se->registerSubsystem(rcemc);
0071
0072
0073 JetReco *towerjetreco = new JetReco();
0074 towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER_RETOWER));
0075 towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER));
0076 towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER));
0077 towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Tower_HIRecoSeedsRaw_r02");
0078 towerjetreco->set_algo_node("ANTIKT");
0079 towerjetreco->set_input_node("TOWER");
0080
0081 se->registerSubsystem(towerjetreco);
0082
0083
0084 DetermineTowerBackground *dtb = new DetermineTowerBackground();
0085 dtb->SetBackgroundOutputName("TowerBackground_Sub1");
0086 dtb->SetFlow(G4HIJETS::do_flow);
0087 dtb->SetSeedType(0);
0088 dtb->SetSeedJetD(3);
0089
0090 se->registerSubsystem(dtb);
0091
0092 CopyAndSubtractJets *casj = new CopyAndSubtractJets();
0093 casj->SetFlowModulation(G4HIJETS::do_flow);
0094 casj->Verbosity(verbosity);
0095 se->registerSubsystem(casj);
0096
0097 DetermineTowerBackground *dtb2 = new DetermineTowerBackground();
0098 dtb2->SetBackgroundOutputName("TowerBackground_Sub2");
0099 dtb2->SetFlow(G4HIJETS::do_flow);
0100 dtb2->SetSeedType(1);
0101 dtb2->SetSeedJetPt(7);
0102 dtb2->Verbosity(verbosity);
0103 se->registerSubsystem(dtb2);
0104
0105
0106 SubtractTowers *st = new SubtractTowers();
0107 st->SetFlowModulation(G4HIJETS::do_flow);
0108 st->Verbosity(verbosity);
0109 se->registerSubsystem(st);
0110
0111
0112 ClusterIso *makeClusterEt = new ClusterIso("isoCluster",0,3,1,1);
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147 Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTcalo");
0148 in->AddListFile(filelist1,1);
0149 se->registerInputManager(in);
0150
0151 Fun4AllInputManager *in2 = new Fun4AllDstInputManager("DSTTruth");
0152 in2 -> AddListFile(filelist2,1);
0153 se -> registerInputManager(in2);
0154
0155 isoCluster *eval = new isoCluster(outname.c_str());
0156 eval -> setGenEvent(0);
0157 se -> registerSubsystem(eval);
0158
0159 se -> run(nEvents);
0160 se -> End();
0161
0162
0163
0164
0165
0166
0167 }