diff --git a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx index 0995fa1c3afcabc434c37a21dabceebcbb5e4dcf..02a363a557433ee1a10641e944c5139c43ad856b 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx +++ b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx @@ -43,7 +43,7 @@ std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>* /* uint32_t CbmMuchUnpackAlgo::getFebIndex(uint32_t dpbidx, uint32_t crobidx, uint16_t elinkidx) { - // This function generates FEB index between 0 to dpbidx * 9 NrAsicsPerCrob + // This function generates FEB index between 0 to dpbidx * 9 NrAsicsPerCrob uint32_t asicidx = fUnpackPar->ElinkIdxToFebIdx(elinkidx); const uint32_t uAsicIdx = (dpbidx * fNrCrobPerDpb + crobidx) * fNrAsicsPerCrob + asicidx; return uAsicIdx; @@ -256,6 +256,10 @@ Bool_t CbmMuchUnpackAlgo::initParSet(CbmMuchUnpackPar* parset) LOG(debug) << "Unpacking data in bin sorter FW mode"; initInternalStatus(parset); + if (fMonitor) { + fMonitor->Init(parset); + LOG(info) << fName << "::initParSet - Successfully initialized MUCH monitor"; + } return kTRUE; } @@ -566,7 +570,8 @@ void CbmMuchUnpackAlgo::processHitInfo(const stsxyter::Message& mess) } const uint32_t uAsicInFeb = uAsicIdx % fNrAsicsPerFeb; const double dTimeSinceStartSec = (dHitTimeNs - fdStartTime) * 1e-9; - const double dCalAdc = fvdFebAdcOffs[uFebIdx] + (usRawAdc - 1) * fvdFebAdcGain[uFebIdx]; + const double dCalAdc = usRawAdc; + // const double dCalAdc = fvdFebAdcOffs[uFebIdx] + (usRawAdc - 1) * fvdFebAdcGain[uFebIdx]; fMonitor->FillHitMonitoringHistos(uFebIdx, usChan, uChanInFeb, usRawAdc, dCalAdc, usRawTs, mess.IsHitMissedEvts()); fMonitor->FillHitEvoMonitoringHistos(uFebIdx, uAsicIdx, uAsicInFeb, uChanInFeb, dTimeSinceStartSec, mess.IsHitMissedEvts()); @@ -692,7 +697,7 @@ uint32_t CbmMuchUnpackAlgo::CreateMuchAddress(uint32_t dpbidx, uint32_t iFebId, // fDigiVect.push_back( CbmMuchDigi( address, itHitIn->GetAdc(), ulTimeInNs ) ); /// With Beamtime MUCH digi - + CbmMuchBeamTimeDigi* digi = new CbmMuchBeamTimeDigi(address, itHitIn->GetAdc(), ulTimeInNs); LOG(debug) << "Sector " << sSector << " channel " << sChannel << " layer " << layer << " Address " << address << " Time " << ulTimeInNs; diff --git a/reco/detectors/much/unpack/CbmMuchUnpackMonitor.cxx b/reco/detectors/much/unpack/CbmMuchUnpackMonitor.cxx index c136bffc0129769f418fd9fed6a2ea7d602ca5d8..624caa020ba60fc1f98615fd13cf0a3c8cceb155 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackMonitor.cxx +++ b/reco/detectors/much/unpack/CbmMuchUnpackMonitor.cxx @@ -4,14 +4,13 @@ #include "CbmMuchUnpackMonitor.h" -#include "CbmQaCanvas.h" - #include "MicrosliceDescriptor.hpp" #include <FairRun.h> #include <FairRunOnline.h> #include <Logger.h> +#include "TCanvas.h" #include <RtypesCore.h> #include <TFile.h> #include <TH1.h> @@ -73,18 +72,19 @@ Bool_t CbmMuchUnpackMonitor::CreateHistograms(CbmMuchUnpackPar* pUnpackPar) fhDigisTimeInRun->SetCanExtend(TH1::kAllAxes); AddHistoToVector(fhDigisTimeInRun, ""); - fhVectorSize = new TH1I("fhVectorSize", "Size of the vector VS TS index; TS index; Size [bytes]", 10, 0, 10); + fhVectorSize = new TH1I("fhMuchVectorSize", "Size of the vector VS TS index; TS index; Size [bytes]", 10, 0, 10); fhVectorSize->SetCanExtend(TH1::kAllAxes); AddHistoToVector(fhVectorSize, ""); fhVectorCapacity = - new TH1I("fhVectorCapacity", "Size of the vector VS TS index; TS index; Size [bytes]", 10000, 0., 10000.); + new TH1I("fhMuchVectorCapacity", "Size of the vector VS TS index; TS index; Size [bytes]", 10000, 0., 10000.); AddHistoToVector(fhVectorCapacity, ""); - fhMsCntEvo = new TH1I("fhMsCntEvo", "; MS index [s]; Counts []", 600, 0.0, 600.0); + fhMsCntEvo = new TH1I("fhMuchMsCntEvo", "; MS index [s]; Counts []", 600, 0.0, 600.0); AddHistoToVector(fhMsCntEvo, ""); - fhMsErrorsEvo = new TH2I("fhMsErrorsEvo", "; MS index [s]; Error type []; Counts []", 600, 0.0, 600.0, 4, -0.5, 3.5); + fhMsErrorsEvo = + new TH2I("fhMuchMsErrorsEvo", "; MS index [s]; Error type []; Counts []", 600, 0.0, 600.0, 4, -0.5, 3.5); AddHistoToVector(fhMsErrorsEvo, ""); /// Hit rates evo per FEB in system @@ -114,7 +114,7 @@ Bool_t CbmMuchUnpackMonitor::CreateHistograms(CbmMuchUnpackPar* pUnpackPar) AddHistoToVector(fhMuchStatusMessType, ""); /// Timeslice counter ratio Plots - sHistName = "hRawHitRatioPerFeb"; + sHistName = "hMuchRawHitRatioPerFeb"; title = "Proportion of digis over raw hits in each FEB; FEB []; digis/raw [Prct]"; fhRawHitRatioPerFeb = new TProfile(sHistName, title, uNbFebs, -0.5, uNbFebs - 0.5); AddHistoToVector(fhRawHitRatioPerFeb, ""); @@ -128,20 +128,20 @@ Bool_t CbmMuchUnpackMonitor::CreateHistograms(CbmMuchUnpackPar* pUnpackPar) /// All histos per FEB: with channels or ASIC as axis!! for (UInt_t uFebIdx = 0; uFebIdx < uNbFebs; ++uFebIdx) { /// Timeslice counter ratio Plots - sHistName = Form("hRawChRatio_%03d", uFebIdx); + sHistName = Form("hMuchRawChRatio_%03d", uFebIdx); title = Form("Proportion of raw hits in each channel of FEB %2d; Channel []; Share of FEB raw msg [Prct]", uFebIdx); fvhRawChRatio.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hHitChRatio_%03d", uFebIdx); + sHistName = Form("hMuchHitChRatio_%03d", uFebIdx); title = Form("Proportion of digis in each channel of FEB %2d; Channel []; Share of FEB digis [Prct]", uFebIdx); fvhHitChRatio.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hDupliChRatio_%03d", uFebIdx); + sHistName = Form("hMuchDupliChRatio_%03d", uFebIdx); title = Form("Proportion of duplicates in each channel of FEB %2d; Channel []; Share of FEB duplicates [Prct]", uFebIdx); fvhDupliChRatio.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hRawHitRatioPerCh_%03d", uFebIdx); + sHistName = Form("hMuchRawHitRatioPerCh_%03d", uFebIdx); title = Form("Proportion of digis over raw hits in each channel of FEB %2d; Channel []; digis/raw [Prct]", uFebIdx); fvhRawHitRatioPerCh.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hRawDupliRatioPerCh_%03d", uFebIdx); + sHistName = Form("hMuchRawDupliRatioPerCh_%03d", uFebIdx); title = Form("Proportion of duplicates over raw hits in each channel of FEB %2d; Channel []; dupli/raw [Prct]", uFebIdx); fvhRawDupliRatioPerCh.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); @@ -282,7 +282,7 @@ Bool_t CbmMuchUnpackMonitor::CreateHistograms(CbmMuchUnpackPar* pUnpackPar) for (UInt_t uFebIdx = 0; uFebIdx < uNbFebs; ++uFebIdx) { // if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) { fvcMuchSumm[uFebIdx] = - new CbmQaCanvas(Form("cMuchSum_%03u", uFebIdx), Form("Summary plots for FEB %03u", uFebIdx), w, h); + new TCanvas(Form("cMuchSum_%03u", uFebIdx), Form("Summary plots for FEB %03u", uFebIdx), w, h); AddCanvasToVector(fvcMuchSumm[uFebIdx], "perFebCanvases"); fvcMuchSumm[uFebIdx]->Divide(2, 3); @@ -298,37 +298,37 @@ void CbmMuchUnpackMonitor::DrawCanvases() gPad->SetGridx(); gPad->SetGridy(); gPad->SetLogy(); - fvhMuchFebChanCntRaw[uFebIdx]->DrawCopy(); + fvhMuchFebChanCntRaw[uFebIdx]->Draw(); //fvcMuchSumm[uFebIdx]->cd(2); //gPad->SetGridx(); //gPad->SetGridy(); //gPad->SetLogy(); - //fvhMuchFebChanHitRateProf[uFebIdx]->DrawCopy("e0"); + //fvhMuchFebChanHitRateProf[uFebIdx]->Draw("e0"); fvcMuchSumm[uFebIdx]->cd(3); gPad->SetGridx(); gPad->SetGridy(); gPad->SetLogz(); - fvhMuchFebChanAdcRaw[uFebIdx]->DrawCopy("colz"); + fvhMuchFebChanAdcRaw[uFebIdx]->Draw("colz"); fvcMuchSumm[uFebIdx]->cd(4); gPad->SetGridx(); gPad->SetGridy(); //gPad->SetLogy(); - fvhMuchFebChanAdcRawProf[uFebIdx]->DrawCopy(); + fvhMuchFebChanAdcRawProf[uFebIdx]->Draw(); fvcMuchSumm[uFebIdx]->cd(5); gPad->SetGridx(); gPad->SetGridy(); gPad->SetLogz(); - fvhMuchFebChanHitRateEvo[uFebIdx]->DrawCopy("colz"); + fvhMuchFebChanHitRateEvo[uFebIdx]->Draw("colz"); fvcMuchSumm[uFebIdx]->cd(6); gPad->SetGridx(); gPad->SetGridy(); //gPad->SetLogy(); - fvhMuchFebChanMissEvt[uFebIdx]->DrawCopy("colz"); + fvhMuchFebChanMissEvt[uFebIdx]->Draw("colz"); // two following two are inactive as currently adc raw and cal are the same @@ -336,27 +336,27 @@ void CbmMuchUnpackMonitor::DrawCanvases() //gPad->SetGridx(); //gPad->SetGridy(); //gPad->SetLogz(); - //fvhMuchFebChanAdcCal[ uFebIdx ]->DrawCopy( "colz" ); + //fvhMuchFebChanAdcCal[ uFebIdx ]->Draw( "colz" ); //fvcMuchSumm[ uFebIdx ]->cd(6); //gPad->SetGridx(); //gPad->SetGridy(); //gPad->SetLogy(); - //fvhMuchFebChanAdcCalProf[ uFebIdx ]->DrawCopy(); + //fvhMuchFebChanAdcCalProf[ uFebIdx ]->Draw(); } } Bool_t CbmMuchUnpackMonitor::CreateMsComponentSizeHistos(UInt_t component) { if (nullptr == fvhMsSize[component]) { - TString sMsSizeName = Form("MsSize_link_%02u", component); + TString sMsSizeName = Form("MuchMsSize_link_%02u", component); TString sMsSizeTitle = Form("Size of MS for nDPB of link %02u; Ms Size [bytes]", component); fvhMsSize[component] = new TH1F(sMsSizeName.Data(), sMsSizeTitle.Data(), 30000, 0., 30000.); fvhMsSize[component]->SetCanExtend(TH2::kAllAxes); AddHistoToVector(fvhMsSize[component], "perComponent"); } if (nullptr == fvhMsSizeTime[component]) { - TString sMsSizeName = Form("MsSizeTime_link_%02u", component); + TString sMsSizeName = Form("MuchMsSizeTime_link_%02u", component); TString sMsSizeTitle = Form("Size of MS vs time for gDPB of link %02u; Time[s] ; Ms Size [bytes]", component); fvhMsSizeTime[component] = new TProfile(sMsSizeName.Data(), sMsSizeTitle.Data(), 15000, 0., 300.); fvhMsSizeTime[component]->SetCanExtend(TH2::kAllAxes); @@ -453,7 +453,7 @@ Bool_t CbmMuchUnpackMonitor::CreateDebugHistograms(CbmMuchUnpackPar* pUnpackPar) TString sHistName {""}; TString title {""}; - sHistName = "hPulserMessageType"; + sHistName = "hMuchPulserMessageType"; title = "Nb of message for each type; Type"; fhMuchMessType = new TH1I(sHistName, title, 6, 0., 6.); fhMuchMessType->GetXaxis()->SetBinLabel(1, "Dummy"); @@ -464,7 +464,7 @@ Bool_t CbmMuchUnpackMonitor::CreateDebugHistograms(CbmMuchUnpackPar* pUnpackPar) fhMuchMessType->GetXaxis()->SetBinLabel(6, "Empty"); AddHistoToVector(fhMuchMessType, ""); - sHistName = "hPulserMessageTypePerDpb"; + sHistName = "hMuchPulserMessageTypePerDpb"; title = "Nb of message of each type for each DPB; DPB; Type"; fhMuchMessTypePerDpb = new TH2I(sHistName, title, uNrOfDpbs, 0, uNrOfDpbs, 6, 0., 6.); fhMuchMessTypePerDpb->GetYaxis()->SetBinLabel(1, "Dummy"); @@ -511,37 +511,37 @@ Bool_t CbmMuchUnpackMonitor::CreateDebugHistograms(CbmMuchUnpackPar* pUnpackPar) AddHistoToVector(fhMuchDpbRawTsMsbDpb, ""); /// Timeslice counter ratio Plots - sHistName = "hRawHitRatioEvoPerFeb"; + sHistName = "hMuchRawHitRatioEvoPerFeb"; title = "Proportion of digis over raw hits in each FEB; Time [s]; FEB []; digis/raw [Prct]"; fhRawHitRatioEvoPerFeb = new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbFebs, -0.5, uNbFebs - 0.5); AddHistoToVector(fhRawHitRatioEvoPerFeb, ""); for (uint32_t uFebIdx = 0; uFebIdx < uNbFebs; ++uFebIdx) { - sHistName = Form("hChDupliAdc_%03d", uFebIdx); + sHistName = Form("hMuchChDupliAdc_%03d", uFebIdx); title = Form("ADC in duplicate raw in each channel of FEB %2d; Channel []; ADC []", uFebIdx); fvhChDupliAdc.push_back(new TH2I(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5, 32, -0.5, 31.5)); - sHistName = Form("hRawChRatioEvo_%03d", uFebIdx); + sHistName = Form("hMuchRawChRatioEvo_%03d", uFebIdx); title = Form("Proportion of raw hits in each channel of FEB %2d; Time [s]; Channel []; Share of FEB raw msg [Prct]", uFebIdx); fvhRawChRatioEvo.push_back( new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hHitChRatioEvo_%03d", uFebIdx); + sHistName = Form("hMuchHitChRatioEvo_%03d", uFebIdx); title = Form("Proportion of digis in each channel of FEB %2d; Time [s]; Channel []; Share of FEB digis [Prct]", uFebIdx); fvhHitChRatioEvo.push_back( new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hDupliChRatioEvo_%03d", uFebIdx); + sHistName = Form("hMuchDupliChRatioEvo_%03d", uFebIdx); title = Form("Proportion of duplicates in each channel of FEB %2d; Time [s]; Channel []; Share of FEB duplicates [Prct]", uFebIdx); fvhDupliChRatioEvo.push_back( new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hRawHitRatioEvoPerCh_%03d", uFebIdx); + sHistName = Form("hMuchRawHitRatioEvoPerCh_%03d", uFebIdx); title = Form("Proportion of digis over raw hits in each channel of FEB %2d; Time [s]; Channel []; digis/raw [Prct]", uFebIdx); fvhRawHitRatioEvoPerCh.push_back( new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hRawDupliRatioEvoPerCh_%03d", uFebIdx); + sHistName = Form("hMuchRawDupliRatioEvoPerCh_%03d", uFebIdx); title = Form("Proportion of duplicates over raw hits in each channel of FEB %2d; Time [s]; Channel []; dupli/raw [Prct]", uFebIdx); @@ -875,23 +875,28 @@ Bool_t CbmMuchUnpackMonitor::Init(CbmMuchUnpackPar* parset) CreateHistograms(parset); if (fDebugMode) CreateDebugHistograms(parset); + /// Trigger Canvas creation on all associated monitors + DrawCanvases(); + /// Obtain vector of pointers on each histo from the algo (+ optionally desired folder) std::vector<std::pair<TNamed*, std::string>> vHistos = GetHistoVector(); /// Obtain vector of pointers on each canvas from the algo (+ optionally desired folder) - std::vector<std::pair<CbmQaCanvas*, std::string>> vCanvases = GetCanvasVector(); + std::vector<std::pair<TCanvas*, std::string>> vCanvases = GetCanvasVector(); /// Register the histos and canvases in the HTTP server THttpServer* server = FairRunOnline::Instance()->GetHttpServer(); if (nullptr != server) { for (UInt_t uCanvas = 0; uCanvas < vCanvases.size(); ++uCanvas) { - server->Register(Form("/%s", vCanvases[uCanvas].second.data()), vCanvases[uCanvas].first); + server->Register(Form("/much/%s", vCanvases[uCanvas].second.data()), vCanvases[uCanvas].first); } for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) { - server->Register(Form("/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first); + server->Register(Form("/much/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first); } + /* server->RegisterCommand("/Reset_UnpMuch_Hist", "bMcbm2018UnpackerTaskMuchResetHistos=kTRUE"); server->Restrict("/Reset_UnpMuch_Hist", "allow=admin"); +*/ } return kTRUE; @@ -900,13 +905,11 @@ Bool_t CbmMuchUnpackMonitor::Init(CbmMuchUnpackPar* parset) // ---- Finish ---- void CbmMuchUnpackMonitor::Finish() { - DrawCanvases(); - /// Obtain vector of pointers on each histo (+ optionally desired folder) std::vector<std::pair<TNamed*, std::string>> vHistos = GetHistoVector(); /// Obtain vector of pointers on each canvas (+ optionally desired folder) - std::vector<std::pair<CbmQaCanvas*, std::string>> vCanvases = GetCanvasVector(); + std::vector<std::pair<TCanvas*, std::string>> vCanvases = GetCanvasVector(); /// Save old global file and folder pointer to avoid messing with FairRoot TFile* oldFile = gFile; diff --git a/reco/detectors/much/unpack/CbmMuchUnpackMonitor.h b/reco/detectors/much/unpack/CbmMuchUnpackMonitor.h index 275783414618b062483858715e9620431560d47c..a9d4a01e5d4ce0471d766c26bea1e0270fe0b81a 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackMonitor.h +++ b/reco/detectors/much/unpack/CbmMuchUnpackMonitor.h @@ -17,7 +17,7 @@ #include "StsXyterMessage.h" -class CbmQaCanvas; +class TCanvas; class CbmMuchUnpackMonitor { public: @@ -59,11 +59,11 @@ public: } std::vector<std::pair<TNamed*, std::string>> GetHistoVector() { return fvpAllHistoPointers; } - void AddCanvasToVector(CbmQaCanvas* pointer, std::string sFolder = "") + void AddCanvasToVector(TCanvas* pointer, std::string sFolder = "") { - fvpAllCanvasPointers.push_back(std::pair<CbmQaCanvas*, std::string>(pointer, sFolder)); + fvpAllCanvasPointers.push_back(std::pair<TCanvas*, std::string>(pointer, sFolder)); } - std::vector<std::pair<CbmQaCanvas*, std::string>> GetCanvasVector() { return fvpAllCanvasPointers; } + std::vector<std::pair<TCanvas*, std::string>> GetCanvasVector() { return fvpAllCanvasPointers; } void SetLongDurationLimits(UInt_t uDurationSeconds, UInt_t uBinSize) { @@ -255,8 +255,8 @@ private: std::vector<std::vector<uint32_t>> fvvuNbDigisTsChan = {}; /// Canvases - std::vector<CbmQaCanvas*> fvcMuchSumm; - std::vector<CbmQaCanvas*> fvcMuchSmxErr; + std::vector<TCanvas*> fvcMuchSumm; + std::vector<TCanvas*> fvcMuchSmxErr; ///General histograms TH1* fhDigisTimeInRun = nullptr; @@ -341,7 +341,7 @@ private: /// ===> server->Register( vHistos[ uHisto ].second.data(), dynamic_cast< TH2 * >(vHistos[ uHisto ].first) ); std::vector<std::pair<TNamed*, std::string>> fvpAllHistoPointers; //! Vector of pointers to histograms + optional folder name - std::vector<std::pair<CbmQaCanvas*, std::string>> + std::vector<std::pair<TCanvas*, std::string>> fvpAllCanvasPointers; //! Vector of pointers to canvases + optional folder name CbmMuchUnpackMonitor(const CbmMuchUnpackMonitor&); diff --git a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx index 7a4b2d994f661fa17b3631a82add832c1e7b9f18..4866e0eade5d6ec3f70d2eb23cd84bbb1ecd6780 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx +++ b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx @@ -4,14 +4,13 @@ #include "CbmStsUnpackMonitor.h" -#include "CbmQaCanvas.h" - #include "MicrosliceDescriptor.hpp" #include <FairRun.h> #include <FairRunOnline.h> #include <Logger.h> +#include "TCanvas.h" #include <RtypesCore.h> #include <TFile.h> #include <TH1.h> @@ -73,18 +72,19 @@ Bool_t CbmStsUnpackMonitor::CreateHistograms(CbmMcbm2018StsPar* pUnpackPar) fhDigisTimeInRun->SetCanExtend(TH1::kAllAxes); AddHistoToVector(fhDigisTimeInRun, ""); - fhVectorSize = new TH1I("fhVectorSize", "Size of the vector VS TS index; TS index; Size [bytes]", 10, 0, 10); + fhVectorSize = new TH1I("fhStsVectorSize", "Size of the vector VS TS index; TS index; Size [bytes]", 10, 0, 10); fhVectorSize->SetCanExtend(TH1::kAllAxes); AddHistoToVector(fhVectorSize, ""); fhVectorCapacity = - new TH1I("fhVectorCapacity", "Size of the vector VS TS index; TS index; Size [bytes]", 10000, 0., 10000.); + new TH1I("fhStsVectorCapacity", "Size of the vector VS TS index; TS index; Size [bytes]", 10000, 0., 10000.); AddHistoToVector(fhVectorCapacity, ""); - fhMsCntEvo = new TH1I("fhMsCntEvo", "; MS index [s]; Counts []", 600, 0.0, 600.0); + fhMsCntEvo = new TH1I("fhStsMsCntEvo", "; MS index [s]; Counts []", 600, 0.0, 600.0); AddHistoToVector(fhMsCntEvo, ""); - fhMsErrorsEvo = new TH2I("fhMsErrorsEvo", "; MS index [s]; Error type []; Counts []", 600, 0.0, 600.0, 4, -0.5, 3.5); + fhMsErrorsEvo = + new TH2I("fhStsMsErrorsEvo", "; MS index [s]; Error type []; Counts []", 600, 0.0, 600.0, 4, -0.5, 3.5); AddHistoToVector(fhMsErrorsEvo, ""); /// Hit rates evo per FEB in system @@ -114,7 +114,7 @@ Bool_t CbmStsUnpackMonitor::CreateHistograms(CbmMcbm2018StsPar* pUnpackPar) AddHistoToVector(fhStsStatusMessType, ""); /// Timeslice counter ratio Plots - sHistName = "hRawHitRatioPerFeb"; + sHistName = "hStsRawHitRatioPerFeb"; title = "Proportion of digis over raw hits in each FEB; FEB []; digis/raw [Prct]"; fhRawHitRatioPerFeb = new TProfile(sHistName, title, uNbFebs, -0.5, uNbFebs - 0.5); AddHistoToVector(fhRawHitRatioPerFeb, ""); @@ -128,20 +128,20 @@ Bool_t CbmStsUnpackMonitor::CreateHistograms(CbmMcbm2018StsPar* pUnpackPar) /// All histos per FEB: with channels or ASIC as axis!! for (UInt_t uFebIdx = 0; uFebIdx < uNbFebs; ++uFebIdx) { /// Timeslice counter ratio Plots - sHistName = Form("hRawChRatio_%03d", uFebIdx); + sHistName = Form("hStsRawChRatio_%03d", uFebIdx); title = Form("Proportion of raw hits in each channel of FEB %2d; Channel []; Share of FEB raw msg [Prct]", uFebIdx); fvhRawChRatio.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hHitChRatio_%03d", uFebIdx); + sHistName = Form("hStsHitChRatio_%03d", uFebIdx); title = Form("Proportion of digis in each channel of FEB %2d; Channel []; Share of FEB digis [Prct]", uFebIdx); fvhHitChRatio.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hDupliChRatio_%03d", uFebIdx); + sHistName = Form("hStsDupliChRatio_%03d", uFebIdx); title = Form("Proportion of duplicates in each channel of FEB %2d; Channel []; Share of FEB duplicates [Prct]", uFebIdx); fvhDupliChRatio.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hRawHitRatioPerCh_%03d", uFebIdx); + sHistName = Form("hStsRawHitRatioPerCh_%03d", uFebIdx); title = Form("Proportion of digis over raw hits in each channel of FEB %2d; Channel []; digis/raw [Prct]", uFebIdx); fvhRawHitRatioPerCh.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hRawDupliRatioPerCh_%03d", uFebIdx); + sHistName = Form("hStsRawDupliRatioPerCh_%03d", uFebIdx); title = Form("Proportion of duplicates over raw hits in each channel of FEB %2d; Channel []; dupli/raw [Prct]", uFebIdx); fvhRawDupliRatioPerCh.push_back(new TProfile(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); @@ -281,8 +281,7 @@ Bool_t CbmStsUnpackMonitor::CreateHistograms(CbmMcbm2018StsPar* pUnpackPar) fvcStsSmxErr.resize(uNbFebs); for (UInt_t uFebIdx = 0; uFebIdx < uNbFebs; ++uFebIdx) { // if (kTRUE == fUnpackParSts->IsFebActive(uFebIdx)) { - fvcStsSumm[uFebIdx] = - new CbmQaCanvas(Form("cStsSum_%03u", uFebIdx), Form("Summary plots for FEB %03u", uFebIdx), w, h); + fvcStsSumm[uFebIdx] = new TCanvas(Form("cStsSum_%03u", uFebIdx), Form("Summary plots for FEB %03u", uFebIdx), w, h); AddCanvasToVector(fvcStsSumm[uFebIdx], "perFebCanvases"); fvcStsSumm[uFebIdx]->Divide(2, 3); @@ -298,37 +297,37 @@ void CbmStsUnpackMonitor::DrawCanvases() gPad->SetGridx(); gPad->SetGridy(); gPad->SetLogy(); - fvhStsFebChanCntRaw[uFebIdx]->DrawCopy(); + fvhStsFebChanCntRaw[uFebIdx]->Draw(); //fvcStsSumm[uFebIdx]->cd(2); //gPad->SetGridx(); //gPad->SetGridy(); //gPad->SetLogy(); - //fvhStsFebChanHitRateProf[uFebIdx]->DrawCopy("e0"); + //fvhStsFebChanHitRateProf[uFebIdx]->Draw("e0"); fvcStsSumm[uFebIdx]->cd(3); gPad->SetGridx(); gPad->SetGridy(); gPad->SetLogz(); - fvhStsFebChanAdcRaw[uFebIdx]->DrawCopy("colz"); + fvhStsFebChanAdcRaw[uFebIdx]->Draw("colz"); fvcStsSumm[uFebIdx]->cd(4); gPad->SetGridx(); gPad->SetGridy(); //gPad->SetLogy(); - fvhStsFebChanAdcRawProf[uFebIdx]->DrawCopy(); + fvhStsFebChanAdcRawProf[uFebIdx]->Draw(); fvcStsSumm[uFebIdx]->cd(5); gPad->SetGridx(); gPad->SetGridy(); gPad->SetLogz(); - fvhStsFebChanHitRateEvo[uFebIdx]->DrawCopy("colz"); + fvhStsFebChanHitRateEvo[uFebIdx]->Draw("colz"); fvcStsSumm[uFebIdx]->cd(6); gPad->SetGridx(); gPad->SetGridy(); //gPad->SetLogy(); - fvhStsFebChanMissEvt[uFebIdx]->DrawCopy("colz"); + fvhStsFebChanMissEvt[uFebIdx]->Draw("colz"); // two following two are inactive as currently adc raw and cal are the same @@ -336,27 +335,27 @@ void CbmStsUnpackMonitor::DrawCanvases() //gPad->SetGridx(); //gPad->SetGridy(); //gPad->SetLogz(); - //fvhStsFebChanAdcCal[ uFebIdx ]->DrawCopy( "colz" ); + //fvhStsFebChanAdcCal[ uFebIdx ]->Draw( "colz" ); //fvcStsSumm[ uFebIdx ]->cd(6); //gPad->SetGridx(); //gPad->SetGridy(); //gPad->SetLogy(); - //fvhStsFebChanAdcCalProf[ uFebIdx ]->DrawCopy(); + //fvhStsFebChanAdcCalProf[ uFebIdx ]->Draw(); } } Bool_t CbmStsUnpackMonitor::CreateMsComponentSizeHistos(UInt_t component) { if (nullptr == fvhMsSize[component]) { - TString sMsSizeName = Form("MsSize_link_%02u", component); + TString sMsSizeName = Form("StsMsSize_link_%02u", component); TString sMsSizeTitle = Form("Size of MS for nDPB of link %02u; Ms Size [bytes]", component); fvhMsSize[component] = new TH1F(sMsSizeName.Data(), sMsSizeTitle.Data(), 30000, 0., 30000.); fvhMsSize[component]->SetCanExtend(TH2::kAllAxes); AddHistoToVector(fvhMsSize[component], "perComponent"); } if (nullptr == fvhMsSizeTime[component]) { - TString sMsSizeName = Form("MsSizeTime_link_%02u", component); + TString sMsSizeName = Form("StsMsSizeTime_link_%02u", component); TString sMsSizeTitle = Form("Size of MS vs time for gDPB of link %02u; Time[s] ; Ms Size [bytes]", component); fvhMsSizeTime[component] = new TProfile(sMsSizeName.Data(), sMsSizeTitle.Data(), 15000, 0., 300.); fvhMsSizeTime[component]->SetCanExtend(TH2::kAllAxes); @@ -453,7 +452,7 @@ Bool_t CbmStsUnpackMonitor::CreateDebugHistograms(CbmMcbm2018StsPar* pUnpackPar) TString sHistName {""}; TString title {""}; - sHistName = "hPulserMessageType"; + sHistName = "hStsPulserMessageType"; title = "Nb of message for each type; Type"; fhStsMessType = new TH1I(sHistName, title, 6, 0., 6.); fhStsMessType->GetXaxis()->SetBinLabel(1, "Dummy"); @@ -464,7 +463,7 @@ Bool_t CbmStsUnpackMonitor::CreateDebugHistograms(CbmMcbm2018StsPar* pUnpackPar) fhStsMessType->GetXaxis()->SetBinLabel(6, "Empty"); AddHistoToVector(fhStsMessType, ""); - sHistName = "hPulserMessageTypePerDpb"; + sHistName = "hStsPulserMessageTypePerDpb"; title = "Nb of message of each type for each DPB; DPB; Type"; fhStsMessTypePerDpb = new TH2I(sHistName, title, uNrOfDpbs, 0, uNrOfDpbs, 6, 0., 6.); fhStsMessTypePerDpb->GetYaxis()->SetBinLabel(1, "Dummy"); @@ -511,37 +510,37 @@ Bool_t CbmStsUnpackMonitor::CreateDebugHistograms(CbmMcbm2018StsPar* pUnpackPar) AddHistoToVector(fhStsDpbRawTsMsbDpb, ""); /// Timeslice counter ratio Plots - sHistName = "hRawHitRatioEvoPerFeb"; + sHistName = "hStsRawHitRatioEvoPerFeb"; title = "Proportion of digis over raw hits in each FEB; Time [s]; FEB []; digis/raw [Prct]"; fhRawHitRatioEvoPerFeb = new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbFebs, -0.5, uNbFebs - 0.5); AddHistoToVector(fhRawHitRatioEvoPerFeb, ""); for (uint32_t uFebIdx = 0; uFebIdx < uNbFebs; ++uFebIdx) { - sHistName = Form("hChDupliAdc_%03d", uFebIdx); + sHistName = Form("hStsChDupliAdc_%03d", uFebIdx); title = Form("ADC in duplicate raw in each channel of FEB %2d; Channel []; ADC []", uFebIdx); fvhChDupliAdc.push_back(new TH2I(sHistName, title, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5, 32, -0.5, 31.5)); - sHistName = Form("hRawChRatioEvo_%03d", uFebIdx); + sHistName = Form("hStsRawChRatioEvo_%03d", uFebIdx); title = Form("Proportion of raw hits in each channel of FEB %2d; Time [s]; Channel []; Share of FEB raw msg [Prct]", uFebIdx); fvhRawChRatioEvo.push_back( new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hHitChRatioEvo_%03d", uFebIdx); + sHistName = Form("hStsHitChRatioEvo_%03d", uFebIdx); title = Form("Proportion of digis in each channel of FEB %2d; Time [s]; Channel []; Share of FEB digis [Prct]", uFebIdx); fvhHitChRatioEvo.push_back( new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hDupliChRatioEvo_%03d", uFebIdx); + sHistName = Form("hStsDupliChRatioEvo_%03d", uFebIdx); title = Form("Proportion of duplicates in each channel of FEB %2d; Time [s]; Channel []; Share of FEB duplicates [Prct]", uFebIdx); fvhDupliChRatioEvo.push_back( new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hRawHitRatioEvoPerCh_%03d", uFebIdx); + sHistName = Form("hStsRawHitRatioEvoPerCh_%03d", uFebIdx); title = Form("Proportion of digis over raw hits in each channel of FEB %2d; Time [s]; Channel []; digis/raw [Prct]", uFebIdx); fvhRawHitRatioEvoPerCh.push_back( new TProfile2D(sHistName, title, 600, -0.5, 599.5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - sHistName = Form("hRawDupliRatioEvoPerCh_%03d", uFebIdx); + sHistName = Form("hStsRawDupliRatioEvoPerCh_%03d", uFebIdx); title = Form("Proportion of duplicates over raw hits in each channel of FEB %2d; Time [s]; Channel []; dupli/raw [Prct]", uFebIdx); @@ -875,23 +874,28 @@ Bool_t CbmStsUnpackMonitor::Init(CbmMcbm2018StsPar* parset) CreateHistograms(parset); if (fDebugMode) CreateDebugHistograms(parset); + /// Trigger Canvas creation on all associated monitors + DrawCanvases(); + /// Obtain vector of pointers on each histo from the algo (+ optionally desired folder) std::vector<std::pair<TNamed*, std::string>> vHistos = GetHistoVector(); /// Obtain vector of pointers on each canvas from the algo (+ optionally desired folder) - std::vector<std::pair<CbmQaCanvas*, std::string>> vCanvases = GetCanvasVector(); + std::vector<std::pair<TCanvas*, std::string>> vCanvases = GetCanvasVector(); /// Register the histos and canvases in the HTTP server THttpServer* server = FairRunOnline::Instance()->GetHttpServer(); if (nullptr != server) { for (UInt_t uCanvas = 0; uCanvas < vCanvases.size(); ++uCanvas) { - server->Register(Form("/%s", vCanvases[uCanvas].second.data()), vCanvases[uCanvas].first); + server->Register(Form("/sts/%s", vCanvases[uCanvas].second.data()), vCanvases[uCanvas].first); } for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) { - server->Register(Form("/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first); + server->Register(Form("/sts/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first); } + /* server->RegisterCommand("/Reset_UnpSts_Hist", "bMcbm2018UnpackerTaskStsResetHistos=kTRUE"); server->Restrict("/Reset_UnpSts_Hist", "allow=admin"); +*/ } return kTRUE; @@ -900,13 +904,11 @@ Bool_t CbmStsUnpackMonitor::Init(CbmMcbm2018StsPar* parset) // ---- Finish ---- void CbmStsUnpackMonitor::Finish() { - DrawCanvases(); - /// Obtain vector of pointers on each histo (+ optionally desired folder) std::vector<std::pair<TNamed*, std::string>> vHistos = GetHistoVector(); /// Obtain vector of pointers on each canvas (+ optionally desired folder) - std::vector<std::pair<CbmQaCanvas*, std::string>> vCanvases = GetCanvasVector(); + std::vector<std::pair<TCanvas*, std::string>> vCanvases = GetCanvasVector(); /// Save old global file and folder pointer to avoid messing with FairRoot TFile* oldFile = gFile; diff --git a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.h b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.h index 58ae412e3f5dee0968af38b9b036478c2c2c27c0..8c9b747712862ce2b9a130fcfac2d8e4a0c4f905 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.h +++ b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.h @@ -17,7 +17,7 @@ #include "StsXyterMessage.h" -class CbmQaCanvas; +class TCanvas; class CbmStsUnpackMonitor { public: @@ -59,11 +59,11 @@ public: } std::vector<std::pair<TNamed*, std::string>> GetHistoVector() { return fvpAllHistoPointers; } - void AddCanvasToVector(CbmQaCanvas* pointer, std::string sFolder = "") + void AddCanvasToVector(TCanvas* pointer, std::string sFolder = "") { - fvpAllCanvasPointers.push_back(std::pair<CbmQaCanvas*, std::string>(pointer, sFolder)); + fvpAllCanvasPointers.push_back(std::pair<TCanvas*, std::string>(pointer, sFolder)); } - std::vector<std::pair<CbmQaCanvas*, std::string>> GetCanvasVector() { return fvpAllCanvasPointers; } + std::vector<std::pair<TCanvas*, std::string>> GetCanvasVector() { return fvpAllCanvasPointers; } void SetLongDurationLimits(UInt_t uDurationSeconds, UInt_t uBinSize) { @@ -249,8 +249,8 @@ private: std::vector<std::vector<uint32_t>> fvvuNbDigisTsChan = {}; /// Canvases - std::vector<CbmQaCanvas*> fvcStsSumm; - std::vector<CbmQaCanvas*> fvcStsSmxErr; + std::vector<TCanvas*> fvcStsSumm; + std::vector<TCanvas*> fvcStsSmxErr; ///General histograms TH1* fhDigisTimeInRun = nullptr; @@ -335,7 +335,7 @@ private: /// ===> server->Register( vHistos[ uHisto ].second.data(), dynamic_cast< TH2 * >(vHistos[ uHisto ].first) ); std::vector<std::pair<TNamed*, std::string>> fvpAllHistoPointers; //! Vector of pointers to histograms + optional folder name - std::vector<std::pair<CbmQaCanvas*, std::string>> + std::vector<std::pair<TCanvas*, std::string>> fvpAllCanvasPointers; //! Vector of pointers to canvases + optional folder name CbmStsUnpackMonitor(const CbmStsUnpackMonitor&);