Belle II Software development
CDCDedxHadSatAlgorithm.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 <map>
12#include <vector>
13#include <iostream>
14#include <fstream>
15
16#include <calibration/CalibrationAlgorithm.h>
17#include <framework/database/DBObjPtr.h>
18#include <framework/gearbox/Const.h>
19
20#include <cdc/dbobjects/CDCDedxHadronCor.h>
21#include <cdc/calibration/CDCdEdx/HadronSaturation.h>
22#include <cdc/calibration/CDCdEdx/HadronPrep.h>
23
24namespace Belle2 {
34
35 public:
36
41
46
50 void setMonitoringPlots(bool value = false) {m_ismakePlots = value;}
51
55 void setProtonCut(double value) {m_cut = value;}
56
60 void setBGPars(const std::string& particle, double nbin, double min, double max)
61 {
62 m_bgpar[particle][0] = nbin;
63 m_bgpar[particle][1] = min;
64 m_bgpar[particle][2] = max;
65 }
66
70 void setCosPars(int bin, double min, double max) { m_cosBins = bin; m_cosMin = min; m_cosMax = max; }
71
75 void getExpRunInfo();
76
80 void createPayload();
81
85 void prepareSample(std::vector< std::string >& particles, const std::string& filename, const std::string& sfx, bool correct);
86
87 protected:
88
92 virtual EResult calibrate() override;
93
94 private:
95
96 std::map<std::string, std::array<double, 3>> m_bgpar = {
97 {"electron", {18, 600, 9600}},
98 {"pion", {4, 2.0, 12.94}},
99 {"kaon", {4, 1.10, 3.6}},
100 {"muon", {8, 2.83, 28.83}},
101 {"proton", {6, 0.44, 0.85}}
102 };
104 int m_cosBins = 8;
105 double m_cosMin = 0;
106 double m_cosMax = 0.95;
108 double m_cut = 0.5;
112 std::string m_suffix;
116 };
118} // namespace Belle2
A calibration algorithm for hadron saturation.
void setBGPars(const std::string &particle, double nbin, double min, double max)
function to set beta gamma parameters for particle
std::map< std::string, std::array< double, 3 > > m_bgpar
bg bins, min, max for different particles
DBObjPtr< CDCDedxHadronCor > m_DBHadronCor
db object for dE/dx hadron saturation parameters
void getExpRunInfo()
function to get exp/run information (payload object, plotting)
double m_cosMax
max range of cosine
CDCDedxHadSatAlgorithm()
Constructor: Sets the description, the properties and the parameters of the algorithm.
void prepareSample(std::vector< std::string > &particles, const std::string &filename, const std::string &sfx, bool correct)
function to prepare sample for bgcurve hadron saturation and monitoring plots
bool m_ismakePlots
produce plots for monitoring
std::string m_suffix
string suffix for object names
void setCosPars(int bin, double min, double max)
function to cos parameters for particle
void setProtonCut(double value)
function to set the cut to clean protons
double m_cosMin
min range of cosine
double m_cut
cut to clean protons
virtual EResult calibrate() override
CDC dE/dx Hadron saturation algorithm.
virtual ~CDCDedxHadSatAlgorithm()
Destructor.
void createPayload()
function to store payloads after full calibration
void setMonitoringPlots(bool value=false)
function to enable monitoring plots
Base class for calibration algorithms.
EResult
The result of calibration.
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Abstract base class for different kinds of events.