21 shift_z = self.shift_z
23 mom = self.mom1.shoot()
24 pos_temp = mom.Vect().Unit()
34 tanTheta = pos_temp.Perp() / abs( pos_temp.Z() );
35 if tanTheta > barrelR1 / endcapZ1:
36 pos_temp *= barrelR1 / pos_temp.Perp()
37 elif tanTheta > barrelR2 / endcapZ1:
38 pos_temp *= endcapZ1 / abs( pos_temp.Z() )
39 elif tanTheta > barrelR2 / endcapZ2:
40 pos_temp *= barrelR2 / pos_temp.Perp()
41 elif tanTheta > barrelR3 / endcapZ2:
42 pos_temp *= endcapZ2 / abs( pos_temp.Z() )
44 pos_temp *= barrelR3 / pos_temp.Perp()
47 pos_temp_2 = ROOT.TVector3()
48 pos_temp_2.SetXYZ(pos_temp.X(), pos_temp.Y(), pos_temp.Z()+shift_z)
49 pos_temp_2 *= 1. / pos_temp_2.Mag();
52 tanTheta_2 = pos_temp_2.Perp() / abs( pos_temp_2.Z() );
53 if tanTheta_2 > barrelR1 / endcapZ1:
54 pos_temp_2 *= barrelR1 / pos_temp_2.Perp()
55 elif tanTheta_2 > barrelR2 / endcapZ1:
56 pos_temp_2 *= endcapZ1 / abs( pos_temp_2.Z() )
57 elif tanTheta_2 > barrelR2 / endcapZ2:
58 pos_temp_2 *= barrelR2 / pos_temp_2.Perp()
59 elif tanTheta_2 > barrelR3 / endcapZ2:
60 pos_temp_2 *= endcapZ2 / abs( pos_temp_2.Z() )
62 pos_temp_2 *= barrelR3 / pos_temp_2.Perp()
64 pos = ROOT.TLorentzVector(pos_temp_2.X(),pos_temp_2.Y(),pos_temp_2.Z(), pos_temp_2.Mag())
68 return [ PG.SampledParticle( pid , mom , pos ) ]