Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:22

0001 // Include guards
0002 #pragma once
0003 #ifndef MACRO_FUN4ALLEVENTSELECTION_C
0004 #define MACRO_FUN4ALLEVENTSELECTION_C
0005 
0006 // Include necessary headers
0007 #include <fun4all/Fun4AllServer.h>
0008 #include <fun4all/Fun4AllDstInputManager.h>
0009 #include <fun4all/Fun4AllDstOutputManager.h>
0010 #include <phool/phool.h>
0011 #include <fun4all/Fun4AllSyncManager.h>
0012 #include <fun4all/Fun4AllInputManager.h>
0013 #include <fun4all/Fun4AllOutputManager.h>
0014 #include <phool/PHRandomSeed.h>
0015 #include <phool/recoConsts.h>
0016 #include <jetvalidation/EventSelection.h>
0017 
0018 // Load required libraries
0019 R__LOAD_LIBRARY(libg4dst.so)
0020 R__LOAD_LIBRARY(libfun4all.so)
0021 R__LOAD_LIBRARY(libJetValidation.so)
0022 
0023 
0024 // Define the Fun4All macro
0025   void Fun4All_EventSelection(const char *filelisttruth = "dst_truth_jet.list",
0026                 const char* outname = "eventselectest.root") {
0027   // Create Fun4All server instance
0028   Fun4AllServer *se = Fun4AllServer::instance();
0029   int verbosity = 0; // Adjust verbosity level as needed
0030   se->Verbosity(verbosity);
0031 
0032   // Register the EventSelection subsystem
0033   EventSelection *myEventSelection = new EventSelection("AntiKt_Truth_r04", outname); // Assuming you want to pass a double and an empty string
0034   se->registerSubsystem(myEventSelection);
0035 
0036   Fun4AllInputManager *intrue = new Fun4AllDstInputManager("DSTtruth");
0037   intrue->AddListFile(filelisttruth,1);
0038   se->registerInputManager(intrue);
0039   /*
0040   // Set up Fun4All input manager for DST data
0041   Fun4AllDstInputManager *inData = new Fun4AllDstInputManager("DSTData");
0042   inData->AddListFile(filelistdata);
0043   se->registerInputManager(inData);
0044   
0045   // Set up Fun4All output manager
0046   Fun4AllDstOutputManager *outData = new Fun4AllDstOutputManager();
0047   outData->outfileopen(outname);
0048   se->registerOutputManager(outData);
0049 */
0050   // Run the analysis
0051   se->run(1000);
0052   se->End();
0053 
0054   // Cleanup
0055   delete se;
0056   std::cout << "Analysis Completed" << std::endl;
0057 }
0058 
0059 #endif // MACRO_FUN4ALLEVENTSELECTION_C