Belle II Software  release-08-01-10
TOPWaveformQualityPlotterModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 // from basf2
11 #include <framework/core/HistoModule.h>
12 #include <framework/datastore/StoreArray.h>
13 #include <top/dataobjects/TOPRawWaveform.h>
14 
15 // stl
16 #include <string>
17 #include <set>
18 #include <map>
19 
20 // ROOT
21 #include "TH1F.h"
22 #include "TH2F.h"
23 #include "TProfile.h"
24 #include "TMultiGraph.h"
25 #include "TDirectory.h"
26 
27 namespace Belle2 {
39  typedef unsigned long long top_channel_id_t;
40  public:
45 
49  void defineHisto() override;
50 
54  void initialize() override;
55 
59  void event() override;
60 
65  void endRun() override;
66 
71  void drawWaveforms(const TOPRawWaveform& rawwave);
72 
77  void basicDebuggingPlots(const TOPRawWaveform& rawwave);
78 
79  private:
80  int m_iEvent = -1;
81  TH1F* m_samples = 0;
82  std::map<int, TH2F*> m_hitmap;
83  TH1F* m_scrod_id = 0;
84  TH1F* m_asic = 0;
85  TH1F* m_carrier = 0;
86  TH1F* m_asic_ch = 0;
87  TH1F* m_errorFlag = 0;
88  TH1F* m_asic_win = 0;
89  TH1F* m_entries = 0;
90  TH1F* m_moduleID = 0;
91  TH1F* m_pixelID = 0;
94  std::map<top_channel_id_t, TH1F*> m_channelNoiseMap;
95  std::map<top_channel_id_t, int> m_channelEventMap;
97  std::map<int, std::map<std::string, TMultiGraph*>> m_channels;
98  std::map<int, std::map<std::string, std::set<int>>> m_channelLabels;
100  std::map<int, std::map<int, std::map<int, std::map<int, TProfile*>>>> m_waveformHists;
102  bool m_DRAWWAVES = true;
103  bool m_DEBUGGING = true;
104  bool m_NOISE = false;
107  TDirectory* m_directory = 0;
109  };
110 
112 }
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Class to store raw data waveforms.
Plots and histograms of waveforms and feature extracted parameters.
unsigned long long top_channel_id_t
topcaf channel ID (deprecated?)
std::map< int, std::map< std::string, TMultiGraph * > > m_channels
per board stack, per asic
std::map< top_channel_id_t, int > m_channelEventMap
to find in which chunk a given channel is
TH1F * m_asic_ch
plot of ASIC channel ID debugging
std::map< int, std::map< int, std::map< int, std::map< int, TProfile * > > > > m_waveformHists
scrod, carrier, asic, channel
int m_iEvent
keeps track of iterations within run
TH1F * m_pixelID
plot of pixel ID for debugging
std::string m_histogramDirectoryName
the name of the directory inside the output file
std::map< int, TH2F * > m_hitmap
hitmaps for each SCROD
std::map< top_channel_id_t, TH1F * > m_channelNoiseMap
histogram of the values after correction
TH1F * m_carrier
plot of carrier IDs for debugging
StoreArray< TOPRawWaveform > m_waveform
the raw waveforms
std::map< int, std::map< std::string, std::set< int > > > m_channelLabels
per board stack, per asic
TH1F * m_errorFlag
plot of error flag (not impemented)
TH1F * m_scrod_id
plot of SCROD IDs for debugging
TH1F * m_asic
plot of ASIC number for debugging
void initialize() override
Module initialization, calls defineHisto and gets waveform.
void basicDebuggingPlots(const TOPRawWaveform &rawwave)
Fills the debugging 1D histograms and hitmaps.
void drawWaveforms(const TOPRawWaveform &rawwave)
Draws the full waveforms onto the TProfiles.
void defineHisto() override
Books the empty histograms.
Abstract base class for different kinds of events.