Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_testEtIso_Pythia.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_testEtIso_Pythia.C
1 #pragma once
2 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
3 #include <fun4all/SubsysReco.h>
7 
10 #include <fun4all/Fun4AllServer.h>
11 
12 #include <phool/PHRandomSeed.h>
13 #include <phool/recoConsts.h>
14 
15 #include <g4jets/FastJetAlgo.h>
16 #include <g4jets/JetReco.h>
17 #include <g4jets/TowerJetInput.h>
18 #include <g4jets/TruthJetInput.h>
19 
26 
27 #include <ClusterIso.h>
28 
29 #include <isocluster/isoCluster.h>
30 
31 R__LOAD_LIBRARY(libfun4all.so)
32 R__LOAD_LIBRARY(libisoCluster.so)
33 R__LOAD_LIBRARY(libg4jets.so)
34 R__LOAD_LIBRARY(libjetbackground.so)
35 R__LOAD_LIBRARY(libclusteriso.so)
36 
37 namespace Enable
38 {
39  bool HIJETS = false;
40  int HIJETS_VERBOSITY = 1;
41 } // namespace Enable
42 
43 namespace G4HIJETS
44 {
45  bool do_flow = true;
46  bool do_CS = false;
47 } // namespace G4HIJETS
48 #endif
49 
50 
52  int nEvents = 1,
53  const char *filelist1 = "dst_calo_cluster_run40_PhotonJet.list",
54  const char *filelist2 = "dst_truth_run40_PhotonJet.list",
55  const string outname = "test.root")
56 {
57 
58 
59 
61  int verbosity = 0;
62 
63  se->Verbosity(verbosity);
65  //rc->set_IntFlag("RUNNUMBER",62);
66 
67 
68  RetowerCEMC *rcemc = new RetowerCEMC();
69  //rcemc->SetEnergyDistribution(1);
70  se->registerSubsystem(rcemc);
71 
72  //seeds
73  JetReco *towerjetreco = new JetReco();
75  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER));
76  towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER));
77  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Tower_HIRecoSeedsRaw_r02");
78  towerjetreco->set_algo_node("ANTIKT");
79  towerjetreco->set_input_node("TOWER");
80 
81  se->registerSubsystem(towerjetreco);
82 
83 
84 
85  //first UE subtraction pass
87  dtb->SetBackgroundOutputName("TowerBackground_Sub1");
89  dtb->SetSeedType(0);
90  dtb->SetSeedJetD(3);
91 
92  se->registerSubsystem(dtb);
93 
96  casj->Verbosity(verbosity);
97  se->registerSubsystem(casj);
98 
99 
100 
102  dtb2->SetBackgroundOutputName("TowerBackground_Sub2");
103  dtb2->SetFlow(G4HIJETS::do_flow);
104  dtb2->SetSeedType(1);
105  dtb2->SetSeedJetPt(7);
106  dtb2->Verbosity(verbosity);
107  se->registerSubsystem(dtb2);
108 
109  //subtract UE from towers
110  SubtractTowers *st = new SubtractTowers();
112  st->Verbosity(verbosity);
113  se->registerSubsystem(st);
114 
115  //I think this goes here?
116  ClusterIso *makeClusterEt = new ClusterIso("isoCluster",0,3,1,0);
117  makeClusterEt -> Verbosity(0);
118  se->registerSubsystem(makeClusterEt);
120  //substract UE from jets
121  /*CopyAndSubtractJets *casj = new CopyAndSubtractJets();
122  casj->SetFlowModulation(G4HIJETS::do_flow);
123 
124  se->registerSubsystem(casj);
125 
126  //second pass of UE subtraction
127  DetermineTowerBackground *dtb2 = new DetermineTowerBackground();
128  dtb2->SetBackgroundOutputName("TowerBackground_Sub2");
129  dtb2->SetFlow(G4HIJETS::do_flow);
130  dtb2->SetSeedType(1);
131  dtb2->SetSeedJetPt(7);
132 
133  se->registerSubsystem(dtb2);*/
134 
135  //now we build our regular jets. Not used for eT analysis right now
136  //but could add in function easily.
137  /*towerjetreco = new JetReco();
138  towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER_SUB1));
139  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER_SUB1));
140  towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER_SUB1));
141  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.2, 1), "AntiKt_Tower_r02_Sub1");
142  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.3, 1), "AntiKt_Tower_r03_Sub1");
143  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.4, 1), "AntiKt_Tower_r04_Sub1");
144  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.5, 1), "AntiKt_Tower_r05_Sub1");
145  towerjetreco->set_algo_node("ANTIKT");
146  towerjetreco->set_input_node("TOWER");
147  towerjetreco->Verbosity(verbosity);
148  se->registerSubsystem(towerjetreco);*/
149 
150 
151 
153  in->AddListFile(filelist1,1);
154  se->registerInputManager(in);
155 
156  Fun4AllInputManager *in2 = new Fun4AllDstInputManager("DSTTruth");
157  in2 -> AddListFile(filelist2,1);
158  se -> registerInputManager(in2);
159 
160  isoCluster *eval = new isoCluster(outname.c_str());
161  eval -> setGenEvent(1);
162  se -> registerSubsystem(eval);
163 
164  se -> run(nEvents);
165  se -> End();
166 
167 }