GeFiCa
Germanium detector Field Calculator
PointContact.cc
Go to the documentation of this file.
1 #include "Units.h"
2 #include "PointContact.h"
3 using namespace GeFiCa;
4 
5 PointContact::PointContact(const char *name, const char *title) :
6  Detector(name, title), Radius(3*cm),
7  PointContactR(1*mm), PointContactH(300*nm),
8  BoreH(0), BoreR(0), BoreTaperW(0), BoreTaperH(0),
9  TaperW(1*mm), TaperH(1*mm), CornerW(1*mm), CornerH(1*mm),
10  WrapAroundR(-1), GrooveW(0), GrooveH(0)
11 { Height=5*cm; Bias.push_back(1*kV); }
12 //______________________________________________________________________________
13 //
15 {
17  if (Radius<=0) {
18  Error("CheckConfigurations", "Radius==%.1f!", Radius);
19  abort();
20  }
21  if (PointContactR<0) {
22  Error("CheckConfigurations", "PointContactR==%.1f!", PointContactR);
23  abort();
24  }
25  if (PointContactH<0) {
26  Error("CheckConfigurations", "PointContactH==%.1f!", PointContactH);
27  abort();
28  }
29  if (BoreH<0) {
30  Error("CheckConfigurations", "BoreH==%.1f!", BoreH);
31  abort();
32  }
33  if (BoreR<0) {
34  Error("CheckConfigurations", "BoreR==%.1f!", BoreR);
35  abort();
36  }
37  if (BoreTaperW<0) {
38  Error("CheckConfigurations", "BoreTaperW==%.1f!", BoreTaperW);
39  abort();
40  }
41  if (BoreTaperH<0) {
42  Error("CheckConfigurations", "BoreTaperH==%.1f!", BoreTaperH);
43  abort();
44  }
45  if (TaperW<0) {
46  Error("CheckConfigurations", "TaperW==%.1f!", TaperW);
47  abort();
48  }
49  if (TaperH<0) {
50  Error("CheckConfigurations", "TaperH==%.1f!", TaperH);
51  abort();
52  }
53  if (CornerW<0) {
54  Error("CheckConfigurations", "CornerW==%.1f!", CornerW);
55  abort();
56  }
57  if (CornerH<0) {
58  Error("CheckConfigurations", "CornerH==%.1f!", CornerH);
59  abort();
60  }
61  if (GrooveW<0) {
62  Error("CheckConfigurations", "GrooveW==%.1f!", GrooveW);
63  abort();
64  }
65  if (GrooveH<0) {
66  Error("CheckConfigurations", "GrooveH==%.1f!", GrooveH);
67  abort();
68  }
69  if (GrooveH>=Height) {
70  Error("CheckConfigurations", "GrooveH(%.1f)>=Height(%.1f)!",
71  GrooveH, Height);
72  abort();
73  }
76  Error("CheckConfigurations",
77  "PointContactR(%.1f)+GrooveW(%.1f)>WrapAroundR(%.1f)!",
79  abort();
80  }
81  if (PointContactH+BoreH>=Height) {
82  Error("CheckConfigurations",
83  "PointContactH(%.1f)+BoreH(%.1f)>=Height(%.1f)!",
85  abort();
86  }
88  Error("CheckConfigurations",
89  "BoreR(%.1f)+BoreTaperW(%.1f)+CornerW(%.1f)>=Radius(%.1f)!",
91  abort();
92  }
93  if (TaperH+CornerH>=Height) {
94  Error("CheckConfigurations", "TaperH(%.1f)+CornerH(%.1f)>=Height(%.1f)!",
96  abort();
97  }
98 }
99 //______________________________________________________________________________
100 //
101 #include <TBox.h>
102 #include <TLine.h>
103 void PointContact::Draw(Option_t* option)
104 {
105  TString opt(option); opt.ToLower();
106  if (opt.Contains("half")) return; // not implemented yet
107  // crystal outline
108  TBox *out = new TBox(-Radius,0,Radius,Height); out->SetFillStyle(0);
109  out->SetLineColor(kBlack); out->SetLineStyle(kDashed); out->Draw();
110  // bore hole
111  TBox *bore = new TBox(-BoreR,Height-BoreH,BoreR,Height);
112  bore->SetLineColor(kBlack); bore->SetLineStyle(kDashed);
113  bore->SetFillStyle(0); bore->Draw();
114  // point contact
115  TBox *pc = new TBox(-PointContactR,0,PointContactR,PointContactH);
116  pc->SetLineColor(kBlack); pc->SetLineStyle(kDashed);
117  pc->SetFillStyle(0); pc->Draw();
118  // bottom tapers
119  TLine *blt = new TLine(-Radius,TaperH,-Radius+TaperW,0);
120  blt->SetLineColor(kBlack); blt->SetLineStyle(kDashed); blt->Draw();
121  TLine *brt = new TLine(Radius-TaperW,0,Radius,TaperH);
122  brt->SetLineColor(kBlack); brt->SetLineStyle(kDashed); brt->Draw();
123  // top tapers
124  TLine *tlt = new TLine(-Radius,Height-CornerH,-Radius+CornerW,Height);
125  tlt->SetLineColor(kBlack); tlt->SetLineStyle(kDashed); tlt->Draw();
126  TLine *trt = new TLine(Radius-CornerW,Height,Radius,Height-CornerH);
127  trt->SetLineColor(kBlack); trt->SetLineStyle(kDashed); trt->Draw();
128  // bore tapers
129  TLine *lb = new TLine(-BoreTaperW-BoreR,Height,-BoreR,Height-BoreTaperH);
130  lb->SetLineColor(kBlack); lb->SetLineStyle(kDashed); lb->Draw();
131  TLine *rb = new TLine(BoreR,Height-BoreTaperH,BoreR+BoreTaperW,Height);
132  rb->SetLineColor(kBlack); rb->SetLineStyle(kDashed); rb->Draw();
133  // grove
134  TBox *lg = new TBox(-WrapAroundR,0,-WrapAroundR+GrooveW,GrooveH);
135  lg->SetLineColor(kBlack); lg->SetLineStyle(kDashed);
136  lg->SetFillStyle(0); lg->Draw();
137  TBox *rg = new TBox(WrapAroundR-GrooveW,0,WrapAroundR,GrooveH);
138  rg->SetLineColor(kBlack); rg->SetLineStyle(kDashed);
139  rg->SetFillStyle(0); rg->Draw();
140 }
std::vector< double > Bias
bias on electrodes
Definition: Detector.h:35
double GrooveH
Height of Groove.
Definition: PointContact.h:30
PointContact(const char *name="pc", const char *title="point-contact detector")
Definition: PointContact.cc:5
double BoreH
Depth of bore hole.
Definition: PointContact.h:17
static const double cm
centimeter
Definition: Units.h:12
double Radius
Radius of crystal.
Definition: PointContact.h:12
double CornerH
Height of taper (bore side)
Definition: PointContact.h:26
static const double kV
kilo volt
Definition: Units.h:21
double CornerW
Width of taper (bore side)
Definition: PointContact.h:25
double BoreTaperW
width of bore hole taper
Definition: PointContact.h:19
double WrapAroundR
Inner radius of outer contact.
Definition: PointContact.h:28
void CheckConfigurations()
Check if detector configurations make sense.
Definition: Detector.cc:13
double PointContactH
Height of point contact.
Definition: PointContact.h:15
Detector & crystal properties.
Definition: Detector.h:32
double Height
height of crystal
Definition: Detector.h:13
void Draw(Option_t *option="side")
double GrooveW
Width of Groove.
Definition: PointContact.h:29
static const double mm
minimeter
Definition: Units.h:15
A file defining commonly used units & constants.
double BoreTaperH
height of bore hole taper
Definition: PointContact.h:20
double BoreR
radius of bore hole
Definition: PointContact.h:18
double PointContactR
Radius of point contact.
Definition: PointContact.h:14
double TaperH
Height of taper (point contact side)
Definition: PointContact.h:23
double TaperW
Width of taper (point contact side)
Definition: PointContact.h:22
The only namespace in GeFiCa.
Definition: Detector.h:6
static const double nm
nanometer
Definition: Units.h:18