Belle II Software  release-05-02-19
SVDChargeSharingAnalysisModule.h
1 /*************************************************************************
2 * BASF2 (Belle Analysis Framework 2) *
3 * Copyright(C) 2018 - Belle II Collaboration *
4 * *
5 * Author: The Belle II Collaboration *
6 * Contributors: Mateusz Kaleta *
7 * *
8 * This software is provided "as is" without any warranty. *
9 **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/core/Module.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <svd/dataobjects/SVDCluster.h>
16 #include <mdst/dataobjects/Track.h>
17 #include <mdst/dataobjects/TrackFitResult.h>
18 #include <tracking/dataobjects/RecoTrack.h>
19 #include <TH1F.h>
20 #include <TH2F.h>
21 #include <TFile.h>
22 #include <TList.h>
23 #include <TCanvas.h>
24 
25 namespace Belle2 {
34  class SVDChargeSharingAnalysisModule : public Module {
35 
36  public:
37 
40 
42  virtual ~SVDChargeSharingAnalysisModule() override;
43 
45  virtual void initialize() override;
46 
48  virtual void event() override;
49 
51  virtual void terminate() override;
52 
53 
54  private:
55 
56  // Input, output.
57  TFile* m_outputRootFile = NULL;
58  std::string m_outputDirName;
59  std::string m_outputRootFileName;
61  // Module parameters.
62  bool m_useTrackInfo = true;
64  // Store arrays.
70  // Constants related to SVD geometry.
71  static const int m_nLayers = 4;
72  static const int m_nSides = 2;
73  static const int m_nClSizes = 3;
74  static const int m_nSensorTypes = 4;
76  std::string m_nameSensorTypes[m_nSensorTypes] = {"L3", "Origami", "BWD", "FWD"};
77  int m_nSensorsOnLayer[m_nLayers] = {2, 3, 4, 5};
79  // Histogram related parameters.
80  const Double_t m_ADUEquivalent = 375.;
81  const Int_t m_nBins = 270;
82  const Double_t m_minCharge = 0.;
83  const Double_t m_maxCharge = m_nBins * m_ADUEquivalent;
85  // tracks.
86  TH1F* h_nTracks = NULL;
87  TH1F* h_TracksPvalue = NULL;
88  TH1F* h_TracksMomentum = NULL;
89  TH1F* h_TracksnSVDhits = NULL;
91  // Cluster charge.
92  TH1F* h_clCharge[m_nSensorTypes][m_nSides][m_nClSizes] = {NULL};
97  // Cluster size.
98  TH1F* h_clSize[m_nSensorTypes][m_nSides] = {NULL};
99  TH2F* h_clSizeVsMomentum[m_nSensorTypes][m_nSides] = {NULL};
103  // cluster SNR.
104  TH1F* h_clSNR[m_nSensorTypes][m_nSides][m_nClSizes] = {NULL};
108  // histogram lists.
110  TList* m_histoList_Tracks = NULL;
111 
115  TList* m_histoList_clChargeVsSNR[m_nSensorTypes] = {NULL};
117  TList* m_histoList_clSize[m_nSensorTypes] = {NULL};
126  // utility methods
128  TH1F* createHistogram1D(const char* name, const char* title,
129  Int_t nbins, Double_t min, Double_t max,
130  const char* xtitle, const char* ytitle, TList* histoList = NULL);
131 
133  TH2F* createHistogram2D(const char* name, const char* title,
134  Int_t nbinsX, Double_t minX, Double_t maxX,
135  const char* titleX,
136  Int_t nbinsY, Double_t minY, Double_t maxY,
137  const char* titleY, TList* histoList);
139  TCanvas* comparisonPlot(TH1F* h1, TH1F* h2, TH1F* h3);
140  };
142 }
Belle2::SVDChargeSharingAnalysisModule::m_tfr
StoreArray< TrackFitResult > m_tfr
Track Fit Result store array.
Definition: SVDChargeSharingAnalysisModule.h:76
Belle2::SVDChargeSharingAnalysisModule::m_outputRootFileName
std::string m_outputRootFileName
root output file name.
Definition: SVDChargeSharingAnalysisModule.h:67
Belle2::SVDChargeSharingAnalysisModule::m_outputRootFile
TFile * m_outputRootFile
root ouput file pointer.
Definition: SVDChargeSharingAnalysisModule.h:65
Belle2::SVDChargeSharingAnalysisModule::h_clChargeVsMomentum
TH2F * h_clChargeVsMomentum[m_nSensorTypes][m_nSides][m_nClSizes]
SVDCluster charge vs.
Definition: SVDChargeSharingAnalysisModule.h:101
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clSNR
TList * m_histoList_clSNR[m_nSensorTypes]
SVDCluster SNR histogram list.
Definition: SVDChargeSharingAnalysisModule.h:130
Belle2::SVDChargeSharingAnalysisModule::m_nClSizes
static const int m_nClSizes
Distinction between clSize=1, clSize=2 & clSize>=3.
Definition: SVDChargeSharingAnalysisModule.h:81
Belle2::SVDChargeSharingAnalysisModule::h_clCharge
TH1F * h_clCharge[m_nSensorTypes][m_nSides][m_nClSizes]
SVDCluster charge.
Definition: SVDChargeSharingAnalysisModule.h:100
Belle2::SVDChargeSharingAnalysisModule::h_TracksnSVDhits
TH1F * h_TracksnSVDhits
Number of SVDhits for a track.
Definition: SVDChargeSharingAnalysisModule.h:97
Belle2::SVDChargeSharingAnalysisModule::m_ADUEquivalent
const Double_t m_ADUEquivalent
Nominal ADUEquivalent, this is just a parameter for histogram bining.
Definition: SVDChargeSharingAnalysisModule.h:88
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clSize
TList * m_histoList_clSize[m_nSensorTypes]
SVDCluster size histogram list.
Definition: SVDChargeSharingAnalysisModule.h:125
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clChargeVsMomentum
TList * m_histoList_clChargeVsMomentum[m_nSensorTypes]
SVDCluster charge vs.
Definition: SVDChargeSharingAnalysisModule.h:121
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clSNRVsMomentum
TList * m_histoList_clSNRVsMomentum[m_nSensorTypes]
SVDCluster SNR vs.
Definition: SVDChargeSharingAnalysisModule.h:131
Belle2::SVDChargeSharingAnalysisModule::h_clSNRVsIncidentAngle
TH2F * h_clSNRVsIncidentAngle[m_nSensorTypes][m_nSides][m_nClSizes]
SVDCluster SNR vs.
Definition: SVDChargeSharingAnalysisModule.h:114
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clChargeVsSNR
TList * m_histoList_clChargeVsSNR[m_nSensorTypes]
SVDCluster charge vs.
Definition: SVDChargeSharingAnalysisModule.h:123
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clSizeVsIncidentAngle
TList * m_histoList_clSizeVsIncidentAngle[m_nSensorTypes]
SVDCluster size vs.
Definition: SVDChargeSharingAnalysisModule.h:127
Belle2::SVDChargeSharingAnalysisModule::h_clSize
TH1F * h_clSize[m_nSensorTypes][m_nSides]
SVDCluster size.
Definition: SVDChargeSharingAnalysisModule.h:106
Belle2::SVDChargeSharingAnalysisModule::m_Tracks
StoreArray< Track > m_Tracks
SVD Tracks strore array.
Definition: SVDChargeSharingAnalysisModule.h:74
Belle2::SVDChargeSharingAnalysisModule::h_clSizeVsIncidentAngle
TH2F * h_clSizeVsIncidentAngle[m_nSensorTypes][m_nSides]
SVDCluster size vs.
Definition: SVDChargeSharingAnalysisModule.h:108
Belle2::SVDChargeSharingAnalysisModule::m_nSensorTypes
static const int m_nSensorTypes
L3 small rect,.
Definition: SVDChargeSharingAnalysisModule.h:82
Belle2::SVDChargeSharingAnalysisModule::event
virtual void event() override
Core method, called for each processed event.
Definition: SVDChargeSharingAnalysisModule.cc:175
Belle2::SVDChargeSharingAnalysisModule::createHistogram1D
TH1F * createHistogram1D(const char *name, const char *title, Int_t nbins, Double_t min, Double_t max, const char *xtitle, const char *ytitle, TList *histoList=NULL)
1D histogram creator.
Definition: SVDChargeSharingAnalysisModule.cc:334
Belle2::SVDChargeSharingAnalysisModule::terminate
virtual void terminate() override
Summary method, called after processing of all events.
Definition: SVDChargeSharingAnalysisModule.cc:254
Belle2::SVDChargeSharingAnalysisModule::SVDChargeSharingAnalysisModule
SVDChargeSharingAnalysisModule()
Constructor: Sets the description, the properties and the parameters of the module.
Definition: SVDChargeSharingAnalysisModule.cc:48
Belle2::SVDChargeSharingAnalysisModule::m_outputDirName
std::string m_outputDirName
output directory.
Definition: SVDChargeSharingAnalysisModule.h:66
Belle2::SVDChargeSharingAnalysisModule::h_clChargeVsIncidentAngle
TH2F * h_clChargeVsIncidentAngle[m_nSensorTypes][m_nSides][m_nClSizes]
SVDCluster charge vs.
Definition: SVDChargeSharingAnalysisModule.h:102
Belle2::SVDChargeSharingAnalysisModule::~SVDChargeSharingAnalysisModule
virtual ~SVDChargeSharingAnalysisModule() override
Default destructor.
Definition: SVDChargeSharingAnalysisModule.cc:60
Belle2::SVDChargeSharingAnalysisModule::m_minCharge
const Double_t m_minCharge
Minimum charge in histogram.
Definition: SVDChargeSharingAnalysisModule.h:90
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVDChargeSharingAnalysisModule::h_clChargeVsSNR
TH2F * h_clChargeVsSNR[m_nSensorTypes][m_nSides][m_nClSizes]
SVDCluster charge vs.
Definition: SVDChargeSharingAnalysisModule.h:103
Belle2::SVDChargeSharingAnalysisModule::m_nSides
static const int m_nSides
DSSD sides.
Definition: SVDChargeSharingAnalysisModule.h:80
Belle2::SVDChargeSharingAnalysisModule::createHistogram2D
TH2F * createHistogram2D(const char *name, const char *title, Int_t nbinsX, Double_t minX, Double_t maxX, const char *titleX, Int_t nbinsY, Double_t minY, Double_t maxY, const char *titleY, TList *histoList)
2D histogram creator.
Definition: SVDChargeSharingAnalysisModule.cc:347
Belle2::SVDChargeSharingAnalysisModule::m_nSensorsOnLayer
int m_nSensorsOnLayer[m_nLayers]
Total number of DSSDs on L3,4,5,6.
Definition: SVDChargeSharingAnalysisModule.h:85
Belle2::SVDChargeSharingAnalysisModule::m_recoTracks
StoreArray< RecoTrack > m_recoTracks
SVD RecoTracks store array.
Definition: SVDChargeSharingAnalysisModule.h:75
Belle2::SVDChargeSharingAnalysisModule::h_TracksMomentum
TH1F * h_TracksMomentum
Tracks momentum.
Definition: SVDChargeSharingAnalysisModule.h:96
Belle2::SVDChargeSharingAnalysisModule::h_clSizeVsSNR
TH2F * h_clSizeVsSNR[m_nSensorTypes][m_nSides]
SVDCluster size vs.
Definition: SVDChargeSharingAnalysisModule.h:109
Belle2::SVDChargeSharingAnalysisModule::m_nLayers
static const int m_nLayers
Number of SVD layers.
Definition: SVDChargeSharingAnalysisModule.h:79
Belle2::SVDChargeSharingAnalysisModule::h_nTracks
TH1F * h_nTracks
Number of tracks.
Definition: SVDChargeSharingAnalysisModule.h:94
Belle2::SVDChargeSharingAnalysisModule::m_useTrackInfo
bool m_useTrackInfo
True if using clusters related to tracks.
Definition: SVDChargeSharingAnalysisModule.h:70
Belle2::SVDChargeSharingAnalysisModule::m_maxCharge
const Double_t m_maxCharge
1ADU bin width.
Definition: SVDChargeSharingAnalysisModule.h:91
Belle2::SVDChargeSharingAnalysisModule::m_svdClusters
StoreArray< SVDCluster > m_svdClusters
SVD clusters store array.
Definition: SVDChargeSharingAnalysisModule.h:73
Belle2::SVDChargeSharingAnalysisModule::h_TracksPvalue
TH1F * h_TracksPvalue
Tracks P value.
Definition: SVDChargeSharingAnalysisModule.h:95
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clCharge
TList * m_histoList_clCharge[m_nSensorTypes]
SVDCluster charge histogram list.
Definition: SVDChargeSharingAnalysisModule.h:120
Belle2::SVDChargeSharingAnalysisModule::h_clSizeVsMomentum
TH2F * h_clSizeVsMomentum[m_nSensorTypes][m_nSides]
SVDCluster size vs.
Definition: SVDChargeSharingAnalysisModule.h:107
Belle2::SVDChargeSharingAnalysisModule::initialize
virtual void initialize() override
Initialize the SVDChargeSharingAnalysi module.
Definition: SVDChargeSharingAnalysisModule.cc:64
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clChargeVsIncidentAngle
TList * m_histoList_clChargeVsIncidentAngle[m_nSensorTypes]
SVDCluster charge vs.
Definition: SVDChargeSharingAnalysisModule.h:122
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clSizeVsSNR
TList * m_histoList_clSizeVsSNR[m_nSensorTypes]
SVDCluster size vs.
Definition: SVDChargeSharingAnalysisModule.h:128
Belle2::StoreArray< SVDCluster >
Belle2::SVDChargeSharingAnalysisModule::m_nameSensorTypes
std::string m_nameSensorTypes[m_nSensorTypes]
Sensor type names.
Definition: SVDChargeSharingAnalysisModule.h:84
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clSizeVsMomentum
TList * m_histoList_clSizeVsMomentum[m_nSensorTypes]
SVDCluster size vs.
Definition: SVDChargeSharingAnalysisModule.h:126
Belle2::SVDChargeSharingAnalysisModule::h_clSNR
TH1F * h_clSNR[m_nSensorTypes][m_nSides][m_nClSizes]
SVDCluster SNR.
Definition: SVDChargeSharingAnalysisModule.h:112
Belle2::SVDChargeSharingAnalysisModule::m_histoList_Tracks
TList * m_histoList_Tracks
List of all histograms concerning track information: nTracks, Track P Value, momentum and SVD hits.
Definition: SVDChargeSharingAnalysisModule.h:118
Belle2::SVDChargeSharingAnalysisModule::m_nBins
const Int_t m_nBins
Number of bins.
Definition: SVDChargeSharingAnalysisModule.h:89
Belle2::SVDChargeSharingAnalysisModule::comparisonPlot
TCanvas * comparisonPlot(TH1F *h1, TH1F *h2, TH1F *h3)
Used to compare charge histograms for different cluster sizes.
Definition: SVDChargeSharingAnalysisModule.cc:365
Belle2::SVDChargeSharingAnalysisModule::m_histoList_clSNRVsIncidentAngle
TList * m_histoList_clSNRVsIncidentAngle[m_nSensorTypes]
SVDCluster SNR vs.
Definition: SVDChargeSharingAnalysisModule.h:132
Belle2::SVDChargeSharingAnalysisModule::h_clSNRVsMomentum
TH2F * h_clSNRVsMomentum[m_nSensorTypes][m_nSides][m_nClSizes]
SVDCluster SNR vs.
Definition: SVDChargeSharingAnalysisModule.h:113