// My private MAD9 initialisation file. John.Jowett@cern.ch // N.B. this file is system-dependent: it calls Unix system commands // and must be modified to work on other systems. // Created at 15:25:42 on 26 Oct 1999 by JMJ // Modified at 11:59:07 on 10 Mar 2000 by JMJ OPTION,ECHO=FALSE; //----------------------------------------------------------------------- // Setting P0=P0Tesla lets us specify fields in Tesla, etc. // Brho is useful for converting fields to gradients, etc. const P0Tesla=1.E-9*CLIGHT; Brho := p0/P0Tesla ; // N.B. Delayed evaluation here. //----------------------------------------------------------------------- // OPTION settings // Store settings that I always like to have in some JMJ* variables. // Some of these may be defaults anyway. // I put my usual trace value in the variable JMJtrace so I can switch if off // temporarily in macros like JMJinfo. It would be nice to save and restore // them in, say, macros but there seems to be no way to assign the value of // of an OPTION setting to a variable. Or to scope. Hence this kludge. Bool JMJtrace=TRUE; Bool JMJinfo=True; Bool JMJecho=True; Bool JMJwarn=True; Bool JMJtfs=True; Bool JMJmad8=False; Bool JMJverify=False; JMJoptions(): Macro{ // all in one command to minimise output OPTION, ECHO=JMJecho, TRACE=JMJtrace, INFO=JMJinfo, WARN=JMJwarn, TFS=JMJtfs, MAD8=JMJmad8, VERIFY=JMJverify; } JMJquiet(): Macro{ OPTION,ECHO=False,TRACE=False,INFO=False,WARN=False; } //----------------------------------------------------------------------- // Information macro (assuming system is Unix) JMJshow(): Macro { JMJquiet(); echo,message="//---------------------------------------------------"; echo,message="// Information macro (called with JMJshow(); ):"; system,'"date" "+%H:%M:%S %a %d/%m/%y"'; system,"pwd"; system,"ls"; system,"ll *.link*" ; value,{P0,P0Tesla,Brho}; echo,message="//---------------------------------------------------"; JMJoptions(); } //----------------------------------------------------------------------- //Hints while running MAD, try to keep this up-to-date Hints(): Macro { JMJquiet(); echo,message="//---------------------------------------------------"; echo,message='//Some hints .... ' ; echo,message='// MAD Home Page: http:// cern.ch/mad'; echo,message='// show,".*"; list names of everything defined.'; echo,message='// show,"JMJ.*"; list my utilities'; echo,message='// show,".*Q.*"; to see everything with Q in it.'; echo,message='// what,x; to see what x is.'; echo,message='// value,x; to see value of expression x.'; echo,message='// JMJshow(); my information macro.'; echo,message='// toyline is a trivial beam line.'; echo,message='// Hints(); (this) hints macro.' ; echo,message='// .... and remember the semi-colons!!'; echo,message='////---------------------------------------------------'; JMJoptions(); } //----------------------------------------------------------------------- // It's convenient to define a trivial beam line so as to always have // something to try commands on toyd: drift,L=1.23456789; toyline: line=(toyd); //----------------------------------------------------------------------- // Messages to appear when MAD9 starts up echo,message=' //'; echo,message=' // Information: JMJshow(); Hints();'; echo,message=' // Option settings: JMJoptions(); JMJquiet();'; echo,message=' // ........... and remember those semi-colons;'; echo,message=' //'; // JMJoptions(); // set my usual preferences