Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:14:31

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_FUN4ALLRUNPI0EFFICIENCY_C
0004 #define MACRO_FUN4ALLRUNPI0EFFICIENCY_C
0005 
0006 #include <fun4all/Fun4AllDstInputManager.h>
0007 #include <fun4all/Fun4AllInputManager.h>
0008 #include <fun4all/Fun4AllServer.h>
0009 
0010 #include <../src/pi0ClusterAna.h>
0011 
0012 R__LOAD_LIBRARY(libfun4all.so)
0013 R__LOAD_LIBRARY(libpi0ClusterAna.so)
0014 
0015 void Fun4All_RunPi0ClusterAna(
0016       const int nEvents = 1,
0017       const string &clusterFile = "dst_calo_cluster.list",
0018       const string &truthFile = "dst_truth.list",
0019       const string &outputFile = "cemcClusterAna_Out.root"
0020             )
0021 {
0022   // this convenience library knows all our i/o objects so you don't
0023   // have to figure out what is in each dst type
0024   gSystem->Load("libg4dst.so");
0025 
0026   Fun4AllServer *se = Fun4AllServer::instance();
0027   se->Verbosity(0);  // set it to 1 if you want event printouts
0028 
0029   Fun4AllInputManager *inCluster = new Fun4AllDstInputManager("DSTClusters");
0030   std::cout << "Adding file list " << clusterFile << std::endl;
0031   inCluster -> AddListFile(clusterFile,1);
0032   se->registerInputManager(inCluster);  
0033 
0034   Fun4AllInputManager *truthCalo = new Fun4AllDstInputManager("DSTCaloTruth");
0035   std::cout << "Adding file list " << truthFile  << std::endl;
0036   truthCalo -> AddListFile(truthFile,1);
0037   se -> registerInputManager(truthCalo);
0038 
0039   pi0ClusterAna *eval = new pi0ClusterAna("dummy", outputFile);
0040   se->registerSubsystem(eval);
0041   
0042   se->run(nEvents);
0043   se->End();
0044   
0045   delete se;
0046   cout << "Analysis Completed" << endl;
0047   
0048   gSystem->Exit(0);
0049 }
0050 
0051 #endif  //MACRO_FUN4ALLG4SLOPECAL_C