BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
ElectronCorrection.h
Go to the documentation of this file.
1//********************************************************************************
2// This file is part of the Widget, a package for performing dE/dx calibration.
3//
4// Author: Jake Bennett
5// Date: July 8, 2015
6//
7// ElectronCorrection is a class designed to apply calibration constants for the
8// electron calibration.
9//
10// For additional details, see the Widget document.
11//
12//********************************************************************************
13#ifndef ELECTRONCORRECTION_H
14#define ELECTRONCORRECTION_H
15
17const int c_NCDCWires = 14336; // number of wires in CDC
18
20
21 public:
22
24 ElectronCorrection( TString constfilename, TString infilename, double removeLowest, double removeHighest );
25 virtual ~ElectronCorrection() {};
26
27 /** Retrieve the calibration constants (placeholder for now) */
29
30 /** Apply corrections to events in infile and write to outfile */
31 void process(TFile* outfile);
32
33 /** Perform a run gain correction */
34 double RunGainCorrection(double& dedx) const;
35 /** Perform a wire gain correction */
36 double WireGainCorrection(int wireID, double& dedx) const;
37
38 /** Perform a standard set of corrections */
39 double StandardCorrection(int wireID, double costheta, double dedx) const;
40
41 /** Perform a hadron saturation correction.
42 * (Set the peak of the truncated mean for electrons to 1) */
43 double HadronCorrection(double costheta, double dedx) const;
44
45 /** Perform the truncation */
46 void calculateMeans(double& mean, double& truncatedMean, double& truncatedMeanErr, double dedx[], int size) const;
47 void calculateMeans(double& mean, double& truncatedMean, double& truncatedMeanErr, std::vector<double> dedx, int size) const;
48
49 private:
50
51 TString m_filename; // name of input ROOT file
52 TString m_constfilename; // name of file that contains constants
53
54 double m_removeLowest; // low end of truncation
55 double m_removeHighest; // high end of truncation
56
57 double m_runGain; // run gain constant
58
59 double m_wireGain[14336]; // list of wire gains
60 double m_valid[14336]; // whether each wire is good or not
61
62 HadronSaturation m_hadsat; // hadron saturation object
63};
64#endif
const int c_NCDCWires
void calculateMeans(double &mean, double &truncatedMean, double &truncatedMeanErr, double dedx[], int size) const
double RunGainCorrection(double &dedx) const
double StandardCorrection(int wireID, double costheta, double dedx) const
double WireGainCorrection(int wireID, double &dedx) const
double HadronCorrection(double costheta, double dedx) const
float costheta