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
40 ROIDQMModule();
41
42 private:
46
47 std::string m_PXDDigitsName;
48
50
51 std::string m_ROIsName;
52 std::string m_InterceptsName;
53
54 TDirectory* m_InterDir;
55 TDirectory* m_ROIDir;
56
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 };
74
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);
81
83
84 TH1F* m_hnROIs;
85 TH1F* m_hnInter;
86 TH1F* m_harea;
88
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;
105
106 };//end class declaration
107
109} // end namespace Belle2
HistoModule()
Constructor.
Definition HistoModule.h:32
The PXD digit class.
Definition PXDDigit.h:27
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
void terminate(void) override final
This method is called at the end of the event processing.
int m_numModules
number of modules
StoreArray< PXDIntercept > m_pxdIntercept
the PXDIntercepts dataobjects collection
std::string m_InterceptsName
Name of the PXDIntercept StoreArray.
VXD::GeoCache & m_aGeometry
the geometry
TDirectory * m_ROIDir
ROI directory in the root file.
void fillSensorInterHistos(const PXDIntercept *inter)
fill histograms per sensor, filled once per intercept
void createHistosDictionaries()
create the dictionary
void initialize(void) override final
Initializer.
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
void defineHisto() override final
define histograms
std::pair< TH1 *, std::function< void(TH1 *, const PXDIntercept *) > > InterHistoAndFill
typedef: histograms to be filled once per intercept + filling function
TH1F * m_harea
ROis area.
std::pair< TH1 *, std::function< void(TH1 *, const ROIid *) > > ROIHistoAndFill
typedef: histograms to be filled once per roi + filling function
TH1F * m_hnROIs
number of ROIs
std::string m_ROIsName
Name of the ROIid StoreArray.
StoreArray< ROIid > m_roiIDs
the ROIids dataobjects collection
TH1F * m_hredFactor
reduction factor
std::unordered_multimap< Belle2::VxdID, InterHistoAndFill, std::function< size_t(const Belle2::VxdID &)> > m_hInterDictionary
map of histograms to be filled once per intercept
TDirectory * m_InterDir
intercepts directory in the root file
std::string m_PXDDigitsName
digit list name
std::unordered_multimap< Belle2::VxdID, ROIHistoAccumulateAndFill &, std::function< size_t(const Belle2::VxdID &) > > m_hROIDictionaryEvt
map of histograms to be filled once per event
TH1F * m_hnInter
number of intercepts
StoreArray< PXDDigit > m_pxdDigits
the PXDDigits dataobjects collection
void event(void) override final
This method is called for each event.
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 facilitate easy access to sensor information of the VXD like coordinate transformations or p...
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 function + accumulate function
std::function< void(const ROIid *, double &) > accumulate
accumulate function
std::function< void(TH1 *, double &) > fill
fill function