Back to home page

sPhenix code displayed by LXR

 
 

    


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

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_FUN4ALLPI0MASSANALYSIS_C
0004 #define MACRO_FUN4ALLPI0MASSANALYSIS_C
0005 
0006 
0007 #include <fun4all/Fun4AllDstInputManager.h>
0008 #include <fun4all/Fun4AllInputManager.h>
0009 #include <fun4all/Fun4AllServer.h>
0010 
0011 #include <pi0massanalysis/Pi0MassAnalysis.h>
0012 
0013 R__LOAD_LIBRARY(libfun4all.so)
0014 R__LOAD_LIBRARY(libPi0MassAnalysis.so)
0015 
0016 void Fun4All_MDCTreeMaker(
0017       const int nEvents = 1000,
0018       const string &clusterFile = "dst_calo_cluster.list",
0019       const string &truthFile = "dst_truth.list",
0020       const string &outputFile = "AuAu_minbias_output.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 " << clusterFile << std::endl;
0032   inCluster->AddListFile(clusterFile,1);
0033   se->registerInputManager(inCluster);  
0034 
0035   //Fun4AllInputManager *truthTracks = new Fun4AllDstInputManager("DSTTruth");
0036   //std::cout << "Adding file list " << truthFile  << std::endl;
0037   //truthTracks->AddListFile(truthFile,1);
0038   //se->registerInputManager(truthTracks);
0039 
0040   Pi0MassAnalysis *analysisModule = new Pi0MassAnalysis(outputFile);
0041   analysisModule->SetMinClusterEnergy(1.0);
0042   se->registerSubsystem(analysisModule);
0043   
0044   se->run(nEvents);
0045   se->End();
0046   
0047   delete se;
0048   cout << "Analysis Completed" << endl;
0049   
0050   gSystem->Exit(0);
0051 }
0052 
0053 #endif