Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F10275407
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
View Options
diff --git a/current_generator/include/write.frm b/current_generator/include/write.frm
index 0351b07..9ef23c2 100644
--- a/current_generator/include/write.frm
+++ b/current_generator/include/write.frm
@@ -1,121 +1,123 @@
#procedure WriteHeader(OUTPUT)
#write <`OUTPUT'> "#pragma once"
#write <`OUTPUT'> ""
#write <`OUTPUT'> "#include <complex>"
#write <`OUTPUT'> "#include \"HEJ/helicity.hh\""
#write <`OUTPUT'> "#include \"HEJ/LorentzVector.hh\""
#write <`OUTPUT'> ""
#write <`OUTPUT'> "namespace HEJ {"
#endprocedure
#procedure WriteOptimised(OUTPUT,EXPRESSION,NUMHELICITIES,?MOMENTA)
#write <`OUTPUT'> " template<%"
#define FIRST "1"
#do i=1,`NUMHELICITIES'
#ifdef `FIRST'
#undefine FIRST
#write <`OUTPUT'> "Helicity%"
#else
#write <`OUTPUT'> ", Helicity%"
#endif
#enddo
#write <`OUTPUT'> ">"
#write <`OUTPUT'> " std::complex<double> `EXPRESSION'("
#call WriteMomenta(`?MOMENTA')
#write <`OUTPUT'> "\n );\n"
#call WriteOptimisedHelper(`OUTPUT',`EXPRESSION',`NUMHELICITIES',`?MOMENTA')
#endprocedure
#procedure WriteOptimisedHelper(OUTPUT,EXPRESSION,NUMHELICITIES,?REST)
#if `NUMHELICITIES' > 0
#do H={+,-}
#call WriteOptimisedHelper(`OUTPUT',`EXPRESSION',{`NUMHELICITIES'-1},`?REST',`H')
#enddo
#else
#define HELSTRING ""
#define TEMPLATEARGS ""
#define MOMENTA ""
#do ARG={`?REST'}
#if ("`ARG'" == "+") || ("`ARG'" == "-")
* arguments that define helicities
#redefine HELSTRING "`HELSTRING'`ARG'"
#if "`TEMPLATEARGS'" != ""
#redefine TEMPLATEARGS "`TEMPLATEARGS',"
#endif
#if "`ARG'" == "+"
#redefine TEMPLATEARGS "`TEMPLATEARGS'Helicity::plus"
#else
#redefine TEMPLATEARGS "`TEMPLATEARGS'Helicity::minus"
#endif
#else
* arguments that define momenta
#if "`MOMENTA'" != ""
#redefine MOMENTA "`MOMENTA',"
#endif
#redefine MOMENTA "`MOMENTA'`ARG'"
#endif
#enddo
#optimize [`EXPRESSION'`HELSTRING']
#write <`OUTPUT'> " template<>"
#write <`OUTPUT'> " inline std::complex<double> `EXPRESSION'<%"
* we use a loop here because otherwise FORM will insert line breaks
* if the string is too large
#define FIRST "1"
#do TEMPLATEARG={`TEMPLATEARGS'}
#ifdef `FIRST'
#undefine FIRST
#else
#write <`OUTPUT'> ", %"
#endif
#write <`OUTPUT'> "`TEMPLATEARG'%"
#enddo
#write <`OUTPUT'> ">("
#call WriteMomenta(`MOMENTA')
#write <`OUTPUT'> "\n ) {"
- #write <`OUTPUT'> " std::complex<double> %"
- #define FIRST "1"
- #do i=1,`optimmaxvar_'
- #ifdef `FIRST'
- #undefine FIRST
- #write <`OUTPUT'> "Z`i'_%"
- #else
- #write <`OUTPUT'> ", Z`i'_%"
- #endif
- #enddo
- #write <`OUTPUT'> ";"
+ #if `optimmaxvar_' > 0
+ #write <`OUTPUT'> " std::complex<double> %"
+ #define FIRST "1"
+ #do i=1,`optimmaxvar_'
+ #ifdef `FIRST'
+ #undefine FIRST
+ #write <`OUTPUT'> "Z`i'_%"
+ #else
+ #write <`OUTPUT'> ", Z`i'_%"
+ #endif
+ #enddo
+ #write <`OUTPUT'> ";"
+ #endif
#write <`OUTPUT'> " %O"
#write <`OUTPUT'> " return %E;" [`EXPRESSION'`HELSTRING']
#write <`OUTPUT'> " }\n" [`EXPRESSION'`HELSTRING']
#clearoptimize
#endif
#endprocedure
#procedure WriteMomenta(?MOMENTA)
#define FIRST "1"
#do P={`?MOMENTA'}
#ifdef `FIRST'
#undefine FIRST
#write <`OUTPUT'> " CLHEP::HepLorentzVector const & `P'%"
#else
#write <`OUTPUT'> ",\n CLHEP::HepLorentzVector const & `P'%"
#endif
#enddo
#endprocedure
#procedure WriteFooter(OUTPUT)
#write <`OUTPUT'> "}"
#endprocedure
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Apr 4, 9:31 PM (15 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4730095
Default Alt Text
(4 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment