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 _MJDATABASECLOVERCRYSTAL_HH
00059 #define _MJDATABASECLOVERCRYSTAL_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 #ifndef _CRYSTALRES_
00072 #define _CRYSTALRES_
00073
00074 struct CrystalRes{
00075 CrystalRes(double e, double r)
00076 :fenergy(e), fresolution(r){}
00077 double energy(){return fenergy;}
00078 double resolution(){return fresolution;}
00079 private:
00080 double fenergy;
00081 double fresolution;
00082 };
00083 #endif
00084 #ifndef _CRYSTALEFF_
00085 #define _CRYSTALEFF_
00086
00087 struct CrystalEff{
00088 CrystalEff(double en, double ef)
00089 :fenergy(en), fefficiency(ef){}
00090 double energy(){return fenergy;}
00091 double efficiency(){return fefficiency;}
00092 private:
00093 double fenergy;
00094 double fefficiency;
00095 };
00096 #endif
00097
00098 class MJDatabaseCloverCrystal
00099 {
00100 public:
00101
00102
00103 MJDatabaseCloverCrystal();
00104
00105 MJDatabaseCloverCrystal(string, double, double, double, double,
00106 double, double, double, double,
00107 MJDatabaseMaterial&, double,
00108 MJDatabaseMaterial&, double, double);
00109
00110 MJDatabaseCloverCrystal(const MJDatabaseCloverCrystal &);
00111
00112
00113 ~MJDatabaseCloverCrystal();
00114
00115
00116 string GetCrystalSerialNo() { return fSerialNo ;}
00117 string GetMaterialName() { return fCrystalMat.GetName();}
00118 string GetInnerContactMaterialName() { return fInnerContactMat.GetName();}
00119 double GetCrystalRadius() { return fRadius ;}
00120 double GetCrystalHeight() { return fHeight ;}
00121 double GetCoreRadius() { return fCoreRadius ;}
00122 double GetCoreDepth() { return fCoreDepth ;}
00123 double GetTopDeficit() { return fTopDeficit ;}
00124 double GetBottomDeficit() { return fBottomDeficit;}
00125 double GetRightDeficit() { return fRightDeficit ;}
00126 double GetLeftDeficit() { return fLeftDeficit;}
00127 double GetInnerContactWidth() { return fInnerContactW;}
00128 double GetInnerDeadThickness() { return fInnerDeadThickness;}
00129 double GetOuterDeadThickness() { return fOuterDeadThickness;}
00130 double GetCornerRadius() { return fCornerR; }
00131 double GetCoreBubbleRadius() { return fCoreBubble;}
00132 vector<double> GetOrientation() { return fOrient;}
00133 string GetBkgModel() { return fBkgModel;}
00134 char GetDiodType() { return fDiodType;}
00135 int GetDepletionVoltage() { return fDepletionVolt;}
00136 vector<CrystalRes> GetResolution() { return fResolution;}
00137 vector<CrystalEff> GetEfficiency(){ return fEfficiencies;}
00138 vector<double> GetRatios() { return fRatios;}
00139
00140 MJDatabaseCloverCrystal * createCrystal(PGresult *);
00141 void print(ostream&);
00142
00143 friend ostream& operator << (ostream& os, MJDatabaseCloverCrystal& );
00144
00145
00146
00147 protected:
00148
00149
00150
00151 private:
00152
00153 string fSerialNo;
00154 MJDatabaseMaterial fCrystalMat;
00155 double fHeight;
00156 string fBkgModel;
00157 double fRadius;
00158 double fCornerR;
00159 double fCoreBubble;
00160 double fCoreRadius;
00161 double fCoreDepth;
00162 double fTopDeficit;
00163 double fBottomDeficit;
00164 double fRightDeficit;
00165 double fLeftDeficit;
00166 vector<double> fOrient;
00167 double fInnerContactW;
00168 MJDatabaseMaterial fInnerContactMat;
00169 double fInnerDeadThickness;
00170 double fOuterDeadThickness;
00171 string fInnerBkgModel;
00172 char fDiodType;
00173 int fDepletionVolt;
00174 vector < CrystalRes> fResolution;
00175 vector<CrystalEff> fEfficiencies;
00176 vector<double> fRatios;
00177
00178 };
00179 #endif