BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
ElectronInterface.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// ElectronInterface is a class designed to be the point of contact with the user.
8// This class interfaces with the other Widget classes to perform the generation,
9// simulation, fitting, and correction tasks necessary for dE/dx calibration.
10//
11// For additional details, see the Widget document.
12//
13//********************************************************************************
14#ifndef ELECTRONINTERFACE_H
15#define ELECTRONINTERFACE_H
16
17#include <fstream>
18#include <algorithm>
19
21#include "ElectronGenerator.h"
22#include "ElectronCalibration.h"
23#include "ElectronCorrection.h"
24
25using std::cout;
26using std::endl;
27
29
30 public:
31
33 virtual ~ElectronInterface() {}
34
35 // set the member variables from the given configuration file
36 void SetupFromConfigFile( std::string configfile );
37
38 // get the input file name
39 TString GetFileName(){ return m_filename; }
40
41 // change the input file (eg. to calibrated sample)
42 void SetFileName( TString newfilename );
43
44 // generate an electron sample
45 void GenerateSample( TString outfile );
46
47 // ---------- methods for the electron calibration ----------
48
49 // prepare and fit the saturation (dE/dx vs. cos(theta))
50 void SaturationCorrection( TString outfilename );
51
52 // prepare and fit the run gains
53 void RunGains( TString outfilename );
54
55 // prepare and fit the 2-d correction (doca vs. entrance angle)
56 void TwoDCorrection( TString outfilename );
57
58 // apply calibrations
59 void ApplyCorrections( TString outfile );
60
61 private:
62
63 TString m_filename; // name of ROOT file that contain hit information
64 TString m_constfilename; // name of file that contains constants
65
66 double m_removeLowest; // low end of truncation
67 double m_removeHighest; // high end of truncation
68
69 int m_mcFlag; // flag for hadron correction: 0 if data, 1 if mc
70 int m_type; // flag for data type: 0 if BESIII, 1 if BELLEII
71 int m_fits; // flag to indicate how to get means: 0 for truncation, 1 for fits
72
73 int m_nevents; // the number of events stored in the vectors below
74
75 int m_bgbins; // number of BG bins
76 double m_lowerbg; // lower bound of BG
77 double m_upperbg; // upper bound of BG
78
79 int m_docabins; // number of DOCA bins
80 double m_lowerdoca; // lower bound of DOCA
81 double m_upperdoca; // upper bound of DOCA
82
83 int m_entabins; // number of entrance angle bins
84 double m_lowerenta; // lower bound of entrance angle
85 double m_upperenta; // upper bound of entrance angle
86
87 int m_costhbins; // number of cos(theta) bins
88
89 ElectronCorrection ecor; // object to access corrections
90};
91#endif
void SetupFromConfigFile(std::string configfile)
void RunGains(TString outfilename)
void ApplyCorrections(TString outfile)
void SaturationCorrection(TString outfilename)
void SetFileName(TString newfilename)
void TwoDCorrection(TString outfilename)
void GenerateSample(TString outfile)