lhcopt / beambeam_macros Goto Github PK
View Code? Open in Web Editor NEWBeam beam macros to setup tracking simulations
Beam beam macros to setup tracking simulations
if(mylhcbeam==1)
{
beamx = beam%lhcb2->ex;
beamy = beam%lhcb2->ey;
sigz = beam%lhcb1->sigt;
sige = beam%lhcb1->sige;
};
if(mylhcbeam==2)
{
beamx = beam%lhcb1->ex;
beamy = beam%lhcb1->ey;
sigz = beam%lhcb2->sigt;
sige = beam%lhcb2->sige;
};
system,"/afs/cern.ch/user/g/giadarol/public/beambeam_macros/headonslice";
This is done based on fraction_crab and on_x1/on_x5
It is inconsistent with what is presently done in lhcmask repository (module_01)
DEFINE_BB_LENS(label,NIR,nn,flag,bbcomm)
Already implemented and tested in python
def find_alpha_and_phi(dpx, dpy):
absphi = np.sqrt(dpx ** 2 + dpy ** 2) / 2.0
if absphi < 1e-20:
phi = absphi
alpha = 0.0
else:
if dpy>=0.:
if dpx>=0:
# First quadrant
if np.abs(dpx) >= np.abs(dpy):
# First octant
phi = absphi
alpha = np.arctan(dpy/dpx)
else:
# Second octant
phi = absphi
alpha = 0.5*np.pi - np.arctan(dpx/dpy)
else: #dpx<0
# Second quadrant
if np.abs(dpx) < np.abs(dpy):
# Third octant
phi = absphi
alpha = 0.5*np.pi - np.arctan(dpx/dpy)
else:
# Forth octant
phi = -absphi
alpha = np.arctan(dpy/dpx)
else: #dpy<0
if dpx<=0:
# Third quadrant
if np.abs(dpx) >= np.abs(dpy):
# Fifth octant
phi = -absphi
alpha = np.arctan(dpy/dpx)
else:
# Sixth octant
phi = -absphi
alpha = 0.5*np.pi - np.arctan(dpx/dpy)
else: #dpx>0
# Forth quadrant
if np.abs(dpx) <= np.abs(dpy):
# Seventh octant
phi = -absphi
alpha = 0.5*np.pi - np.arctan(dpx/dpy)
else:
# Eighth octant
phi = absphi
alpha = np.arctan(dpy/dpx)
return alpha, phi
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.