Functions | Variables
reco_momentum_tuples Namespace Reference

Functions

def shift_x (x)
 
def to_f (x)
 
def momentum_costheta (x1, x2, x3)
 
def momentum (x1, x2, x3, scale=1.)
 

Variables

 parser = ap()
 
 type
 
 str
 
 help
 
 default
 
 int
 
 float
 
 args = parser.parse_args()
 
float mag_P1 = 5.82044830e-3
 
float mag_P3 = -4.68880000e-6
 
float mag_P4 = 324.573967
 
 files = ls(args.i)
 
 t = RT.TChain("NTuples/GoodParticle")
 
 max_files = args.m
 
int nFiles = 0
 
 fout = RT.TFile(args.o, "RECREATE")
 
 h = RT.TH1D("h", "", 150,0.5,1.5)
 
 hTrue = RT.TH1D("hTrue", "", 150,0.5,1.5)
 
 true_vs_reco = RT.TH2D("true_vs_reco", "", 150,0.5,1.5,150,0.5,1.5)
 
 r = RT.TH1D("r", "", 200,-1.,1.)
 
 r_vs_true = RT.TH2D("r_vs_true", "", 150,0.5,1.5, 200,-1.,1.)
 
 r_vs_p = RT.TH2D("r_vs_p", "", 150,0.5,1.5, 200,-1.,1.)
 
 hF1 = RT.TH1D("hF1", "", 192, 0, 192)
 
 hF2 = RT.TH1D("hF2", "", 192, 0, 192)
 
 hF3 = RT.TH1D("hF3", "", 192, 0, 192)
 
 f1 = array("i", [0])
 
 f2 = array("i", [0])
 
 f3 = array("i", [0])
 
 x1 = array("d", [0])
 
 x2 = array("d", [0])
 
 x3 = array("d", [0])
 
 true_p = array("d", [0.])
 
 preSpec_p = array("d", [0.])
 
 TOF1_p = array("d", [0.])
 
 postSpec_p = array("d", [0.])
 
 NP04front_p = array("d", [0.])
 
 NP04FieldCage_p = array("d", [0.])
 
 reco_p = array("d", [0.])
 
 reco_p_B_plus = array("d", [0.])
 
 reco_p_B_minus = array("d", [0.])
 
 reco_p_B_plus_2 = array("d", [0.])
 
 reco_p_B_minus_2 = array("d", [0.])
 
 reco_tof = array("d", [0.])
 
 flip_p = array("d", [0.])
 
 plus_p_1 = array("d", [0.])
 
 minus_p_1 = array("d", [0.])
 
 plus_p_2 = array("d", [0.])
 
 minus_p_2 = array("d", [0.])
 
 plus_p_3 = array("d", [0.])
 
 minus_p_3 = array("d", [0.])
 
 PDG = array("i", [0])
 
 fcPDG = array("i", [0])
 
 TOF1_TrackID = array("i", [0])
 
 TRIG2_TrackID = array("i", [0])
 
 TOF1_ParentID = array("i", [0])
 
 TRIG2_ParentID = array("i", [0])
 
 TOF1_EventID = array("i", [0])
 
 TRIG2_EventID = array("i", [0])
 
 outtree = RT.TTree("tree","")
 
 reco_p_shift_n1sigma = array("d", [0.])
 
 reco_p_shift_p1sigma = array("d", [0.])
 
 reco_p_shift_n2sigma = array("d", [0.])
 
 reco_p_shift_p2sigma = array("d", [0.])
 
 reco_p_B_p1_shift_p1 = array("d", [0.])
 
 reco_p_B_m1_shift_p1 = array("d", [0.])
 
 reco_p_B_p1_shift_m1 = array("d", [0.])
 
 reco_p_B_m1_shift_m1 = array("d", [0.])
 
 reco_p_B_p2_shift_p1 = array("d", [0.])
 
 reco_p_B_m2_shift_p1 = array("d", [0.])
 
 reco_p_B_p2_shift_m1 = array("d", [0.])
 
 reco_p_B_m2_shift_m1 = array("d", [0.])
 
 reco_p_B_p1_shift_p2 = array("d", [0.])
 
 reco_p_B_m1_shift_p2 = array("d", [0.])
 
 reco_p_B_p1_shift_m2 = array("d", [0.])
 
 reco_p_B_m1_shift_m2 = array("d", [0.])
 
 reco_p_B_p2_shift_p2 = array("d", [0.])
 
 reco_p_B_m2_shift_p2 = array("d", [0.])
 
 reco_p_B_p2_shift_m2 = array("d", [0.])
 
 reco_p_B_m2_shift_m2 = array("d", [0.])
 
int count = 0
 
 px = e.AfterTarget_Px
 
 py = e.AfterTarget_Py
 
 pz = e.AfterTarget_Pz
 
 current
 
 LB = mag_P1*current
 
 deltaI = current-mag_P4
 

Function Documentation

def reco_momentum_tuples.momentum (   x1,
  x2,
  x3,
  scale = 1. 
)

Definition at line 198 of file reco_momentum_tuples.py.

198 def momentum(x1,x2,x3, scale = 1.):
199  return 299792458*LB*scale/(1.E9 * acos(momentum_costheta(x1,x2,x3)))
200 
201 
def momentum_costheta(x1, x2, x3)
def momentum(x1, x2, x3, scale=1.)
def reco_momentum_tuples.momentum_costheta (   x1,
  x2,
  x3 
)

Definition at line 46 of file reco_momentum_tuples.py.

46 def momentum_costheta(x1,x2,x3):
47  L1 = 1.98
48  L2 = 1.69472
49  L3 = 2.11666
50  fBeamBend = .12003
51 
52  a = (x2*L3 - x3*L2)*cos(fBeamBend)/(L3-L2);
53 
54 
55  numTerm = (a - x1)*( (L3 - L2)*tan(fBeamBend) + (x3 - x2)*cos(fBeamBend) ) + L1*( L3 - L2 );
56 
57  denomTerm1 = sqrt( L1*L1 + (a - x1)*(a - x1) );
58  denomTerm2 = sqrt( ( (L3 - L2)*tan(fBeamBend) + (x3 - x2)*cos(fBeamBend) )**2 + ( (L3 - L2) )**2 );
59  denom = denomTerm1 * denomTerm2;
60 
61  cosTheta = numTerm/denom;
62  return cosTheta;
63 
64 
def momentum_costheta(x1, x2, x3)
def reco_momentum_tuples.shift_x (   x)

Definition at line 39 of file reco_momentum_tuples.py.

39 def shift_x(x):
40  return ( floor(x) + .5 )
41 
def reco_momentum_tuples.to_f (   x)

Definition at line 42 of file reco_momentum_tuples.py.

42 def to_f(x):
43  if x > 0.: return int(ceil(x))
44  else: return int(floor(x))
45 

Variable Documentation

reco_momentum_tuples.args = parser.parse_args()

Definition at line 13 of file reco_momentum_tuples.py.

int reco_momentum_tuples.count = 0

Definition at line 202 of file reco_momentum_tuples.py.

reco_momentum_tuples.current

Definition at line 254 of file reco_momentum_tuples.py.

reco_momentum_tuples.default

Definition at line 8 of file reco_momentum_tuples.py.

reco_momentum_tuples.deltaI = current-mag_P4

Definition at line 262 of file reco_momentum_tuples.py.

reco_momentum_tuples.f1 = array("i", [0])

Definition at line 78 of file reco_momentum_tuples.py.

reco_momentum_tuples.f2 = array("i", [0])

Definition at line 79 of file reco_momentum_tuples.py.

reco_momentum_tuples.f3 = array("i", [0])

Definition at line 80 of file reco_momentum_tuples.py.

reco_momentum_tuples.fcPDG = array("i", [0])

Definition at line 106 of file reco_momentum_tuples.py.

reco_momentum_tuples.files = ls(args.i)

Definition at line 24 of file reco_momentum_tuples.py.

reco_momentum_tuples.flip_p = array("d", [0.])

Definition at line 98 of file reco_momentum_tuples.py.

reco_momentum_tuples.float

Definition at line 12 of file reco_momentum_tuples.py.

reco_momentum_tuples.fout = RT.TFile(args.o, "RECREATE")

Definition at line 65 of file reco_momentum_tuples.py.

reco_momentum_tuples.h = RT.TH1D("h", "", 150,0.5,1.5)

Definition at line 66 of file reco_momentum_tuples.py.

reco_momentum_tuples.help

Definition at line 8 of file reco_momentum_tuples.py.

reco_momentum_tuples.hF1 = RT.TH1D("hF1", "", 192, 0, 192)

Definition at line 74 of file reco_momentum_tuples.py.

reco_momentum_tuples.hF2 = RT.TH1D("hF2", "", 192, 0, 192)

Definition at line 75 of file reco_momentum_tuples.py.

reco_momentum_tuples.hF3 = RT.TH1D("hF3", "", 192, 0, 192)

Definition at line 76 of file reco_momentum_tuples.py.

reco_momentum_tuples.hTrue = RT.TH1D("hTrue", "", 150,0.5,1.5)

Definition at line 67 of file reco_momentum_tuples.py.

reco_momentum_tuples.int

Definition at line 10 of file reco_momentum_tuples.py.

reco_momentum_tuples.LB = mag_P1*current

Definition at line 261 of file reco_momentum_tuples.py.

float reco_momentum_tuples.mag_P1 = 5.82044830e-3

Definition at line 17 of file reco_momentum_tuples.py.

float reco_momentum_tuples.mag_P3 = -4.68880000e-6

Definition at line 18 of file reco_momentum_tuples.py.

float reco_momentum_tuples.mag_P4 = 324.573967

Definition at line 19 of file reco_momentum_tuples.py.

reco_momentum_tuples.max_files = args.m

Definition at line 27 of file reco_momentum_tuples.py.

reco_momentum_tuples.minus_p_1 = array("d", [0.])

Definition at line 100 of file reco_momentum_tuples.py.

reco_momentum_tuples.minus_p_2 = array("d", [0.])

Definition at line 102 of file reco_momentum_tuples.py.

reco_momentum_tuples.minus_p_3 = array("d", [0.])

Definition at line 104 of file reco_momentum_tuples.py.

int reco_momentum_tuples.nFiles = 0

Definition at line 30 of file reco_momentum_tuples.py.

reco_momentum_tuples.NP04FieldCage_p = array("d", [0.])

Definition at line 91 of file reco_momentum_tuples.py.

reco_momentum_tuples.NP04front_p = array("d", [0.])

Definition at line 90 of file reco_momentum_tuples.py.

reco_momentum_tuples.outtree = RT.TTree("tree","")

Definition at line 115 of file reco_momentum_tuples.py.

reco_momentum_tuples.parser = ap()

Definition at line 6 of file reco_momentum_tuples.py.

reco_momentum_tuples.PDG = array("i", [0])

Definition at line 105 of file reco_momentum_tuples.py.

reco_momentum_tuples.plus_p_1 = array("d", [0.])

Definition at line 99 of file reco_momentum_tuples.py.

reco_momentum_tuples.plus_p_2 = array("d", [0.])

Definition at line 101 of file reco_momentum_tuples.py.

reco_momentum_tuples.plus_p_3 = array("d", [0.])

Definition at line 103 of file reco_momentum_tuples.py.

reco_momentum_tuples.postSpec_p = array("d", [0.])

Definition at line 89 of file reco_momentum_tuples.py.

reco_momentum_tuples.preSpec_p = array("d", [0.])

Definition at line 87 of file reco_momentum_tuples.py.

reco_momentum_tuples.px = e.AfterTarget_Px

Definition at line 218 of file reco_momentum_tuples.py.

reco_momentum_tuples.py = e.AfterTarget_Py

Definition at line 219 of file reco_momentum_tuples.py.

reco_momentum_tuples.pz = e.AfterTarget_Pz

Definition at line 220 of file reco_momentum_tuples.py.

reco_momentum_tuples.r = RT.TH1D("r", "", 200,-1.,1.)

Definition at line 70 of file reco_momentum_tuples.py.

reco_momentum_tuples.r_vs_p = RT.TH2D("r_vs_p", "", 150,0.5,1.5, 200,-1.,1.)

Definition at line 72 of file reco_momentum_tuples.py.

reco_momentum_tuples.r_vs_true = RT.TH2D("r_vs_true", "", 150,0.5,1.5, 200,-1.,1.)

Definition at line 71 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p = array("d", [0.])

Definition at line 92 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_m1_shift_m1 = array("d", [0.])

Definition at line 153 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_m1_shift_m2 = array("d", [0.])

Definition at line 171 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_m1_shift_p1 = array("d", [0.])

Definition at line 151 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_m1_shift_p2 = array("d", [0.])

Definition at line 169 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_m2_shift_m1 = array("d", [0.])

Definition at line 162 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_m2_shift_m2 = array("d", [0.])

Definition at line 180 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_m2_shift_p1 = array("d", [0.])

Definition at line 160 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_m2_shift_p2 = array("d", [0.])

Definition at line 178 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_minus = array("d", [0.])

Definition at line 94 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_minus_2 = array("d", [0.])

Definition at line 96 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_p1_shift_m1 = array("d", [0.])

Definition at line 152 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_p1_shift_m2 = array("d", [0.])

Definition at line 170 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_p1_shift_p1 = array("d", [0.])

Definition at line 150 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_p1_shift_p2 = array("d", [0.])

Definition at line 168 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_p2_shift_m1 = array("d", [0.])

Definition at line 161 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_p2_shift_m2 = array("d", [0.])

Definition at line 179 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_p2_shift_p1 = array("d", [0.])

Definition at line 159 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_p2_shift_p2 = array("d", [0.])

Definition at line 177 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_plus = array("d", [0.])

Definition at line 93 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_B_plus_2 = array("d", [0.])

Definition at line 95 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_shift_n1sigma = array("d", [0.])

Definition at line 142 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_shift_n2sigma = array("d", [0.])

Definition at line 144 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_shift_p1sigma = array("d", [0.])

Definition at line 143 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_p_shift_p2sigma = array("d", [0.])

Definition at line 145 of file reco_momentum_tuples.py.

reco_momentum_tuples.reco_tof = array("d", [0.])

Definition at line 97 of file reco_momentum_tuples.py.

reco_momentum_tuples.str

Definition at line 8 of file reco_momentum_tuples.py.

reco_momentum_tuples.t = RT.TChain("NTuples/GoodParticle")

Definition at line 25 of file reco_momentum_tuples.py.

reco_momentum_tuples.TOF1_EventID = array("i", [0])

Definition at line 112 of file reco_momentum_tuples.py.

reco_momentum_tuples.TOF1_p = array("d", [0.])

Definition at line 88 of file reco_momentum_tuples.py.

reco_momentum_tuples.TOF1_ParentID = array("i", [0])

Definition at line 110 of file reco_momentum_tuples.py.

reco_momentum_tuples.TOF1_TrackID = array("i", [0])

Definition at line 108 of file reco_momentum_tuples.py.

reco_momentum_tuples.TRIG2_EventID = array("i", [0])

Definition at line 113 of file reco_momentum_tuples.py.

reco_momentum_tuples.TRIG2_ParentID = array("i", [0])

Definition at line 111 of file reco_momentum_tuples.py.

reco_momentum_tuples.TRIG2_TrackID = array("i", [0])

Definition at line 109 of file reco_momentum_tuples.py.

reco_momentum_tuples.true_p = array("d", [0.])

Definition at line 86 of file reco_momentum_tuples.py.

reco_momentum_tuples.true_vs_reco = RT.TH2D("true_vs_reco", "", 150,0.5,1.5,150,0.5,1.5)

Definition at line 68 of file reco_momentum_tuples.py.

reco_momentum_tuples.type

Definition at line 8 of file reco_momentum_tuples.py.

reco_momentum_tuples.x1 = array("d", [0])

Definition at line 82 of file reco_momentum_tuples.py.

reco_momentum_tuples.x2 = array("d", [0])

Definition at line 83 of file reco_momentum_tuples.py.

reco_momentum_tuples.x3 = array("d", [0])

Definition at line 84 of file reco_momentum_tuples.py.