Skip to content
Snippets Groups Projects
Commit e4231e00 authored by Volker Friese's avatar Volker Friese Committed by Jan de Cuveland
Browse files

Made http server port configurable.

parent 460f26e0
No related branches found
No related tags found
1 merge request!784QA for digi events. Checks the digi time distribution within the event.
Pipeline #16862 passed
This commit is part of merge request !784. Comments created here will be created in the context of that merge request.
......@@ -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();
// ------------------------------------------------------------------------
......
......@@ -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();
......
......@@ -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);
};
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment