9#include <generators/modules/phokharainput/PhokharaInputModule.h>
11#include <framework/datastore/StoreArray.h>
12#include <framework/utilities/FileSystem.h>
13#include <framework/utilities/IOIntercept.h>
29 setDescription(
"Generates radiative return events with PHOKHARA 10.");
33 "Final state: mu+mu-(0), pi+pi-(1), 2pi0pi+pi-(2), 2pi+2pi-(3), ppbar(4), nnbar(5), K+K-(6), K0K0bar(7), pi+pi-pi0(8), lamb(->pi-p)lambbar(->pi+pbar)(9), eta pi+ pi- (10), chi_c1 production (11), chi_c2 production (12), pi0 g (13), eta g (14), etaP g (15)",
36 "Replace muons by a virtual photon (for FinalState == 0 only).",
38 addParam(
"SearchMax",
m_nSearchMax,
"Number of events used to search for maximum of differential cross section", 100000);
42 addParam(
"LO",
m_LO,
"ph0 Born: 1ph(0), Born: 0ph(1), only Born: 0ph(-1)", 0);
44 addParam(
"FullNLO",
m_fullNLO,
"full NLO : No(0), Yes(1). Allowed only for ph0=1, nlo=1, fsr=2, fsrnlo=1", 0);
45 addParam(
"QED",
m_QED,
"ISR only(0, default), ISR+FSR(1), ISR+INT+FSR(2)", 0);
48 "Vacuum polarization switch: off (0), on (1, [by Fred Jegerlehner], default), on (2, [by Thomas Teubner])",
50 addParam(
"PionFF",
m_pionff,
"Pion FF: KS PionFormFactor(0, default), GS old 1), GS new(2)", 0);
52 "For pi+pi- only: f0+f0(600): K+K- model(0, default), no structure model(1), no f0+f0(600)(2), f0 KLOE(3)", 0);
54 "Kaon FF: KaonFormFactor constrained(0, default), KaonFormFactor unconstrained(1) KaonFormFactor old(2)", 0);
55 addParam(
"NarrowRes",
m_narres,
"Only for m_finalState = 0,1,6,7: No narrow resonances (0, default), J/Psi (1) and Psi(2S) (2)", 0);
56 addParam(
"ProtonFF",
m_protonff,
"ProtonFormFactor old(0), ProtonFormFactor new(1)", 1);
58 "chi_sw: Radiative return(0), Chi production(1), Radiative return + Chi production (2). Works only for pion=11 and pion=12.", 0);
60 "be_r: without beam resolution(0), with beam resolution(1). Works only for pion=11 and pion=12; (0) assumes exact CMS-Energy, (1) each beam ennergy (=CMS-Energy/2) is smeared with Gaussian distribution of the given variance=BeamResolution**2.",
62 addParam(
"BeamResolution",
m_beamres,
"beamres - beam resolution for pion==11 and pion==12 only", 0.);
65 "Min [0] and Max [1] value for the scattering angle of photons [deg], default (0, 180)",
make_vector(0.0, 180.0));
67 "Min [0] and Max [1] value for the scattering angle of pions(muons,nucleons,kaons) [deg], default (0, 180)",
make_vector(0.0,
73 "Force application of the MinInvMassHadrons cut. It is ignored by PHOKHARA with LO = 1, NLO = 1.",
76 addParam(
"MinEnergyGamma",
m_MinEnergyGamma,
"Minimal photon energy/missing energy, must be greater than 0.0098 * CMS energy [GeV]",
78 const std::string defaultParameterFile =
81 "File that contains particle properties.",
82 defaultParameterFile);
84 "Simulate beam-energy spread (initializes PHOKHARA for every event - very slow).",
false);
106 B2FATAL(
"You requested to replace muons by a virtual photon, but the "
107 "final state is not mu+ mu-.");
110 B2FATAL(
"You requested to replace muons by a virtual photon. In this "
111 "mode, PHOKHARA works as an ISR generator. The parameter QED "
112 "should be set to 0 (ISR only). If FSR is taken into account "
113 "(QED = 1 or 2), the results will be incorrect.");
116 B2FATAL(
"You requested to replace muons by a virtual photon. In this "
117 "mode, PHOKHARA works as an ISR generator. The parameter IFSNLO "
118 "should be set to 0 (off). If simultaneous emission of initial "
119 "and final-state photons is taken into account (IFSNLO = 1), "
120 "the results will be incorrect.");
125 B2FATAL(
"Generation of the chi_c1 or chi_c2 (final states 11 and 12, "
126 "respectively) requires to turn on the J/psi (NarrowRes = 1) "
127 "and use LO radiative-return mode (LO = 0, NLO = 0)");
150 B2FATAL(
"PhokharaInputModule::event(): BeamParameters have changed within a job, this is not supported for PHOKHARA!");
160 ROOT::Math::LorentzRotation boost = initial.
getCMSToLab();
163 ROOT::Math::XYZVector vertex = initial.
getVertex();
171 initLogCapture.
start();
180 evtMetaData->setGeneratedWeight(weight);
This class contains the nominal beam parameters and the parameters used for smearing of the primary v...
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
The base module for generator modules, which sets the generator information as EventExtraInfo.
bool start()
Start intercepting the output.
Capture stdout and stderr and convert into log messages.
bool finish()
Finish the capture and emit the message if output has appeard on stdout or stderr.
const BeamParameters & getBeamParameters() const
Return reference to nominal beam parameters.
void setAllowedFlags(int allowedFlags)
Set allowed flags.
@ c_Debug
Debug: for code development.
This class contains the initial state for the given event.
@ c_smearVertex
smear vertex
@ c_smearBeam
smear the full beam momentum (energy and direction)
const ROOT::Math::LorentzRotation & getCMSToLab() const
Return the LorentzRotation to convert from CMS to lab frame.
const ROOT::Math::XYZVector & getVertex() const
Get the position of the collision.
double getMass() const
Get the invariant mass of the collision (= energy in CMS)
@ c_checkCyclic
Check for cyclic dependencies.
@ c_setDecayInfo
Set decay time and vertex.
void generateList(const std::string &name="", int options=c_setNothing)
Generates the MCParticle list and stores it in the StoreArray with the given name.
void setDescription(const std::string &description)
Sets the description of the module.
void setWeighted(int weighted)
Sets weighted mode.
void setm_MinInvMassHadrons(double MinInvMassHadrons)
Sets the minimal inv.
void init(const std::string ¶mFile)
Initializes the generator.
void setNarrowRes(int narres)
Sets narrow resonances.
void setLO(int LO)
Sets LO correction mode.
void setEpsilon(double epsilon)
Sets soft/hard photon energy separator.
void setKaonFF(int kaonff)
Sets kaon formfactors.
void setFinalState(int finalState)
Sets final state.
void setCMSEnergy(double cmsEnergy)
Sets the CMS energy.
void setScatteringAngleRangeFinalStates(std::pair< double, double > angleRange)
Sets the theta scattering angle range for the final state particles.
void setPionStructure(int pionstructure)
Sets Pion Structure.
void setMinEnergyGamma(double MinEnergyGamma)
Sets the minimal photon energy/missing energy.
void term()
Terminates the generator.
void setScatteringAngleRangePhoton(std::pair< double, double > angleRange)
Sets the theta scattering angle range for the photon.
void setPionFF(int pionff)
Sets pion formfactors.
double generateEvent(MCParticleGraph &mcGraph, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost)
Generates one single event.
void setProtonFF(int protonff)
Sets Proton formfactors.
void setSwitchBeamResolution(int be_r)
Switches beam resolution for Chi production.
void setAlpha(int alpha)
Sets alpha qed options.
void setMinInvMassHadronsGamma(double MinInvMassHadronsGamma)
Sets the minimal hadrons(muons)-gamma-inv mass squared.
void setNLO(int NLO)
Sets NLO mode.
void setNSearchMax(int nSearchMax)
Sets the number of events used to search maximum.
void setFullNLO(int FullNLO)
Sets Full NLO mode.
void setForceMinInvMassHadronsCut(bool forceMinInvMassHadronsCut)
Sets whether to force the minimal invariant mass squared cut.
void setBeamResolution(double beamres)
Beam resolution for Chi production.
void setQED(int QED)
Sets QED corrections.
void setNMaxTrials(int nMaxTrials)
Sets number of trials per event.
void setIFSNLO(int IFSNLO)
Sets IFSNLO options.
void setReplaceMuonsByVirtualPhoton(bool replaceMuonsByVirtualPhoton)
Sets whether to replace muons by a virtual photon.
void setChiSW(int chisw)
Sets Chi production.
void setm_MaxInvMassHadrons(double MaxInvMassHadrons)
Sets the maximal inv.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
std::pair< T, T > vectorToPair(std::vector< T > &vec, const std::string &name="")
std::vector< T > make_vector(T const &t1, T const &t2)
make_vector.
void initialize()
function to be executed on initialize()
MCInitialParticles & generate()
Generate a new event.
void clear()
Reset particles and decay information to make the class reusable.
Abstract base class for different kinds of events.