diff --git a/Decay/FormFactors/KornerKurodaFormFactor.cc b/Decay/FormFactors/KornerKurodaFormFactor.cc new file mode 100644 --- /dev/null +++ b/Decay/FormFactors/KornerKurodaFormFactor.cc @@ -0,0 +1,182 @@ +// -*- C++ -*- +// +// This is the implementation of the non-inlined, non-templated member +// functions of the KornerKurodaFormFactor class. +// + +#include "KornerKurodaFormFactor.h" +#include "ThePEG/Interface/ClassDocumentation.h" +#include "ThePEG/Interface/Parameter.h" +#include "ThePEG/EventRecord/Particle.h" +#include "ThePEG/Repository/UseRandom.h" +#include "ThePEG/Repository/EventGenerator.h" +#include "ThePEG/Utilities/DescribeClass.h" +#include "ThePEG/Persistency/PersistentOStream.h" +#include "ThePEG/Persistency/PersistentIStream.h" + +using namespace Herwig; +using namespace ThePEG; + +KornerKurodaFormFactor::KornerKurodaFormFactor() : mRho_(775.26*MeV), mOmega_(782.65*MeV), mPhi_(1019.461*MeV), + aPrime_(1./GeV2) { + const double o3=1./3., o6=1./6., o9=1./6.; + c1Rho_ = { 0.5, -0.5, 1., 0., -1., 0.5, -0.5, 0., 0.}; + c1Omega_ = { 0.5, 0.5, o3, o3, o3, o6, o6, o3, 0.}; + c1Phi_ = { 0., 0. , -o3, -o3, -o3, -2.*o3,- 2.*o3, -o3, 0.}; + c12Rho_ = {5.*o6, 1.25, 2.*o3, 0., 2., 0.25, -0.5, 0., 1.}; + c12Omega_ = { o6, -0.25, 2.*o9,2.*o3, -2.*o3, 0.25*o3, o6, 0., 0.}; + c12Phi_ = { 0., 0., o9, o3, -o3, 2.*o3, 4.*o3, 1., 0.}; + // mu_ = {2.792847,-1.192304,2.458,0.930949,-1.160,-1.250,-0.6507,-0.613,1.61}; + mu_ = {2.792847,-1.192304,2.458,0.930949,-1.160,-1.250,-0.6507,-2.792847/3.,1.61}; + // set up the form factors + addFormFactor(2212,2212,2,2,2,2,1,1); + addFormFactor(2112,2112,2,2,2,1,1,1); + addFormFactor(3222,3222,2,2,2,2,3,3); + addFormFactor(3212,3212,2,2,2,1,3,3); + addFormFactor(3112,3112,2,2,1,1,3,3); + addFormFactor(3322,3322,2,2,2,3,3,3); + addFormFactor(3312,3312,2,2,1,3,3,3); + addFormFactor(3122,3122,2,2,2,1,3,3); + addFormFactor(3122,3212,2,2,2,1,3,3); + initialModes(numberOfFactors()); +} + +IBPtr KornerKurodaFormFactor::clone() const { + return new_ptr(*this); +} + +IBPtr KornerKurodaFormFactor::fullclone() const { + return new_ptr(*this); +} + +void KornerKurodaFormFactor::persistentOutput(PersistentOStream & os) const { + os << ounit(mRho_,GeV) << ounit(mOmega_,GeV) << ounit(mPhi_, GeV) + << ounit(aPrime_,1./GeV2) + << c1Rho_ << c1Omega_ << c1Phi_ << c12Rho_ << c12Omega_ << c12Phi_ + << c2Rho_ << c2Omega_ << c2Phi_ << mu_; +} + +void KornerKurodaFormFactor::persistentInput(PersistentIStream & is, int) { + is >> iunit(mRho_,GeV) >> iunit(mOmega_,GeV) >> iunit(mPhi_, GeV) + >> iunit(aPrime_,1./GeV2) + >> c1Rho_ >> c1Omega_ >> c1Phi_ >> c12Rho_ >> c12Omega_ >> c12Phi_ + >> c2Rho_ >> c2Omega_ >> c2Phi_ >> mu_; +} + +void KornerKurodaFormFactor::doinit() { + for(unsigned int ix=0;ix +describeThePEGKornerKurodaFormFactor("Herwig::KornerKurodaFormFactor", + "HwFormFactors.so"); + +void KornerKurodaFormFactor::Init() { + + static ClassDocumentation documentation + ("Simple mode of the nucelon form-factors based on Phys. Rev. D 16 (1977) 2165", + "Simple model of the nucleon form factors based on \\cite{Korner:1976hv}.", + "\\bibitem{Korner:1976hv}" + "J.~G.~Korner and M.~Kuroda," + "%``E+ e- Annihilation Into Baryon-anti-Baryon Pairs,''" + "Phys.\\ Rev.\\ D {\\bf 16} (1977) 2165." + "doi:10.1103/PhysRevD.16.2165" + "%%CITATION = doi:10.1103/PhysRevD.16.2165;%%" + "%108 citations counted in INSPIRE as of 31 Oct 2019"); + + static Parameter interfacemRho + ("mRho", + "Mass of the rho meson for the form factor", + &KornerKurodaFormFactor::mRho_, GeV, 0.77526*GeV, 0.6*GeV, 1.0*GeV, + false, false, Interface::limited); + + static Parameter interfacemOmega + ("mOmega", + "Mass of the omega meson for the form factor", + &KornerKurodaFormFactor::mOmega_, GeV, 0.78265*GeV, 0.6*GeV, 1.0*GeV, + false, false, Interface::limited); + + static Parameter interfacemPhi + ("mPhi", + "Mass of the phi meson for the form factor", + &KornerKurodaFormFactor::mPhi_, GeV, 1.019461*GeV, 0.9*GeV, 1.5*GeV, + false, false, Interface::limited); + + static Parameter interfacealphaPrime + ("alphaPrime", + "The regge slope", + &KornerKurodaFormFactor::aPrime_, 1./GeV2, 1./GeV2, 0.5/GeV2, 1.5/GeV2, + false, false, Interface::limited); +} + +void KornerKurodaFormFactor:: +SpinHalfSpinHalfFormFactor(Energy2 q2,int iloc, int ,int ,Energy,Energy, + Complex & f1v,Complex & f2v,Complex & f3v, + Complex & f1a,Complex & f2a,Complex & f3a, + FlavourInfo flavour, + Virtuality virt) { + assert(virt==TimeLike); + f1a = f2a = f3a = f1v = f2v = f3v = 0.; + if(flavour.charm != Charm::Unknown and flavour.charm != Charm::Zero ) return; + if(flavour.bottom != Beauty::Unknown and flavour.bottom !=Beauty::Zero ) return; + bool rho = true, omega = true, phi = true; + // strange content + if(flavour.strange != Strangeness::Unknown) { + if(flavour.strange == Strangeness::Zero) phi = false; + else if(flavour.strange == Strangeness::ssbar) phi = true; + else return; + } + if(flavour.I!=IsoSpin::IUnknown) { + // I=0, i.e omega content + if(flavour.I==IsoSpin::IZero) { + rho=false; + if(flavour.I3!=IsoSpin::I3Unknown and flavour.I3!=IsoSpin::I3Zero) return; + } + // I=1, i.e rho content + else if(flavour.I==IsoSpin::IOne) { + omega=false; + if(flavour.I3!=IsoSpin::I3Unknown and flavour.I3!=IsoSpin::I3Zero) return; + } + } + if(flavour.I3!=IsoSpin::I3Unknown and flavour.I3!=IsoSpin::I3Zero) return; + // form factors + // rho component + if(rho) { + Energy2 mRho2[3] = {sqr(mRho_), mRho2[0]+1./aPrime_, mRho2[0]+2./aPrime_}; + f1v += c1Rho_[iloc]/(1.-q2/mRho2[0])/(1.-q2/mRho2[1]); + f2v += c2Rho_[iloc]/(1.-q2/mRho2[0])/(1.-q2/mRho2[1])/(1.-q2/mRho2[2]); + } + // omega component + if(omega) { + Energy2 mOmega2[3] = {sqr(mOmega_), mOmega2[0]+1./aPrime_, mOmega2[0]+2./aPrime_}; + f1v += c1Omega_[iloc]/(1.-q2/mOmega2[0])/(1.-q2/mOmega2[1]); + f2v += c2Omega_[iloc]/(1.-q2/mOmega2[0])/(1.-q2/mOmega2[1])/(1.-q2/mOmega2[2]); + } + // phi component + if(phi) { + Energy2 mPhi2[3] = {sqr(mPhi_), mPhi2[0]+1./aPrime_, mPhi2[0]+2./aPrime_}; + f1v += c1Phi_[iloc]/(1.-q2/mPhi2[0])/(1.-q2/mPhi2[1]); + f2v += c2Phi_[iloc]/(1.-q2/mPhi2[0])/(1.-q2/mPhi2[1])/(1.-q2/mPhi2[2]); + } +} + +void KornerKurodaFormFactor:: +dataBaseOutput(ofstream& output,bool header, + bool create) const { + if(header) output << "update decayers set parameters=\""; + if(create) output << "create Herwig::KornerKurodaFormFactor " + << name() << " \n"; + output << "newdef " << name() << ":mRho " << mRho_/GeV << "\n"; + output << "newdef " << name() << ":mOmega " << mOmega_/GeV << "\n"; + output << "newdef " << name() << ":mPhi " << mPhi_/GeV << "\n"; + output << "newdef " << name() << ":alphaPrime " << aPrime_*GeV2 << "\n"; + BaryonFormFactor::dataBaseOutput(output,false,false); + if(header) output << "\n\" where BINARY ThePEGName=\"" + << fullName() << "\";" << endl; +} diff --git a/Decay/FormFactors/KornerKurodaFormFactor.h b/Decay/FormFactors/KornerKurodaFormFactor.h new file mode 100644 --- /dev/null +++ b/Decay/FormFactors/KornerKurodaFormFactor.h @@ -0,0 +1,206 @@ +// -*- C++ -*- +#ifndef HERWIG_KornerKurodaFormFactor_H +#define HERWIG_KornerKurodaFormFactor_H +// +// This is the declaration of the KornerKurodaFormFactor class. +// + +#include "BaryonFormFactor.h" + +namespace Herwig { +using namespace ThePEG; + +/** + * The KornerKurodaFormFactor class implements the simple model of PRD 16, 2165, 1997 for the + * form factors of the baryon octet/ + * + * @see \ref KornerKurodaFormFactorInterfaces "The interfaces" + * defined for KornerKurodaFormFactor. + */ +class KornerKurodaFormFactor: public BaryonFormFactor { + +public: + + /** + * The default constructor. + */ + KornerKurodaFormFactor(); + + /** + * The form factor for the weak decay of a spin \f$\frac12\f$ baryon to a + * spin \f$\frac12\f$ baryon. + * @param q2 The scale \f$q^2\f$. + * @param iloc The location in the form factor list. + * @param id0 The PDG code of the incoming baryon. + * @param id1 The PDG code of the outgoing baryon. + * @param m0 The mass of the incoming baryon. + * @param m1 The mass of the outgoing baryon. + * @param f1v The form factor \f$F^V_1\f$. + * @param f2v The form factor \f$F^V_2\f$. + * @param f3v The form factor \f$F^V_3\f$. + * @param f1a The form factor \f$F^A_1\f$. + * @param f2a The form factor \f$F^A_2\f$. + * @param f3a The form factor \f$F^A_3\f$. + * @param virt Whether the q2 is space or timelike + */ + virtual void SpinHalfSpinHalfFormFactor(Energy2 q2,int iloc, int id0, int id1, + Energy m0, Energy m1, + Complex & f1v,Complex & f2v,Complex & f3v, + Complex & f1a,Complex & f2a,Complex & f3a, + FlavourInfo flavour, + Virtuality virt=SpaceLike); + + /** + * Output the setup information for the particle database + * @param os The stream to output the information to + * @param header Whether or not to output the information for MySQL + * @param create Whether or not to add a statement creating the object + */ + virtual void dataBaseOutput(ofstream & os,bool header,bool create) const; + +public: + + /** @name Functions used by the persistent I/O system. */ + //@{ + /** + * Function used to write out object persistently. + * @param os the persistent output stream written to. + */ + void persistentOutput(PersistentOStream & os) const; + + /** + * Function used to read in object persistently. + * @param is the persistent input stream read from. + * @param version the version number of the object when written. + */ + void persistentInput(PersistentIStream & is, int version); + //@} + + /** + * The standard Init function used to initialize the interfaces. + * Called exactly once for each class by the class description system + * before the main function starts or + * when this class is dynamically loaded. + */ + static void Init(); + +protected: + + /** @name Clone Methods. */ + //@{ + /** + * Make a simple clone of this object. + * @return a pointer to the new object. + */ + virtual IBPtr clone() const; + + /** Make a clone of this object, possibly modifying the cloned object + * to make it sane. + * @return a pointer to the new object. + */ + virtual IBPtr fullclone() const; + //@} + +protected: + + /** + * Initialize this object after the setup phase before saving an + * EventGenerator to disk. + * @throws InitException if object could not be initialized properly. + */ + virtual void doinit(); + +private: + + /** + * The assignment operator is private and must never be called. + * In fact, it should not even be implemented. + */ + KornerKurodaFormFactor & operator=(const KornerKurodaFormFactor &) = delete; + +private: + + /** + * Masses for the form-factors + */ + //@{ + /** + * Mass of the \f$\rho\f$ meson + */ + Energy mRho_; + + /** + * Mass of the \f$\omega\f$ meson + */ + Energy mOmega_; + + /** + * Mass of the \f$\phi\f$ meson + */ + Energy mPhi_; + //@} + + /** + * Regge slope + */ + InvEnergy2 aPrime_; + + /** + * Couplings for the form factors + */ + //@{ + /** + * Coupling \f$C_1^\rho\f$ + */ + vector c1Rho_; + + /** + * Coupling \f$C_1^\omega\f$ + */ + vector c1Omega_; + + /** + * Coupling \f$C_1^\phi\f$ + */ + vector c1Phi_; + + /** + * Coupling \f$C_1^\rho+C_2^\rho\f$ + */ + vector c12Rho_; + + /** + * Coupling \f$C_1^\omega+C_2^\omega\f$ + */ + vector c12Omega_; + + /** + * Coupling \f$C_1^\phi+C_2^\phi\f$ + */ + vector c12Phi_; + + /** + * Coupling \f$C_2^\rho\f$ + */ + vector c2Rho_; + + /** + * Coupling \f$C_2^\omega\f$ + */ + vector c2Omega_; + + /** + * Coupling \f$C_2^\phi\f$ + */ + vector c2Phi_; + + /** + * Magnetic moments + */ + vector mu_; + //@} +}; + +} + +#endif /* HERWIG_KornerKurodaFormFactor_H */ diff --git a/Decay/FormFactors/Makefile.am b/Decay/FormFactors/Makefile.am --- a/Decay/FormFactors/Makefile.am +++ b/Decay/FormFactors/Makefile.am @@ -1,50 +1,52 @@ BUILT_SOURCES = Formfactor__all.cc CLEANFILES = Formfactor__all.cc Formfactor__all.cc : $(DIR_H_FILES) $(DIR_CC_FILES) Makefile @echo "Concatenating .cc files into $@" @$(top_srcdir)/cat_with_cpplines $(DIR_CC_FILES) > $@ EXTRA_DIST = $(ALL_H_FILES) $(ALL_CC_FILES) DIR_H_FILES = $(addprefix $(srcdir)/,$(ALL_H_FILES)) ALL_H_FILES = \ BallZwickyScalarFormFactor.h \ BallZwickyVectorFormFactor.h \ BaryonSimpleFormFactor.h \ BaryonThreeQuarkModelFormFactor.h \ ChengHeavyBaryonFormFactor.h \ ISGW2FormFactor.h \ ISGWFormFactor.h \ LambdabExcitedLambdacSumRuleFormFactor.h \ LightBaryonQuarkModelFormFactor.h \ SingletonFormFactor.h \ WSBFormFactor.h \ KiselevBcFormFactor.h \ MelikhovFormFactor.h \ MelikhovStechFormFactor.h \ BtoSGammaFlatEnergy.h \ BtoSGammaKagan.h \ HQETFormFactor.h \ -CzyzNucleonFormFactor.h +CzyzNucleonFormFactor.h \ +KornerKurodaFormFactor.h DIR_CC_FILES = $(addprefix $(srcdir)/,$(ALL_CC_FILES)) ALL_CC_FILES = \ BallZwickyScalarFormFactor.cc \ BallZwickyVectorFormFactor.cc \ BaryonSimpleFormFactor.cc \ BaryonThreeQuarkModelFormFactor.cc \ ChengHeavyBaryonFormFactor.cc \ ISGW2FormFactor.cc \ ISGWFormFactor.cc \ LambdabExcitedLambdacSumRuleFormFactor.cc \ LightBaryonQuarkModelFormFactor.cc \ SingletonFormFactor.cc \ WSBFormFactor.cc \ KiselevBcFormFactor.cc \ MelikhovFormFactor.cc \ MelikhovStechFormFactor.cc \ BtoSGammaFlatEnergy.cc \ BtoSGammaKagan.cc \ HQETFormFactor.cc \ -CzyzNucleonFormFactor.cc +CzyzNucleonFormFactor.cc \ +KornerKurodaFormFactor.cc diff --git a/Tests/python/LowEnergy-EE-NonPerturbative.in b/Tests/python/LowEnergy-EE-NonPerturbative.in --- a/Tests/python/LowEnergy-EE-NonPerturbative.in +++ b/Tests/python/LowEnergy-EE-NonPerturbative.in @@ -1,103 +1,109 @@ # -*- ThePEG-repository -*- read snippets/EECollider.in ################################################## # Selected the hard process ################################################## # leading-order processes ################################################## cd /Herwig/MatrixElements # e+ e- -> pi+pi- create Herwig::MEee2Mesons MEee2Pions HwMELeptonLowEnergy.so create Herwig::TwoPionCzyzCurrent /Herwig/Decays/TwoPionCzyzCurrent set MEee2Pions:WeakCurrent /Herwig/Decays/TwoPionCzyzCurrent # e+ e- -> K+K-/ K0K0 create Herwig::MEee2Mesons MEee2Kaons HwMELeptonLowEnergy.so create Herwig::TwoKaonCzyzCurrent /Herwig/Decays/TwoKaonCzyzCurrent set MEee2Kaons:WeakCurrent /Herwig/Decays/TwoKaonCzyzCurrent # e+ e- -> pi+ pi- pi0 create Herwig::MEee2Mesons MEee3Pions HwMELeptonLowEnergy.so create Herwig::ThreePionCzyzCurrent /Herwig/Decays/ThreePionCzyzCurrent set MEee3Pions:WeakCurrent /Herwig/Decays/ThreePionCzyzCurrent # e+ e- -> 2pi+ 2pi-, 2pi0, pi+ pi- create Herwig::MEee2Mesons MEee4Pions HwMELeptonLowEnergy.so create Herwig::FourPionCzyzCurrent /Herwig/Decays/FourPionCzyzCurrent set MEee4Pions:WeakCurrent /Herwig/Decays/FourPionCzyzCurrent # e+ e- -> eta pi+ pi- create Herwig::MEee2Mesons MEee2EtaPiPi HwMELeptonLowEnergy.so create Herwig::EtaPiPiCurrent /Herwig/Decays/EtaPiPiCurrent set MEee2EtaPiPi:WeakCurrent /Herwig/Decays/EtaPiPiCurrent # e+ e- -> eta' pi+ pi- create Herwig::MEee2Mesons MEee2EtaPrimePiPi HwMELeptonLowEnergy.so create Herwig::EtaPrimePiPiCurrent /Herwig/Decays/EtaPrimePiPiCurrent set MEee2EtaPrimePiPi:WeakCurrent /Herwig/Decays/EtaPrimePiPiCurrent # e+ e- -> omega pi (omega -> pi0 gamma) create Herwig::MEee2Mesons MEee2OmegaPi HwMELeptonLowEnergy.so create Herwig::TwoPionPhotonSNDCurrent /Herwig/Decays/OmegaPiCurrent #create Herwig::TwoPionPhotonCurrent /Herwig/Decays/OmegaPiCurrent set MEee2OmegaPi:WeakCurrent /Herwig/Decays/OmegaPiCurrent # e+ e- > pi0 gamma create Herwig::MEee2Mesons MEee2PiGamma HwMELeptonLowEnergy.so create Herwig::PionPhotonCurrent /Herwig/Decays/PiGammaCurrent set MEee2PiGamma:WeakCurrent /Herwig/Decays/PiGammaCurrent # e+e- -> eta gamma create Herwig::MEee2Mesons MEee2EtaGamma HwMELeptonLowEnergy.so create Herwig::EtaPhotonCurrent /Herwig/Decays/EtaGammaCurrent set MEee2EtaGamma:WeakCurrent /Herwig/Decays/EtaGammaCurrent # e+e- -> eta phi create Herwig::MEee2Mesons MEee2EtaPhi HwMELeptonLowEnergy.so create Herwig::EtaPhiCurrent /Herwig/Decays/EtaPhiCurrent set MEee2EtaPhi:WeakCurrent /Herwig/Decays/EtaPhiCurrent # e+e- -> eta omega create Herwig::MEee2Mesons MEee2EtaOmega HwMELeptonLowEnergy.so create Herwig::EtaOmegaCurrent /Herwig/Decays/EtaOmegaCurrent set MEee2EtaOmega:WeakCurrent /Herwig/Decays/EtaOmegaCurrent # e+e- > p pbar create Herwig::MEee2Mesons MEee2ppbar HwMELeptonLowEnergy.so create Herwig::WeakBaryonCurrent /Herwig/Decays/CzyzCurrent create Herwig::CzyzNucleonFormFactor /Herwig/Decays/CzyzFormFactor set /Herwig/Decays/CzyzCurrent:FormFactor /Herwig/Decays/CzyzFormFactor set MEee2ppbar:WeakCurrent /Herwig/Decays/CzyzCurrent +# e+e- > hyperons +create Herwig::MEee2Mesons MEee2LL HwMELeptonLowEnergy.so +create Herwig::WeakBaryonCurrent /Herwig/Decays/KornerKurodaCurrent +create Herwig::KornerKurodaFormFactor /Herwig/Decays/KornerKurodaFormFactor +set /Herwig/Decays/KornerKurodaCurrent:FormFactor /Herwig/Decays/KornerKurodaFormFactor +set MEee2LL:WeakCurrent /Herwig/Decays/KornerKurodaCurrent # e+e- -> KKpi create Herwig::MEee2Mesons MEee2KKPi HwMELeptonLowEnergy.so create Herwig::KKPiCurrent /Herwig/Decays/KKPiCurrent set MEee2KKPi:WeakCurrent /Herwig/Decays/KKPiCurrent # e+e- -> phi pi create Herwig::MEee2Mesons MEee2PhiPi HwMELeptonLowEnergy.so create Herwig::PhiPiCurrent /Herwig/Decays/PhiPiCurrent set MEee2PhiPi:WeakCurrent /Herwig/Decays/PhiPiCurrent # e+ e- -> omega pi pi create Herwig::MEee2Mesons MEee2OmegaPiPi HwMELeptonLowEnergy.so create Herwig::OmegaPiPiCurrent /Herwig/Decays/OmegaPiPiCurrent set MEee2OmegaPiPi:WeakCurrent /Herwig/Decays/OmegaPiPiCurrent # default e+e- > q qbar (5 flavours d,u,s,c,b) ${processes} ################################################## # LEP physics parameters (override defaults) ################################################## cd /Herwig/Generators set EventGenerator:EventHandler:LuminosityFunction:Energy ${ECMS} set /Herwig/Generators/EventGenerator:EventHandler:Cuts:MHatMin 0.2 set /Herwig/Particles/e-:PDF /Herwig/Partons/NoPDF set /Herwig/Particles/e+:PDF /Herwig/Partons/NoPDF set /Herwig/Particles/pi0:Stable Stable set /Herwig/Particles/K_S0:Stable Stable cd /Herwig/Generators ################################################## ## prepare for Rivet analysis or HepMC output ## when running with parton shower ################################################## create ThePEG::RivetAnalysis /Herwig/Analysis/Rivet RivetAnalysis.so insert EventGenerator:AnalysisHandlers 0 /Herwig/Analysis/Rivet ${ANALYSES} ################################################### # Save run for later usage with 'Herwig run' ################################################## set EventGenerator:MaxErrors 10000 set EventGenerator:EventHandler:StatLevel Full set EventGenerator:EventHandler:CascadeHandler NULL saverun Rivet-LowEnergy-EE-NonPerturbative-${ECMS} EventGenerator diff --git a/Tests/python/LowEnergy.py b/Tests/python/LowEnergy.py --- a/Tests/python/LowEnergy.py +++ b/Tests/python/LowEnergy.py @@ -1,392 +1,395 @@ #! /usr/bin/env python import yoda,os,math,subprocess,optparse from string import Template # get the path for the rivet data p = subprocess.Popen(["rivet-config", "--datadir"],stdout=subprocess.PIPE) path=p.communicate()[0].strip() #Define the arguments op = optparse.OptionParser(usage=__doc__) op.add_option("--process" , dest="processes" , default=[], action="append") op.add_option("--path" , dest="path" , default=path) op.add_option("--non-perturbative", dest="nonPerturbative" , default=False, action="store_true") op.add_option("--perturbative" , dest="perturbative" , default=False, action="store_true") op.add_option("--dest" , dest="dest" , default="Rivet") op.add_option("--list" , dest="list" , default=False, action="store_true") op.add_option("--flavour" , dest="flavour" , default="All" ) op.add_option("--plots" , dest="plot" , default=False, action="store_true") opts, args = op.parse_args() path=opts.path thresholds = [0.7,2.*.5,2.*1.87,2.*5.28] # the list of analyses and processes analyses={ 'KK' : {} , 'pipi' : {}, 'ppbar' : {}, "3pi" : {}, "etapipi" : {}, "etaprimepipi" : {} , "4pi" : {}, "etaPhi" : {}, "etaOmega" : {}, "2K1pi" : {} ,"2K2pi" : {} , "4K" : {}, "6m" : {}, "omegapi" : {} , "pigamma" : {}, "etagamma" : {}, "phipi" : {}, "omegapipi" : {} , "DD" : {} , "BB" : {}, "5pi" :{} , "LL" : {} } # pi+pi- analyses["pipi"]["KLOE_2009_I797438"] = ["d02-x01-y01"] analyses["pipi"]["KLOE_2005_I655225"] = ["d02-x01-y01"] analyses["pipi"]["KLOE2_2017_I1634981"] = ["d01-x01-y01"] analyses["pipi"]["BABAR_2009_I829441"] = ["d01-x01-y01"] analyses["pipi"]["DM1_1978_I134061"] = ["d01-x01-y01"] analyses["pipi"]["DM2_1989_I267118"] = ["d01-x01-y01"] analyses["pipi"]["CMD2_2007_I728302"] = ["d02-x01-y01"] analyses["pipi"]["CMD2_2006_I728191"] = ["d03-x01-y01"] analyses["pipi"]["BESIII_2016_I1385603"] = ["d01-x01-y01"] analyses["pipi"]["SND_2005_I686349"] = ["d01-x01-y01"] analyses["pipi"]["CMD_1985_I221309"] = ["d01-x01-y01","d02-x01-y01"] analyses["pipi"]["CMD2_2002_I568807"] = ["d01-x01-y02"] analyses["pipi"]["CMD2_1999_I498859"] = ["d01-x01-y01"] analyses['pipi']["CLEOC_2005_I693873"] = ["d01-x01-y01"] analyses['pipi']["ND_1991_I321108"] = ["d11-x01-y01"] analyses['pipi']["OLYA_1984_I208231"] = ["d01-x01-y01"] # K+K- and K_S^0 K_L^0 analyses['KK']["BESIII_2018_I1704558"] = ["d01-x01-y01"] analyses['KK']["BABAR_2013_I1238807"] = ["d01-x01-y01"] analyses['KK']["DM1_1981_I156053"] = ["d01-x01-y01"] analyses['KK']["DM1_1981_I156054"] = ["d01-x01-y01"] analyses['KK']["CLEOC_2005_I693873"] = ["d01-x01-y02"] analyses['KK']["BABAR_2015_I1383130"] = ["d01-x01-y04"] analyses['KK']["DM2_1988_I262690" ] = ["d01-x01-y01"] analyses['KK']["SND_2007_I755881"] = ["d01-x01-y01"] analyses['KK']["SND_2001_I533574"] = ["d01-x01-y01","d01-x01-y02","d01-x01-y03", "d02-x01-y01","d02-x01-y02","d02-x01-y03"] analyses['KK']["SND_2006_I720035"] = ["d01-x01-y01"] analyses['KK']["BABAR_2014_I1287920"] = ["d09-x01-y01"] analyses['KK']["CMD2_2003_I601222"] = ["d01-x01-y01"] analyses['KK']["CMD3_2016_I1444990"] = ["d01-x01-y06"] analyses['KK']["CMD2_1995_I406880"] = ["d01-x01-y01","d01-x01-y02"] analyses['KK']["CMD2_1999_I502164"] = ["d01-x01-y01","d02-x01-y01", "d03-x01-y01","d04-x01-y01"] analyses['KK']["CMD2_2008_I782516"] = ["d01-x01-y01","d02-x01-y01"] analyses['KK']["ND_1991_I321108"] = ["d12-x01-y01","d13-x01-y01"] analyses['KK']["OLYA_1981_I173076"] = ["d01-x01-y01"] analyses['KK']["SND_2016_I1484677"] = ["d01-x01-y01","d02-x01-y01"] # proton-antiproton analyses['ppbar']["BESIII_2019_I1736235"] = ["d01-x01-y01"] analyses['ppbar']["BESIII_2019_I1718337"] = ["d01-x01-y01"] analyses['ppbar']["BESIII_2015_I1358937"] = ["d01-x01-y05"] analyses['ppbar']["BABAR_2013_I1217421"] = ["d01-x01-y01"] analyses['ppbar']["SND_2014_I1321689"] = ["d01-x01-y01","d02-x01-y01"] analyses['ppbar']["CMD3_2016_I1385598"] = ["d01-x01-y06"] analyses['ppbar']["CLEOC_2005_I693873"] = ["d01-x01-y03"] analyses['ppbar']["BABAR_2006_I700020"] = ["d01-x01-y01","d02-x01-y01"] analyses['ppbar']["DM2_1983_I190558"] = ["d01-x01-y01"] analyses["ppbar"]["DM2_1990_I297706"] = ["d01-x01-y01"] analyses["ppbar"]["DM1_1979_I141565"] = ["d01-x01-y01"] analyses["ppbar"]["FENICE_1998_I471263"] = ["d01-x01-y01"] analyses["ppbar"]["FENICE_1994_I377833"] = ["d01-x01-y01"] analyses['ppbar']["BESII_2005_I685906"] = ["d01-x01-y01"] analyses['ppbar']["BESIII_2014_I1286898"] = ["d01-x01-y06"] # pi0 gamma analyses["pigamma"]["SND_2018_I1694988"] = ["d01-x01-y01"] analyses["pigamma"]["SND_2016_I1418483"] = ["d01-x01-y05"] analyses["pigamma"]["SND_2003_I612867"] = ["d01-x01-y01"] analyses["pigamma"]["CMD2_2005_I658856"] = ["d02-x01-y01"] analyses["pigamma"]["SND_2000_I524221"] = ["d01-x01-y02"] # eta gamma analyses["etagamma"]["CMD2_2005_I658856"] = ["d01-x01-y01"] analyses["etagamma"]["SND_2006_I717778" ] = ["d01-x01-y01","d02-x01-y01"] analyses["etagamma"]["SND_2014_I1275333"] = ["d01-x01-y01"] analyses["etagamma"]["SND_2000_I524221"] = ["d01-x01-y01"] analyses["etagamma"]["CMD2_1999_I503154"] = ["d01-x01-y01"] analyses["etagamma"]["CMD2_2001_I554522"] = ["d01-x01-y01"] analyses['etagamma']["CMD2_1995_I406880"] = ["d01-x01-y04"] analyses['etagamma']["BABAR_2006_I716277"] = ["d01-x01-y01"] # 3 meson analyses["3pi"]["BABAR_2004_I656680"] = ["d01-x01-y01"] analyses["3pi"]["SND_2002_I582183"] = ["d01-x01-y01"] analyses["3pi"]["SND_2003_I619011"] = ["d01-x01-y01"] analyses["3pi"]["SND_1999_I508003"] = ["d01-x01-y01"] analyses["3pi"]["SND_2001_I533574"] = ["d01-x01-y04","d02-x01-y04"] analyses["3pi"]["CMD2_2000_I523691"] = ["d01-x01-y01"] analyses["3pi"]["CMD2_1998_I480170"] = ["d01-x01-y01"] analyses['3pi']["CMD2_1995_I406880"] = ["d01-x01-y03"] analyses['3pi']["DM2_1992_I339265" ] = ["d01-x01-y01"] analyses['3pi']["DM1_1980_I140174" ] = ["d01-x01-y01"] analyses['3pi']["ND_1991_I321108"] = ["d05-x01-y01","d10-x01-y04"] analyses['3pi']["GAMMAGAMMA_1981_I158474"] = ["d01-x01-y01"] analyses["3pi"]["CLEO_2006_I691720"] = ["d01-x01-y01"] analyses["3pi"]["SND_2015_I1389908"] = ["d01-x01-y01"] # etapipi analyses["etapipi"]["BABAR_2018_I1700745"] = ["d02-x01-y01"] analyses["etapipi"]["BABAR_2018_I1647139"] = ["d01-x01-y01"] analyses["etapipi"]["SND_2015_I1332929"] = ["d01-x01-y01"] analyses["etapipi"]["SND_2018_I1638368"] = ["d01-x01-y01"] analyses["etapipi"]["BABAR_2007_I758568"] = ["d01-x01-y01","d02-x01-y01"] analyses["etapipi"]["CMD2_2000_I532970"] = ["d02-x01-y01"] analyses["etapipi"]["DM2_1988_I264144"] = ["d01-x01-y01"] analyses['etapipi']["ND_1991_I321108"] = ["d06-x01-y01","d14-x01-y01"] +analyses['etapipi']["CMD3_2019_I1744510"] = ["d02-x01-y01"] # eta Phi analyses["etaPhi"]["BABAR_2008_I765258"] = ["d04-x01-y01","d05-x01-y01"] analyses["etaPhi"]["SND_2018_I1693737"] = ["d01-x01-y01"] analyses["etaPhi"]["BABAR_2017_I1511276"] = ["d03-x01-y01"] analyses["etaPhi"]["SND_2019_I1726419"] = ["d01-x01-y03"] +analyses["etaPhi"]["CMD3_2019_I1740541"] = ["d01-x01-y06","d02-x01-y06","d03-x01-y06"] # eta Omega analyses["etaOmega"]["SND_2016_I1473343"] = ["d01-x01-y01"] analyses["etaOmega"]["BABAR_2006_I709730"] = ["d02-x01-y01"] analyses["etaOmega"]["SND_2019_I1726419"] = ["d01-x01-y01","d01-x01-y02"] analyses["etaOmega"]["CMD3_2017_I1606078"] = ["d01-x01-y01","d01-x01-y02"] # 4 pions analyses["4pi"]["BABAR_2017_I1621593"] = ["d01-x01-y01","d02-x01-y01"] analyses["4pi"]["BABAR_2012_I1086164"] = ["d01-x01-y01"] analyses["4pi"]["CMD2_2000_I531667"] = ["d01-x01-y01"] analyses["4pi"]["CMD2_2004_I648023"] = ["d01-x01-y01"] analyses["4pi"]["BABAR_2005_I676691"] = ["d01-x01-y01"] analyses["4pi"]["CMD2_2000_I511375"] = ["d01-x01-y01"] analyses["4pi"]["CMD2_1999_I483994"] = ["d01-x01-y01","d02-x01-y01"] analyses["4pi"]["BESII_2008_I801210"] = ["d01-x01-y01"] analyses["4pi"]["KLOE_2008_I791841"] = ["d01-x01-y01"] analyses['4pi']["ND_1991_I321108"] = ["d07-x01-y01","d08-x01-y01","d10-x01-y01","d10-x01-y02"] analyses['4pi']["BESII_2007_I750713"] = ["d01-x01-y03"] analyses['4pi']["SND_2001_I579319"] = ["d01-x01-y01","d02-x01-y01"] analyses['4pi']["DM1_1982_I168552"] = ["d01-x01-y01"] analyses['4pi']["DM1_1979_I132828"] = ["d01-x01-y01"] analyses['4pi']["GAMMAGAMMA_1980_I153382"] = ["d01-x01-y01"] analyses['4pi']["GAMMAGAMMA_1981_I158474"] = ["d01-x01-y02"] # (these are omega(-> pi0 gamma) pi0) analyses["omegapi"]["SND_2016_I1489182" ] = ["d01-x01-y01"] analyses["omegapi"]["SND_2000_I527752" ] = ["d01-x01-y01"] analyses["omegapi"]["SND_2000_I503946" ] = ["d01-x01-y01"] analyses["omegapi"]["CMD2_2003_I616446" ] = ["d01-x01-y01"] # non omega analyses["omegapi"]["SND_2002_I587084" ] = ["d01-x01-y01"] analyses["omegapi"]["CMD2_2004_I630009" ] = ["d01-x01-y01"] analyses["omegapi"]["KLOE_2008_I791841"] = ["d02-x01-y01"] # from 4pion analyses["omegapi"]["CMD2_1999_I483994" ] = ["d03-x01-y01"] analyses['omegapi']["ND_1991_I321108"] = ["d01-x01-y01","d02-x01-y01","d03-x01-y01", "d04-x01-y01","d10-x01-y03"] # 5 pion and related analyses["omegapipi"]["DM1_1981_I166964" ] = ["d01-x01-y01"] analyses["omegapipi"]["DM2_1992_I339265" ] = ["d02-x01-y01"] analyses["omegapipi"]["CMD2_2000_I532970" ] = ["d01-x01-y01"] analyses["omegapipi"]["BABAR_2018_I1700745"] = ["d03-x01-y01"] analyses["omegapipi"]["BABAR_2007_I758568" ] = ["d03-x01-y01","d04-x01-y01"] analyses["5pi"]["CMD2_2000_I532970"] = ["d03-x01-y01"] analyses["5pi"]["BABAR_2007_I758568"] = ["d01-x01-y01"] analyses['5pi']["ND_1991_I321108"] = ["d14-x01-y01"] analyses['5pi']["GAMMAGAMMA_1981_I158474"] = ["d01-x01-y03"] analyses["5pi"]["BABAR_2018_I1700745"] = ["d01-x01-y01"] # 2K 1 pi analyses["2K1pi"]["BABAR_2008_I765258"] = ["d01-x01-y01","d02-x01-y01","d03-x01-y01"] analyses["2K1pi"]["DM1_1982_I176801"] = ["d01-x01-y01"] analyses["2K1pi"]["DM2_1991_I318558"] = ["d01-x01-y01","d02-x01-y01"] analyses["2K1pi"]["BESII_2008_I801208"] = ["d01-x01-y01"] analyses["2K1pi"]["SND_2018_I1637194"] = ["d01-x01-y01"] analyses["2K1pi"]["BESIII_2018_I1691798"] = ["d01-x01-y01"] analyses["2K1pi"]["BABAR_2017_I1511276"] = ["d01-x01-y01"] analyses["phipi"]["BABAR_2017_I1511276"] = ["d01-x01-y01","d02-x01-y01"] analyses["phipi"]["BABAR_2008_I765258"] = ["d02-x01-y01","d03-x01-y01"] # 2K 2 pi analyses["2K2pi"]["DM1_1982_I169382"] = ["d01-x01-y01"] analyses["2K2pi"]["BABAR_2005_I676691"] = ["d02-x01-y01"] analyses["2K2pi"]["BABAR_2014_I1287920"] = ["d09-x01-y01","d10-x01-y01","d11-x01-y01"] analyses["2K2pi"]["BABAR_2012_I892684"] = ["d01-x01-y01","d02-x01-y01","d03-x01-y01", "d04-x01-y01","d05-x01-y01", "d06-x01-y01","d07-x01-y01"] analyses["2K2pi"]["BABAR_2007_I747875"] = ["d01-x01-y01","d02-x01-y01","d03-x01-y01", "d04-x01-y01","d05-x01-y01","d07-x01-y01"] analyses["2K2pi"]["BESII_2008_I801210"] = ["d01-x01-y02"] analyses["2K2pi"]["BESII_2008_I801208"] = ["d01-x01-y02"] analyses["2K2pi"]["BELLE_2009_I809630"] = ["d01-x01-y01"] analyses["2K2pi"]["CMD3_2016_I1395968"] = ["d01-x01-y01"] analyses['2K2pi']["BESII_2007_I750713"] = ["d01-x01-y04"] analyses["2K2pi"]["BABAR_2017_I1511276"] = ["d03-x01-y01","d04-x01-y01"] analyses["2K2pi"]["BABAR_2017_I1591716"] = ["d01-x01-y01","d02-x01-y01"] analyses['2K2pi']["BESIII_2018_I1699641"] = ["d01-x01-y01","d02-x01-y01"] # 4K analyses["4K"]["BESIII_2019_I1743841"] = ["d01-x01-y01","d02-x01-y01"] analyses["4K"]["BABAR_2005_I676691"] = ["d03-x01-y01"] analyses["4K"]["BABAR_2014_I1287920"] = ["d12-x01-y01"] analyses["4K"]["BABAR_2012_I892684"] = ["d08-x01-y01"] analyses["4K"]["BABAR_2007_I747875"] = ["d07-x01-y01"] analyses['4K']["BESII_2007_I750713"] = ["d01-x01-y06","d01-x01-y07"] # 6 mesons analyses["6m"]["CMD3_2013_I1217420"] = ["d01-x01-y01"] analyses["6m"]["SND_2019_I1726419"] = ["d01-x01-y01","d01-x01-y04"] analyses["6m"]["CMD3_2017_I1606078"] = ["d01-x01-y03","d01-x01-y04"] analyses["6m"]["CMD3_2019_I1720610"] = ["d01-x01-y01","d01-x01-y02","d01-x01-y03"] analyses["6m"]["BABAR_2018_I1700745"] = ["d04-x01-y01","d05-x01-y01"] analyses["6m"]["SND_2016_I1471515"] = ["d01-x01-y06"] analyses["6m"]["DM1_1981_I166353"] = ["d01-x01-y01"] analyses["6m"]["BABAR_2006_I709730"] = ["d01-x01-y01","d02-x01-y01","d03-x01-y01"] analyses["6m"]["BABAR_2007_I758568"] = ["d05-x01-y01","d07-x01-y01", "d08-x01-y01","d09-x01-y01","d10-x01-y01","d11-x01-y01"] analyses["etaprimepipi"]["BABAR_2007_I758568"] = ["d05-x01-y01","d06-x01-y01"] analyses["6m"]["BESII_2007_I763880"] = ["d01-x01-y01","d01-x01-y02","d01-x01-y03","d01-x01-y04", "d01-x01-y05","d01-x01-y06","d01-x01-y07"] analyses["6m"]["BESII_2007_I762901"] = ["d01-x01-y01","d01-x01-y02","d01-x01-y03","d01-x01-y04", "d01-x01-y06","d01-x01-y07","d01-x01-y08","d01-x01-y09","d01-x01-y10"] analyses["6m"]["CLEO_2006_I691720"] = ["d01-x01-y02","d01-x01-y03","d01-x01-y04","d01-x01-y05", "d01-x01-y07","d01-x01-y08","d01-x01-y09","d01-x01-y10","d01-x01-y11", "d01-x01-y12","d01-x01-y13","d01-x01-y14","d01-x01-y15","d01-x01-y17"] analyses["6m"]["BESII_2008_I801210"] = ["d01-x01-y03","d01-x01-y04","d01-x01-y05"] analyses["6m"]["BESII_2008_I801208"] = ["d01-x01-y03","d01-x01-y04","d01-x01-y05","d01-x01-y06"] analyses["6m"]["JADE_1979_I142874"] = ["d02-x01-y01"] analyses["6m"]["MARKI_1982_I169326"] = ["d06-x01-y01"] analyses["6m"]["MARKI_1975_I100592"] = ["d01-x01-y01","d02-x01-y01"] analyses['6m']["BESII_2007_I750713"] = ["d01-x01-y08","d01-x01-y09","d01-x01-y11", "d01-x01-y12","d01-x01-y13","d01-x01-y14", "d01-x01-y15","d01-x01-y16","d01-x01-y17","d01-x01-y18"] analyses['6m']["SND_2016_I1473343"] = ["d01-x01-y01"] # DD analyses["DD"]["BELLE_2007_I723333" ] = ["d01-x01-y01","d02-x01-y01"] analyses["DD"]["BELLE_2007_I756012" ] = ["d01-x01-y01"] analyses["DD"]["BELLE_2007_I756643" ] = ["d01-x01-y01"] analyses["DD"]["BELLE_2008_I757220" ] = ["d01-x01-y01","d02-x01-y01"] analyses["DD"]["BELLE_2008_I759073" ] = ["d01-x01-y01"] analyses["DD"]["BABAR_2008_I776519" ] = ["d01-x01-y01","d01-x01-y02"] analyses["DD"]["BELLE_2008_I791660" ] = ["d01-x01-y01"] analyses["DD"]["BELLE_2013_I1225975"] = ["d01-x01-y01"] analyses["DD"]["BELLE_2014_I1282602"] = ["d01-x01-y01"] analyses["DD"]["BELLE_2015_I1324785"] = ["d01-x01-y01"] analyses["DD"]["BESIII_2016_I1457597"] = ["d01-x01-y07"] analyses["DD"]["BESIII_2015_I1355215"] = ["d01-x01-y10"] analyses["DD"]["BESIII_2015_I1377204"] = ["d01-x01-y10"] analyses["DD"]["BESIII_2016_I1495838"] = ["d01-x01-y01","d02-x01-y01"] analyses["DD"]["CRYSTAL_BALL_1986_I238081"] = ["d02-x01-y01"] analyses["DD"]["CLEOC_2008_I777917"] = ["d01-x01-y01","d01-x01-y02","d01-x01-y03", "d02-x01-y01","d02-x01-y02","d02-x01-y03", "d03-x01-y01","d03-x01-y02","d03-x01-y03", "d04-x01-y01","d04-x01-y02", "d05-x01-y01","d05-x01-y02"] analyses["DD"]["BELLE_2017_I1613517"] = ["d01-x01-y01","d01-x01-y02"] analyses["DD"]["BESIII_2014_I1323621"] = ["d01-x01-y01"] analyses["DD"]["BESIII_2015_I1406939"] = ["d02-x01-y06","d03-x01-y06"] analyses["DD"]["BESIII_2017_I1628093"] = ["d01-x01-y01"] analyses["DD"]["BESIII_2019_I1723934"] = ["d01-x01-y01"] analyses["DD"]["BESIII_2019_I1756876"] = ["d01-x01-y09","d01-x01-y10"] # BB analyses["BB"]["BELLE_2016_I1389855"] = ["d01-x01-y02","d01-x01-y03"] analyses["BB"]["BELLE_2008_I764099"] = ["d01-x01-y01","d02-x01-y01", "d03-x01-y01","d04-x01-y01"] analyses["BB"]["CLEO_1999_I474676"] = ["d01-x01-y01","d01-x01-y02"] analyses["BB"]["CUSB_1991_I325661"] = ["d01-x01-y01"] analyses["BB"]["BABAR_2001_I558091"] = ["d01-x01-y01"] analyses["BB"]["CLEO_1991_I29927"] = ["d01-x01-y01"] analyses["LL"]["BESIII_2018_I1627871"] = ["d01-x01-y01"] analyses["LL"]["DM2_1990_I297706"] = ["d02-x01-y01"] analyses["LL"]["BESIII_2019_I1758883"] = ["d01-x01-y05"] analyses["LL"]["BABAR_2007_I760730"] = ["d01-x01-y01","d02-x01-y01","d03-x01-y01"] # list the analysis if required and quit() if "all" in opts.processes : processes = sorted(list(analyses.keys())) else : processes = sorted(list(set(opts.processes))) if(opts.list) : for process in processes : print " ".join(analyses[process]) quit() if(opts.plot) : output="" for process in processes: for analysis in analyses[process] : for plot in analyses[process][analysis]: output+= " -m/%s/%s" % (analysis,plot) print output quit() # mapping of process to me to use me = { "pipi" : "MEee2Pions", "KK" : "MEee2Kaons", "3pi" : "MEee3Pions", "4pi" : "MEee4Pions", "etapipi" : "MEee2EtaPiPi", "etaprimepipi" : "MEee2EtaPrimePiPi", "etaPhi" : "MEee2EtaPhi", "etaOmega" : "MEee2EtaOmega", "omegapi" : "MEee2OmegaPi", "omegapipi" : "MEee2OmegaPiPi", "phipi" : "MEee2PhiPi", "pigamma" : "MEee2PiGamma", "etagamma" : "MEee2EtaGamma", "ppbar" : "MEee2ppbar", - "2K1pi" : "MEee2KKPi"} + "LL" : "MEee2LL" , + "2K1pi" : "MEee2KKPi" } # energies we need energies={} def nearestEnergy(en) : Emin=0 delta=1e30 anals=[] for val in energies : if(abs(val-en)200) : energy *= 0.001 emin,delta,anals = nearestEnergy(energy) if(energy in energies) : if(analysis not in energies[energy][1]) : energies[energy][1].append(analysis) if(matrix!="" and matrix not in energies[energy][0]) : energies[energy][0].append(matrix) elif(delta<1e-7) : if(analysis not in anals[1]) : anals[1].append(analysis) if(matrix!="" and matrix not in anals[0]) : anals[0].append(matrix) else : if(matrix=="") : energies[energy]=[[],[analysis]] else : energies[energy]=[[matrix],[analysis]] with open("python/LowEnergy-EE-Perturbative.in", 'r') as f: templateText = f.read() perturbative=Template( templateText ) with open("python/LowEnergy-EE-NonPerturbative.in", 'r') as f: templateText = f.read() nonPerturbative=Template( templateText ) targets="" for energy in sorted(energies) : anal="" for analysis in energies[energy][1]: anal+= "insert /Herwig/Analysis/Rivet:Analyses 0 %s\n" %analysis proc="" for matrix in energies[energy][0] : proc+="insert SubProcess:MatrixElements 0 %s\n" % matrix proc+="set %s:Flavour %s\n" % (matrix,opts.flavour) maxflavour =5 if(energy thresholds[0]) : inputPerturbative = perturbative.substitute({"ECMS" : "%8.6f" % energy, "ANALYSES" : anal, "lepton" : "", "maxflavour" : maxflavour}) with open(opts.dest+"/Rivet-LowEnergy-EE-Perturbative-%8.6f.in" % energy ,'w') as f: f.write(inputPerturbative) targets += "Rivet-LowEnergy-EE-Perturbative-%8.6f.yoda " % energy # input file for currents if(opts.nonPerturbative and proc!="") : inputNonPerturbative = nonPerturbative.substitute({"ECMS" : "%8.6f" % energy, "ANALYSES" : anal, "processes" : proc}) with open(opts.dest+"/Rivet-LowEnergy-EE-NonPerturbative-%8.6f.in" % energy ,'w') as f: f.write(inputNonPerturbative) targets += "Rivet-LowEnergy-EE-NonPerturbative-%8.6f.yoda " % energy print targets