|
[Rivet] AGILe and PYTUNEGavin Hesketh hesketh at cern.chSat Dec 4 10:14:39 GMT 2010
Hi, that's neater than my idea, but I still had to hack the code a little to call pytune rather than pygive. Now I can pass agile the following parameter file: PYTUNE 103 PARP(64) 2 PYTUNE has to come first in the list, but that's fine. The hacks I used: FPythiaWrapper.hh: #define FC_PYTUNE FC_FUNC(pytune, PYTUNE) void FC_PYTUNE(int*); .... void call_pytune(int tune); FPythiaWrapper.hh: void call_pytune( int tune ) { pytune_( &tune ); } FPythia.cc, modify the setParam function: // Set a parameter with a string value bool FPythia::setParam(const string& name, const string& value) { Generator::setParam(name, value); if(name=="PYTUNE") call_pytune(atoi(value.c_str())); else { const string pygive_input(toUpper(name) + "=" + value); call_pygive(pygive_input.c_str()); } return SUCCESS; } cheers, Gavin On 03/12/10 19:41, Peter Skands wrote: > Hi, > > MSTP(5) is only intended as a convenience for users that *just* want a > specific tune. It is 100% equivalent to the construction: > > CALL PYTUNE(ITUNE) > CALL PYINIT(...) > > For users that desire more flexibility (or me, when I make new tunes), > it is completely possible to take control back and make a construction > like: > > C...Set base tune > CALL PYTUNE(ITUNE) > C...Insert user modifications here > CALL PYGIVE('PARP(64)=2D0') > ... > C...Force PYINIT to *not* call PYTUNE > CALL PYGIVE('MSTP(5)=0') > CALL PYINIT(...) > > Would that work for you? > > Peter > > On 12/3/10 7:21 PM, Andy Buckley wrote: >> On 03/12/10 16:53, Gavin Hesketh wrote: >>> Dear AGILe authors, >>> I've just been playing around with the fortran pythia. I'm sure you know >>> recent versions have the PYTUNE function, which allows you to select any >>> of the "standard" tunes, by setting the MSTP(5) parameter. >>> >>> But, if I want to use this feature while also varying one parameter that >>> is part of that tune, eg by passing the following parameter file when I >>> call agile-runmc: >>> >>> MSTP(5) 105 >>> PARP(64) 2 >>> >>> then my choice of PARP(64) is overwritten by PYTUNE. iirc, he way to >>> avoid this is to set MSTP(5), call PYINIT, then set the other >>> parameters. >>> >>> I wondered if anyone had figured out how to do such a thing with agile, >>> or if I simply can't use the MSTP(5)/PYTUNE functionality and have to >>> set all the tune variables by hand? >> >> Hi Gavin, >> >> As far as I'm aware, PYTUNE will stomp all over any user-specific >> settings, so slight variations on PYTUNE tunes are not possible. I >> mentioned this to Peter Skands (CC'd) a while ago, so maybe the latest >> version of PYTHIA does now support customising settings on top of >> PYTUNE... Peter? >> >> If not, is it possible to structure AGILe's calls to the PYTHIA routines >> such that PYTUNE will be called first (with a special-case param passing >> of MSTP(5)) and then PYGIVE be called for all the other params? >> >> I'll very happily make an AGILe patch release to incorporate this (as >> well as any new Fortran generator interfaces that people supply... >> MC at NLO, anyone?!) >> >> Andy >>
More information about the Rivet mailing list |