GeFiCa
Germanium detector Field Calculator
SquarePointContact.cc
Go to the documentation of this file.
1 #include "Units.h"
2 #include "SquarePointContact.h"
3 using namespace GeFiCa;
4 
5 SquarePointContact::SquarePointContact(const char *name, const char *title) :
6  Detector(name, title), Width(1*cm),Length(1*cm),
7  PointContactW(1*mm),PointContactL(1*mm), PointContactH(300*nm),
8  WrapAroundW(2*mm), WrapAroundL(2*mm)
9 { Height=1*cm; Bias.push_back(1*kV); }
10 //______________________________________________________________________________
11 //
13 {
15  if (Width<=0) {
16  Error("CheckConfigurations", "Width==%.1f!", Width); abort();
17  }
18  if (Length<=0) {
19  Error("CheckConfigurations", "Length==%.1f!", Length); abort();
20  }
21  if (PointContactW<=0) {
22  Error("CheckConfigurations", "PointContactW==%.1f!", PointContactW);
23  abort();
24  }
25  if (PointContactL<=0) {
26  Error("CheckConfigurations", "PointContactL==%.1f!", PointContactL);
27  abort();
28  }
29  if (PointContactH<0) {
30  Error("CheckConfigurations", "PointContactH==%.1f!", PointContactH);
31  abort();
32  }
33  if (WrapAroundW<PointContactW || WrapAroundW>Width) {
34  Error("CheckConfigurations", "WrapAroundW==%.1f!", WrapAroundW);
35  Error("CheckConfigurations", "PointContactW==%.1f!", PointContactW);
36  Error("CheckConfigurations", "Width==%.1f!", Width);
37  abort();
38  }
39  if (WrapAroundL<PointContactL || WrapAroundL>Length) {
40  Error("CheckConfigurations", "WrapAroundL==%.1f!", WrapAroundL);
41  Error("CheckConfigurations", "PointContactL==%.1f!", PointContactL);
42  Error("CheckConfigurations", "Length==%.1f!", Length);
43  abort();
44  }
45 }
46 //______________________________________________________________________________
47 //
48 #include <TBox.h>
49 #include <TLine.h>
50 void SquarePointContact::Draw(Option_t* option)
51 {
52  TString opt(option); opt.ToLower();
53  //TODO
54  /*
55  TString opt(option); opt.ToLower();
56  if (opt.Contains("half")) return; // not implemented yet
57  // crystal outline
58  TBox *out = new TBox(-Radius,0,Radius,Height); out->SetFillStyle(0);
59  out->SetLineColor(kBlack); out->SetLineStyle(kDashed); out->Draw();
60  // bore hole
61  TBox *bore = new TBox(-BoreR,Height-BoreH,BoreR,Height);
62  bore->SetLineColor(kBlack); bore->SetLineStyle(kDashed);
63  bore->SetFillStyle(0); bore->Draw();
64  // point contact
65  TBox *pc = new TBox(-PointContactR,0,PointContactR,PointContactH);
66  pc->SetLineColor(kBlack); pc->SetLineStyle(kDashed);
67  pc->SetFillStyle(0); pc->Draw();
68  */
69 }
double PointContactH
Height of point contact.
std::vector< double > Bias
bias on electrodes
Definition: Detector.h:35
double Length
Length(y) of crystal.
double WrapAroundW
Inner width of outer contact.
static const double cm
centimeter
Definition: Units.h:12
static const double kV
kilo volt
Definition: Units.h:21
SquarePointContact(const char *name="spc", const char *title="squre point-contact detector")
void CheckConfigurations()
Check if detector configurations make sense.
Definition: Detector.cc:13
Detector & crystal properties.
Definition: Detector.h:32
double Height
height of crystal
Definition: Detector.h:13
double Width
Width(x) of crystal.
static const double mm
minimeter
Definition: Units.h:15
double PointContactL
Length of point contact.
A file defining commonly used units & constants.
void Draw(Option_t *option="side")
double WrapAroundL
Inner length of outer contact.
The only namespace in GeFiCa.
Definition: Detector.h:6
double PointContactW
Width of point contact.
static const double nm
nanometer
Definition: Units.h:18