Belle II Software  release-06-01-15
SVDROIDQMModule.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 <svd/dataobjects/SVDRecoDigit.h>
17 #include <svd/dataobjects/SVDShaperDigit.h>
18 #include <tracking/dataobjects/ROIid.h>
19 #include <tracking/dataobjects/SVDIntercept.h>
20 
21 #include <unordered_map>
22 #include <utility>
23 #include <functional>
24 #include <TH1.h>
25 #include <TH1F.h>
26 
27 namespace Belle2 {
38  class SVDROIDQMModule : public HistoModule {
39 
40  public:
41 
44 
45  void initialize() override;
47  void event() override;
49  void endRun() override;
51  private:
52 
53  std::string m_SVDShaperDigitsName;
54  std::string m_SVDRecoDigitsName;
63  std::string m_ROIsName;
64  std::string m_InterceptsName;
66  TDirectory* m_InterDir;
67  TDirectory* m_ROIDir;
70  typedef std::pair< TH1*, std::function< void(TH1*, const SVDIntercept*) > > InterHistoAndFill;
72  std::unordered_multimap<Belle2::VxdID, InterHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > hInterDictionary;
73 
75  typedef std::pair< TH1*, std::function< void(TH1*, const ROIid*) > > ROIHistoAndFill;
77  std::unordered_multimap<Belle2::VxdID, ROIHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > hROIDictionary;
78 
81  TH1* hPtr;
82  std::function< void (const ROIid*, double&) > accumulate;
83  std::function< void (TH1*, double&) > fill;
84  double value;
85  };
87  std::unordered_multimap<Belle2::VxdID, ROIHistoAccumulateAndFill&, std::function<size_t (const Belle2::VxdID&) > >
89 
91  void fillSensorROIHistos(const ROIid* roi);
92  void fillSensorInterHistos(const SVDIntercept* inter);
96  TH1F* hnROIs;
97  TH1F* hnInter;
98  TH1F* harea;
99  TH1F* hredFactor;
100  TH1F* hCellU;
101  TH1F* hCellV;
102  int n_events;
104  void defineHisto() override;
106  };//end class declaration
107 
108 
110 } // end namespace Belle2
111 
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
Definition: ROIid.h:25
SVDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an SVD ...
Definition: SVDIntercept.h:22
Creates basic DQM for ROI creation on ExpressReco
std::unordered_multimap< Belle2::VxdID, ROIHistoAccumulateAndFill &, std::function< size_t(const Belle2::VxdID &) > > hROIDictionaryEvt
map of histograms to be filled once per event
int m_numModules
number of hardware modules
std::unordered_multimap< Belle2::VxdID, InterHistoAndFill, std::function< size_t(const Belle2::VxdID &)> > hInterDictionary
map of histograms to be filled once per intercept
std::pair< TH1 *, std::function< void(TH1 *, const SVDIntercept *) > > InterHistoAndFill
typedef: histograms to be filled once per intercept + filling function
std::string m_InterceptsName
Name of the SVDIntercept StoreArray.
VXD::GeoCache & m_geoCache
the geo cache instance
TH1F * hnROIs
number of ROIs
int n_events
number of events
void initialize() override
register histograms
TDirectory * m_ROIDir
ROI directory in the root file.
void fillSensorInterHistos(const SVDIntercept *inter)
fill histograms per sensor, filled once per intercept
void createHistosDictionaries()
create the dictionary
std::string m_SVDRecoDigitsName
reco digit list name
void fillSensorROIHistos(const ROIid *roi)
fill histograms per sensor, filled once per ROI
void event() override
fill per-event histograms
void endRun() override
fill per-run histograms
SVDROIDQMModule()
Constructor defining the parameters.
std::pair< TH1 *, std::function< void(TH1 *, const ROIid *) > > ROIHistoAndFill
typedef: histograms to be filled once per roi + filling function
TH1F * hredFactor
reduction factor
StoreArray< SVDShaperDigit > m_SVDShaperDigits
shaper digits sotre array
StoreArray< SVDRecoDigit > m_SVDRecoDigits
reco digit store array
std::string m_ROIsName
Name of the ROIid StoreArray.
TH1F * hnInter
number of intercpets
TDirectory * m_InterDir
intercepts directory in the root file
std::unordered_multimap< Belle2::VxdID, ROIHistoAndFill, std::function< size_t(const Belle2::VxdID &)> > hROIDictionary
map of histograms to be filled once per roi
TH1F * harea
ROis area.
StoreArray< SVDIntercept > m_Intercepts
SVDINtercept Store Arrays.
std::string m_SVDShaperDigitsName
shaper digit list name
void defineHisto() override
define histograms
StoreArray< ROIid > m_ROIs
ROis store array.
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:213
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
std::function< void(const ROIid *, double &) > accumulate
accumulate function
std::function< void(TH1 *, double &) > fill
fill function