00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00032
00039
00040
00045
00046
00056
00057
00058 #ifndef _MJDATABASESIMPE800G_HH
00059 #define _MJDATABASESIPLE800G_HH
00060
00061
00062 #include "database/MJDatabaseMaterial.hh"
00063
00064 #include <string>
00065 #include <vector>
00066 #include "libpq-fe.h"
00067
00068 using namespace std;
00069
00070
00071
00072 #ifndef _CRYSTALRES_
00073 #define _CRYSTALRES_
00074
00075 struct CrystalRes{
00076 CrystalRes(double e, double r)
00077 :fenergy(e), fresolution(r){}
00078 double energy(){return fenergy;}
00079 double resolution(){return fresolution;}
00080 private:
00081 double fenergy;
00082 double fresolution;
00083 };
00084 #endif
00085 #ifndef _CRYSTALEFF_
00086 #define _CRYSTALEFF_
00087
00088 struct CrystalEff{
00089 CrystalEff(double en, double ef)
00090 :fenergy(en), fefficiency(ef){}
00091 double energy(){return fenergy;}
00092 double efficiency(){return fefficiency;}
00093 private:
00094 double fenergy;
00095 double fefficiency;
00096 };
00097 #endif
00098
00099 class MJDatabaseSimple800g
00100 {
00101 public:
00102
00103
00104 MJDatabaseSimple800g();
00105
00106
00107 MJDatabaseSimple800g(const MJDatabaseSimple800g &);
00108
00109
00110 ~MJDatabaseSimple800g();
00111
00112
00113 string GetCrystalSerialNo() { return fSerialNo ;}
00114 string GetMaterialName() { return fCrystalMat.GetName();}
00115 string GetInnerContactMaterialName() { return fInnerContactMat.GetName();}
00116 double GetCrystalRadius() { return fRadius ;}
00117 double GetCrystalHeight() { return fHeight ;}
00118 double GetCoreRadius() { return fCoreRadius ;}
00119 double GetCoreDepth() { return fCoreDepth ;}
00120 double GetInnerContactWidth() { return fInnerContactW;}
00121 double GetInnerDeadThickness() { return fInnerDeadThickness;}
00122 double GetOuterDeadThickness() { return fOuterDeadThickness;}
00123 double GetCornerRadius() { return fCornerR ;}
00124
00125 string GetBkgModel() { return fBkgModel;}
00126 char GetDiodType() { return fDiodType;}
00127 double GetDepletionVoltage() { return fDepletionVolt;}
00128 vector<CrystalRes> GetResolution() { return fResolution;}
00129 vector<CrystalEff> GetEfficiency(){ return fEfficiencies;}
00130 string GetComment(){ return fcomment;}
00131
00132 MJDatabaseSimple800g * createCrystal(PGresult *);
00133 void print(ostream&);
00134
00135 friend ostream& operator << (ostream& os, MJDatabaseSimple800g& );
00136
00137
00138
00139 protected:
00140
00141
00142
00143 private:
00144
00145 string fSerialNo;
00146 MJDatabaseMaterial fCrystalMat;
00147 double fHeight;
00148 string fBkgModel;
00149 double fRadius;
00150 double fCoreRadius;
00151 double fCornerR;
00152 double fCoreDepth;
00153 double fInnerContactW;
00154 MJDatabaseMaterial fInnerContactMat;
00155 double fInnerDeadThickness;
00156 double fOuterDeadThickness;
00157 string fInnerBkgModel;
00158 char fDiodType;
00159 double fDepletionVolt;
00160 vector < CrystalRes> fResolution;
00161 vector<CrystalEff> fEfficiencies;
00162 string fcomment;
00163 };
00164 #endif