Belle II Software development
ROIDQMModule.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
9#pragma once
10
11#include <framework/core/HistoModule.h>
12#include <framework/datastore/StoreArray.h>
13
14#include <vxd/geometry/GeoCache.h>
15
16#include <TH1.h>
17#include <TH1F.h>
18
19#include <unordered_map>
20#include <utility>
21#include <functional>
22
23namespace Belle2 {
28 class PXDDigit;
29 class ROIid;
30 class PXDIntercept;
31
36 class ROIDQMModule : public HistoModule {
37
38 public:
39
41
42 private:
47 std::string m_PXDDigitsName;
51 std::string m_ROIsName;
52 std::string m_InterceptsName;
54 TDirectory* m_InterDir;
55 TDirectory* m_ROIDir;
58 typedef std::pair< TH1*, std::function< void(TH1*, const PXDIntercept*) > > InterHistoAndFill;
60 std::unordered_multimap<Belle2::VxdID, InterHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > m_hInterDictionary;
61
63 typedef std::pair< TH1*, std::function< void(TH1*, const ROIid*) > > ROIHistoAndFill;
65 std::unordered_multimap<Belle2::VxdID, ROIHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > m_hROIDictionary;
66
69 TH1* hPtr;
70 std::function< void (const ROIid*, double&) > accumulate;
71 std::function< void (TH1*, double&) > fill;
72 double value;
73 };
75 std::unordered_multimap<Belle2::VxdID, ROIHistoAccumulateAndFill&, std::function<size_t (const Belle2::VxdID&) > >
77
79 void fillSensorROIHistos(const ROIid* roi);
80 void fillSensorInterHistos(const PXDIntercept* inter);
84 TH1F* m_hnROIs;
85 TH1F* m_hnInter;
86 TH1F* m_harea;
92 void initialize(void) override final;
93
97 void event(void) override final;
98
102 void terminate(void) override final;
103
104 void defineHisto() override final;
106 };//end class declaration
107
109} // end namespace Belle2
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
Definition: PXDIntercept.h:22
The HLT ROI DQM module.
Definition: ROIDQMModule.h:36
void terminate(void) override final
This method is called at the end of the event processing.
int m_numModules
number of modules
Definition: ROIDQMModule.h:82
StoreArray< PXDIntercept > m_pxdIntercept
the PXDIntercepts dataobjects collection
Definition: ROIDQMModule.h:45
std::string m_InterceptsName
Name of the PXDIntercept StoreArray.
Definition: ROIDQMModule.h:52
VXD::GeoCache & m_aGeometry
the geometry
Definition: ROIDQMModule.h:49
TDirectory * m_ROIDir
ROI directory in the root file.
Definition: ROIDQMModule.h:55
void fillSensorInterHistos(const PXDIntercept *inter)
fill histograms per sensor, filled once per intercept
void createHistosDictionaries()
create the dictionary
void initialize(void) override final
Initializer.
Definition: ROIDQMModule.cc:84
void fillSensorROIHistos(const ROIid *roi)
fill histograms per sensor, filled once per ROI
std::unordered_multimap< Belle2::VxdID, ROIHistoAndFill, std::function< size_t(const Belle2::VxdID &)> > m_hROIDictionary
map of histograms to be filled once per roi
Definition: ROIDQMModule.h:65
void defineHisto() override final
define histograms
Definition: ROIDQMModule.cc:58
std::pair< TH1 *, std::function< void(TH1 *, const PXDIntercept *) > > InterHistoAndFill
typedef: histograms to be filled once per intercept + filling function
Definition: ROIDQMModule.h:58
TH1F * m_harea
ROis area.
Definition: ROIDQMModule.h:86
std::pair< TH1 *, std::function< void(TH1 *, const ROIid *) > > ROIHistoAndFill
typedef: histograms to be filled once per roi + filling function
Definition: ROIDQMModule.h:63
TH1F * m_hnROIs
number of ROIs
Definition: ROIDQMModule.h:84
std::string m_ROIsName
Name of the ROIid StoreArray.
Definition: ROIDQMModule.h:51
StoreArray< ROIid > m_roiIDs
the ROIids dataobjects collection
Definition: ROIDQMModule.h:44
TH1F * m_hredFactor
reduction factor
Definition: ROIDQMModule.h:87
std::unordered_multimap< Belle2::VxdID, InterHistoAndFill, std::function< size_t(const Belle2::VxdID &)> > m_hInterDictionary
map of histograms to be filled once per intercept
Definition: ROIDQMModule.h:60
TDirectory * m_InterDir
intercepts directory in the root file
Definition: ROIDQMModule.h:54
std::string m_PXDDigitsName
digit list name
Definition: ROIDQMModule.h:47
std::unordered_multimap< Belle2::VxdID, ROIHistoAccumulateAndFill &, std::function< size_t(const Belle2::VxdID &) > > m_hROIDictionaryEvt
map of histograms to be filled once per event
Definition: ROIDQMModule.h:76
TH1F * m_hnInter
number of intercpets
Definition: ROIDQMModule.h:85
StoreArray< PXDDigit > m_pxdDigits
the PXDDigits dataobjects collection
Definition: ROIDQMModule.h:43
void event(void) override final
This method is called for each event.
Definition: ROIDQMModule.cc:94
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
Definition: ROIid.h:25
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.
struct: histograms to be filled once per event + filling fucntion + accumulate function
Definition: ROIDQMModule.h:68
std::function< void(const ROIid *, double &) > accumulate
accumulate function
Definition: ROIDQMModule.h:70
std::function< void(TH1 *, double &) > fill
fill function
Definition: ROIDQMModule.h:71