9#include "svd/modules/svdDQM/SVDUnpackerDQMModule.h"
10#include <svd/online/SVDOnlineToOfflineMap.h>
12#include <framework/datastore/StoreObjPtr.h>
13#include <framework/datastore/StoreArray.h>
15#include <svd/dataobjects/SVDDAQDiagnostic.h>
17#include <TDirectory.h>
46 std::string(
"SVDUnpacker"));
54SVDUnpackerDQMModule::~SVDUnpackerDQMModule()
66 TDirectory* oldDir = gDirectory;
72 const unsigned short Bins_FTBFlags = 5;
73 const unsigned short Bins_FTBError = 4;
74 const unsigned short Bins_APVError = 4;
75 const unsigned short Bins_APVMatch = 1;
76 const unsigned short Bins_FADCMatch = 1;
77 const unsigned short Bins_UpsetAPV = 1;
78 const unsigned short Bins_BadMapping = 1;
79 const unsigned short Bins_BadHeader = 1;
80 const unsigned short Bins_MissedTrailer = 1;
81 const unsigned short Bins_MissedHeader = 1;
82 const unsigned short Bins_SEURecoData = 1;
85 const unsigned short nBins = Bins_FTBFlags + Bins_FTBError + Bins_APVError + Bins_APVMatch + Bins_FADCMatch + Bins_UpsetAPV +
86 Bins_BadMapping + Bins_BadHeader + Bins_MissedTrailer + Bins_MissedHeader + Bins_SEURecoData;
88 m_DQMUnpackerHisto =
new TH2F(
"DQMUnpackerHisto",
"SVD Data Format Monitor", nBins, 1, nBins + 1, 52, 1, 53);
91 m_DQMnSamplesHisto =
new TH2F(
"DQMnSamplesHisto",
"nAPVsamples VS DAQMode", 3, 1, 4, 2, 1, 3);
92 m_DQMnSamplesHisto2 =
new TH2F(
"DQMnSamplesHisto2",
"nAPVsamples VS DAQMode", 2, 1, 3, 2, 1, 3);
93 m_DQMtrgQuality =
new TH2F(
"DQMtrgQuality",
"nAPVsamples VS trgQuality", 4, 1, 5, 2, 1, 3);
96 "SVD SEU (errAPV or errDET or errSYNC) detected on Sensors for the @view/@side");
119 TString Xlabels[nBins] = {
"EvTooLong",
"TimeOut",
"doubleHead",
"badEvt",
"errCRC",
"badFADC",
"badTTD",
"badFTB",
"badALL",
"errAPV",
"errDET",
"errFrame",
"errFIFO",
"APVmatch",
"FADCmatch",
"errSYNC",
"EVTmatch",
"missHead",
"missTrail",
"badMapping",
"SEURecovery"};
121 TString Ysamples[2] = {
"3",
"6"};
122 TString Xsamples[3] = {
"3 samples",
"6 samples",
"3/6 mixed"};
124 TString Xquality[4] = {
"coarse",
"fine",
"super fine",
"no TRGSummary"};
127 for (
unsigned short i = 0; i < nBins; i++)
m_DQMUnpackerHisto->GetXaxis()->SetBinLabel(i + 1, Xlabels[i].Data());
130 for (
unsigned short i = 0; i < 3; i++)
m_DQMnSamplesHisto->GetXaxis()->SetBinLabel(i + 1, Xsamples[i].Data());
131 for (
unsigned short i = 0; i < 2; i++)
m_DQMnSamplesHisto2->GetXaxis()->SetBinLabel(i + 1, Xsamples[i].Data());
133 for (
unsigned short i = 0; i < 2; i++)
m_DQMnSamplesHisto->GetYaxis()->SetBinLabel(i + 1, Ysamples[i].Data());
134 for (
unsigned short i = 0; i < 2; i++)
m_DQMnSamplesHisto2->GetYaxis()->SetBinLabel(i + 1, Ysamples[i].Data());
137 for (
unsigned short i = 0; i < 4; i++)
m_DQMtrgQuality->GetXaxis()->SetBinLabel(i + 1, Xquality[i].Data());
138 for (
unsigned short i = 0; i < 2; i++)
m_DQMtrgQuality->GetYaxis()->SetBinLabel(i + 1, Ysamples[i].Data());
174 Int_t pos = tmp.Last(
'~');
175 if (pos == -1) pos = tmp.Length() + 2;
176 TString title = tmp(0, pos - 2);
183 Int_t pos = tmp.Last(
'~');
184 if (pos == -1) pos = tmp.Length() + 2;
185 TString title = tmp(0, pos - 2);
192 Int_t pos = tmp.Last(
'~');
193 if (pos == -1) pos = tmp.Length() + 2;
194 TString title = tmp(0, pos - 2);
201 Int_t pos = tmp.Last(
'~');
202 if (pos == -1) pos = tmp.Length() + 2;
203 TString title = tmp(0, pos - 2);
210 Int_t pos = tmp.Last(
'~');
211 if (pos == -1) pos = tmp.Length() + 2;
212 TString title = tmp(0, pos - 2);
219 Int_t pos = tmp.Last(
'~');
220 if (pos == -1) pos = tmp.Length() + 2;
221 TString title = tmp(0, pos - 2);
239 unsigned short ifadc = 0;
254 B2WARNING(
"There are no SVDDAQDiagnostic objects saved by the Unpacker! SVD Data Format Monitoring disabled!");
261 B2WARNING(
"There is no SVDEventInfo object saved by the Unpacker! SVD Data Format Monitoring disabled!");
291 unsigned short bin_no = 0;
292 gStyle->SetOptStat(0);
294 for (
unsigned short i = 0; i < nDiagnostics; i++) {
341 bool side = theVxdInfo.
m_uSide;
403 TString histoErrorTitle = TString::Format(
"SVD Events with errors, Exp %d Run %d",
m_expNumber,
m_runNumber);
412 TString histoSEURecoFADCsTitle = TString::Format(
"Number of FADCs with Empty Data (SEURecovery) per Event, Exp %d Run %d",
427 B2WARNING(
"=================== SVD DQM Data Format Statistics: =============");
430 B2WARNING(
"=================================================================");
HistoModule()
Constructor.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
class to summarize SVD quantities per sensor and side
TH1F * m_DQMSeuRecoveryFADCsEventHisto
TH1F histogram showing the number of FADC with SEU recoveries per event.
unsigned int m_nBadEvents
counter of events with any kind of error
void initialize() override final
Module function initialize.
TH2F * m_DQMnSamplesHisto2
TH2F histogram showing number of samples in data VS daqMode (2bins only)
int m_runNumber
run number
bool m_badTrailer
bad trailer error
unsigned short m_apvNo
apv number
bool m_seuEvent
indicates if the particular event is SEU case
unsigned int m_nEvents
event counter
bool m_seuRecoData
special SEU recovery data
StoreObjPtr< SVDEventInfo > m_svdEventInfo
SVDEventInfo StoreObjectPointer.
bool m_missedHeader
missed Header error
bool m_shutUpNoData
shut up if no data comes
TH2F * m_DQMUnpackerHisto
TH2F histogram with Unpacking errors.
std::string m_SVDDAQDiagnosticsName
SVD diagnostics module name.
SVDUnpackerDQMModule()
Constructor.
int m_expNumber
experiment number
StoreArray< SVDDAQDiagnostic > m_svdDAQDiagnostics
SVDDAQDiagnostic StoreArray.
std::vector< unsigned short > m_vec_fadc
vector of FADC boards
std::unordered_map< unsigned short, unsigned short > m_fadc_map
FADC board number map.
void defineHisto() override final
Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
DBObjPtr< PayloadFile > m_mapping
channel map payload
float m_errorFraction
fraction of events with any kind of error
TH2F * m_DQMnSamplesHisto
TH2F histogram showing number of samples in data VS daqMode.
bool m_seuRecoEvent
indicates if the particular event is SEU recovery case
StoreObjPtr< EventMetaData > m_eventMetaData
EvtMetaData StoreObjectPointer.
static std::string m_xmlFileName
xml filename
bool m_badHeader
bad header error
bool m_upsetAPV
upset APV error
void event() override final
Module function event.
StoreObjPtr< TRGSummary > m_objTrgSummary
Trigger Summary data object.
std::string m_histogramDirectoryName
Name of the histogram directory in ROOT file.
bool m_missedTrailer
missed Trailer error
std::unordered_set< unsigned char > * m_FADCs
FADC boards number.
TH2F * m_DQMtrgQuality
TH2F histogram showing number of samples in data VS Trigger Quality.
void endRun() override final
Module function endRun.
bool m_badMapping
bad mapping error
uint16_t m_apvError
APV error container.
std::string m_SVDEventInfoName
SVDEventInfo name.
unsigned short m_fadcNo
fadc number
bool m_fadcMatch
fadcc match error
std::unordered_set< unsigned char > m_seuFADCs
FADC numbers affected by SEU.
void beginRun() override final
Module function beginRun.
bool m_badEvent
indicates if the particular event has any SVD error
SVDSummaryPlots * m_SEUonSensors
histogram showing SEU Reco events for given sensor
std::unique_ptr< SVDOnlineToOfflineMap > m_map
mapping implementation
TH1F * m_DQMErrorEventsHisto
TH1F histogram showing the events affected by errors.
uint16_t m_ftbError
FTB error container.
uint16_t m_ftbFlags
FTB flags container.
bool m_changeFADCaxis
change FADC (y) axis
bool m_apvMatch
apv match error
Type-safe access to single objects in the data store.
unsigned short baseType
The base integer type for VxdID.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.
Struct to hold data about a sensor.
bool m_uSide
True if u-side of the sensor.
VxdID m_sensorID
Sensor ID.