File indexing completed on 2025-12-17 09:23:58
0001 #include <GlobalVariables.C> // GlobalVariables.C has to be first
0002
0003 #include <fun4all/SubsysReco.h>
0004 #include <fun4all/Fun4AllServer.h>
0005
0006 #include <fun4allraw/Fun4AllStreamingInputManager.h>
0007 #include <fun4allraw/SingleMicromegasPoolInput.h>
0008
0009 #include <phool/recoConsts.h>
0010
0011 #include <micromegas/MicromegasCombinedDataCalibration.h>
0012 #include <micromegas/MicromegasClusterizer.h>
0013
0014 #include <Rtypes.h> // for R__LOAD_LIBRARY macro
0015 #include <TSystem.h>
0016
0017 R__LOAD_LIBRARY(libfun4all.so)
0018 R__LOAD_LIBRARY(libfun4allraw.so)
0019
0020
0021 int Fun4All_TpotCalibration(
0022 const int nEvents = 1000,
0023 const std::string &inputFile = "/sphenix/lustre01/sphnxpro/physics/TPOT/calib/TPOT_ebdc39_calib-00074871-0000.evt",
0024 const std::string &calibrationFile = "TPOT_Pedestal-00074871-0000.root",
0025 const std::string &evaluationFile = "MicromegasCombinedDataCalibration-00074871-0000.root"
0026 )
0027 {
0028
0029 std::cout << "Fun4All_TpotCalibration - nEvents: " << nEvents << std::endl;
0030 std::cout << "Fun4All_TpotCalibration - inputFile: " << inputFile << std::endl;
0031 std::cout << "Fun4All_TpotCalibration - calibrationFile: " << calibrationFile << std::endl;
0032 std::cout << "Fun4All_TpotCalibration - evaluationFile: " << evaluationFile << std::endl;
0033
0034
0035 auto *se = Fun4AllServer::instance();
0036 se->Verbosity(1);
0037
0038
0039 auto *rc = recoConsts::instance();
0040
0041
0042 Enable::CDB = true;
0043 rc->set_StringFlag("CDB_GLOBALTAG",CDB::global_tag);
0044 rc->set_uint64Flag("TIMESTAMP",CDB::timestamp);
0045
0046
0047 auto *in = new Fun4AllStreamingInputManager;
0048 se->registerInputManager(in);
0049 if( true )
0050 {
0051
0052 auto *single = new SingleMicromegasPoolInput;
0053 single->AddFile(inputFile);
0054 in->registerStreamingInput(single, InputManagerType::MICROMEGAS);
0055 }
0056
0057 {
0058
0059 auto *micromegasCombinedDataCalibration = new MicromegasCombinedDataCalibration;
0060 micromegasCombinedDataCalibration->set_sample_min(0);
0061 micromegasCombinedDataCalibration->set_sample_max(20);
0062
0063
0064 micromegasCombinedDataCalibration->set_calibration_file(calibrationFile);
0065
0066
0067 micromegasCombinedDataCalibration->set_do_evaluation(true);
0068 micromegasCombinedDataCalibration->set_evaluation_file(evaluationFile);
0069
0070 se->registerSubsystem( micromegasCombinedDataCalibration );
0071 }
0072
0073
0074 se->run(nEvents);
0075
0076
0077 se->End();
0078 se->PrintTimer();
0079
0080 std::cout << "All done" << std::endl;
0081 delete se;
0082 gSystem->Exit(0);
0083 return 0;
0084 }
0085
0086
0087
0088 void RunFFALoadTest() {}