11#include <cdc/dbobjects/CDCDedxCosineCor.h>
12#include <calibration/CalibrationAlgorithm.h>
13#include <framework/database/DBObjPtr.h>
95 void defineHisto(std::vector<TH1D*>& hdedx,
const std::string& tag,
const std::string& chargeLabel);
115 void plotdedxHist(std::vector<TH1D*>& hDedxCos_all, std::vector<TH1D*>& hDedxCos_neg, std::vector<TH1D*>& hDedxCos_pos);
120 void setHist(TH1D* h,
int color,
const char* title,
121 double ymin,
double ymax,
int marker = 20)
123 h->SetLineColor(color);
125 h->SetMarkerColor(color);
126 h->SetMarkerStyle(marker);
127 h->SetMarkerSize(0.7);
130 if (strlen(title) > 0)
133 h->GetYaxis()->SetRangeUser(ymin, ymax);
139 void plotCosThetaDist(TH1D* hCosth_all, TH1D* hCosth_pos, TH1D* hCosth_neg);
144 void plotFitResults(
const std::vector<std::vector<double>>& dedxAll,
const std::vector<std::vector<double>>& dedxNeg,
145 const std::vector<std::vector<double>>& dedxPos);
163 static const std::array<unsigned int, m_kNGroups> repLayer = {1, 9, 17};
164 return repLayer.at(igroup);
212 const std::array<std::string, m_kNGroups>
m_label = {
"SL0",
"SL1",
"SL2-8"};
void setCosineRange(double min=-1.0, double max=1.0)
function to set min/max range of cosine for calibration
void setSuffix(const std::string &value)
adding suffix to control plots
FitValues fitHistogram(TH1D *&hist)
Fit histogram with Gaussian and return mean, error, and width.
void setFitWidth(double value=2.5)
set sigma to restrict fit range around mean
void getExpRunInfo()
function to extract calibration run/exp
void setHistRange(double min=0.0, double max=5.0)
function to set min/max range of dedx dist for calibration
TH1D * defineCosthHist(const std::string &tag)
function to define cosine histograms
static constexpr int m_kNGroups
SL grouping: inner (SL0), middle (SL1), outer (SL2–8)
void setCosineBins(unsigned int value=100)
function to set number of cosine bins for calibration
int m_dedxBin
number of bins for dedx histogram
double m_cosMax
max cosine angle for cal
void setHistBins(int value=250)
function to set nbins of dedx dist for calibration
void plotCosThetaDist(TH1D *hCosth_all, TH1D *hCosth_pos, TH1D *hCosth_neg)
Plot cos(theta) distributions for all, positive, and negative tracks.
bool isMergePayload
merge payload at the time of calibration
unsigned int getRepresentativeLayer(unsigned int igroup) const
Representative CDC layer for each SL group (used to access group-wise constants): SL0 => 1,...
std::string m_suffix
add suffix to all plot name
DBObjPtr< CDCDedxCosineCor > m_DBCosineCor
Electron saturation correction DB object.
void plotConstants()
function to draw the old/new final constants
CDCDedxCosineAlgorithm()
Constructor: Sets the description, the properties and the parameters of the algorithm.
void fitGaussianWithRange(TH1D *&temphist, TString &status)
function to fit histogram in each cosine bin
const std::array< std::string, m_kNGroups > m_label
add inner/outer superlayer label
double m_cosMin
min cosine angle for cal
void setMergePayload(bool value=true)
function to decide merge vs relative gains
void plotEventStats()
function to draw the stats plots
void setMethodSep(bool value=true)
function to make flag active for method of sep
virtual EResult calibrate() override
Cosine algorithm.
double m_sigLim
gaussian fit sigma limit
void plotFitResults(const std::vector< std::vector< double > > &dedxAll, const std::vector< std::vector< double > > &dedxNeg, const std::vector< std::vector< double > > &dedxPos)
Plot dE/dx fit results for all, negative, and positive tracks.
void plotdedxHist(std::vector< TH1D * > &hDedxCos_all, std::vector< TH1D * > &hDedxCos_neg, std::vector< TH1D * > &hDedxCos_pos)
function to draw the dE/dx histogram in costh bins
bool isMethodSep
if e+ e- need to be consider sep
void createPayload(std::vector< double > cosine)
function to store new payload after full calibration
double m_dedxMax
max dedx range for gain cal
virtual ~CDCDedxCosineAlgorithm()
Destructor.
bool isMakePlots
produce plots for status
void setMonitoringPlots(bool value=false)
function to make flag active for plotting
double m_dedxMin
min dedx range for gain cal
void setHist(TH1D *h, int color, const char *title, double ymin, double ymax, int marker=20)
Set basic style (color, marker, title, y-range) for a TH1D histogram.
unsigned int m_cosBin
number of bins across cosine range
void defineHisto(std::vector< TH1D * > &hdedx, const std::string &tag, const std::string &chargeLabel)
function to define dE/dx histograms
std::vector< std::vector< double > > m_coscors
final vectors of calibration
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.
Abstract base class for different kinds of events.
Container for Gaussian fit results of a histogram.
double sigma
sigma : fitted width
double meanErr
meanErr : uncertainty on the mean
double sigmaErr
sigmaErr : uncertainty on the width
double mean
mean : fitted mean value
TString status
status : fit status flag (e.g.