Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:15

0001 // these include guards are not really needed, but if we ever include this
0002 // file somewhere they would be missed and we will have to refurbish all macros
0003 #ifndef MACRO_FUN4ALLRUNEMCRECO_C
0004 #define MACRO_FUN4ALLRUNEMCRECO_C
0005 
0006 #include <fun4all/Fun4AllDstInputManager.h>
0007 #include <fun4all/Fun4AllInputManager.h>
0008 #include <fun4all/Fun4AllServer.h>
0009 
0010 #include <../src/cemcReco.h>
0011 
0012 R__LOAD_LIBRARY(libfun4all.so)
0013 R__LOAD_LIBRARY(libcemcReco.so)
0014 
0015 void Fun4All_RunEMCReco(
0016     const int nEvents = 1,
0017     const string caloRecoIn = "dst_calo_cluster_run40_JS30GeV_noPileup.list",
0018     const string caloTruthIn = "dst_truth_run40_JS30GeV_noPileup.list",
0019     const string tracksIn = "",
0020     const string &outputFile = "cemcReco_Out.root"
0021             )
0022 {
0023   // this convenience library knows all our i/o objects so you don't
0024   // have to figure out what is in each dst type
0025   gSystem->Load("libg4dst.so");
0026 
0027   Fun4AllServer *se = Fun4AllServer::instance();
0028   se->Verbosity(0);  // set it to 1 if you want event printouts
0029 
0030   Fun4AllInputManager *inCluster = new Fun4AllDstInputManager("DSTClusters");
0031   std::cout << "Adding file list " << caloRecoIn << std::endl;
0032   inCluster -> AddListFile(caloRecoIn,1);
0033   se->registerInputManager(inCluster);  
0034   
0035   if(strcmp(tracksIn.c_str(),""))
0036     {
0037       Fun4AllInputManager *inTracks = new Fun4AllDstInputManager("DSTTracks");
0038       std::cout << "Adding file list " << tracksIn  << std::endl;
0039       inTracks -> AddListFile(tracksIn,1);
0040       se->registerInputManager(inTracks);
0041     }
0042   
0043   Fun4AllInputManager *truthCalo = new Fun4AllDstInputManager("DSTCaloTruth");
0044   std::cout << "Adding file list " << caloTruthIn  << std::endl;
0045   truthCalo -> AddListFile(caloTruthIn,1);
0046   se -> registerInputManager(truthCalo);
0047 
0048   cemcReco *eval = new cemcReco("cemcRecoAna", outputFile);
0049   se->registerSubsystem(eval);
0050 
0051   se->run(nEvents);
0052   se->End();
0053   
0054   delete se;
0055   cout << "Analysis Completed" << endl;
0056   
0057   gSystem->Exit(0);
0058 }
0059 
0060 #endif  //MACRO_FUN4ALLRUNEMCRECO_C