Belle II Software  release-05-02-19
TOPWaveformQualityPlotterModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jan Strube *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 // from basf2
13 #include <framework/core/HistoModule.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <top/dataobjects/TOPRawWaveform.h>
16 
17 // stl
18 #include <string>
19 #include <set>
20 #include <map>
21 
22 // ROOT
23 #include "TH1F.h"
24 #include "TH2F.h"
25 #include "TProfile.h"
26 #include "TMultiGraph.h"
27 #include "TDirectory.h"
28 
29 namespace Belle2 {
40  class TOPWaveformQualityPlotterModule : public HistoModule {
41  typedef unsigned long long top_channel_id_t;
42  public:
47 
51  void defineHisto() override;
52 
56  void initialize() override;
57 
61  void event() override;
62 
67  void endRun() override;
68 
73  void drawWaveforms(const TOPRawWaveform& rawwave);
74 
79  void basicDebuggingPlots(const TOPRawWaveform& rawwave);
80 
81  private:
82  int m_iEvent = -1;
83  TH1F* m_samples = 0;
84  std::map<int, TH2F*> m_hitmap;
85  TH1F* m_scrod_id = 0;
86  TH1F* m_asic = 0;
87  TH1F* m_carrier = 0;
88  TH1F* m_asic_ch = 0;
89  TH1F* m_errorFlag = 0;
90  TH1F* m_asic_win = 0;
91  TH1F* m_entries = 0;
92  TH1F* m_moduleID = 0;
93  TH1F* m_pixelID = 0;
96  std::map<top_channel_id_t, TH1F*> m_channelNoiseMap;
97  std::map<top_channel_id_t, int> m_channelEventMap;
99  std::map<int, std::map<std::string, TMultiGraph*>> m_channels;
100  std::map<int, std::map<std::string, std::set<int>>> m_channelLabels;
102  std::map<int, std::map<int, std::map<int, std::map<int, TProfile*>>>> m_waveformHists;
104  bool m_DRAWWAVES = true;
105  bool m_DEBUGGING = true;
106  bool m_NOISE = false;
109  TDirectory* m_directory = 0;
111  };
112 
114 }
Belle2::TOPWaveformQualityPlotterModule::m_directory
TDirectory * m_directory
the directory itself
Definition: TOPWaveformQualityPlotterModule.h:117
Belle2::TOPWaveformQualityPlotterModule::m_asic
TH1F * m_asic
plot of ASIC number for debugging
Definition: TOPWaveformQualityPlotterModule.h:94
Belle2::TOPWaveformQualityPlotterModule::m_entries
TH1F * m_entries
plot of waveform size
Definition: TOPWaveformQualityPlotterModule.h:99
Belle2::TOPWaveformQualityPlotterModule::m_iEvent
int m_iEvent
keeps track of iterations within run
Definition: TOPWaveformQualityPlotterModule.h:90
Belle2::TOPWaveformQualityPlotterModule::m_errorFlag
TH1F * m_errorFlag
plot of error flag (not impemented)
Definition: TOPWaveformQualityPlotterModule.h:97
Belle2::TOPWaveformQualityPlotterModule::event
void event() override
Event processor.
Definition: TOPWaveformQualityPlotterModule.cc:139
Belle2::TOPWaveformQualityPlotterModule::top_channel_id_t
unsigned long long top_channel_id_t
topcaf channel ID (deprecated?)
Definition: TOPWaveformQualityPlotterModule.h:49
Belle2::TOPWaveformQualityPlotterModule::m_asic_ch
TH1F * m_asic_ch
plot of ASIC channel ID debugging
Definition: TOPWaveformQualityPlotterModule.h:96
Belle2::TOPWaveformQualityPlotterModule::m_samples
TH1F * m_samples
plot of ADC sample values
Definition: TOPWaveformQualityPlotterModule.h:91
Belle2::TOPWaveformQualityPlotterModule::m_DEBUGGING
bool m_DEBUGGING
option to fill debug histograms
Definition: TOPWaveformQualityPlotterModule.h:113
Belle2::TOPWaveformQualityPlotterModule::m_NOISE
bool m_NOISE
option to draw noisemaps
Definition: TOPWaveformQualityPlotterModule.h:114
Belle2::TOPWaveformQualityPlotterModule::endRun
void endRun() override
End-of-run action.
Definition: TOPWaveformQualityPlotterModule.cc:175
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TOPWaveformQualityPlotterModule::basicDebuggingPlots
void basicDebuggingPlots(const TOPRawWaveform &rawwave)
Fills the debugging 1D histograms and hitmaps.
Definition: TOPWaveformQualityPlotterModule.cc:75
Belle2::TOPWaveformQualityPlotterModule::m_waveformHists
std::map< int, std::map< int, std::map< int, std::map< int, TProfile * > > > > m_waveformHists
scrod, carrier, asic, channel
Definition: TOPWaveformQualityPlotterModule.h:110
Belle2::TOPWaveformQualityPlotterModule::m_channelLabels
std::map< int, std::map< std::string, std::set< int > > > m_channelLabels
per board stack, per asic
Definition: TOPWaveformQualityPlotterModule.h:108
Belle2::TOPWaveformQualityPlotterModule::m_pixelID
TH1F * m_pixelID
plot of pixel ID for debugging
Definition: TOPWaveformQualityPlotterModule.h:101
Belle2::TOPWaveformQualityPlotterModule::m_scrod_id
TH1F * m_scrod_id
plot of SCROD IDs for debugging
Definition: TOPWaveformQualityPlotterModule.h:93
Belle2::TOPWaveformQualityPlotterModule::m_asic_win
TH1F * m_asic_win
plot of ASIC storage window
Definition: TOPWaveformQualityPlotterModule.h:98
Belle2::TOPWaveformQualityPlotterModule::initialize
void initialize() override
Module initialization, calls defineHisto and gets waveform.
Definition: TOPWaveformQualityPlotterModule.cc:66
Belle2::TOPWaveformQualityPlotterModule::defineHisto
void defineHisto() override
Books the empty histograms.
Definition: TOPWaveformQualityPlotterModule.cc:45
Belle2::TOPWaveformQualityPlotterModule::m_hitmap
std::map< int, TH2F * > m_hitmap
hitmaps for each SCROD
Definition: TOPWaveformQualityPlotterModule.h:92
Belle2::TOPWaveformQualityPlotterModule::m_moduleID
TH1F * m_moduleID
plot of module ID
Definition: TOPWaveformQualityPlotterModule.h:100
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TOPWaveformQualityPlotterModule::m_channels
std::map< int, std::map< std::string, TMultiGraph * > > m_channels
per board stack, per asic
Definition: TOPWaveformQualityPlotterModule.h:107
Belle2::TOPWaveformQualityPlotterModule::m_carrier
TH1F * m_carrier
plot of carrier IDs for debugging
Definition: TOPWaveformQualityPlotterModule.h:95
Belle2::TOPWaveformQualityPlotterModule::m_channelNoiseMap
std::map< top_channel_id_t, TH1F * > m_channelNoiseMap
histogram of the values after correction
Definition: TOPWaveformQualityPlotterModule.h:104
Belle2::TOPWaveformQualityPlotterModule::drawWaveforms
void drawWaveforms(const TOPRawWaveform &rawwave)
Draws the full waveforms onto the TProfiles.
Definition: TOPWaveformQualityPlotterModule.cc:105
Belle2::TOPWaveformQualityPlotterModule::m_waveform
StoreArray< TOPRawWaveform > m_waveform
the raw waveforms
Definition: TOPWaveformQualityPlotterModule.h:103
Belle2::TOPWaveformQualityPlotterModule::m_channelEventMap
std::map< top_channel_id_t, int > m_channelEventMap
to find in which chunk a given channel is
Definition: TOPWaveformQualityPlotterModule.h:105
Belle2::TOPWaveformQualityPlotterModule::TOPWaveformQualityPlotterModule
TOPWaveformQualityPlotterModule()
Constructor.
Definition: TOPWaveformQualityPlotterModule.cc:33
Belle2::TOPWaveformQualityPlotterModule::m_DRAWWAVES
bool m_DRAWWAVES
option to draw waveforms
Definition: TOPWaveformQualityPlotterModule.h:112
Belle2::TOPWaveformQualityPlotterModule::m_histogramDirectoryName
std::string m_histogramDirectoryName
the name of the directory inside the output file
Definition: TOPWaveformQualityPlotterModule.h:116