ATLAS Offline Software
Loading...
Searching...
No Matches
TRTCalib_cfilter Namespace Reference

Functions

 tshift_poly (dt, p0, p1, p2, p3)
 p3root (a, b, c, d)

Variables

bool keeprt = False
bool keept0 = False
bool shiftrt = False
bool shiftt0 = False
bool do_global = False
 Dt0 = float(sys.argv[2])
 olddbs = open(sys.argv[3]).readlines()
 newdbs = open(sys.argv[3]).readlines()
 olddicts = open(sys.argv[3]).readlines()
list oldrts = []
list oldt0s = []
list olderrors = []
list newrts = []
list newt0s = []
list newerrors = []
list rts = newrts
list t0s = newt0s
list rtfix = [1,18]
dict rtconsts = {}
dict rtshifts = {}
int nprint = 0
 rtkeytokens = rt.strip().split(':')[0].strip().split()
str rtdbkey = "%s %s %s %s %s"%(rtkeytokens[0],rtkeytokens[1],rtkeytokens[2],rtkeytokens[3],rtkeytokens[4])
str rtdictkey = "_%s_%s_%s_%s_%s"%(rtkeytokens[0],rtkeytokens[1],rtkeytokens[2],rtkeytokens[3],rtkeytokens[4])
 p0 = float(rt.strip().split(':')[-1].split()[1].strip())
 p1 = float(rt.strip().split(':')[-1].split()[2].strip())
 p2 = float(rt.strip().split(':')[-1].split()[3].strip())
 p3 = float(rt.strip().split(':')[-1].split()[4].strip())
list poly_orig = [p3, p2, p1, p0 - rtfix[0]]
 r_orig = p3root(p3, p2, p1, p0 - rtfix[0])
tuple shiftval = ( r_orig - rtfix[1] )
 p0n
 p1n
 p2n
 p3n
list poly_new = [p3n, p2n, p1n, p0n]
 r_new = p3root(p3n, p2n, p1n, p0n)
float shiftvaln = 0.0
 p0nn
 p1nn
 p2nn
 p3nn
list poly_newnew = [p3nn, p2nn, p1nn, p0nn]
dict t0consts = {}
 t0keytokens = t0.strip().split(':')[0].strip().split()
str t0dbkey = "%s %s %s %s %s"%(t0keytokens[0],t0keytokens[1],t0keytokens[2],t0keytokens[3],t0keytokens[4])
list dbrtouts = []
list dbt0outs = []
 dbfile = open("dbconst.txt","w")
dict t0dicts = {}
list dictouts = []
 keytokens = straw.split('_')
 detector
 dictfile = open("dictconst.txt","w")

Function Documentation

◆ p3root()

TRTCalib_cfilter.p3root ( a,
b,
c,
d )

Definition at line 14 of file TRTCalib_cfilter.py.

14def p3root(a, b, c, d): # this is to replace the numpy root finder, should numpy not be available
15
16 r = 18.0
17 pi = 3.14159265359
18 if a*a < 1.0e-48 :
19 return r
20 p = (3*a*c-b*b)/(3*a*a)
21 q = (2*b*b*b-9*a*b*c+27*a*a*d)/(27*a*a*a)
22
23 offset = -b/(3*a)
24 discriminant = 4*p*p*p+27*q*q
25 if discriminant > 0:
26 v = math.sqrt(q*q/4 + p*p*p/27 )
27 if (-q/2 + v) >0 and (-q/2-v) > 0 :
28 r = pow(-q/2 + v,0.3333333)+pow(-q/2-v,0.3333333)+offset
29 if discriminant < 0 and p < 0:
30 cphi = (3.0/2.0)*(q/p)*math.sqrt(-3/p)
31 phi = math.acos(cphi)
32 z1 = 2*math.sqrt(-p/3)*math.cos(phi/3) + offset
33 z2 = 2*math.sqrt(-p/3)*math.cos((phi+2*pi)/3) + offset
34 z3 = 2*math.sqrt(-p/3)*math.cos((phi+4*pi)/3) + offset
35 if abs(z1-18)<abs(z2-18) and abs(z1-18)<abs(z3-18):
36 r = z1
37 elif abs(z2-18)<abs(z3-18):
38 r = z2
39 else:
40 r = z3
41
42 return r
43
constexpr int pow(int base, int exp) noexcept

◆ tshift_poly()

TRTCalib_cfilter.tshift_poly ( dt,
p0,
p1,
p2,
p3 )

Definition at line 7 of file TRTCalib_cfilter.py.

7def tshift_poly(dt,p0,p1,p2,p3):
8 p0n = p0 + p1*dt + p2*dt*dt + p3*dt*dt*dt
9 p1n = p1 + 2*p2*dt + 3*p3*dt*dt
10 p2n = p2 + 3*p3*dt
11 p3n = p3
12 return p0n,p1n,p2n,p3n
13

Variable Documentation

◆ dbfile

TRTCalib_cfilter.dbfile = open("dbconst.txt","w")

Definition at line 207 of file TRTCalib_cfilter.py.

◆ dbrtouts

list TRTCalib_cfilter.dbrtouts = []

Definition at line 187 of file TRTCalib_cfilter.py.

◆ dbt0outs

list TRTCalib_cfilter.dbt0outs = []

Definition at line 192 of file TRTCalib_cfilter.py.

◆ detector

TRTCalib_cfilter.detector

Definition at line 241 of file TRTCalib_cfilter.py.

◆ dictfile

TRTCalib_cfilter.dictfile = open("dictconst.txt","w")

Definition at line 251 of file TRTCalib_cfilter.py.

◆ dictouts

list TRTCalib_cfilter.dictouts = []

Definition at line 238 of file TRTCalib_cfilter.py.

◆ do_global

bool TRTCalib_cfilter.do_global = False

Definition at line 48 of file TRTCalib_cfilter.py.

◆ Dt0

TRTCalib_cfilter.Dt0 = float(sys.argv[2])

Definition at line 55 of file TRTCalib_cfilter.py.

◆ keeprt

int TRTCalib_cfilter.keeprt = False

Definition at line 44 of file TRTCalib_cfilter.py.

◆ keept0

int TRTCalib_cfilter.keept0 = False

Definition at line 45 of file TRTCalib_cfilter.py.

◆ keytokens

TRTCalib_cfilter.keytokens = straw.split('_')

Definition at line 240 of file TRTCalib_cfilter.py.

◆ newdbs

TRTCalib_cfilter.newdbs = open(sys.argv[3]).readlines()

Definition at line 57 of file TRTCalib_cfilter.py.

◆ newerrors

list TRTCalib_cfilter.newerrors = []

Definition at line 99 of file TRTCalib_cfilter.py.

◆ newrts

list TRTCalib_cfilter.newrts = []

Definition at line 97 of file TRTCalib_cfilter.py.

◆ newt0s

list TRTCalib_cfilter.newt0s = []

Definition at line 98 of file TRTCalib_cfilter.py.

◆ nprint

int TRTCalib_cfilter.nprint = 0

Definition at line 122 of file TRTCalib_cfilter.py.

◆ olddbs

TRTCalib_cfilter.olddbs = open(sys.argv[3]).readlines()

Definition at line 56 of file TRTCalib_cfilter.py.

◆ olddicts

TRTCalib_cfilter.olddicts = open(sys.argv[3]).readlines()

Definition at line 63 of file TRTCalib_cfilter.py.

◆ olderrors

list TRTCalib_cfilter.olderrors = []

Definition at line 87 of file TRTCalib_cfilter.py.

◆ oldrts

list TRTCalib_cfilter.oldrts = []

Definition at line 85 of file TRTCalib_cfilter.py.

◆ oldt0s

list TRTCalib_cfilter.oldt0s = []

Definition at line 86 of file TRTCalib_cfilter.py.

◆ p0

TRTCalib_cfilter.p0 = float(rt.strip().split(':')[-1].split()[1].strip())

Definition at line 129 of file TRTCalib_cfilter.py.

◆ p0n

TRTCalib_cfilter.p0n

Definition at line 140 of file TRTCalib_cfilter.py.

◆ p0nn

TRTCalib_cfilter.p0nn

Definition at line 145 of file TRTCalib_cfilter.py.

◆ p1

TRTCalib_cfilter.p1 = float(rt.strip().split(':')[-1].split()[2].strip())

Definition at line 130 of file TRTCalib_cfilter.py.

◆ p1n

TRTCalib_cfilter.p1n

Definition at line 140 of file TRTCalib_cfilter.py.

◆ p1nn

TRTCalib_cfilter.p1nn

Definition at line 145 of file TRTCalib_cfilter.py.

◆ p2

TRTCalib_cfilter.p2 = float(rt.strip().split(':')[-1].split()[3].strip())

Definition at line 131 of file TRTCalib_cfilter.py.

◆ p2n

TRTCalib_cfilter.p2n

Definition at line 140 of file TRTCalib_cfilter.py.

◆ p2nn

TRTCalib_cfilter.p2nn

Definition at line 145 of file TRTCalib_cfilter.py.

◆ p3

TRTCalib_cfilter.p3 = float(rt.strip().split(':')[-1].split()[4].strip())

Definition at line 132 of file TRTCalib_cfilter.py.

◆ p3n

TRTCalib_cfilter.p3n

Definition at line 140 of file TRTCalib_cfilter.py.

◆ p3nn

TRTCalib_cfilter.p3nn

Definition at line 145 of file TRTCalib_cfilter.py.

◆ poly_new

list TRTCalib_cfilter.poly_new = [p3n, p2n, p1n, p0n]

Definition at line 141 of file TRTCalib_cfilter.py.

◆ poly_newnew

list TRTCalib_cfilter.poly_newnew = [p3nn, p2nn, p1nn, p0nn]

Definition at line 146 of file TRTCalib_cfilter.py.

◆ poly_orig

list TRTCalib_cfilter.poly_orig = [p3, p2, p1, p0 - rtfix[0]]

Definition at line 136 of file TRTCalib_cfilter.py.

◆ r_new

TRTCalib_cfilter.r_new = p3root(p3n, p2n, p1n, p0n)

Definition at line 142 of file TRTCalib_cfilter.py.

◆ r_orig

TRTCalib_cfilter.r_orig = p3root(p3, p2, p1, p0 - rtfix[0])

Definition at line 137 of file TRTCalib_cfilter.py.

◆ rtconsts

dict TRTCalib_cfilter.rtconsts = {}

Definition at line 120 of file TRTCalib_cfilter.py.

◆ rtdbkey

str TRTCalib_cfilter.rtdbkey = "%s %s %s %s %s"%(rtkeytokens[0],rtkeytokens[1],rtkeytokens[2],rtkeytokens[3],rtkeytokens[4])

Definition at line 126 of file TRTCalib_cfilter.py.

◆ rtdictkey

str TRTCalib_cfilter.rtdictkey = "_%s_%s_%s_%s_%s"%(rtkeytokens[0],rtkeytokens[1],rtkeytokens[2],rtkeytokens[3],rtkeytokens[4])

Definition at line 127 of file TRTCalib_cfilter.py.

◆ rtfix

list TRTCalib_cfilter.rtfix = [1,18]

Definition at line 119 of file TRTCalib_cfilter.py.

◆ rtkeytokens

TRTCalib_cfilter.rtkeytokens = rt.strip().split(':')[0].strip().split()

Definition at line 125 of file TRTCalib_cfilter.py.

◆ rts

TRTCalib_cfilter.rts = newrts

Definition at line 109 of file TRTCalib_cfilter.py.

◆ rtshifts

dict TRTCalib_cfilter.rtshifts = {}

Definition at line 121 of file TRTCalib_cfilter.py.

◆ shiftrt

int TRTCalib_cfilter.shiftrt = False

Definition at line 46 of file TRTCalib_cfilter.py.

◆ shiftt0

int TRTCalib_cfilter.shiftt0 = False

Definition at line 47 of file TRTCalib_cfilter.py.

◆ shiftval

tuple TRTCalib_cfilter.shiftval = ( r_orig - rtfix[1] )

Definition at line 138 of file TRTCalib_cfilter.py.

◆ shiftvaln

float TRTCalib_cfilter.shiftvaln = 0.0

Definition at line 144 of file TRTCalib_cfilter.py.

◆ t0consts

dict TRTCalib_cfilter.t0consts = {}

Definition at line 177 of file TRTCalib_cfilter.py.

◆ t0dbkey

str TRTCalib_cfilter.t0dbkey = "%s %s %s %s %s"%(t0keytokens[0],t0keytokens[1],t0keytokens[2],t0keytokens[3],t0keytokens[4])

Definition at line 180 of file TRTCalib_cfilter.py.

◆ t0dicts

dict TRTCalib_cfilter.t0dicts = {}

Definition at line 234 of file TRTCalib_cfilter.py.

◆ t0keytokens

TRTCalib_cfilter.t0keytokens = t0.strip().split(':')[0].strip().split()

Definition at line 179 of file TRTCalib_cfilter.py.

◆ t0s

TRTCalib_cfilter.t0s = newt0s

Definition at line 110 of file TRTCalib_cfilter.py.