diff --git a/macro/reco/reco_steer.C b/macro/reco/reco_steer.C index 1fc55ceec3e590049c8579a74c54b14cea58c588..c3d4872b9998def99f52290984171c4e34f15141 100644 --- a/macro/reco/reco_steer.C +++ b/macro/reco/reco_steer.C @@ -24,6 +24,7 @@ using std::string; ** @param tsaFile Name of input file (w/o extension .tsa) ** @param outFile Name of output file (w/o extension .digi.root) ** @param numTs Number of timeslices to process. If not specified, all available will be used. + ** @param port Port of http server. If 0, server will not be activated. ** ** Reconstruction from timeslice level, making use of the steering class CbmReco. ** Currently included stages: @@ -36,7 +37,8 @@ using std::string; ** the extension .tsa by .digi.root **/ -void reco_steer(TString tsaFile = "", TString outFile = "", int32_t numTs = std::numeric_limits<int32_t>::max()) +void reco_steer(TString tsaFile = "", TString outFile = "", int32_t numTs = std::numeric_limits<int32_t>::max(), + uint32_t port = 8080) { // ======================================================================== @@ -98,7 +100,7 @@ void reco_steer(TString tsaFile = "", TString outFile = "", int32_t numTs = std: // ----- Run reconstruction ------------------------------------------- TStopwatch timer; timer.Start(); - CbmReco run(inFile.Data(), outFile.Data(), numTs, config); + CbmReco run(inFile.Data(), outFile.Data(), numTs, config, port); run.Run(); timer.Stop(); // ------------------------------------------------------------------------ diff --git a/reco/tasks/CbmReco.cxx b/reco/tasks/CbmReco.cxx index 80a3e7a0bef0ad9c14e01d4d45752ca3585f5e1b..373191c2b9e1233e406d4ddb8c95e7667775be81 100644 --- a/reco/tasks/CbmReco.cxx +++ b/reco/tasks/CbmReco.cxx @@ -29,22 +29,25 @@ using std::string; // ----- Constructor from single source ----------------------------------- -CbmReco::CbmReco(string source, TString outFile, int32_t numTs, const CbmRecoConfig& config) +CbmReco::CbmReco(string source, TString outFile, int32_t numTs, const CbmRecoConfig& config, uint16_t port) : fSourceNames {source} , fOutputFileName(outFile) , fNumTs(numTs) , fConfig(config) + , fHttpServerPort(port) { } // ---------------------------------------------------------------------------- // ----- Constructor from multiple sources -------------------------------- -CbmReco::CbmReco(std::vector<string> sources, TString outFile, int32_t numTs, const CbmRecoConfig& config) +CbmReco::CbmReco(std::vector<string> sources, TString outFile, int32_t numTs, const CbmRecoConfig& config, + uint16_t port) : fSourceNames(sources) , fOutputFileName(outFile) , fNumTs(numTs) , fConfig(config) + , fHttpServerPort(port) { } // ---------------------------------------------------------------------------- @@ -120,10 +123,11 @@ int32_t CbmReco::Run() run.AddTask(evtQa.release()); // ----- HttpServer for online monitoring - Int_t serverHttpPort = 8080; - Int_t serverRefreshRate = 100; // timeslices - run.ActivateHttpServer(serverRefreshRate, serverHttpPort); - run.GetHttpServer()->GetSniffer()->SetScanGlobalDir(kFALSE); + if (fHttpServerPort) { + Int_t serverRefreshRate = 100; // timeslices + run.ActivateHttpServer(serverRefreshRate, fHttpServerPort); + run.GetHttpServer()->GetSniffer()->SetScanGlobalDir(kFALSE); + } // --- Initialise and start run timer.Stop(); diff --git a/reco/tasks/CbmReco.h b/reco/tasks/CbmReco.h index 32dbdb004859a5bf490afc24718b816418c000e9..28aaf291efaecd9cab7d6fef7b65fbebbe922d9e 100644 --- a/reco/tasks/CbmReco.h +++ b/reco/tasks/CbmReco.h @@ -64,8 +64,9 @@ public: ** @param outFile Name of output file ** @param numTs Number of timeslices to process. If negative, all available will be used. ** @param config Configuration + ** @param port Port number for the http server. If 0, server will not be activated. **/ - CbmReco(std::string source, TString outFile, int32_t numTs, const CbmRecoConfig& config); + CbmReco(std::string source, TString outFile, int32_t numTs, const CbmRecoConfig& config, uint16_t port = 0); /** @brief Standard constructor for list of sources @@ -73,8 +74,10 @@ public: ** @param outFile Name of output file ** @param numTs Number of timeslices to process. If negative, all available will be used. ** @param config Configuration + ** @param port Port number for the http server **/ - CbmReco(std::vector<std::string> sources, TString outFile, int32_t numTs, const CbmRecoConfig& config); + CbmReco(std::vector<std::string> sources, TString outFile, int32_t numTs, const CbmRecoConfig& config, + uint16_t port = 0); /** @brief Destructor **/ @@ -98,6 +101,7 @@ private: TString fOutputFileName = ""; ///< Output file int32_t fNumTs = 0; ///< Number of timeslices to process CbmRecoConfig fConfig = {}; ///< Configuration parameters + uint16_t fHttpServerPort = 0; ClassDef(CbmReco, 1); }; diff --git a/reco/tasks/CbmTaskDigiEventQa.cxx b/reco/tasks/CbmTaskDigiEventQa.cxx index fa73bb7fe21f2339af78e276615e56c35a352e1a..d45ff3c4e3cf0b5ecd2d2c6a9eb81171b91af78f 100644 --- a/reco/tasks/CbmTaskDigiEventQa.cxx +++ b/reco/tasks/CbmTaskDigiEventQa.cxx @@ -150,6 +150,8 @@ InitStatus CbmTaskDigiEventQa::Init() LOG(info) << "--- Http server present; registering histograms"; if (fHistDigiTimeSts) server->Register("DigiEvent", fHistDigiTimeSts); } + else + LOG(info) << "--- No Http server present"; LOG(info) << "=================================================="; std::cout << std::endl;