Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_RunLambdaJetHunter.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_RunLambdaJetHunter.C
1 // ----------------------------------------------------------------------------
2 // 'Fun4All_RunLambdaJetHunter.C'
3 // Derek Anderson
4 // 01.25.2024
5 //
6 // F4A macro the SLambdaJetHunter module.
7 // ----------------------------------------------------------------------------
8 
9 #define FUN4ALL_RUNLAMBDAJETHUNTER_C
10 
11 // c++ utilities
12 #include <vector>
13 #include <string>
14 // f4a/sphenix libraries
15 #include <FROG.h>
16 #include <fun4all/Fun4AllServer.h>
19 // analysis specific utilities
20 #include "LambdaJetHunterOptions.h"
21 #include "/sphenix/user/danderson/install/include/slambdajethunter/SLambdaJetHunter.h"
22 #include "/sphenix/user/danderson/install/include/slambdajethunter/SLambdaJetHunterConfig.h"
23 
24 // load libraries
25 R__LOAD_LIBRARY(/sphenix/user/danderson/install/lib/libslambdajethunter.so)
26 R__LOAD_LIBRARY(/sphenix/user/danderson/install/lib/libscorrelatorutilities.so)
27 
28 // make common namespaces implicit
29 using namespace std;
30 using namespace SColdQcdCorrelatorAnalysis;
31 
32 // global constants
33 static const int NEvtDefault = 10;
34 static const int VerbDefault = 0;
35 static const string SOutDefault = "test.root";
36 static const vector<string> SInDefault = {
37  "DST_GLOBAL_pythia8_Jet10_3MHz-0000000008-04075.root",
38  "DST_TRUTH_pythia8_Jet10_3MHz-0000000008-04075.root"
39 };
40 
41 
42 
43 // macro body -----------------------------------------------------------------
44 
46  const vector<string>& sInput = SInDefault,
47  const string sOutput = SOutDefault,
48  const int nEvents = NEvtDefault,
49  const int verbosity = VerbDefault
50 ) {
51 
52  // set module configuration
54 
55  // load libraries and create f4a server
56  gSystem -> Load("libg4dst.so");
57  gSystem -> Load("libFROG.so");
58 
59  FROG* frog = new FROG();
61  ffaServer -> Verbosity(verbosity);
62 
63  // add input files
64  for (size_t iInput = 0; iInput < sInput.size(); iInput++) {
65  Fun4AllDstInputManager* inManager = new Fun4AllDstInputManager("InputDstManager" + to_string(iInput));
66  inManager -> AddFile(sInput.at(iInput));
67  ffaServer -> registerInputManager(inManager);
68  }
69 
70  // instantiate & register lambda jet hunter
71  SLambdaJetHunter* hunter = new SLambdaJetHunter(config);
72  ffaServer -> registerSubsystem(hunter);
73 
74  // run reconstruction & close f4a
75  ffaServer -> run(nEvents);
76  ffaServer -> End();
77  delete ffaServer;
78 
79  // announce end & exit
80  gSystem -> Exit(0);
81  return;
82 
83 }
84 
85 // end ------------------------------------------------------------------------