Belle II Software  release-05-02-19
ROIDQMModule.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, Eugenio Paoloni, Bjoern Spruck *
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 <tracking/dataobjects/ROIid.h>
19 #include <tracking/dataobjects/PXDIntercept.h>
20 #include <pxd/dataobjects/PXDDigit.h>
21 
22 #include <unordered_map>
23 #include <utility>
24 #include <functional>
25 #include <TH1.h>
26 #include <TH1F.h>
27 
28 namespace Belle2 {
41  class ROIDQMModule : public HistoModule {
42 
43  public:
44 
45  ROIDQMModule();
46 
47  private:
48  StoreArray<PXDDigit> m_pxdDigits;
52  std::string m_PXDDigitsName;
56  std::string m_ROIsName;
57  std::string m_InterceptsName;
59  TDirectory* m_InterDir;
60  TDirectory* m_ROIDir;
63  typedef std::pair< TH1*, std::function< void(TH1*, const PXDIntercept*) > > InterHistoAndFill;
65  std::unordered_multimap<Belle2::VxdID, InterHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > m_hInterDictionary;
66 
68  typedef std::pair< TH1*, std::function< void(TH1*, const ROIid*) > > ROIHistoAndFill;
70  std::unordered_multimap<Belle2::VxdID, ROIHistoAndFill, std::function<size_t (const Belle2::VxdID&)> > m_hROIDictionary;
71 
74  TH1* hPtr;
75  std::function< void (const ROIid*, double&) > accumulate;
76  std::function< void (TH1*, double&) > fill;
77  double value;
78  };
80  std::unordered_multimap<Belle2::VxdID, ROIHistoAccumulateAndFill&, std::function<size_t (const Belle2::VxdID&) > >
82 
84  void fillSensorROIHistos(const ROIid* roi);
85  void fillSensorInterHistos(const PXDIntercept* inter);
87  int m_numModules;
89  TH1F* m_hnROIs;
90  TH1F* m_hnInter;
91  TH1F* m_harea;
92  TH1F* m_hredFactor;
94  void initialize(void) override final;
95 
96  void event(void) override final;
97 
98  void terminate(void) override final;
99 
100  void defineHisto() override final;
102  };//end class declaration
103 
104 
106 } // end namespace Belle2
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::ROIDQMModule::ROIHistoAccumulateAndFill::value
double value
value used to fill
Definition: ROIDQMModule.h:85
Belle2::ROIDQMModule::ROIHistoAccumulateAndFill::hPtr
TH1 * hPtr
histogram pointer
Definition: ROIDQMModule.h:82
Belle2::ROIDQMModule::m_hnROIs
TH1F * m_hnROIs
number of ROIs
Definition: ROIDQMModule.h:97
Belle2::ROIDQMModule::m_hROIDictionaryEvt
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:89
Belle2::ROIDQMModule::m_numModules
int m_numModules
number of modules
Definition: ROIDQMModule.h:95
Belle2::ROIDQMModule::m_roiIDs
StoreArray< ROIid > m_roiIDs
the ROIids dataobjects collection
Definition: ROIDQMModule.h:57
Belle2::ROIDQMModule::terminate
void terminate(void) override final
Function to terminate module.
Definition: ROIDQMModule.cc:710
Belle2::ROIDQMModule::ROIHistoAccumulateAndFill::fill
std::function< void(TH1 *, double &) > fill
fill function
Definition: ROIDQMModule.h:84
Belle2::ROIDQMModule::m_hInterDictionary
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:73
Belle2::ROIDQMModule::ROIHistoAccumulateAndFill
struct: histograms to be filled once per event + filling fucntion + accumulate function
Definition: ROIDQMModule.h:81
Belle2::ROIDQMModule::fillSensorInterHistos
void fillSensorInterHistos(const PXDIntercept *inter)
fill histograms per sensor, filled once per intercept
Definition: ROIDQMModule.cc:683
Belle2::ROIDQMModule::m_hROIDictionary
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:78
Belle2::ROIDQMModule::m_aGeometry
VXD::GeoCache & m_aGeometry
the geometry
Definition: ROIDQMModule.h:62
Belle2::ROIDQMModule::m_ROIsName
std::string m_ROIsName
Name of the ROIid StoreArray.
Definition: ROIDQMModule.h:64
Belle2::ROIDQMModule::m_pxdIntercept
StoreArray< PXDIntercept > m_pxdIntercept
the PXDIntercepts dataobjects collection
Definition: ROIDQMModule.h:58
Belle2::ROIDQMModule::m_hnInter
TH1F * m_hnInter
number of intercpets
Definition: ROIDQMModule.h:98
Belle2::ROIDQMModule::m_ROIDir
TDirectory * m_ROIDir
ROI directory in the root file.
Definition: ROIDQMModule.h:68
Belle2::ROIDQMModule::createHistosDictionaries
void createHistosDictionaries()
create the dictionary
Definition: ROIDQMModule.cc:140
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::ROIDQMModule::m_InterDir
TDirectory * m_InterDir
intercepts directory in the root file
Definition: ROIDQMModule.h:67
Belle2::ROIDQMModule::m_hredFactor
TH1F * m_hredFactor
reduction factor
Definition: ROIDQMModule.h:100
Belle2::ROIDQMModule::fillSensorROIHistos
void fillSensorROIHistos(const ROIid *roi)
fill histograms per sensor, filled once per ROI
Definition: ROIDQMModule.cc:695
Belle2::ROIDQMModule::m_InterceptsName
std::string m_InterceptsName
Name of the PXDIntercept StoreArray.
Definition: ROIDQMModule.h:65
Belle2::ROIDQMModule::initialize
void initialize(void) override final
Function for dynamic initialization of module.
Definition: ROIDQMModule.cc:83
Belle2::VXD::GeoCache
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:41
Belle2::ROIDQMModule::ROIHistoAccumulateAndFill::accumulate
std::function< void(const ROIid *, double &) > accumulate
accumulate function
Definition: ROIDQMModule.h:83
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::ROIDQMModule::defineHisto
void defineHisto() override final
define histograms
Definition: ROIDQMModule.cc:57
Belle2::ROIDQMModule::event
void event(void) override final
Function to process event record.
Definition: ROIDQMModule.cc:93
Belle2::ROIDQMModule::m_pxdDigits
StoreArray< PXDDigit > m_pxdDigits
the PXDDigits dataobjects collection
Definition: ROIDQMModule.h:56
Belle2::PXDIntercept
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
Definition: PXDIntercept.h:32
Belle2::ROIDQMModule::InterHistoAndFill
std::pair< TH1 *, std::function< void(TH1 *, const PXDIntercept *) > > InterHistoAndFill
typedef: histograms to be filled once per intercept + filling function
Definition: ROIDQMModule.h:71
Belle2::ROIDQMModule::m_PXDDigitsName
std::string m_PXDDigitsName
digit list name
Definition: ROIDQMModule.h:60
Belle2::ROIDQMModule::ROIHistoAndFill
std::pair< TH1 *, std::function< void(TH1 *, const ROIid *) > > ROIHistoAndFill
typedef: histograms to be filled once per roi + filling function
Definition: ROIDQMModule.h:76
Belle2::ROIDQMModule::m_harea
TH1F * m_harea
ROis area.
Definition: ROIDQMModule.h:99