Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All.C
1 #pragma once
2 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
3 
4 #include <fun4all/SubsysReco.h>
8 
11 
12 #include <phool/PHRandomSeed.h>
13 #include <phool/recoConsts.h>
14 
16 
19 
20 #include <jetbase/JetReco.h>
21 #include <jetbase/TowerJetInput.h>
22 #include <jetbase/FastJetAlgo.h>
23 #include <g4jets/TruthJetInput.h>
24 
25 #include <HIJetReco.C>
26 
27 #include <randomconeana/RandomConeAna.h>
28 
29 R__LOAD_LIBRARY(libfun4all.so)
30 R__LOAD_LIBRARY(libg4jets.so)
31 R__LOAD_LIBRARY(libjetbackground.so)
32 R__LOAD_LIBRARY(libjetbase.so)
33 R__LOAD_LIBRARY(libg4centrality.so)
34 R__LOAD_LIBRARY(libg4dst.so)
35 R__LOAD_LIBRARY(libRandomConeAna.so)
36 
37 
38 
39 #endif
40 
41 
42 void Fun4All(
43  const char *filelisttruth = "dst_truth_jet.list",
44  const char *filelistcalo = "dst_calo_cluster.list",
45  const char *filelistglobal = "dst_global.list",
46  const char * outputfile = "output.root"
47 )
48 {
49 
50  //-----------------------------------
51  // Fun4All server initialization
52  //-----------------------------------
53 
54  // create fun4all server
56  int verbosity = 0;
57  se->Verbosity(verbosity);
59 
60  // centrality
62  cent->Verbosity(0);
63  cent->GetCalibrationParameters().ReadFromFile("centrality", "xml", 0, 0, string(getenv("CALIBRATIONROOT")) + string("/Centrality/"));
64  se->registerSubsystem( cent );
65 
66  //-----------------------------------
67  // Jet reco
68  //-----------------------------------
70  HIJetReco();
71 
72  //-----------------------------------
73  // Random Cone Reco
74  //-----------------------------------
75 
76  RandomConeAna *myJetTree = new RandomConeAna(outputfile);
83  myJetTree->set_user_seed(42);
84  myJetTree->setEventSelection(30,1000);
85  myJetTree->addWeight(2.178e-9);
86  myJetTree->Verbosity(verbosity);
87  se->registerSubsystem(myJetTree);
88 
89 
90  //-----------------------------------
91  // Input managers
92  //-----------------------------------
93 
94  Fun4AllInputManager *intrue = new Fun4AllDstInputManager("DSTtruth");
95  intrue->AddListFile(filelisttruth,1);
96  se->registerInputManager(intrue);
97 
98  Fun4AllInputManager *in2 = new Fun4AllDstInputManager("DSTcalo");
99  in2->AddListFile(filelistcalo,1);
100  se->registerInputManager(in2);
101 
102  Fun4AllInputManager *in3 = new Fun4AllDstInputManager("DSTglobal");
103  in3->AddListFile(filelistglobal,1);
104  se->registerInputManager(in3);
105 
106  //-----------------------------------
107  // Run the analysis
108  //-----------------------------------
109 
110  se->run(-1);
111  se->End();
112 
113  gSystem->Exit(0);
114  return 0;
115 
116 }