File indexing completed on 2025-12-18 09:24:12
0001 #ifndef MACRO_FUN4ALL_CALOTREEGEN_C
0002 #define MACRO_FUN4ALL_CALOTREEGEN_C
0003
0004 #include <ffamodules/CDBInterface.h>
0005 #include <fun4all/Fun4AllUtils.h>
0006
0007 #include <fun4all/Fun4AllDstInputManager.h>
0008 #include <fun4all/Fun4AllInputManager.h>
0009 #include <fun4all/Fun4AllServer.h>
0010 #include <fun4all/SubsysReco.h>
0011
0012 #include <fun4all/Fun4AllDstOutputManager.h>
0013 #include <fun4all/Fun4AllOutputManager.h>
0014 #include <fun4all/Fun4AllServer.h>
0015
0016 #include <mbd/MbdReco.h>
0017
0018 #include <phool/PHRandomSeed.h>
0019 #include <phool/recoConsts.h>
0020 #include <globalvertex/GlobalVertexReco.h>
0021
0022 #include <calohistgen/caloHistGen.h>
0023
0024 #include <Calo_Calib.C>
0025
0026 R__LOAD_LIBRARY(libfun4all.so)
0027 R__LOAD_LIBRARY(libffarawobjects.so)
0028 R__LOAD_LIBRARY(libcaloHistGen.so)
0029
0030
0031 void Fun4All_CaloHistGen(const int nEvents = 1000, const std::string &fnameCalo = "DST_CALOFITTING_run3auau_new_newcdbtag_v008-00066484-00000.root", const std::string &outName = "commissioning.root", const std::string &dbtag = "ProdA_2024")
0032
0033 {
0034 Fun4AllServer *se = Fun4AllServer::instance();
0035 se->Verbosity(0);
0036 recoConsts *rc = recoConsts::instance();
0037
0038 pair<int, int> runseg = Fun4AllUtils::GetRunSegment(fnameCalo);
0039 int runnumber = runseg.first;
0040
0041 bool isAuAu = false;
0042 if(fnameCalo.find("auau") != std::string::npos)
0043 {
0044 std::cout << "This is Au+Au, setting flags and cuts" << std::endl;
0045 isAuAu = true;
0046 }
0047 else
0048 {
0049 std::cout << "This is p+p, Au+Au flags will not be set" << std::endl;
0050 }
0051
0052
0053 rc -> set_StringFlag("CDB_GLOBALTAG",dbtag);
0054 rc -> set_uint64Flag("TIMESTAMP",runnumber);
0055 CDBInterface::instance() -> Verbosity(1);
0056
0057 gSystem->Load("libg4dst");
0058
0059 Fun4AllInputManager *inputManager = new Fun4AllDstInputManager("DSTRaw");
0060 inputManager->AddFile(fnameCalo);
0061 se->registerInputManager(inputManager);
0062
0063
0064 Process_Calo_Calib();
0065
0066
0067 MbdReco *mbdreco = new MbdReco();
0068 se->registerSubsystem(mbdreco);
0069
0070 GlobalVertexReco *gvertex = new GlobalVertexReco();
0071 gvertex->Verbosity(Fun4AllBase::VERBOSITY_QUIET);
0072 se->registerSubsystem(gvertex);
0073
0074 caloHistGen *calo = new caloHistGen(outName);
0075
0076
0077 calo->setIsAuAu(isAuAu);
0078
0079
0080 calo->doEMCal(1, "TOWERINFO_CALIB_CEMC");
0081
0082 calo->doClusters(1, "CLUSTERINFO_CEMC");
0083
0084
0085 calo->doHCals(1, "TOWERINFO_CALIB_HCALOUT", "TOWERINFO_CALIB_HCALIN");
0086
0087
0088 calo->doZDC(1, "TOWERS_ZDC");
0089
0090
0091
0092 calo->doTrig(0, "14001");
0093
0094
0095 calo->setPi0Reco(1);
0096 calo->setMaxAlpha(0.6);
0097 if(isAuAu)
0098 {
0099 calo->setCluster1EMin(1.3);
0100 calo->setCluster2EMin(0.7);
0101 calo->peripheralOnlyPi0(true);
0102 calo->setCaloFrac(0.2);
0103 }
0104 else
0105 {
0106 calo->setCluster1EMin(0.5);
0107 calo->setCluster2EMin(0.5);
0108 }
0109
0110 if(!isAuAu)
0111 {
0112 calo->setTrig("jet");
0113 calo->setTrig("photon");
0114 }
0115
0116 se->registerSubsystem(calo);
0117
0118 se->run(nEvents);
0119 se->End();
0120 se->PrintTimer();
0121 std::cout << "All done!" << std::endl;
0122
0123 gSystem->Exit(0);
0124 }
0125
0126 #endif