Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_JetSeedCount.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_JetSeedCount.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 #include <HIJetReco.C>
21 
22 //#include <jetbackground/CopyAndSubtractJets.h>
23 //#include <jetbackground/DetermineTowerBackground.h>
24 //#include <jetbackground/FastJetAlgoSub.h>
25 //#include <jetbackground/RetowerCEMC.h>
26 //#include <jetbackground/SubtractTowers.h>
27 //#include <jetbackground/SubtractTowersCS.h>
28 
29 #include <jetvalidation/JetValidation.h>
30 #include <jetseedcount/JetSeedCount.h>
31 
32 R__LOAD_LIBRARY(libfun4all.so)
33 R__LOAD_LIBRARY(libg4jets.so)
34 R__LOAD_LIBRARY(libjetbackground.so)
35 R__LOAD_LIBRARY(libJetSeedCount.so)
36 R__LOAD_LIBRARY(libg4centrality.so)
37 R__LOAD_LIBRARY(libg4dst.so)
38 
39 /*
40 namespace Enable
41 {
42  bool HIJETS = true;
43  int HIJETS_VERBOSITY = 1;
44 } // namespace Enable
45 
46 namespace G4HIJETS
47 {
48  bool do_flow = false;
49  bool do_CS = false;
50 } // namespace G4HIJETS
51 */
52 #endif
53 
54 
55 void Fun4All_JetSeedCount(const char *filelisthit = "g4hit_test.list",
56  const char *filelistcalo = "dst_calo_test.list",
57  const char *outname = "SeedCountoutput.root",
58  int n_skip = 100,
59  int n_event = 1000)
60 {
61 
62 
64  int verbosity = 0;
65 
66  se->Verbosity(verbosity);
68 
70  cent->Verbosity(0);
71  cent->GetCalibrationParameters().ReadFromFile("centrality", "xml", 0, 0, string(getenv("CALIBRATIONROOT")) + string("/Centrality/"));
72  se->registerSubsystem( cent );
73 
74  HIJetReco();
75  /*
76  RetowerCEMC *rcemc = new RetowerCEMC();
77  rcemc->Verbosity(verbosity);
78  rcemc->set_towerinfo(true);
79  se->registerSubsystem(rcemc);
80 
81  JetReco *towerjetreco = new JetReco();
82  towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWERINFO_RETOWER));
83  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWERINFO));
84  towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWERINFO));
85  towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_TowerInfo_HIRecoSeedsRaw_r02");
86  towerjetreco->set_algo_node("ANTIKT");
87  towerjetreco->set_input_node("TOWER");
88  towerjetreco->Verbosity(verbosity);
89  se->registerSubsystem(towerjetreco);
90 
91  DetermineTowerBackground *dtb = new DetermineTowerBackground();
92  dtb->SetBackgroundOutputName("TowerInfoBackground_Sub1");
93  dtb->SetFlow(0);
94  dtb->SetSeedType(0);
95  dtb->SetSeedJetD(3);
96  dtb->set_towerinfo(true);
97  dtb->Verbosity(10);
98  se->registerSubsystem(dtb);
99 
100  CopyAndSubtractJets *casj = new CopyAndSubtractJets();
101  casj->SetFlowModulation(0);
102  casj->Verbosity(10);
103  casj->set_towerinfo(true);
104  se->registerSubsystem(casj);
105 
106  DetermineTowerBackground *dtb2 = new DetermineTowerBackground();
107  dtb2->SetBackgroundOutputName("TowerInfoBackground_Sub2");
108  dtb2->SetFlow(0);
109  dtb2->SetSeedType(1);
110  dtb2->SetSeedJetPt(7);
111  dtb2->Verbosity(10);
112  dtb2->set_towerinfo(true);
113  se->registerSubsystem(dtb2);
114 
115  SubtractTowers *st = new SubtractTowers();
116  st->SetFlowModulation(0);
117  st->Verbosity(10);
118  st->set_towerinfo(true);
119  se->registerSubsystem(st);
120 
121  towerjetreco = new JetReco();
122  towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWERINFO_SUB1));
123  towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWERINFO_SUB1));
124  towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWERINFO_SUB1));
125  //towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.2, 1), "AntiKt_Tower_r02_Sub1");
126  //towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.3, 1), "AntiKt_Tower_r03_Sub1");
127  towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.4, 1), "AntiKt_Tower_r04_Sub1");
128  //towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.5, 1), "AntiKt_Tower_r05_Sub1");
129  towerjetreco->set_algo_node("ANTIKT");
130  towerjetreco->set_input_node("TOWER");
131  towerjetreco->Verbosity(verbosity);
132  se->registerSubsystem(towerjetreco);
133 
134  */
135  JetSeedCount *myJetVal = new JetSeedCount("AntiKt_Tower_r04_Sub1", "AntiKt_Truth_r04", outname);
136 
137  myJetVal->setPtRange(5, 100);
138  myJetVal->setEtaRange(-1.1, 1.1);
139  //myJetVal->doUnsub(1);
140  //myJetVal->doTruth(1);
141  //myJetVal->doSeeds(1);
142  se->registerSubsystem(myJetVal);
143 
144 
145  Fun4AllInputManager *intrue = new Fun4AllDstInputManager("DSThits");
146  intrue->AddListFile(filelisthit,1);
147  se->registerInputManager(intrue);
148 
149 
150  Fun4AllInputManager *in2 = new Fun4AllDstInputManager("DSTcalo");
151  in2->AddListFile(filelistcalo,1);
152  se->registerInputManager(in2);
153 
154 
155  //se->run(-1);
156  se->run(n_event);
157  se->skip(n_skip);
158  se->End();
159 
160  gSystem->Exit(0);
161  return 0;
162 
163 }