11#include <calibration/CalibrationAlgorithm.h>
12#include <framework/database/DBObjPtr.h>
14#include <cdc/dbobjects/CDCGeometry.h>
15#include <cdc/geometry/CDCGeometryPar.h>
16#include <cdc/geometry/CDCGeometryParConstants.h>
18#include <cdc/dbobjects/CDCDedxInjectionTime.h>
50 std::array<std::vector<double>, 3>
cosgain;
102 void printCanvasRun(
const std::map<int, TH1D*>& htemp,
const std::string& namesfx);
110 void printCanvas(std::vector<TH1D*>& htemp,
const std::string& namesfx,
const std::string& svar);
130 void defineHisto(std::vector<TH1D*>& htemp,
const std::string& var,
const std::string& stype);
136 void wireGain(std::vector<TH1D*>& hdedxhit);
144 static void printCanvasWire(std::vector<TH1D*> temp,
const std::string& namesfx,
const std::vector<double>& vdedx_mean);
154 void fit(TH1D*& hist,
double& mean,
double& meanErr,
double& sigma,
double& sigmaErr);
178 void printCanvasdEdx(std::array<std::vector<TH1D*>, 2>& htemp,
const std::string& namesfx,
const std::string& svar);
188 std::string label =
"";
189 if (tedges < 2e4)label = Form(
"%0.01f-%0.01fK",
m_tedges[it] / 1e3,
m_tedges[it + 1] / 1e3);
190 else if (tedges < 1e5)label = Form(
"%0.0f-%0.0fK",
m_tedges[it] / 1e3,
m_tedges[it + 1] / 1e3);
191 else label = Form(
"%0.01f-%0.01fM",
m_tedges[it] / 1e6,
m_tedges[it + 1] / 1e6);
221 pt.SetShadowColor(kWhite);
222 pt.SetTextColor(color);
304 std::array<std::string, 2>
m_sring{
"ler",
"her"};
void setTestingPayload(const std::string &testingPayloadName)
Set testing payload name.
void bhabhaValidation()
Validate dE/dx using bhabha sample (vs run, cosine)
double m_eaMax
upper edge of entrance angle
void setGlobalTag(const std::string &globalTagName)
Set Global Tag name.
double m_momMin
min range of momentum
static void resetDatabase()
Clear current DB pointers and state.
static void setTextCosmetics(TPaveText pt, Color_t color)
Set text cosmetics for TPaveText.
void wireGain(std::vector< TH1D * > &hdedxhit)
Validate wire gain data using dE/dx histograms.
void printCanvas(std::vector< TH1D * > &htemp, const std::string &namesfx, const std::string &svar)
Draw dE/dx histograms across bins.
std::vector< double > m_vtlocaledges
internal time vector
int m_cosBins
bins for cosine
void radeeValidation()
Validate dE/dx using radee sample (vs momentum, injection time)
double m_sigmaR
fit dedx dist in sigma range
WireGainData getwiregain(int experiment, int run)
Retrieve wire gain data from DB.
void getExpRunInfo()
function to get extract calibration run/exp
double m_cosMax
max range of cosine
OnedData getonedgain(int experiment, int run)
Retrieve 1D gain data from DB.
double * m_tedges
internal time array (points into m_vtlocaledges)
std::string m_GlobalTagName
Global Tag name.
void DatabaseIN(int experiment, int run)
Load database payload for given run.
static void defineTimeBins(std::vector< double > &vtlocaledges)
Set bin edges for injection time.
std::array< std::string, 2 > m_sring
injection ring name
CosGainData getcosgain(int experiment, int run)
Retrieve cosine gain data from DB.
std::string m_testingPayloadName
Testing payload location.
std::string m_suffix
suffix string to separate plots
int m_momBins
bins for momentum
int m_dedxBins
bins for dedx histogram
DBObjPtr< CDCGeometry > m_cdcGeo
Geometry of CDC.
double m_momMax
max range of momentum
CDCDedxValidationAlgorithm()
Constructor: Sets the description, the properties and the parameters of the algorithm.
double getrungain(int experiment, int run)
Retrieve run gain data from DB.
void printCanvasRun(const std::map< int, TH1D * > &htemp, const std::string &namesfx)
Draw dE/dx per run histogram canvas.
void fitGaussianWRange(TH1D *&temphist, std::string &status)
Perform Gaussian fit with range on a histogram.
double m_cosMin
min range of cosine
void plotEventStats()
Plot summary statistics of selected events.
virtual EResult calibrate() override
Main calibration method.
void printCanvasdEdx(std::array< std::vector< TH1D * >, 2 > &htemp, const std::string &namesfx, const std::string &svar)
Draw dE/dx histograms for momentum and cosine bins.
double m_dedxMax
max range of dedx
virtual ~CDCDedxValidationAlgorithm() override
Destructor.
static void printCanvasWire(std::vector< TH1D * > temp, const std::string &namesfx, const std::vector< double > &vdedx_mean)
Plot dE/dx vs wire number.
DBObjPtr< CDCDedxInjectionTime > m_DBInjectTime
Injection time DB object.
double m_dedxMin
min range of dedx
unsigned int m_tbins
internal time bins
void defineHisto(std::vector< TH1D * > &htemp, const std::string &var, const std::string &stype)
Define dE/dx histograms for plotting.
std::string getTimeBinLabel(const double &tedges, const int &it)
Get time bin label string.
void fit(TH1D *&hist, double &mean, double &meanErr, double &sigma, double &sigmaErr)
Perform full Gaussian fit and extract parameters.
double m_eaMin
lower edge of entrance angle
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 cosine gain data.
std::array< std::vector< double >, 3 > cosgain
Gain correction factors for cos(theta) bins.
std::vector< double > costh
cos(theta) bin centers
Container for 1D gain data.
std::vector< double > enta
Entrance angle values.
std::array< std::vector< double >, 3 > oneDcorr
1D cell dE/dx values
Container for wire gain data.
std::vector< double > layermean
Mean gain values per layer.
std::vector< double > wiregain
Gain values for individual wires.