Belle II Software development
CDCDedxBadWireAlgorithm.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 <string>
12
13#include <TH2F.h>
14#include <TPaveText.h>
15
16#include <framework/database/DBObjPtr.h>
17
18#include <cdc/dbobjects/CDCDedxBadWires.h>
19#include <cdc/dbobjects/CDCDedxWireGain.h>
20
21#include <calibration/CalibrationAlgorithm.h>
22
23#include <cdc/dbobjects/CDCGeometry.h>
24
25
26namespace Belle2 {
31
37
38 public:
39
44
49
53 void setMonitoringPlots(bool value = false) {m_isMakePlots = value;}
54
58 void setHighFracThres(double value) {m_fracThres = value;}
59
63 void setRMSThres(double value) {m_rmsThres = value;}
64
68 void setMeanThres(double value) {m_meanThres = value;}
69
73 void setADC(bool value = false)
74 {
75 m_isADC = value;
76 if (m_isADC) m_varMax = 1000.0;
77 else m_varMax = 7.0;
78 }
79
83 void setHistPars(int nbin, double min, double max)
84 {
85 m_varBins = nbin;
86 m_varMin = min;
87 m_varMax = max;
88 }
89
93 void getExpRunInfo();
94
98 void plotWireDist(const std::vector<double>& inwires, std::map<int, std::vector<double>>& vhitvar);
99
103 void printCanvas(TList* list, TList* hflist, Color_t color);
104
108 void plotBadWireMap(const std::vector<double>& vbadwires, const std::vector<double>& vdeadwires);
109
113 TH2F* getHistoPattern(const std::vector<double>& inwires, const std::string& suffix, int& total);
114
118 void plotQaPars(std::map<int, std::vector<double>>& qapars);
119
123 void plotEventStats();
124
128 void setTextCosmetics(TPaveText* pt, double size)
129 {
130 pt->SetTextAlign(11);
131 pt->SetFillStyle(3001);
132 pt->SetLineColor(2);
133 pt->SetTextFont(82);
134 pt->SetTextSize(size);
135 }
136
140 void setHistCosmetics(TH2F* hist, Color_t color)
141 {
142 hist->SetMarkerStyle(20);
143 hist->SetMarkerSize(0.3);
144 hist->SetMarkerColor(color);
145 hist->SetFillColor(color);
146 hist->SetStats(0);
147 }
148
149 protected:
150
154 virtual EResult calibrate() override;
155
156 private:
157
158 unsigned int c_nwireCDC;
159
161 bool m_isADC;
162
164 double m_varMin;
165 double m_varMax;
166 double m_meanThres;
167 double m_rmsThres;
168 double m_fracThres;
169 double m_amean;
170 double m_arms;
171
172 std::string m_varName;
173 std::string m_suffix;
174
178 };
179
180} // namespace Belle2
void setHistCosmetics(TH2F *hist, Color_t color)
function to change histogram styles
void plotBadWireMap(const std::vector< double > &vbadwires, const std::vector< double > &vdeadwires)
function to plot wire status map (all, bad and dead)
double m_varMax
max range for input variable
double m_rmsThres
rms Threshold accepted for good wire
double m_varMin
min range for input variable
std::string m_varName
std::string to set var name (adc or dedx)
void getExpRunInfo()
function to get extract calibration run/exp
unsigned int c_nwireCDC
number of wires in CDC
double m_arms
average rms of dedx for all wires
bool m_isMakePlots
produce plots for status
void setHighFracThres(double value)
function to set high dedx fraction threshold
DBObjPtr< CDCDedxBadWires > m_DBBadWires
Badwire DB object.
void setMeanThres(double value)
function to set Mean Threshold
std::string m_suffix
suffix std::string for naming plots
void setTextCosmetics(TPaveText *pt, double size)
function to change text styles
CDCDedxBadWireAlgorithm()
Constructor: Sets the description, the properties and the parameters of the algorithm.
DBObjPtr< CDCGeometry > m_cdcGeo
Geometry of CDC.
double m_meanThres
mean Threshold accepted for good wire
DBObjPtr< CDCDedxWireGain > m_DBWireGains
Wiregain DB object.
double m_fracThres
high-frac Threshold accepted for good wire
int m_varBins
number of bins for input variable
void printCanvas(TList *list, TList *hflist, Color_t color)
function to print canvas
void plotQaPars(std::map< int, std::vector< double > > &qapars)
function to plot the QA (decision) parameters
void plotEventStats()
function to draw the stats
void setRMSThres(double value)
function to set RMS Threshold
virtual EResult calibrate() override
cdcdedx badwire algorithm
void setADC(bool value=false)
function to choose adc or dedx as variable
void plotWireDist(const std::vector< double > &inwires, std::map< int, std::vector< double > > &vhitvar)
function to draw per wire plots
void setHistPars(int nbin, double min, double max)
function to set adc/dedx parameters
void setMonitoringPlots(bool value=false)
function to enable plotting
double m_amean
average mean of dedx for all wires
bool m_isADC
Use adc if(true) else dedx for calibration.
TH2F * getHistoPattern(const std::vector< double > &inwires, const std::string &suffix, int &total)
function to get wire map with input file (all, bad and dead)
EResult
The result of calibration.
CalibrationAlgorithm(const std::string &collectorModuleName)
Constructor - sets the prefix for collected objects (won't be accesses until execute(....
Class for accessing objects in the database.
Definition DBObjPtr.h:21
Abstract base class for different kinds of events.