File indexing completed on 2025-08-06 08:21:00
0001 #pragma once
0002 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
0003 #include <fun4all/SubsysReco.h>
0004 #include <fun4all/Fun4AllServer.h>
0005 #include <fun4all/Fun4AllInputManager.h>
0006 #include <fun4all/Fun4AllRunNodeInputManager.h>
0007 #include <fun4allraw/Fun4AllPrdfInputManager.h>
0008 #include <fun4all/Fun4AllDstInputManager.h>
0009
0010 #include <fun4all/Fun4AllDstOutputManager.h>
0011
0012
0013 #include <caloreco/CaloTowerCalib.h>
0014 #include <caloreco/RawClusterBuilderTemplate.h>
0015 #include <calib_emc_pi0/CaloCalibEmc_Pi0.h>
0016
0017 #include <phool/recoConsts.h>
0018
0019
0020 R__LOAD_LIBRARY(libfun4all.so)
0021 R__LOAD_LIBRARY(libfun4allraw.so)
0022 R__LOAD_LIBRARY(libcalo_reco.so)
0023
0024 R__LOAD_LIBRARY(libcalibCaloEmc_pi0.so)
0025
0026
0027
0028 #endif
0029
0030
0031 void dst_simple_towerslope_runmacro(int nevents = 1e5, const char *fname = "/sphenix/user/sregmi/FINAL_VERSION/tower_slope_old_tower_method/3_RawWaveformTowerBuilder/macro/testoutput_400.root", const char * outfile = "defout.root", const int runNumber = 0)
0032
0033 {
0034 gSystem->Load("libg4dst");
0035
0036 Fun4AllServer *se = Fun4AllServer::instance();
0037
0038
0039
0040
0041
0042
0043
0044
0045 Fun4AllInputManager *in = new Fun4AllDstInputManager("in");
0046
0047 TString infiletstr(fname);
0048 if (infiletstr.Contains(".list"))
0049 in->AddListFile(fname);
0050 else
0051 in->fileopen(fname);
0052
0053
0054 se->registerInputManager(in);
0055
0056 Fun4AllInputManager *intrue2 = new Fun4AllRunNodeInputManager("DST_GEO");
0057 intrue2->AddFile("updated_geo.root");
0058 se->registerInputManager(intrue2);
0059
0060
0061
0062
0063 recoConsts *rc = recoConsts::instance();
0064 rc->set_StringFlag("CDB_GLOBALTAG","ProdA_2023");
0065
0066
0067 rc->set_uint64Flag("TIMESTAMP",runNumber);
0068
0069
0070 CaloTowerCalib *calib = new CaloTowerCalib("CEMCCALIB");
0071
0072
0073 calib->set_detector_type(CaloTowerCalib::CEMC);
0074 se->registerSubsystem(calib);
0075
0076
0077 RawClusterBuilderTemplate *ClusterBuilder = new RawClusterBuilderTemplate("EmcRawClusterBuilderTemplate2");
0078 ClusterBuilder->Detector("CEMC");
0079 ClusterBuilder->Verbosity(10);
0080 ClusterBuilder->set_threshold_energy(0.032);
0081 std::string emc_prof = getenv("CALIBRATIONROOT");
0082 emc_prof += "/EmcProfile/CEMCprof_Thresh30MeV.root";
0083 ClusterBuilder->LoadProfile(emc_prof);
0084 ClusterBuilder->set_UseTowerInfo(1);
0085 se->registerSubsystem(ClusterBuilder);
0086
0087
0088 CaloCalibEmc_Pi0 *eval_pi2 = new CaloCalibEmc_Pi0("dummy", outfile);
0089
0090
0091
0092
0093 eval_pi2->set_UseTowerInfo(1);
0094 se->registerSubsystem(eval_pi2);
0095 cout << "successful registration of pi0 " << endl;
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120 se->run(nevents);
0121
0122 se->End();
0123 se->PrintTimer();
0124 gSystem->Exit(0);
0125 }