diff --git a/MQ/histoServer/CbmMqHistoServer.cxx b/MQ/histoServer/CbmMqHistoServer.cxx index 4c9133bbb011ce20051c519d57364cdb96c416a2..b72d29b960a2bee00070fb9919ec7a1d04140ff8 100644 --- a/MQ/histoServer/CbmMqHistoServer.cxx +++ b/MQ/histoServer/CbmMqHistoServer.cxx @@ -5,18 +5,15 @@ * GNU Lesser General Public Licence (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ -#include <mutex> - #include "CbmMqHistoServer.h" #include "CbmFlesCanvasTools.h" -#include "BoostSerializer.h" #include "FairLogger.h" #include "FairMQProgOptions.h" // device->fConfig -#include "RootSerializer.h" #include "TCanvas.h" +#include "TEnv.h" #include "TFile.h" #include "TH1.h" #include "TH2.h" @@ -26,10 +23,14 @@ #include "TProfile.h" #include "TRootSniffer.h" #include "TSystem.h" -#include "TEnv.h" +#include "BoostSerializer.h" #include <boost/serialization/utility.hpp> +#include <mutex> + +#include "RootSerializer.h" + std::mutex mtx; /* Bool_t bMqHistoServerResetHistos = kFALSE; @@ -70,9 +71,8 @@ void CbmMqHistoServer::InitTask() { fServer = new THttpServer(Form("http:%u", fuHttpServerPort)); /// To avoid the server sucking all Histos from gROOT when no output file is used fServer->GetSniffer()->SetScanGlobalDir(kFALSE); - const char *jsrootsys = gSystem->Getenv("JSROOTSYS"); - if (!jsrootsys) - jsrootsys = gEnv->GetValue("HttpServ.JSRootPath", jsrootsys); + const char* jsrootsys = gSystem->Getenv("JSROOTSYS"); + if (!jsrootsys) jsrootsys = gEnv->GetValue("HttpServ.JSRootPath", jsrootsys); LOG(info) << "JSROOT location: " << jsrootsys; diff --git a/MQ/monitor/CbmDeviceMonitorT0.cxx b/MQ/monitor/CbmDeviceMonitorT0.cxx index fc83b46eaac8770cb4c93c7528c4b18de1e9b730..503f80b42920ae075e41a4575cb71c499139d2f3 100644 --- a/MQ/monitor/CbmDeviceMonitorT0.cxx +++ b/MQ/monitor/CbmDeviceMonitorT0.cxx @@ -76,7 +76,7 @@ void CbmDeviceMonitorT0::InitTask() try { fuMaxTotPulser = fConfig->GetValue<uint32_t>("PulsTotMax"); fuOffSpillCountLimit = fConfig->GetValue<uint32_t>("SpillThr"); fuOffSpillCountLimitNonPulser = fConfig->GetValue<uint32_t>("SpillThrNonPuls"); - fdSpillCheckInterval = fConfig->GetValue<double>("SpillCheckInt"); + fdSpillCheckInterval = fConfig->GetValue<double>("SpillCheckInt"); std::string sChanMap = fConfig->GetValue<std::string>("ChanMap"); fuPublishFreqTs = fConfig->GetValue<uint32_t>("PubFreqTs"); fdMinPublishTime = fConfig->GetValue<double_t>("PubTimeMin"); diff --git a/MQ/monitor/CbmDeviceMonitorT0.h b/MQ/monitor/CbmDeviceMonitorT0.h index 886fc067df525c2bdd446da58f8a9162a4ee76b9..55ff3d92faccc48daffd7130d6bd91de3fb9883a 100644 --- a/MQ/monitor/CbmDeviceMonitorT0.h +++ b/MQ/monitor/CbmDeviceMonitorT0.h @@ -51,7 +51,7 @@ private: uint32_t fuMaxTotPulser; uint32_t fuOffSpillCountLimit; uint32_t fuOffSpillCountLimitNonPulser; - double fdSpillCheckInterval; + double fdSpillCheckInterval; std::vector<uint32_t> fvuChanMap; uint32_t fuPublishFreqTs; double_t fdMinPublishTime; diff --git a/MQ/monitor/runMonitorT0.cxx b/MQ/monitor/runMonitorT0.cxx index 5f82ce8c930e511d4a9485d290cf6de2b869b0f4..fe57f52a4e8902ce47da923a305c1be6ca4e3098 100644 --- a/MQ/monitor/runMonitorT0.cxx +++ b/MQ/monitor/runMonitorT0.cxx @@ -20,14 +20,10 @@ void addCustomOptions(bpo::options_description& options) { options.add_options()("PulsTotMax", bpo::value<uint32_t>()->default_value(195), "Maximal TOT for pulser cut"); - options.add_options()("SpillThr", - bpo::value<uint32_t>()->default_value(25), - "Hits Nb Thr for spill detection"); - options.add_options()("SpillThrNonPuls", - bpo::value<uint32_t>()->default_value(10), + options.add_options()("SpillThr", bpo::value<uint32_t>()->default_value(25), "Hits Nb Thr for spill detection"); + options.add_options()("SpillThrNonPuls", bpo::value<uint32_t>()->default_value(10), "Non pulser Hits Nb Thr for spill detection"); - options.add_options()("SpillCheckInt", - bpo::value<double>()->default_value(0.128), + options.add_options()("SpillCheckInt", bpo::value<double>()->default_value(0.128), "Interval in seconds between count checks for spill detection"); options.add_options()("ChanMap", bpo::value<std::string>()->default_value("0,1,2,3,4,5,6,7"), "Set T0 channel map e.g. 0,1,2,3,4,5,6,7"); diff --git a/MQ/source/CbmMQTsaMultiSampler.cxx b/MQ/source/CbmMQTsaMultiSampler.cxx index 45ebe988ab599475732edeebfb71df4f84a65c6d..a85e354f9342c2d1c042293cec54a1aee84c6113 100644 --- a/MQ/source/CbmMQTsaMultiSampler.cxx +++ b/MQ/source/CbmMQTsaMultiSampler.cxx @@ -11,27 +11,28 @@ #include "CbmFlesCanvasTools.h" #include "CbmFormatDecHexPrintout.h" -#include "FairMQLogger.h" -#include "FairMQProgOptions.h" // device->fConfig -#include "BoostSerializer.h" -#include "RootSerializer.h" - #include "TimesliceInputArchive.hpp" #include "TimesliceMultiInputArchive.hpp" #include "TimesliceMultiSubscriber.hpp" #include "TimesliceSubscriber.hpp" +#include "FairMQLogger.h" +#include "FairMQProgOptions.h" // device->fConfig + #include <TCanvas.h> #include <TH1F.h> #include <TH1I.h> #include <TProfile.h> +#include "BoostSerializer.h" #include <boost/algorithm/string.hpp> #include <boost/archive/binary_oarchive.hpp> #include <boost/filesystem.hpp> #include <boost/regex.hpp> #include <boost/serialization/utility.hpp> +#include "RootSerializer.h" + namespace filesys = boost::filesystem; #include <algorithm> @@ -66,7 +67,8 @@ CbmMQTsaMultiSampler::CbmMQTsaMultiSampler() , fSource(nullptr) , fTime() , fLastPublishTime {std::chrono::system_clock::now()} -{} +{ +} void CbmMQTsaMultiSampler::InitTask() try { // Get the values from the command line options (via fConfig) @@ -81,12 +83,12 @@ void CbmMQTsaMultiSampler::InitTask() try { fbSendTsPerChannel = fConfig->GetValue<bool>("send-ts-per-channel"); fsChannelNameMissedTs = fConfig->GetValue<std::string>("ChNameMissTs"); fsChannelNameCommands = fConfig->GetValue<std::string>("ChNameCmds"); - fuPublishFreqTs = fConfig->GetValue< uint32_t >( "PubFreqTs" ); - fdMinPublishTime = fConfig->GetValue< double_t >( "PubTimeMin" ); - fdMaxPublishTime = fConfig->GetValue< double_t >( "PubTimeMax" ); - fsChannelNameHistosInput = fConfig->GetValue< std::string >( "ChNameIn" ); - fsChannelNameHistosConfig = fConfig->GetValue< std::string >( "ChNameHistCfg" ); - fsChannelNameCanvasConfig = fConfig->GetValue< std::string >( "ChNameCanvCfg" ); + fuPublishFreqTs = fConfig->GetValue<uint32_t>("PubFreqTs"); + fdMinPublishTime = fConfig->GetValue<double_t>("PubTimeMin"); + fdMaxPublishTime = fConfig->GetValue<double_t>("PubTimeMax"); + fsChannelNameHistosInput = fConfig->GetValue<std::string>("ChNameIn"); + fsChannelNameHistosConfig = fConfig->GetValue<std::string>("ChNameHistCfg"); + fsChannelNameCanvasConfig = fConfig->GetValue<std::string>("ChNameCanvCfg"); if (fbNoSplitTs) { if (fbSendTsPerSysId) { @@ -207,8 +209,9 @@ void CbmMQTsaMultiSampler::InitTask() try { /// Catches and ignores the channels for missing TS indices and commands /// Same for the histogram channels if (entry.first == fsChannelNameMissedTs || entry.first == fsChannelNameCommands - || ( 0 < fuPublishFreqTs && ( entry.first == fsChannelNameHistosInput || - entry.first == fsChannelNameHistosConfig || entry.first == fsChannelNameCanvasConfig ) ) ) { + || (0 < fuPublishFreqTs + && (entry.first == fsChannelNameHistosInput || entry.first == fsChannelNameHistosConfig + || entry.first == fsChannelNameCanvasConfig))) { continue; } // if( entry.first == fsChannelNameMissedTs || entry.first == fsChannelNameCommands || histo channels name) @@ -262,36 +265,36 @@ void CbmMQTsaMultiSampler::InitTask() try { LOG(info) << "Sending components in separate TS per channel"; } // else if( fbSendTsPerSysId && fbSendTsPerSysId ) of if( fbNoSplitTs ) - if( 0 < fuPublishFreqTs ) { + if (0 < fuPublishFreqTs) { LOG(info) << "Histograms publication frequency in TS: " << fuPublishFreqTs; LOG(info) << "Histograms publication min. interval in s: " << fdMinPublishTime; LOG(info) << "Histograms publication max. interval in s: " << fdMaxPublishTime; /// Vector of pointers on each histo (+ optionally desired folder) - std::vector< std::pair< TNamed *, std::string > > vHistos = {}; + std::vector<std::pair<TNamed*, std::string>> vHistos = {}; /// Vector of pointers on each canvas (+ optionally desired folder) - std::vector< std::pair< TCanvas *, std::string > > vCanvases = {}; + std::vector<std::pair<TCanvas*, std::string>> vCanvases = {}; /// Histos creation and obtain pointer on them fhTsRate = new TH1I("TsRate", "TS rate; t [s]", 1800, 0., 1800.); fhTsSize = new TH1I("TsSize", "Size of TS; Size [MB]", 15000, 0., 15000.); - fhTsSizeEvo = new TProfile( "TsSizeEvo", "Evolution of the TS Size; t [s]; Mean size [MB]", 1800, 0., 1800.); + fhTsSizeEvo = new TProfile("TsSizeEvo", "Evolution of the TS Size; t [s]; Mean size [MB]", 1800, 0., 1800.); fhTsMaxSizeEvo = new TH1F("TsMaxSizeEvo", "Evolution of maximal TS Size; t [s]; Max size [MB]", 1800, 0., 1800.); fhMissedTS = new TH1I("Missed_TS", "Missed TS", 2, 0., 2.); - fhMissedTSEvo = new TProfile( "Missed_TS_Evo", "Missed TS evolution; t [s]", 1800, 0., 1800.); + fhMissedTSEvo = new TProfile("Missed_TS_Evo", "Missed TS evolution; t [s]", 1800, 0., 1800.); /// Add histo pointers to the histo vector - vHistos.push_back( std::pair< TNamed *, std::string >( fhTsRate, "Sampler" ) ); - vHistos.push_back( std::pair< TNamed *, std::string >( fhTsSize, "Sampler" ) ); - vHistos.push_back( std::pair< TNamed *, std::string >( fhTsSizeEvo, "Sampler" ) ); - vHistos.push_back( std::pair< TNamed *, std::string >( fhTsMaxSizeEvo, "Sampler" ) ); - vHistos.push_back( std::pair< TNamed *, std::string >( fhMissedTS, "Sampler" ) ); - vHistos.push_back( std::pair< TNamed *, std::string >( fhMissedTSEvo, "Sampler" ) ); + vHistos.push_back(std::pair<TNamed*, std::string>(fhTsRate, "Sampler")); + vHistos.push_back(std::pair<TNamed*, std::string>(fhTsSize, "Sampler")); + vHistos.push_back(std::pair<TNamed*, std::string>(fhTsSizeEvo, "Sampler")); + vHistos.push_back(std::pair<TNamed*, std::string>(fhTsMaxSizeEvo, "Sampler")); + vHistos.push_back(std::pair<TNamed*, std::string>(fhMissedTS, "Sampler")); + vHistos.push_back(std::pair<TNamed*, std::string>(fhMissedTSEvo, "Sampler")); /// Canvases creation Double_t w = 10; Double_t h = 10; - fcSummary = new TCanvas( "cSampSummary", "Sampler monitoring plots", w, h); + fcSummary = new TCanvas("cSampSummary", "Sampler monitoring plots", w, h); fcSummary->Divide(2, 3); fcSummary->cd(1); @@ -327,17 +330,16 @@ void CbmMQTsaMultiSampler::InitTask() try { fhMissedTSEvo->Draw("el"); /// Add canvas pointers to the canvas vector - vCanvases.push_back( std::pair< TCanvas *, std::string >( fcSummary, "canvases") ); + vCanvases.push_back(std::pair<TCanvas*, std::string>(fcSummary, "canvases")); /// Add pointers to each histo in the histo array /// Create histo config vector /// ===> Use an std::vector< std::pair< std::string, std::string > > with < Histo name, Folder > /// and send it through a separate channel using the BoostSerializer - for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto ) - { -// LOG(info) << "Registering " << vHistos[ uHisto ].first->GetName() -// << " in " << vHistos[ uHisto ].second.data() -// ; + for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) { + // LOG(info) << "Registering " << vHistos[ uHisto ].first->GetName() + // << " in " << vHistos[ uHisto ].second.data() + // ; fArrayHisto.Add( vHistos[ uHisto ].first ); std::pair< std::string, std::string > psHistoConfig( vHistos[ uHisto ].first->GetName(), vHistos[ uHisto ].second ); @@ -350,20 +352,19 @@ void CbmMQTsaMultiSampler::InitTask() try { /// Send message to the common histogram config messages queue if( Send( messageHist, fsChannelNameHistosConfig ) < 0 ) { - LOG(fatal) << "Problem sending histo config"; + LOG(fatal) << "Problem sending histo config"; } // if( Send( messageHist, fsChannelNameHistosConfig ) < 0 ) LOG(info) << "Config of hist " << psHistoConfig.first.data() << " in folder " << psHistoConfig.second.data() ; - } // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto ) + } // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto ) /// Create canvas config vector /// ===> Use an std::vector< std::pair< std::string, std::string > > with < Canvas name, config > /// and send it through a separate channel using the BoostSerializer - for( UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv ) - { -// LOG(info) << "Registering " << vCanvases[ uCanv ].first->GetName() -// << " in " << vCanvases[ uCanv ].second.data(); + for (UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv) { + // LOG(info) << "Registering " << vCanvases[ uCanv ].first->GetName() + // << " in " << vCanvases[ uCanv ].second.data(); std::string sCanvName = (vCanvases[ uCanv ].first)->GetName(); std::string sCanvConf = GenerateCanvasConfigString( vCanvases[ uCanv ].first ); @@ -378,13 +379,13 @@ void CbmMQTsaMultiSampler::InitTask() try { /// Send message to the common canvas config messages queue if( Send( messageCan, fsChannelNameCanvasConfig ) < 0 ) { - LOG(fatal) << "Problem sending canvas config"; + LOG(fatal) << "Problem sending canvas config"; } // if( Send( messageCan, fsChannelNameCanvasConfig ) < 0 ) LOG(info) << "Config string of Canvas " << psCanvConfig.first.data() << " is " << psCanvConfig.second.data() ; - } // for( UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv ) - } // if( 0 < fuPublishFreqTs ) + } // for( UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv ) + } // if( 0 < fuPublishFreqTs ) fTime = std::chrono::steady_clock::now(); } catch (InitTaskError& e) { @@ -445,37 +446,35 @@ bool CbmMQTsaMultiSampler::ConditionalRun() { const fles::Timeslice& ts = *timeslice; uint64_t uTsIndex = ts.index(); - if( 0 < fuPublishFreqTs ) { + if (0 < fuPublishFreqTs) { uint64_t uTsTime = ts.descriptor(0, 0).idx; - if( 0 == fuStartTime ) { - fuStartTime = uTsTime; - } // if( 0 == fuStartTime ) - fdTimeToStart = static_cast< double_t >(uTsTime - fuStartTime)/1e9; + if (0 == fuStartTime) { fuStartTime = uTsTime; } // if( 0 == fuStartTime ) + fdTimeToStart = static_cast<double_t>(uTsTime - fuStartTime) / 1e9; uint64_t uSizeMb = 0; - for( uint64_t uComp = 0; uComp < ts.num_components(); ++uComp ) { - uSizeMb += ts.size_component( uComp ) / (1024 * 1024); - } // for( uint_t uComp = 0; uComp < ts.num_components(); ++uComp ) + for (uint64_t uComp = 0; uComp < ts.num_components(); ++uComp) { + uSizeMb += ts.size_component(uComp) / (1024 * 1024); + } // for( uint_t uComp = 0; uComp < ts.num_components(); ++uComp ) - fhTsRate->Fill( fdTimeToStart ); - fhTsSize->Fill( uSizeMb ); - fhTsSizeEvo->Fill( fdTimeToStart, uSizeMb ); + fhTsRate->Fill(fdTimeToStart); + fhTsSize->Fill(uSizeMb); + fhTsSizeEvo->Fill(fdTimeToStart, uSizeMb); /// Fill max size per s (assumes the histo binning is 1 second!) - if( 0. == fdLastMaxTime ) { + if (0. == fdLastMaxTime) { fdLastMaxTime = fdTimeToStart; - fdTsMaxSize = uSizeMb; - } // if( 0. == fdLastMaxTime ) - else if( 1. <= fdTimeToStart - fdLastMaxTime ) { - fhTsMaxSizeEvo->Fill( fdLastMaxTime, fdTsMaxSize ); + fdTsMaxSize = uSizeMb; + } // if( 0. == fdLastMaxTime ) + else if (1. <= fdTimeToStart - fdLastMaxTime) { + fhTsMaxSizeEvo->Fill(fdLastMaxTime, fdTsMaxSize); fdLastMaxTime = fdTimeToStart; + fdTsMaxSize = uSizeMb; + } // else if if( 1 <= fdTimeToStart - fdLastMaxTime ) + else if (fdTsMaxSize < uSizeMb) { fdTsMaxSize = uSizeMb; - } // else if if( 1 <= fdTimeToStart - fdLastMaxTime ) - else if( fdTsMaxSize < uSizeMb ) { - fdTsMaxSize = uSizeMb; - } // else if( fdTsMaxSize < uSizeMb ) - } // if( 0 < fuPublishFreqTs ) + } // else if( fdTsMaxSize < uSizeMb ) + } // if( 0 < fuPublishFreqTs ) /// Missed TS detection (only if output channel name defined by user) if ((uTsIndex != (fuPrevTsIndex + 1)) @@ -499,16 +498,16 @@ bool CbmMQTsaMultiSampler::ConditionalRun() { return false; } // if( !SendMissedTsIdx( vulMissedIndices ) ) - if( 0 < fuPublishFreqTs ) { + if (0 < fuPublishFreqTs) { fhMissedTS->Fill(1, uTsIndex - fuPrevTsIndex); fhMissedTSEvo->Fill(fdTimeToStart, 1, uTsIndex - fuPrevTsIndex); - } // if( 0 < fuPublishFreqTs ) + } // if( 0 < fuPublishFreqTs ) } // if( ( uTsIndex != ( fuPrevTsIndex + 1 ) ) && ( 0 != fuPrevTsIndex && 0 != uTsIndex ) && "" != fsChannelNameMissedTs ) - else if( 0 < fuPublishFreqTs ) { + else if (0 < fuPublishFreqTs) { fhMissedTS->Fill(0); fhMissedTSEvo->Fill(fdTimeToStart, 0, 1); - } // else if( 0 < fuPublishFreqTs ) + } // else if( 0 < fuPublishFreqTs ) fuPrevTsIndex = uTsIndex; @@ -579,21 +578,21 @@ bool CbmMQTsaMultiSampler::ConditionalRun() { } // for (unsigned int nrComp = 0; nrComp < ts.num_components(); ++nrComp) } // else of if( fbSendTsPerSysId ) - if( 0 < fuPublishFreqTs ) { + if (0 < fuPublishFreqTs) { /// Send histograms periodically. /// Use also runtime checker to trigger sending after M s if /// processing too slow or delay sending if processing too fast std::chrono::system_clock::time_point currentTime = std::chrono::system_clock::now(); - std::chrono::duration<double_t> elapsedSeconds = currentTime - fLastPublishTime; - if ((fdMaxPublishTime < elapsedSeconds.count()) || - (0 == fTSCounter % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count())) { + std::chrono::duration<double_t> elapsedSeconds = currentTime - fLastPublishTime; + if ((fdMaxPublishTime < elapsedSeconds.count()) + || (0 == fTSCounter % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count())) { SendHistograms(); fLastPublishTime = std::chrono::system_clock::now(); } // if( ( fdMaxPublishTime < elapsedSeconds.count() ) || ( 0 == fTSCounter % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count() ) ) - } // if( 0 < fuPublishFreqTs ) + } // if( 0 < fuPublishFreqTs ) return true; - } // if (fTSCounter < fMaxTimeslices) + } // if (fTSCounter < fMaxTimeslices) else { CalcRuntime(); @@ -609,8 +608,8 @@ bool CbmMQTsaMultiSampler::ConditionalRun() { } // if( "" != fsChannelNameCommands ) return false; - } // else of if (fTSCounter < fMaxTimeslices) - } // if (timeslice) + } // else of if (fTSCounter < fMaxTimeslices) + } // if (timeslice) else { CalcRuntime(); @@ -626,7 +625,7 @@ bool CbmMQTsaMultiSampler::ConditionalRun() { } // if( "" != fsChannelNameCommands ) return false; - } // else of if (timeslice) + } // else of if (timeslice) } bool CbmMQTsaMultiSampler::CreateAndSendComponent(const fles::Timeslice& ts, @@ -1003,15 +1002,14 @@ bool CbmMQTsaMultiSampler::SendCommand(std::string sCommand) { bool CbmMQTsaMultiSampler::SendHistograms() { /// Serialize the array of histos into a single MQ message - FairMQMessagePtr message( NewMessage() ); - Serialize<RootSerializer>( *message, &fArrayHisto ); + FairMQMessagePtr message(NewMessage()); + Serialize<RootSerializer>(*message, &fArrayHisto); /// Send message to the common histogram messages queue - if( Send( message, fsChannelNameHistosInput ) < 0 ) - { + if (Send(message, fsChannelNameHistosInput) < 0) { LOG(error) << "Problem sending data"; return false; - } // if( Send( message, fsChannelNameHistosInput ) < 0 ) + } // if( Send( message, fsChannelNameHistosInput ) < 0 ) /// Reset the histograms after sending them (but do not reset the time) ResetHistograms(); diff --git a/MQ/source/CbmMQTsaMultiSampler.h b/MQ/source/CbmMQTsaMultiSampler.h index 56e07239802eaa262eeb3316be7ee8e341721fce..ddae90821736c94f579cf87df41ce3a80d7b40a8 100644 --- a/MQ/source/CbmMQTsaMultiSampler.h +++ b/MQ/source/CbmMQTsaMultiSampler.h @@ -51,9 +51,9 @@ protected: std::string fsChannelNameHistosInput = "histogram-in"; std::string fsChannelNameHistosConfig = "histo-conf"; std::string fsChannelNameCanvasConfig = "canvas-conf"; - uint32_t fuPublishFreqTs = 0; - double_t fdMinPublishTime = 0.5; - double_t fdMaxPublishTime = 5; + uint32_t fuPublishFreqTs = 0; + double_t fdMinPublishTime = 0.5; + double_t fdMaxPublishTime = 5; uint64_t fuPrevTsIndex = 0; uint64_t fTSCounter; @@ -126,11 +126,11 @@ private: /// Array of histograms to send to the histogram server TObjArray fArrayHisto = {}; /// Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server - std::vector< std::pair< std::string, std::string > > fvpsHistosFolder = {}; + std::vector<std::pair<std::string, std::string>> fvpsHistosFolder = {}; /// Vector of string pairs with ( CanvasName, CanvasConfig ) to send to the histogram server /// Format of Can config is "NbPadX(U);NbPadY(U);ConfigPad1(s);....;ConfigPadXY(s)" /// Format of Pad config is "GrixX(b),GridY(b),LogX(b),LogY(b),LogZ(b),HistoName(s),DrawOptions(s)" - std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig = {}; + std::vector<std::pair<std::string, std::string>> fvpsCanvasConfig = {}; /// Histograms TH1I* fhTsRate = nullptr; @@ -144,7 +144,6 @@ private: double_t fdTimeToStart = 0.; double_t fdLastMaxTime = 0.; double_t fdTsMaxSize = 0.; - }; #endif /* CBMMQTSASAMPLER_H_ */ diff --git a/MQ/source/runTsaMultiSampler.cxx b/MQ/source/runTsaMultiSampler.cxx index dd421e17c0da6c2b9d670a661977d4100b6e77b8..30cc9c3d7b450bf6811cb7463a9f869bc85342d0 100644 --- a/MQ/source/runTsaMultiSampler.cxx +++ b/MQ/source/runTsaMultiSampler.cxx @@ -42,19 +42,17 @@ void addCustomOptions(bpo::options_description& options) { bpo::value<std::string>()->default_value(""), "MQ channel name for commands to slaves"); - options.add_options()("PubFreqTs", bpo::value<uint32_t>()->default_value(0), - "Histo publishing frequency in TS"); + options.add_options()("PubFreqTs", bpo::value<uint32_t>()->default_value(0), "Histo publishing frequency in TS"); options.add_options()("PubTimeMin", bpo::value<double_t>()->default_value(1.0), "Minimal time between two publishing"); options.add_options()("PubTimeMax", bpo::value<double_t>()->default_value(10.0), "Maximal time between two publishing"); - options.add_options()("ChNameIn", bpo::value< std::string >()->default_value( "histogram-in" ), + options.add_options()("ChNameIn", bpo::value<std::string>()->default_value("histogram-in"), "MQ channel name for histos"); - options.add_options()("ChNameHistCfg", bpo::value< std::string >()->default_value( "histo-conf" ), + options.add_options()("ChNameHistCfg", bpo::value<std::string>()->default_value("histo-conf"), "MQ channel name for histos config"); - options.add_options()("ChNameCanvCfg", bpo::value< std::string >()->default_value( "canvas-conf" ), + options.add_options()("ChNameCanvCfg", bpo::value<std::string>()->default_value("canvas-conf"), "MQ channel name for canvases config"); - } FairMQDevicePtr getDevice(const FairMQProgOptions& /*config*/) { diff --git a/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoT0.cxx b/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoT0.cxx index 8d6fc39cad74ecc9fecb53eade4a0cf1ea8ff0e7..fb766fb55ac685fbce48a8edba739ad0fdfe4748 100644 --- a/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoT0.cxx +++ b/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoT0.cxx @@ -320,15 +320,12 @@ Bool_t CbmMcbm2018MonitorAlgoT0::ProcessMs(const fles::Timeslice& ts, else if (fuOffSpillCountLimit < fuCountsLastInter) fbSpillOn = kTRUE; - LOG(debug) << Form( "%6llu %6.4f %9u %9u %2d", - fulCurrentTsIdx, fdMsTime - fdLastInterTime, - fuCountsLastInter, - fuNonPulserCountsLastInter, - fuCurrentSpillIdx); + LOG(debug) << Form("%6llu %6.4f %9u %9u %2d", fulCurrentTsIdx, fdMsTime - fdLastInterTime, fuCountsLastInter, + fuNonPulserCountsLastInter, fuCurrentSpillIdx); - fuCountsLastInter = 0; + fuCountsLastInter = 0; fuNonPulserCountsLastInter = 0; - fdLastInterTime = fdMsTime; + fdLastInterTime = fdMsTime; } // if( fdSpillCheckInterval < fdMsTime - fdLastInterTime ) } // if( 0 == fuCurrDpbIdx ) diff --git a/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoT0.h b/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoT0.h index a450a80c6f64272ddfcc6f70b0d436e620aa3aa9..b206944cf43ead7f0e400742656af3d5769c4225 100644 --- a/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoT0.h +++ b/fles/mcbm2018/monitor/CbmMcbm2018MonitorAlgoT0.h @@ -72,12 +72,8 @@ public: inline void SetSpillThreshold(UInt_t uCntLimit) { fuOffSpillCountLimit = uCntLimit; } - inline void SetSpillThresholdNonPulser(UInt_t uCntLimit) { - fuOffSpillCountLimitNonPulser = uCntLimit; - } - inline void SetSpillCheckInterval(Double_t dIntervalSec) { - fdSpillCheckInterval = dIntervalSec; - } + inline void SetSpillThresholdNonPulser(UInt_t uCntLimit) { fuOffSpillCountLimitNonPulser = uCntLimit; } + inline void SetSpillCheckInterval(Double_t dIntervalSec) { fdSpillCheckInterval = dIntervalSec; } inline void SetChannelMap(UInt_t uChan0, UInt_t uChan1, UInt_t uChan2, @@ -122,7 +118,7 @@ private: UInt_t fuMaxTotPulser = 100; UInt_t fuOffSpillCountLimit = 200; UInt_t fuOffSpillCountLimitNonPulser = 80; - Double_t fdSpillCheckInterval = 1.0; + Double_t fdSpillCheckInterval = 1.0; /// Constants static const Int_t kiMaxNbFlibLinks = 32; diff --git a/fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskT0.cxx b/fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskT0.cxx index 0674c524b2520af48c0189a2f9a636f9176d5586..6afc8f5beb28708942cabface7a6e2e0fab6b2f2 100644 --- a/fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskT0.cxx +++ b/fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskT0.cxx @@ -44,7 +44,8 @@ CbmMcbm2018MonitorTaskT0::CbmMcbm2018MonitorTaskT0() , fuOffSpillCountLimitNonPulser(80) , fdSpillCheckInterval(1.0) , fulTsCounter(0) - , fMonitorAlgo(nullptr) { + , fMonitorAlgo(nullptr) +{ fMonitorAlgo = new CbmMcbm2018MonitorAlgoT0(); } diff --git a/fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskT0.h b/fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskT0.h index 745205638498f6787e78d5e36a46ce1afa5f34aa..ef1e3759ec1f3bc021efdd48f2fa2a1c63226832 100644 --- a/fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskT0.h +++ b/fles/mcbm2018/monitor/CbmMcbm2018MonitorTaskT0.h @@ -55,12 +55,8 @@ public: inline void SetSpillThreshold(UInt_t uCntLimit) { fuOffSpillCountLimit = uCntLimit; } - inline void SetSpillThresholdNonPulser(UInt_t uCntLimit) { - fuOffSpillCountLimitNonPulser = uCntLimit; - } - inline void SetSpillCheckInterval(Double_t dIntervalSec) { - fdSpillCheckInterval = dIntervalSec; - } + inline void SetSpillThresholdNonPulser(UInt_t uCntLimit) { fuOffSpillCountLimitNonPulser = uCntLimit; } + inline void SetSpillCheckInterval(Double_t dIntervalSec) { fdSpillCheckInterval = dIntervalSec; } void SetChannelMap(UInt_t uChan0, UInt_t uChan1, UInt_t uChan2, diff --git a/macro/beamtime/mcbm2021/MonitorT0.C b/macro/beamtime/mcbm2021/MonitorT0.C index 88a19cafafa2fc7164e9c2d202190a4a5c35c29f..21f897a1efed37b457842c4ea886f797f96f291c 100644 --- a/macro/beamtime/mcbm2021/MonitorT0.C +++ b/macro/beamtime/mcbm2021/MonitorT0.C @@ -10,12 +10,17 @@ // In order to call later Finish, we make this global FairRunOnline* run = NULL; +/// FIXME: Disable clang formatting to keep easy parameters overview +/* clang-format off */ void MonitorT0(TString inFile = "", TString sHostname = "cbmflesnode8:5558;cbmflesnode9:5559", Int_t iServerHttpPort = 8080, Int_t iServerRefreshRate = 100, UInt_t uRunId = 0, UInt_t nrEvents = 0) { + /// FIXME: Re-enable clang formatting after parameters initial values setting + /* clang-format on */ + TString srcDir = gSystem->Getenv("VMCWORKDIR"); // --- Specify number of events to be produced. @@ -52,17 +57,13 @@ void MonitorT0(TString inFile = "", monitor_t0->SetIgnoreOverlapMs(); monitor_t0->SetHistoryHistoSize(1800); - if (0 < uRunId) - monitor_t0->SetHistoFilename( - Form("data/HistosMonitorT0_%03u.root", uRunId)); + if (0 < uRunId) monitor_t0->SetHistoFilename(Form("data/HistosMonitorT0_%03u.root", uRunId)); monitor_t0->SetPulserTotLimits(180, 210); // for runs > 86 // --- Source task CbmMcbm2018Source* source = new CbmMcbm2018Source(); - if ("" != inFile) { - source->SetFileName(inFile); - } // if( "" != inFile ) + if ("" != inFile) { source->SetFileName(inFile); } // if( "" != inFile ) else { source->SetHostName(sHostname); } // else of if( "" != inFile ) @@ -96,23 +97,22 @@ void MonitorT0(TString inFile = "", std::cout << ">>> MonitorT0: Starting run..." << std::endl; if (0 == nrEvents) { run->Run(nEvents, 0); // run until end of input file - } else { + } + else { run->Run(0, nrEvents); // process 2000 Events } run->Finish(); timer.Stop(); - std::cout << "Processed " << std::dec << source->GetTsCount() << " timeslices" - << std::endl; + std::cout << "Processed " << std::dec << source->GetTsCount() << " timeslices" << std::endl; // --- End-of-run info Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); std::cout << std::endl << std::endl; std::cout << ">>> MonitorT0: Macro finished successfully." << std::endl; - std::cout << ">>> MonitorT0: Real time " << rtime << " s, CPU time " << ctime - << " s" << std::endl; + std::cout << ">>> MonitorT0: Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl; std::cout << std::endl; /// --- Screen output for automatic tests