Class Reference for E1039 Core & Analysis Software
CalibParamXT.h
Go to the documentation of this file.
1 #ifndef __CALIB_PARAM_XT_H__
2 #define __CALIB_PARAM_XT_H__
3 #include <TGraphErrors.h>
4 #include "RunParamBase.h"
5 class TGraph;
6 class TGraphErrors;
7 
9 
13 class CalibParamXT : public CalibParamBase {
14  public:
16  struct Set {
17  double X0;
18  double X1;
19  double T0;
20  double T1;
21  TGraphErrors t2x;
22  TGraph t2dx;
23  TGraph t2dt;
24  TGraphErrors x2t;
25  TGraph x2dt;
26  TGraph x2dx;
27  void Add(const double t, const double x, const double dt, const double dx);
28  };
29 
30  private:
32  struct ParamItem {
33  std::string det_name;
34  short det;
35  double t;
36  double x;
37  double dt;
38  double dx;
39  };
40  typedef std::vector<ParamItem> List_t;
41  List_t m_list;
42 
43  typedef std::map<short, Set> SetMap_t; // [det_id] = Set
44  SetMap_t m_map_sets;
45 
46  public:
47  CalibParamXT();
48  virtual ~CalibParamXT();
49 
50  void Add(const std::string det , const double t, const double x, const double dt, const double dx);
51  void Add(const std::string det_name, const short det_id, const double t, const double x, const double dt, const double dx);
52 
53  Set* GetParam(const short det);
54 
55  void Print(std::ostream& os);
56 
57  protected:
58  int ReadFileCont(LineList& lines);
59  int WriteFileCont(std::ostream& os);
60 
61  void ReadDbTable(DbSvc& db);
62  void WriteDbTable(DbSvc& db);
63 };
64 
65 #endif // __CALIB_PARAM_XT_H__
Calibration parameter for chamber X-T relation.
Definition: CalibParamXT.h:13
virtual ~CalibParamXT()
Definition: CalibParamXT.cc:39
int ReadFileCont(LineList &lines)
Definition: CalibParamXT.cc:44
void Add(const std::string det, const double t, const double x, const double dt, const double dx)
int WriteFileCont(std::ostream &os)
Definition: CalibParamXT.cc:60
void WriteDbTable(DbSvc &db)
Definition: CalibParamXT.cc:88
void Print(std::ostream &os)
Set * GetParam(const short det)
Return a set of parameters for det. Return 0 if det is invalid.
void ReadDbTable(DbSvc &db)
Definition: CalibParamXT.cc:71
Standard interface with SQL database.
Definition: DbSvc.h:15
std::vector< std::string > LineList
Definition: RunParamBase.h:51
A set of parameters for one detector (plane).
Definition: CalibParamXT.h:16
TGraphErrors t2x
Definition: CalibParamXT.h:21
double X1
Maximim X. Half cell width.
Definition: CalibParamXT.h:18
double T0
T at X0. T0 > T1.
Definition: CalibParamXT.h:19
void Add(const double t, const double x, const double dt, const double dx)
Definition: CalibParamXT.cc:14
double T1
T at X1.
Definition: CalibParamXT.h:20
TGraphErrors x2t
Definition: CalibParamXT.h:24
double X0
Minimum X. Usually zero.
Definition: CalibParamXT.h:17