Belle II Software  release-05-02-19
SVDROIDQMModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2013 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Giulia Casarosa *
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 
16 #include <vxd/geometry/GeoCache.h>
17 
18 #include <svd/dataobjects/SVDRecoDigit.h>
19 #include <svd/dataobjects/SVDShaperDigit.h>
20 #include <tracking/dataobjects/ROIid.h>
21 #include <tracking/dataobjects/SVDIntercept.h>
22 
23 #include <unordered_map>
24 #include <utility>
25 #include <functional>
26 #include <TH1.h>
27 #include <TH1F.h>
28 
29 namespace Belle2 {
40  class SVDROIDQMModule : public HistoModule {
41 
42  public:
43 
46 
47  void initialize() override;
49  void event() override;
51  void endRun() override;
53  private:
54 
55  std::string m_SVDShaperDigitsName;
56  std::string m_SVDRecoDigitsName;
58  StoreArray<ROIid> m_ROIs;
59  StoreArray<SVDIntercept> m_Intercepts;
60  StoreArray<SVDShaperDigit> m_SVDShaperDigits;
61  StoreArray<SVDRecoDigit> m_SVDRecoDigits;
65  std::string m_ROIsName;
66  std::string m_InterceptsName;
68  TDirectory* m_InterDir;
69  TDirectory* m_ROIDir;
72  typedef std::pair< TH1*, std::function< void(TH1*, const SVDIntercept*) > > InterHistoAndFill;
74  std::unordered_multimap<Belle2::VxdID, InterHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > hInterDictionary;
75 
77  typedef std::pair< TH1*, std::function< void(TH1*, const ROIid*) > > ROIHistoAndFill;
79  std::unordered_multimap<Belle2::VxdID, ROIHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > hROIDictionary;
80 
83  TH1* hPtr;
84  std::function< void (const ROIid*, double&) > accumulate;
85  std::function< void (TH1*, double&) > fill;
86  double value;
87  };
89  std::unordered_multimap<Belle2::VxdID, ROIHistoAccumulateAndFill&, std::function<size_t (const Belle2::VxdID&) > >
91 
93  void fillSensorROIHistos(const ROIid* roi);
94  void fillSensorInterHistos(const SVDIntercept* inter);
96  int m_numModules;
98  TH1F* hnROIs;
99  TH1F* hnInter;
100  TH1F* harea;
101  TH1F* hredFactor;
102  TH1F* hCellU;
103  TH1F* hCellV;
104  int n_events;
106  void defineHisto() override;
108  };//end class declaration
109 
110 
112 } // end namespace Belle2
113 
Belle2::SVDIntercept
SVDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an SVD ...
Definition: SVDIntercept.h:32
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::SVDROIDQMModule::defineHisto
void defineHisto() override
define histograms
Definition: SVDROIDQMModule.cc:62
Belle2::SVDROIDQMModule::SVDROIDQMModule
SVDROIDQMModule()
Constructor defining the parameters.
Definition: SVDROIDQMModule.cc:29
Belle2::SVDROIDQMModule::m_ROIs
StoreArray< ROIid > m_ROIs
ROis store array.
Definition: SVDROIDQMModule.h:66
Belle2::SVDROIDQMModule::hROIDictionaryEvt
std::unordered_multimap< Belle2::VxdID, ROIHistoAccumulateAndFill &, std::function< size_t(const Belle2::VxdID &) > > hROIDictionaryEvt
map of histograms to be filled once per event
Definition: SVDROIDQMModule.h:98
Belle2::SVDROIDQMModule::createHistosDictionaries
void createHistosDictionaries()
create the dictionary
Definition: SVDROIDQMModule.cc:161
Belle2::SVDROIDQMModule::hredFactor
TH1F * hredFactor
reduction factor
Definition: SVDROIDQMModule.h:109
Belle2::SVDROIDQMModule::ROIHistoAccumulateAndFill::value
double value
value used to fill
Definition: SVDROIDQMModule.h:94
Belle2::SVDROIDQMModule::m_SVDShaperDigits
StoreArray< SVDShaperDigit > m_SVDShaperDigits
shaper digits sotre array
Definition: SVDROIDQMModule.h:68
Belle2::SVDROIDQMModule::ROIHistoAccumulateAndFill::hPtr
TH1 * hPtr
histogram pointer
Definition: SVDROIDQMModule.h:91
Belle2::SVDROIDQMModule::hnInter
TH1F * hnInter
number of intercpets
Definition: SVDROIDQMModule.h:107
Belle2::SVDROIDQMModule::hROIDictionary
std::unordered_multimap< Belle2::VxdID, ROIHistoAndFill, std::function< size_t(const Belle2::VxdID &)> > hROIDictionary
map of histograms to be filled once per roi
Definition: SVDROIDQMModule.h:87
Belle2::SVDROIDQMModule::m_SVDRecoDigits
StoreArray< SVDRecoDigit > m_SVDRecoDigits
reco digit store array
Definition: SVDROIDQMModule.h:69
Belle2::SVDROIDQMModule::hInterDictionary
std::unordered_multimap< Belle2::VxdID, InterHistoAndFill, std::function< size_t(const Belle2::VxdID &)> > hInterDictionary
map of histograms to be filled once per intercept
Definition: SVDROIDQMModule.h:82
Belle2::SVDROIDQMModule::m_ROIsName
std::string m_ROIsName
Name of the ROIid StoreArray.
Definition: SVDROIDQMModule.h:73
Belle2::SVDROIDQMModule::hCellV
TH1F * hCellV
V cells.
Definition: SVDROIDQMModule.h:111
Belle2::SVDROIDQMModule::m_SVDShaperDigitsName
std::string m_SVDShaperDigitsName
shaper digit list name
Definition: SVDROIDQMModule.h:63
Belle2::ROIid
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
Definition: ROIid.h:35
Belle2::VXD::GeoCache::getInstance
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:215
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVDROIDQMModule::ROIHistoAndFill
std::pair< TH1 *, std::function< void(TH1 *, const ROIid *) > > ROIHistoAndFill
typedef: histograms to be filled once per roi + filling function
Definition: SVDROIDQMModule.h:85
Belle2::SVDROIDQMModule::m_geoCache
VXD::GeoCache & m_geoCache
the geo cache instance
Definition: SVDROIDQMModule.h:71
Belle2::SVDROIDQMModule::event
void event() override
fill per-event histograms
Definition: SVDROIDQMModule.cc:105
Belle2::SVDROIDQMModule::hnROIs
TH1F * hnROIs
number of ROIs
Definition: SVDROIDQMModule.h:106
Belle2::SVDROIDQMModule::initialize
void initialize() override
register histograms
Definition: SVDROIDQMModule.cc:91
Belle2::SVDROIDQMModule::InterHistoAndFill
std::pair< TH1 *, std::function< void(TH1 *, const SVDIntercept *) > > InterHistoAndFill
typedef: histograms to be filled once per intercept + filling function
Definition: SVDROIDQMModule.h:80
Belle2::SVDROIDQMModule::m_ROIDir
TDirectory * m_ROIDir
ROI directory in the root file.
Definition: SVDROIDQMModule.h:77
Belle2::SVDROIDQMModule::m_numModules
int m_numModules
number of hardware modules
Definition: SVDROIDQMModule.h:104
Belle2::SVDROIDQMModule::m_InterceptsName
std::string m_InterceptsName
Name of the SVDIntercept StoreArray.
Definition: SVDROIDQMModule.h:74
Belle2::SVDROIDQMModule::m_SVDRecoDigitsName
std::string m_SVDRecoDigitsName
reco digit list name
Definition: SVDROIDQMModule.h:64
Belle2::SVDROIDQMModule::harea
TH1F * harea
ROis area.
Definition: SVDROIDQMModule.h:108
Belle2::SVDROIDQMModule::ROIHistoAccumulateAndFill::fill
std::function< void(TH1 *, double &) > fill
fill function
Definition: SVDROIDQMModule.h:93
Belle2::SVDROIDQMModule::n_events
int n_events
number of events
Definition: SVDROIDQMModule.h:112
Belle2::SVDROIDQMModule::m_Intercepts
StoreArray< SVDIntercept > m_Intercepts
SVDINtercept Store Arrays.
Definition: SVDROIDQMModule.h:67
Belle2::VXD::GeoCache
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:41
Belle2::SVDROIDQMModule::fillSensorInterHistos
void fillSensorInterHistos(const SVDIntercept *inter)
fill histograms per sensor, filled once per intercept
Definition: SVDROIDQMModule.cc:589
Belle2::SVDROIDQMModule::m_InterDir
TDirectory * m_InterDir
intercepts directory in the root file
Definition: SVDROIDQMModule.h:76
Belle2::SVDROIDQMModule::fillSensorROIHistos
void fillSensorROIHistos(const ROIid *roi)
fill histograms per sensor, filled once per ROI
Definition: SVDROIDQMModule.cc:601
Belle2::SVDROIDQMModule::ROIHistoAccumulateAndFill::accumulate
std::function< void(const ROIid *, double &) > accumulate
accumulate function
Definition: SVDROIDQMModule.h:92
Belle2::SVDROIDQMModule::hCellU
TH1F * hCellU
U cells.
Definition: SVDROIDQMModule.h:110
Belle2::SVDROIDQMModule::endRun
void endRun() override
fill per-run histograms
Definition: SVDROIDQMModule.cc:616
Belle2::SVDROIDQMModule::ROIHistoAccumulateAndFill
struct: histograms to be filled once per event + filling fucntion + accumulate function
Definition: SVDROIDQMModule.h:90