Belle II Software  release-05-02-19
SVDDQMDoseModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2021 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Ludovico Massaccesi *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/core/HistoModule.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/datastore/StoreObjPtr.h>
16 #include <TH1.h>
17 #include <TH2.h>
18 #include <string>
19 #include <vector>
20 #include <functional>
21 
22 namespace Belle2 {
27  // Forward declarations to avoid the need of #includes here in the header
28  class RawFTSW;
29  class SVDShaperDigit;
30  class TRGSummary;
31  class VxdID;
32  // class SVDFADCMaskedStrips;
33 
34  namespace SVD {
46  class SVDDQMDoseModule : public HistoModule {
47  public:
49  enum EEventType {
50  c_HERInjection = 1,
51  c_LERInjection = 2,
52  c_NoInjection = 4
53  };
54 
57  void initialize() override final;
58  void beginRun() override final;
59  void event() override final;
60  void defineHisto() override final;
62  private:
64  typedef struct SensorGroup {
66  const char* nameSuffix;
68  const char* titleSuffix;
70  int nBins;
72  double xMin;
74  double xMax;
76  std::function<bool(const VxdID&)> contains;
78  mutable int nStripsU = 0;
79  } SensorGroup;
80 
81  // Steerable data members (parameters)
82  unsigned int m_eventFilter;
83  std::string m_histogramDirectoryName;
84  std::string m_SVDShaperDigitsName;
85  double m_noInjectionTime;
86  std::vector<int> m_trgTypes;
88  // Inputs
93  // Outputs (histograms)
95  TH2F* h_nEvtsVsTime = nullptr;
97  std::vector<TH2F*> m_groupNHitsU;
99  std::vector<TH1F*> m_groupOccupanciesU;
101  TH1F* h_nEvtsVsTime1 = nullptr;
103  std::vector<TH1F*> m_groupNHits1U;
105  TH2F* h_bunchNumVsNHits = nullptr;
106 
107  // Other stuff
116  static constexpr double c_revolutionTime = 5120.0 / 508.0;
129  static constexpr double c_globalClock = 127.0;
130 
132  static constexpr double c_defaultOccuMin = 0.0;
137  static const int c_defaultNBins = 90;
149  static constexpr double c_defaultOccuMax = 100.0 / 1536.0 * c_defaultNBins;
150 
152  static const std::vector<SensorGroup> c_sensorGroups;
153  };
154  }
156 }
Belle2::SVD::SVDDQMDoseModule::m_trgSummary
StoreObjPtr< TRGSummary > m_trgSummary
Input: trigger type.
Definition: SVDDQMDoseModule.h:99
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::SVD::SVDDQMDoseModule::SVDDQMDoseModule
SVDDQMDoseModule()
Default constructor, defines parameters.
Definition: SVDDQMDoseModule.cc:32
Belle2::SVD::SVDDQMDoseModule::EEventType
EEventType
Bits definition for the bitmask that selects the events to put in the histograms.
Definition: SVDDQMDoseModule.h:57
Belle2::SVD::SVDDQMDoseModule::m_noInjectionTime
double m_noInjectionTime
After this time (in microseconds) from last injection the event falls in the "No Injection" category.
Definition: SVDDQMDoseModule.h:93
Belle2::SVD::SVDDQMDoseModule::m_groupNHits1U
std::vector< TH1F * > m_groupNHits1U
Hists of the number of hits in each time bin (1D) per sensor group, U-side.
Definition: SVDDQMDoseModule.h:111
Belle2::SVD::SVDDQMDoseModule::m_groupNHitsU
std::vector< TH2F * > m_groupNHitsU
Hists of the number of hits in each time bin per sensor group, U-side.
Definition: SVDDQMDoseModule.h:105
Belle2::SVD::SVDDQMDoseModule::m_histogramDirectoryName
std::string m_histogramDirectoryName
Name of the histograms' directory in the ROOT file.
Definition: SVDDQMDoseModule.h:91
Belle2::SVD::SVDDQMDoseModule::m_digits
StoreArray< SVDShaperDigit > m_digits
Input: raw hits.
Definition: SVDDQMDoseModule.h:98
Belle2::SVD::SVDDQMDoseModule::c_globalClock
static constexpr double c_globalClock
Approximated global clock frequency in MHz.
Definition: SVDDQMDoseModule.h:137
Belle2::SVD::SVDDQMDoseModule::h_nEvtsVsTime
TH2F * h_nEvtsVsTime
Hist of the total evts in each time bin (time since inj.
Definition: SVDDQMDoseModule.h:103
Belle2::SVD::SVDDQMDoseModule::SensorGroup
A struct to define non-trivial histograms in a human-readable way.
Definition: SVDDQMDoseModule.h:72
Belle2::SVD::SVDDQMDoseModule::c_defaultOccuMin
static constexpr double c_defaultOccuMin
Default minimum of the instantaneous occupancy histograms.
Definition: SVDDQMDoseModule.h:140
Belle2::SVD::SVDDQMDoseModule::m_SVDShaperDigitsName
std::string m_SVDShaperDigitsName
Name of the StoreArray of SVDShaperDigit to use.
Definition: SVDDQMDoseModule.h:92
Belle2::SVD::SVDDQMDoseModule::m_eventFilter
unsigned int m_eventFilter
Bitmask for event type selection, see EEventType .
Definition: SVDDQMDoseModule.h:90
Belle2::SVD::SVDDQMDoseModule::defineHisto
void defineHisto() override final
Overrides HistoModule::defineHisto.
Definition: SVDDQMDoseModule.cc:58
Belle2::SVD::SVDDQMDoseModule::c_revolutionTime
static constexpr double c_revolutionTime
Beam revolution time in microseconds (approximated).
Definition: SVDDQMDoseModule.h:124
Belle2::SVD::SVDDQMDoseModule::c_sensorGroups
static const std::vector< SensorGroup > c_sensorGroups
List of interesting groups of sensors to average over.
Definition: SVDDQMDoseModule.h:160
Belle2::SVD::SVDDQMDoseModule::SensorGroup
struct Belle2::SVD::SVDDQMDoseModule::SensorGroup SensorGroup
A struct to define non-trivial histograms in a human-readable way.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::SVD::SVDDQMDoseModule::h_bunchNumVsNHits
TH2F * h_bunchNumVsNHits
Hist of bunch number vs number of fired strips (copied from SVDDQMInjection).
Definition: SVDDQMDoseModule.h:113
Belle2::SVD::SVDDQMDoseModule::m_trgTypes
std::vector< int > m_trgTypes
Trigger types to accept (all if the vector is empty).
Definition: SVDDQMDoseModule.h:94
Belle2::SVD::SVDDQMDoseModule::c_defaultNBins
static const int c_defaultNBins
Default number of bins of the instantaneous occupancy histograms.
Definition: SVDDQMDoseModule.h:145
Belle2::SVD::SVDDQMDoseModule::c_defaultOccuMax
static constexpr double c_defaultOccuMax
Default maximum of the instantaneous occupancy histograms.
Definition: SVDDQMDoseModule.h:157
Belle2::SVD::SVDDQMDoseModule::event
void event() override final
Overrides HistoModule::event.
Definition: SVDDQMDoseModule.cc:166
Belle2::SVD::SVDDQMDoseModule::m_groupOccupanciesU
std::vector< TH1F * > m_groupOccupanciesU
Hists of the instantaneous occupancy per sensor group (see c_sensorGroups), U-side.
Definition: SVDDQMDoseModule.h:107
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::SVD::SVDDQMDoseModule::beginRun
void beginRun() override final
Overrides HistoModule::beginRun.
Definition: SVDDQMDoseModule.cc:153
Belle2::SVD::SVDDQMDoseModule::m_rawTTD
StoreArray< RawFTSW > m_rawTTD
Input: DAQ status.
Definition: SVDDQMDoseModule.h:97
Belle2::SVD::SVDDQMDoseModule::h_nEvtsVsTime1
TH1F * h_nEvtsVsTime1
Hist of the total evts in each time bin (1D, time since inj.
Definition: SVDDQMDoseModule.h:109
Belle2::SVD::SVDDQMDoseModule::initialize
void initialize() override final
Overrides HistoModule::initialize.
Definition: SVDDQMDoseModule.cc:123