Belle II Software development
SVDLocalCalibrationsCheckModule.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/Module.h>
12#include <vxd/dataobjects/VxdID.h>
13
14#include <svd/dataobjects/SVDHistograms.h>
15#include <svd/dataobjects/SVDAPVHistograms.h>
16#include <svd/dataobjects/SVDSummaryPlots.h>
17
18#include <string>
19#include <TFile.h>
20#include <TTree.h>
21#include <TBranch.h>
22#include <TH1F.h>
23#include <TH2F.h>
24#include <TList.h>
25#include <TLegend.h>
26
27namespace Belle2 {
36
37 public:
38
43
45 virtual void beginRun() override;
46
48 virtual void event() override;
49
50 /* ROOT file related parameters */
51 TFile* m_rootFilePtrREF = nullptr;
52 TFile* m_rootFilePtrCHECK = nullptr;
53 TTree* m_treeREF = nullptr;
54 TTree* m_treeCHECK = nullptr;
56 //branches REF
57 TBranch* b_runREF = nullptr;
58 TBranch* b_ladderREF = nullptr;
59 TBranch* b_layerREF = nullptr;
60 TBranch* b_sensorREF = nullptr;
61 TBranch* b_sideREF = nullptr;
62 TBranch* b_stripREF = nullptr;
63 TBranch* b_maskREF = nullptr;
64 TBranch* b_pedestalREF = nullptr;
65 TBranch* b_gainREF = nullptr;
66 TBranch* b_noiseREF = nullptr;
67 TBranch* b_noiseElREF = nullptr;
68 TBranch* b_calPeakADCREF = nullptr;
69 TBranch* b_calPeakTimeREF = nullptr;
70 TBranch* b_pulseWidthREF = nullptr;
72 //branches CHECK
73 TBranch* b_runCHECK = nullptr;
74 TBranch* b_ladderCHECK = nullptr;
75 TBranch* b_layerCHECK = nullptr;
76 TBranch* b_sensorCHECK = nullptr;
77 TBranch* b_sideCHECK = nullptr;
78 TBranch* b_stripCHECK = nullptr;
79 TBranch* b_maskCHECK = nullptr;
80 TBranch* b_pedestalCHECK = nullptr;
81 TBranch* b_gainCHECK = nullptr;
82 TBranch* b_noiseCHECK = nullptr;
83 TBranch* b_noiseElCHECK = nullptr;
84 TBranch* b_calPeakTimeCHECK = nullptr;
85 TBranch* b_calPeakADCCHECK = nullptr;
86 TBranch* b_pulseWidthCHECK = nullptr;
89 //branch variables
90 UInt_t m_runREF = -1;
91 UInt_t m_layerREF = -1;
92 UInt_t m_ladderREF = -1;
93 UInt_t m_sensorREF = -1;
94 UInt_t m_sideREF = -1;
95 UInt_t m_stripREF = -1;
96 float m_maskREF = -1;
97 float m_noiseREF = -1;
98 float m_noiseElREF = -1;
99 float m_pedestalREF = -1;
100 float m_gainREF = -1;
101 float m_calPeakTimeREF = -1;
102 float m_calPeakADCREF = -1;
103 float m_pulseWidthREF = -1;
106 //branch variables
107 UInt_t m_runCHECK = -1;
108 UInt_t m_layerCHECK = -1;
109 UInt_t m_ladderCHECK = -1;
110 UInt_t m_sensorCHECK = -1;
111 UInt_t m_sideCHECK = -1;
112 UInt_t m_stripCHECK = -1;
113 float m_maskCHECK = -1;
114 float m_noiseCHECK = -1;
115 float m_noiseElCHECK = -1;
116 float m_pedestalCHECK = -1;
117 float m_gainCHECK = -1;
119 float m_calPeakADCCHECK = -1;
120 float m_pulseWidthCHECK = -1;
122 std::string m_rootFileNameREF = "SVDLocalCalibrationMonitor_experiment5_run92.root";
123 std::string m_rootFileNameCHECK = "SVDLocalCalibrationMonitor_experiment5_run408.root";
125 std::string m_idFileNameREF = "refID";
126 std::string m_idFileNameCHECK = "checkID";
128 std::string m_outputPdfName = "SVDLocalCalibrationCheck.pdf";
130 bool m_plotGoodAPVs = false;
132 //analsyis parameters
133 int m_cutN_out = -1;
134 float m_cutNoise_ave = -1;
135 float m_cutNoise_out = -1;
138 float m_cutPedestal_ave = -1;
139 float m_cutPedestal_out = -1;
141 private:
142
143 void printConfiguration();
145 const int m_apvColors[6] = { 1, 2, 8, kBlue, 6, 28};
146 void setAPVHistoStyles(SVDAPVHistograms<TH1F>* m_APVhistos);
148 void createLegends();
149 TLegend* m_leg2D = nullptr;
150 TLegend* m_legU = nullptr;
151 TLegend* m_legV = nullptr;
153 void printFirstPage();
154 void printLayerPage(int layer);
155 void printPage(VxdID theVxdID, TList* listUBAD, TList* listVBAD, TList* listUGOOD, TList* listVGOOD, TString variable,
156 bool isL3);
158 void printAPVSummaryPages();
159 void printLastPage();
161 int hasAnyProblem(TH1F* h, float cutAve, float cutCOUNT);
198 };
200}
201
Base class for Modules.
Definition: Module.h:72
template class for the APV Histograms
template class for SVd histograms
Definition: SVDHistograms.h:24
Module to produce a list of histogram showing the uploaded local calibration constants.
SVDHistograms< TH2F > * m_h2CalpeakADCREF
CALPEAKS ADC.
SVDSummaryPlots * m_hCalpeakADCSummary
calpeakADC summary histo
int m_nMaskedUCHECK
number of masked strips in the check calibration (u side)
TFile * m_rootFilePtrCHECK
pointer at the CHECK root file
SVDHistograms< TH2F > * m_h2CalpeakTimeCHECK
calpeakTime VS strip 2D histo
void printPage(VxdID theVxdID, TList *listUBAD, TList *listVBAD, TList *listUGOOD, TList *listVGOOD, TString variable, bool isL3)
print the page relative to a sensor with problematic APVs
SVDAPVHistograms< TH1F > * m_hMaskDIFF
mask histo
int m_cutN_out
maximum number of allowed outliers
int m_nMaskedUREF
number of masked strips in the reference calibration (u side)
SVDAPVHistograms< TH1F > * m_hCalpeakTimeDIFF
calpeakTime histo
SVDLocalCalibrationsCheckModule()
Constructor: Sets the description, the properties and the parameters of the module.
TBranch * b_calPeakADCCHECK
strip calPeakADC (ADC of max pulse)
SVDHistograms< TH2F > * m_h2CalpeakADCCHECK
calpeakADC VS strip 2D histo
SVDSummaryPlots * m_hMaskSummary
mask summary histo
void printMaskedSummaryPages()
summary page with Masked strips summary plot
virtual void event() override
perform analysis and Draw pdf Canvas
TBranch * b_calPeakADCREF
strip calPeakADC (ADC of max pulse)
float m_cutPedestal_ave
maximum relative deviation APV-average (pedestal)
SVDSummaryPlots * m_hMaskSummaryCHECK
mask summary histo
TFile * m_rootFilePtrREF
pointer at the REFERENCE root file
float m_cutCalpeakADC_ave
maximum relative deviation APV-average (calpeakADC)
void printLayerPage(int layer)
print layer-number page
SVDSummaryPlots * m_hCalpeakTimeSummary
calpeakTime summary histo
float m_cutCalpeakADC_out
maximum relative deviation strip (calpeakADC)
void printAPVSummaryPages()
summary page with 2D summary plot with problemtic APVs
std::string m_idFileNameCHECK
ID of the xml file name CHECK.
SVDHistograms< TH2F > * m_h2NoiseCHECK
noise VS strip 2D histo
SVDAPVHistograms< TH1F > * m_hPedestalDIFF
pedestal histo
bool m_plotGoodAPVs
if true also the good APVs are plotted on the DIFF canvas
float m_cutNoise_ave
maximum relative deviation APV-average (noise)
TBranch * b_calPeakTimeCHECK
strip calPeakTime (time of max pulse)
virtual void beginRun() override
initialize the TTrees and create SVDHistograms and SVDAPVHistograms
int m_nMaskedVREF
number of masked strips in the reference calibration (v side)
float m_cutNoise_out
maximum relative deviation strip (noise)
void printConfiguration()
print the configuration of the check of the calibration VS a reference calibration
int hasAnyProblem(TH1F *h, float cutAve, float cutCOUNT)
return True if the APV has a problem, given a variable
std::string m_rootFileNameREF
root file name REFERENCE
std::string m_idFileNameREF
ID of the xml file name REFERENCE.
SVDAPVHistograms< TH1F > * m_hCalpeakADCDIFF
calpeakADC histo
SVDHistograms< TH2F > * m_h2PedestalCHECK
pedestal VS strip 2D histo
TBranch * b_calPeakTimeREF
strip calPeakTime (time of max pulse)
int m_nMaskedVCHECK
number of masked strips in the check calibration (v side)
void printFirstPage()
print the first page of the output pdf
void createLegends()
create the TLegends for the plot
SVDAPVHistograms< TH1F > * m_hNoiseDIFF
noise histo
SVDSummaryPlots * m_hPedestalSummary
pedestal summary histo
SVDSummaryPlots * m_hNoiseSummary
noise summary histo
SVDHistograms< TH2F > * m_h2MaskCHECK
mask VS strip 2D histo
void setAPVHistoStyles(SVDAPVHistograms< TH1F > *m_APVhistos)
set style of APV histograms
SVDHistograms< TH2F > * m_h2CalpeakTimeREF
CALPEAKS TIME.
float m_cutPedestal_out
maximum relative deviation strip (pedestal)
class to summarize SVD quantities per sensor and side
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.