Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:19:42

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_FUN4ALLG4SLOPECAL_C
0004 #define MACRO_FUN4ALLG4SLOPECAL_C
0005 
0006 #include <fun4all/Fun4AllDstInputManager.h>
0007 #include <fun4all/Fun4AllInputManager.h>
0008 #include <fun4all/Fun4AllServer.h>
0009 
0010 #include <litecaloeval/LiteCaloEval.h>
0011 
0012 R__LOAD_LIBRARY(libfun4all.so)
0013 
0014 void Fun4All_G4_SlopeCal(
0015     const int nEvents = 1,
0016     const string &inputClustersFileList = "dst_calo_cluster.list",
0017     const string &outputFile = "test1")
0018 {
0019   // this convenience library knows all our i/o objects so you don't
0020   // have to figure out what is in each dst type
0021   gSystem->Load("libg4dst.so");
0022   gSystem->Load("libLiteCaloEvalTowSlope.so");
0023 
0024   Fun4AllServer *se = Fun4AllServer::instance();
0025   se->Verbosity();  // set it to 1 if you want event printouts
0026 
0027   Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTClusters");
0028   in->AddListFile(inputClustersFileList);
0029   se->registerInputManager(in);
0030 
0031   string outputfile = outputFile + "_g4cemc_eval.root";
0032   string outputfile2 = outputFile + "_g4hcalin_eval.root";
0033   string outputfile3 = outputFile + "_g4hcalout_eval.root";
0034 
0035   LiteCaloEval *eval = new LiteCaloEval("CEMCEVALUATOR", "CEMC", outputfile);
0036   //  eval->Verbosity(verbosity);
0037   eval->CaloType(LiteCaloEval::CEMC);
0038   se->registerSubsystem(eval);
0039 
0040   LiteCaloEval *eval2 = new LiteCaloEval("HINEVALUATOR", "HCALIN", outputfile2);
0041   eval2->CaloType(LiteCaloEval::HCALIN);
0042   //  eval->Verbosity(verbosity);
0043   se->registerSubsystem(eval2);
0044 
0045   LiteCaloEval *eval3 = new LiteCaloEval("HOUTEVALUATOR", "HCALOUT", outputfile3);
0046   //  eval->Verbosity(verbosity);
0047   eval3->CaloType(LiteCaloEval::HCALOUT);
0048   se->registerSubsystem(eval3);
0049 
0050   se->run(nEvents);
0051   se->End();
0052   delete se;
0053   gSystem->Exit(0);
0054 }
0055 
0056 #endif  //MACRO_FUN4ALLG4SLOPECAL_C