Belle II Software prerelease-10-00-00a
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
39 class ROIDQMModule : public HistoModule {
40
41 public:
42
43 ROIDQMModule();
44
45 private:
49
50 std::string m_PXDDigitsName;
51
53
54 std::string m_ROIsName;
55 std::string m_InterceptsName;
56
57 TDirectory* m_InterDir;
58 TDirectory* m_ROIDir;
59
61 typedef std::pair< TH1*, std::function< void(TH1*, const PXDIntercept*) > > InterHistoAndFill;
63 std::unordered_multimap<Belle2::VxdID, InterHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > m_hInterDictionary;
64
66 typedef std::pair< TH1*, std::function< void(TH1*, const ROIid*) > > ROIHistoAndFill;
68 std::unordered_multimap<Belle2::VxdID, ROIHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > m_hROIDictionary;
69
72 TH1* hPtr;
73 std::function< void (const ROIid*, double&) > accumulate;
74 std::function< void (TH1*, double&) > fill;
75 double value;
76 };
77
78 std::unordered_multimap<Belle2::VxdID, ROIHistoAccumulateAndFill&, std::function<size_t (const Belle2::VxdID&) > >
80
82 void fillSensorROIHistos(const ROIid* roi);
83 void fillSensorInterHistos(const PXDIntercept* inter);
84
86
87 TH1F* m_hnROIs;
88 TH1F* m_hnInter;
89 TH1F* m_harea;
91
95 void initialize(void) override final;
96
100 void event(void) override final;
101
105 void terminate(void) override final;
106
107 void defineHisto() override final;
108
109 };//end class declaration
110
112} // 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