Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_Condor.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_Condor.C
1 #ifndef MACRO_FUN4ALLCONDOR_C
2 #define MACRO_FUN4ALLCONDOR_C
8 
9 #include <g4jets/ClusterJetInput.h>
10 #include <g4jets/FastJetAlgo.h>
11 #include <g4jets/JetReco.h>
12 #include <g4jets/TowerJetInput.h>
13 #include <g4jets/TrackJetInput.h>
14 #include <g4jets/TruthJetInput.h>
21 
22 #include <G4_Jets.C>
23 #include <frog/FROG.h>
24 #include "truthjettagging/TruthJetTagging.h"
25 
26 R__LOAD_LIBRARY(libfun4all.so)
27 
28 R__LOAD_LIBRARY(libg4jets.so)
29 R__LOAD_LIBRARY(libTruthJetTagging.so)
30 
31 
32 namespace G4HIJETS
33 {
34  int do_flow = 1;
35  bool do_flow_subtraction = true;
36  bool do_CS = false;
37 }
38 
39 
40 void Fun4All_Condor(string inputFile1 = "DST_TRUTH_pythia8_Bottom_3MHz-0000000003-00000.root", int outputfilenumber = 0)
41  {
42 const int nEvents = 10;
43 
44  gSystem->Load("libFROG");
45 
46  FROG *fr = new FROG();
47  cout << fr->location(inputFile1.c_str()) << endl;
48 
49 
51  // Make the Server
54  se->Verbosity(0);
55  int verbosity = 0;
56 
57  Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
58  hitsin->fileopen(inputFile1);
59  se->registerInputManager(hitsin);
60 
61  //-------------------------------------------------------------------------------------------
62  // Reconstruct truth jets if they are not already in the node tree
63  //-------------------------------------------------------------------------------------------
64 
65  JetReco *truthjetreco = new JetReco("TRUTHJETRECO");
67  tji->add_embedding_flag(1); // (1) for pythia simulations, (2) for pythia embedding into hijing
68  truthjetreco->add_input(tji);
69  truthjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.4), "AntiKt_Truth_r04");
70  truthjetreco->set_algo_node("ANTIKT");
71  truthjetreco->set_input_node("TRUTH");
72  truthjetreco->Verbosity(0);
73  se->registerSubsystem(truthjetreco);
74 
75 
76  TruthJetTagging *myreco = new TruthJetTagging();
77  myreco->add_algo("AntiKt_Truth_r04"); // add each truth jet node to look at here
78  myreco->add_radius(0.4); // If doing HF tagging must specify one radius for each truth jet node, in order!
79  myreco->do_hf_tagging(true); // enable HF tagging
80  myreco->set_embedding_id(1); // (1) for pythia simulations, (2) for pythia embedding into hijing
81 
82  myreco->do_photon_tagging(true); // enable photon jet tagging (returns fraction of jet pT carried by the highest pT photon
83  se->registerSubsystem(myreco);
84 
85 
86 string FullOutFile = "testoutput.root";
87 Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", FullOutFile);
88 se->registerOutputManager(out);
89  if (nEvents <= 0)
90  {
91  return;
92  }
93  cout << endl << "Running over " << nEvents << " Events" << endl;
94  se->run(nEvents);
95  cout << endl << "Calling End in Fun4All_Analysis.C" << endl;
96  se->End();
97  cout << endl << "All done, calling delete Fun4AllServer" << endl;
98  delete se;
99  cout << endl << "gSystem->Exit(0)" << endl;
100  gSystem->Exit(0);
101 }
102 #endif // MACRO_FUN4ALLANALYSIS_C
103