Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:24

0001 #ifndef MACRO_G4CENTRALITY_C
0002 #define MACRO_G4CENTRALITY_C
0003 
0004 #include <GlobalVariables.C>
0005 
0006 #include <g4centrality/PHG4CentralityReco.h>
0007 
0008 #include <phparameter/PHParameterUtils.h>
0009 
0010 #include <fun4all/Fun4AllServer.h>
0011 
0012 R__LOAD_LIBRARY(libfun4all.so)
0013 R__LOAD_LIBRARY(libcentrality_io.so)
0014 R__LOAD_LIBRARY(libg4centrality.so)
0015 
0016 namespace Enable
0017 {
0018   bool CENTRALITY = false;
0019   int CENTRALITY_VERBOSITY = 0;
0020 }  // namespace Enable
0021 
0022 void Centrality()
0023 {
0024   int verbosity = max(Enable::VERBOSITY, Enable::CENTRALITY_VERBOSITY);
0025   //---------------
0026   // Fun4All server
0027   //---------------
0028 
0029   Fun4AllServer *se = Fun4AllServer::instance();
0030 
0031   PHG4CentralityReco *cent = new PHG4CentralityReco();
0032   cent->Verbosity(verbosity);
0033   if (Enable::CDB)
0034   {
0035     PHParameterUtils::FillPHParametersFromCDB(cent->GetCalibrationParameters(),"CENTRALITY");
0036   }
0037   else
0038   {
0039     cent->GetCalibrationParameters().ReadFromFile("centrality", "xml", 0, 0, string(getenv("CALIBRATIONROOT")) + string("/Centrality/"));
0040   }
0041   se->registerSubsystem( cent );
0042   
0043   return;
0044 }
0045 #endif