Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_JetRhoMedian.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_JetRhoMedian.C
1 #ifndef MACRO_FUN4ALLJETANA_C
2 #define MACRO_FUN4ALLJETANA_C
3 
7 #include <fun4all/SubsysReco.h>
9 #include <jetbase/FastJetAlgo.h>
10 #include <jetbase/JetReco.h>
11 #include <jetbase/TowerJetInput.h>
12 #include <g4jets/TruthJetInput.h>
13 /* #include <g4vertex/GlobalVertexReco.h> */
15 #include <fun4all/PHTFileServer.h>
17 #include <HIJetReco.C>
18 
19 // here you need your package name (set in configure.ac)
20 #include <fastjetmedianbkg/JetRhoMedian.h>
21 #include <fastjetmedianbkg/PrintTowers.h>
22 R__LOAD_LIBRARY(libfun4all.so)
23 R__LOAD_LIBRARY(libg4centrality.so)
24 R__LOAD_LIBRARY(libg4jets.so)
25 R__LOAD_LIBRARY(libjetbase.so)
26 R__LOAD_LIBRARY(libjetbackground.so)
27 R__LOAD_LIBRARY(libjetrhomedian.so)
28 R__LOAD_LIBRARY(libjetbackground.so)
29 /* R__LOAD_LIBRARY(libg4vertex.so) */
30 
32  const int nevnt = 10
33  , const float jet_R = 0.4
34  , const string& out_name = "test.root"
35  , const float min_lead_truth_pt = 30
36  , const string& list_calo_cluster=""
37  , const string& list_truth_jet=""
38  , const string& list_bbc=""
39  , const string& list_global=""
40  , const string& list_truth_g4hit=""
41  , const int verbosity=0
42  )
43 {
44  gSystem->Load("libjetrhomedian");
45  gSystem->Load("libg4dst");
46 
48 
49  if (list_bbc!="") {
51  cent->Verbosity(0);
52  cent->GetCalibrationParameters().ReadFromFile("centrality", "xml", 0, 0, string(getenv("CALIBRATIONROOT")) + string("/Centrality/"));
53  se->registerSubsystem( cent );
54 
55  Fun4AllInputManager *inp_bbc = new Fun4AllDstInputManager("BBC_info");
56  inp_bbc->AddListFile(list_bbc);
57  se->registerInputManager(inp_bbc);
58  } else {
59  cout << " Fatal: missing bbc input file. Exiting." << endl;
60  gSystem->Exit(0);
61  }
62 
63  // add the CEMC retowering
64  RetowerCEMC *rcemc = new RetowerCEMC();
65  /* rcemc->Verbosity(verbosity); */
66  /* rcemc->set_towerinfo(true); */
67  se->registerSubsystem(rcemc);
68  //
69  // do the background subtraction
71  HIJetReco();
72 
73  std::string sub1_jet_name = Form("AntiKt_Tower_r0%i_Sub1", ((int)(jet_R*10)));
74  std::string truth_jet_name = Form("AntiKt_Truth_r0%i", ((int)(jet_R*10)));
75 
76  JetRhoMedian *jetRhoMedian = new JetRhoMedian(out_name, jet_R, truth_jet_name, sub1_jet_name, min_lead_truth_pt);
78  jetRhoMedian->add_input(new TowerJetInput(Jet::HCALIN_TOWER));
79  jetRhoMedian->add_input(new TowerJetInput(Jet::HCALOUT_TOWER));
80  jetRhoMedian->Verbosity(0);
81  se->registerSubsystem(jetRhoMedian);
82 
83 
84  if (list_truth_jet!="") {
85  Fun4AllInputManager *inp_truth_jet = new Fun4AllDstInputManager("DSTtruth");
86  inp_truth_jet->AddListFile(list_truth_jet,1); // adding the option "1" confirms to use, even if file is large
87  se->registerInputManager(inp_truth_jet);
88  } else {
89  cout << " Fatal: missing truth jet list file. Exiting." << endl;
90  gSystem->Exit(0);
91  }
92 
93  if (list_calo_cluster!="") {
94  Fun4AllInputManager *inp_calo_cluster = new Fun4AllDstInputManager("DSTcalocluster");
95  inp_calo_cluster->AddListFile(list_calo_cluster,1);
96  se->registerInputManager(inp_calo_cluster);
97  } else {
98  cout << " Fatal: missing calo cluster list file. Exiting." << endl;
99  gSystem->Exit(0);
100  }
101 
102 
103  if (list_global!="") {
104  Fun4AllInputManager *inp_global = new Fun4AllDstInputManager("DSTglobal");
105  inp_global->AddListFile(list_global,1); // adding the option "1" confirms to use, even if file is large
106  se->registerInputManager(inp_global);
107  } else {
108  cout << " Fatal: missing global dst list file. Exiting." << endl;
109  gSystem->Exit(0);
110  }
111 
112  if (list_truth_g4hit!="") {
113  Fun4AllInputManager *inp_truth_g4hit = new Fun4AllDstInputManager("DST_truth_g4hit");
114  inp_truth_g4hit->AddListFile(list_truth_g4hit,1); // adding the option "1" confirms to use, even if file is large
115  se->registerInputManager(inp_truth_g4hit);
116  } else {
117  cout << " Fatal: missing truth g4hit list file. Exiting." << endl;
118  gSystem->Exit(0);
119  }
120 
121 
122  se->run(nevnt);
123  se->End();
124  delete se;
125  cout << " Done in Fun4All_JetRhoMedian.C " << endl;
126  gSystem->Exit(0);
127 
128 }
129 
130 #endif