-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathQfuncs.cxx
87 lines (80 loc) · 2.4 KB
/
Qfuncs.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// @(#)Qfuncs:$Id$
// Authors: KD Jan-26-2015
/*************************************************************************
* Copyright (C) None. *
* All rights reserved. *
**************************************************************************/
//////////////////////////////////////////////////////////////////////////
// //
// Qfuncs //
// //
// Single functions Q for various geometries and shapes, //
// all as a function of t //
// //
//////////////////////////////////////////////////////////////////////////
#include "Qfuncs.h"
#include "TMath.h"
using namespace TMath;
//______________________________________________________________________________
double Qfuncs::PadRect(double tt, double xl, double xh, double yl, double yh, double w)
{
// Calculate dispersion of charge across 2-D resistive anode
double N = 10000;// in q_e, 8000 is typical COMPASS GEM value
double R = 5.3E05;//530000;// Ohms per square
double C = 0.21E-12;// 0.21pF/mm^2
//double w = 250E-3;// in mm
/*
double tt = t[0];
double xl = par[0];//1;// in mm
double xh = par[1];//3;// in mm
double yl = par[2];//1;// in mm
double yh = par[3];//7;// in mm
*/
double Qpad;// = 1/Sqrt(4*t/(R*C)+2*Power(w,2));
double ttn=-999;
if(tt>0)
{
ttn=tt/double(1000000000);
double S = Sqrt(4*ttn/(R*C)+2*Power(w,2));
double diffxErf = Erf(xh/S)-Erf(xl/S);
double diffyErf = Erf(yh/S)-Erf(yl/S);
Qpad = N/double(4) * ( diffxErf*diffyErf );
}
else
{
Qpad = 0;
}
return Qpad;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
double Qfuncs::TestTri(double tt)
{
double tri;
if(tt>0&&tt<2)
{
tri = tt;
}
else if(tt>=2&&tt<4)
{
tri = 4 - tt;
}
else
{
tri = 0;
}
return tri;
}
double Qfuncs::TestBox(double tt)
{
double box;
if(tt>0&&tt<4)
{
box = 2;
}
else
{
box = 0;
}
return box;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~