Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:13:24

0001 /// ---------------------------------------------------------------------------
0002 /*! \file   Fun4All_RunLambdaJetHunter.C
0003  *  \author Derek Anderson
0004  *  \date   01.25.2024
0005  *
0006  *  F4A macro the SLambdaJetHunter module.
0007  */
0008 /// ---------------------------------------------------------------------------
0009 
0010 #define FUN4ALL_RUNLAMBDAJETHUNTER_C
0011 
0012 // c++ utilities
0013 #include <vector>
0014 #include <string>
0015 // f4a/sphenix libraries
0016 #include <FROG.h>
0017 #include <fun4all/Fun4AllServer.h>
0018 #include <fun4all/Fun4AllDstInputManager.h>
0019 #include <g4main/Fun4AllDstPileupInputManager.h>
0020 // module definition
0021 #include <slambdajethunter/SLambdaJetHunter.h>
0022 // macro options
0023 #include "LambdaJetHunterOptions.h"
0024 
0025 // make common namespaces implicit
0026 using namespace std;
0027 using namespace SColdQcdCorrelatorAnalysis;
0028 
0029 // load libraries
0030 R__LOAD_LIBRARY(libslambdajethunter.so)
0031 R__LOAD_LIBRARY(libscorrelatorutilities.so)
0032 
0033 // global constants
0034 static const int            NEvtDefault = 10;
0035 static const int            VerbDefault = 0;
0036 static const string         SOutDefault = "test.root";
0037 static const vector<string> SInDefault  = {
0038   "DST_GLOBAL_pythia8_Jet10_3MHz-0000000008-04075.root",
0039   "DST_TRUTH_pythia8_Jet10_3MHz-0000000008-04075.root"
0040 };
0041 
0042 
0043 
0044 // macro body -----------------------------------------------------------------
0045 
0046 void Fun4All_RunLambdaJetHunter(
0047   const vector<string>& sInput    = SInDefault,
0048   const string          sOutput   = SOutDefault,
0049   const int             nEvents   = NEvtDefault,
0050   const int             verbosity = VerbDefault
0051 ) {
0052 
0053   // set module configuration
0054   SLambdaJetHunterConfig config = LambdaJetHunterOptions::GetConfig(verbosity, sOutput);
0055 
0056   // load libraries and create f4a server
0057   gSystem -> Load("libg4dst.so");
0058   gSystem -> Load("libFROG.so");
0059 
0060   FROG*          frog      = new FROG();
0061   Fun4AllServer* ffaServer = Fun4AllServer::instance();
0062   ffaServer -> Verbosity(verbosity);
0063 
0064   // add input files 
0065   for (size_t iInput = 0; iInput < sInput.size(); iInput++) {
0066     Fun4AllDstInputManager* inManager = new Fun4AllDstInputManager("InputDstManager" + to_string(iInput));
0067     inManager -> AddFile(sInput.at(iInput));
0068     ffaServer -> registerInputManager(inManager);
0069   }
0070 
0071   // instantiate & register lambda jet hunter
0072   SLambdaJetHunter* hunter = new SLambdaJetHunter(config);
0073   ffaServer -> registerSubsystem(hunter);
0074 
0075   // run reconstruction & close f4a
0076   ffaServer -> run(nEvents);
0077   ffaServer -> End();
0078   delete ffaServer;
0079 
0080   // announce end & exit
0081   gSystem -> Exit(0);
0082   return;
0083 
0084 }
0085 
0086 // end ------------------------------------------------------------------------