Belle II Software development
BabayagaNLO Class Reference

C++ Interface for the Fortran Bhabha and exclusive two photon generator BABAYAGA.NLO. More...

#include <BabayagaNLO.h>

Public Member Functions

 BabayagaNLO ()
 Constructor.
 
 ~BabayagaNLO ()
 Destrucotr.
 
void setDefaultSettings ()
 Sets the default settings for the BhWide Fortran generator.
 
void setScatAngle (std::pair< double, double > angleRange)
 Sets the theta scattering angle range for the scattered particles.
 
void setNSearchMax (int nSearchMax)
 Sets the number of events used to search maximum.
 
void setFMax (double fMax)
 Maximum differential cross section.
 
void setMaxAcollinearity (double maxAcollinearity)
 Sets maximum acollinearity angle between finale state leptons/photons in degrees.
 
void setCmsEnergyNominal (double cmsEnergyNominal)
 Sets nominal ECM.
 
void setMinEnergy (double minEnergy)
 Sets minimum energy for leptons/photons in the final state, in GeV.
 
void setEpsilon (double epsilon)
 Sets soft/hard photon energy separator.
 
void setVacPol (const std::string &vacPol)
 Sets vacuum polarization.
 
void setModel (const std::string &model)
 Sets model: matched or ps.
 
void setMode (const std::string &mode)
 Sets mode: weighted or unweighted.
 
void setOrder (const std::string &order)
 Sets Order: born, alpha or exp.
 
void setFinalState (const std::string &finalState)
 Sets final state minimum energy.
 
void setEnergySpread (double spread)
 TEMPORARY SOLUTION! Approximate energy spread per beam (CMS)
 
void setVPUncertainty (bool vpuncertainty)
 Calculate VP uncertainty by internal reweighting (on/off)
 
void setNPhotons (int nPhot)
 Sets the fixed number of nphot (hard) photons.
 
void setUserMode (const std::string &usermode)
 Sets User mode similar to TEEGG: ETRON, EGAMMA, GAMMA or PRESCALE or NONE (default)
 
void setNSKDataFile (const std::string &NSKDataFile)
 Sets NSK VP data file.
 
void setEEMIN (double eemin)
 Sets the minimum CMS energy of the tagged e-/e+.
 
void setTEMIN (double temin)
 Sets the minimum CMS angle between the tagged e-/e+ and -z axis.
 
void setEGMIN (double egmin)
 Sets the minimum CMS energy of the gamma.
 
void setTGMIN (double tgmin)
 Sets the minimum CMS angle between the gamma and -z axis.
 
void setEEVETO (double eeveto)
 Sets the minimum CMS energy to veto e-/e+.
 
void setTEVETO (double teveto)
 Sets the maximum CMS theta of e-/e+ in final state.
 
void setEGVETO (double egveto)
 Sets the minimum CMS energy to veto gamma.
 
void setTGVETO (double tgveto)
 Sets the maximum CMS angle between the gamma and -z axis.
 
void setMaxPrescale (double maxprescale)
 Sets the maximum prescale value.
 
void init ()
 Initializes the generator.
 
void initExtraInfo ()
 Initializes the extra info.
 
void generateEvent (MCParticleGraph &mcGraph, double ecm, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost)
 Generates one single event.
 
double getSDif ()
 Returns weight.
 
void term ()
 Terminates the generator.
 

Protected Member Functions

void applySettings ()
 Apply the settings to the internal Fortran generator.
 
void storeParticle (MCParticleGraph &mcGraph, const double *mom, int pdg, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost, bool isVirtual=false, bool isInitial=false, bool isISRFSR=false)
 Store a single generated particle into the MonteCarlo graph.
 

Protected Attributes

bool m_applyBoost
 Apply a boost to the MCParticles.
 
double m_pi
 pi=3.1415....
 
double m_conversionFactor
 Conversion factor for hbarc to nb.
 
double m_alphaQED0
 QED coupling constant at Q=0.
 
double m_massElectron
 muon mass.
 
double m_massMuon
 electron mass.
 
double m_massW
 W mass [GeV] for on shell sin2theta and GF.
 
double m_massZ
 Z mass [GeV].
 
double m_widthZ
 Z width [GeV] (may be recalculated by EW library).
 
std::string m_vacPol
 vacuum polarization: off, hadr5 (Jegerlehner) or hmnt (Teubner).
 
std::string m_finalState
 final state: ee, gg or mm.
 
std::string m_model
 model: matched or ps.
 
std::string m_mode
 mode: weighted or unweighted.
 
std::string m_order
 order: born, alpha or exp.
 
double m_EnergySpread
 TEMPORARY SOLUTION! Approximate energy spread per beam (CMS).
 
double m_cmsEnergyNominal
 Nominal CMS Energy = 2*Ebeam [GeV].
 
std::pair< double, double > m_ScatteringAngleRange
 Min and Max val.
 
std::pair< double, double > m_ScatteringAngleRangePhoton
 Min and Max val.
 
double m_epsilon
 Soft/hard photon separator in units of CMS/2.
 
double m_eMin
 [GeV].
 
double m_maxAcollinearity
 Maximum acollinearity of the electron-positron pair.
 
int m_nSearchMax
 Events used to search maximum of differential cross section.
 
int m_nPhot
 fixed number of nphot (hard) photons are generated.
 
bool m_VPUncertainty
 vary all VP related parameters and extracted total uncertainty.
 
std::string m_NSKDataFile
 data file for NSK VP.
 
std::string m_userMode
 User mode similar to TEEGG: ETRON, EGAMMA, GAMMA or PRESCALE.
 
double m_eemin
 Minimum CMS energy of the tagged e-/e+ (GeV).
 
double m_temin
 Minimum CMS angle between the tagged e-/e+ and -z axis (deg).
 
double m_egmin
 Minimum CMS energy of the gamma (GeV).
 
double m_tgmin
 Minimum CMS angle between the gamma and -z axis (deg).
 
double m_eeveto
 Minimum CMS energy to veto e-/e+ (GeV).
 
double m_teveto
 Maximum CMS theta of e-/e+ in final state (deg).
 
double m_egveto
 Minimum CMS energy to veto gamma (GeV).
 
double m_tgveto
 Maximum CMS angle between the gamma and -z axis (deg).
 
double m_maxprescale
 Maximum prescale value.
 
double m_fMax
 Maximum of differential cross section.
 
double m_sDif
 Differential xsec/weight used for event.
 
ROOT::Math::LorentzRotation m_boostVector
 The Lorentz boost vector for the transformation CMS to LAB frame.
 

Private Attributes

int m_npar [100]
 Integer parameters for BabayagaNLO.
 
double m_xpar [100]
 Double parameters for BabayagaNLO.
 

Detailed Description

C++ Interface for the Fortran Bhabha and exclusive two photon generator BABAYAGA.NLO.

Definition at line 27 of file BabayagaNLO.h.

Constructor & Destructor Documentation

◆ BabayagaNLO()

Constructor.

Sets the default settings.

Definition at line 257 of file BabayagaNLO.cc.

258{
259 for (int i = 0; i < 100; ++i) {
260 m_npar[i] = 0;
261 m_xpar[i] = 0.0;
262 }
263
264 m_sDif = 0.;
265
267}
double m_sDif
Differential xsec/weight used for event.
Definition: BabayagaNLO.h:238
int m_npar[100]
Integer parameters for BabayagaNLO.
Definition: BabayagaNLO.h:261
void setDefaultSettings()
Sets the default settings for the BhWide Fortran generator.
Definition: BabayagaNLO.cc:274
double m_xpar[100]
Double parameters for BabayagaNLO.
Definition: BabayagaNLO.h:262

◆ ~BabayagaNLO()

Destrucotr.

Definition at line 269 of file BabayagaNLO.cc.

270{
271
272}

Member Function Documentation

◆ applySettings()

void applySettings ( )
protected

Apply the settings to the internal Fortran generator.

Definition at line 403 of file BabayagaNLO.cc.

404{
405 //--------------------
406 // Integer parameters
407 //--------------------
408 m_npar[0] = m_nPhot;
409 m_npar[1] = m_nSearchMax;
410 if (m_VPUncertainty) m_npar[5] = 1;
411 else m_npar[5] = 0;
412
413 //--------------------
414 // Double parameters
415 //--------------------
417 m_xpar[1] = m_pi;
419 m_xpar[3] = m_alphaQED0;
421 m_xpar[5] = m_massMuon;
422 m_xpar[6] = m_massW;
423 m_xpar[7] = m_massZ;
424 m_xpar[8] = m_widthZ;
425 m_xpar[9] = m_eMin;
427 m_xpar[11] = m_epsilon;
428 m_xpar[20] = m_ScatteringAngleRange.first;
429 m_xpar[21] = m_ScatteringAngleRange.second;
430 m_xpar[30] = m_fMax;
431 m_xpar[40] = m_EnergySpread; // only for some internal checks, not the actual smaering!
432
433 //user cuts
434 m_xpar[50] = m_eemin;
435 m_xpar[51] = m_temin;
436 m_xpar[52] = m_egmin;
437 m_xpar[53] = m_tgmin;
438 m_xpar[54] = m_eeveto;
439 m_xpar[55] = m_teveto;
440 m_xpar[56] = m_egveto;
441 m_xpar[57] = m_tgveto;
442 m_xpar[58] = m_maxprescale;
443
444 //--------------------
445 // string parameters, wrapped to integers
446 //--------------------
447 if (m_finalState == "ee") m_npar[20] = 1;
448 else if (m_finalState == "gg") m_npar[20] = 2;
449 else if (m_finalState == "mm") m_npar[20] = 3;
450 else B2FATAL("Invalid final state: " << m_finalState);
451
452 if (m_model == "matched") m_npar[21] = 1;
453 else if (m_model == "ps") m_npar[21] = 2;
454 else B2FATAL("Invalid matching model: " << m_model);
455
456 if (m_order == "born") m_npar[22] = 1;
457 else if (m_order == "alpha") m_npar[22] = 2;
458 else if (m_order == "exp") m_npar[22] = 3;
459 else B2FATAL("Invalid QED order: " << m_order);
460
461 if (m_vacPol == "off") m_npar[23] = 1;
462 else if (m_vacPol == "hadr5") m_npar[23] = 2;
463 else if (m_vacPol == "hlmnt") m_npar[23] = 3;
464 else B2FATAL("Invalid vacuum polarization code: " << m_vacPol);
465
466 if (m_mode == "unweighted" || m_mode == "uw") m_npar[24] = 1;
467 else if (m_mode == "weighted" || m_mode == "w") m_npar[24] = 2;
468 else B2FATAL("Invalid mode: " << m_mode);
469
470 if (m_userMode == "NONE") m_npar[25] = 1;
471 else if (m_userMode == "GAMMA") m_npar[25] = 2;
472 else if (m_userMode == "EGAMMA") m_npar[25] = 3;
473 else if (m_userMode == "ETRON") m_npar[25] = 4;
474 else if (m_userMode == "PRESCALE") m_npar[25] = 5;
475 else B2FATAL("Invalid user mode: " << m_userMode);
476
477 // set the data file for the novosibirsk routine (not supported yet, but needs to be set)
478 size_t fileLength = m_NSKDataFile.size();
479 babayaga_setvpolnsk_(m_NSKDataFile.c_str(), &fileLength);
480
481 //use mode to control init/generation/finalize in FORTRAN code
482 int mode = -1;
483 double ecm = -1.;
484 main_belle2_(&mode, &ecm, m_xpar, m_npar);
485}
double m_eeveto
Minimum CMS energy to veto e-/e+ (GeV).
Definition: BabayagaNLO.h:231
std::string m_NSKDataFile
data file for NSK VP.
Definition: BabayagaNLO.h:224
double m_tgveto
Maximum CMS angle between the gamma and -z axis (deg).
Definition: BabayagaNLO.h:234
std::pair< double, double > m_ScatteringAngleRange
Min and Max val.
Definition: BabayagaNLO.h:216
double m_maxAcollinearity
Maximum acollinearity of the electron-positron pair.
Definition: BabayagaNLO.h:220
double m_alphaQED0
QED coupling constant at Q=0.
Definition: BabayagaNLO.h:202
double m_EnergySpread
TEMPORARY SOLUTION! Approximate energy spread per beam (CMS).
Definition: BabayagaNLO.h:214
double m_maxprescale
Maximum prescale value.
Definition: BabayagaNLO.h:235
double m_conversionFactor
Conversion factor for hbarc to nb.
Definition: BabayagaNLO.h:201
std::string m_order
order: born, alpha or exp.
Definition: BabayagaNLO.h:213
double m_tgmin
Minimum CMS angle between the gamma and -z axis (deg).
Definition: BabayagaNLO.h:230
double m_epsilon
Soft/hard photon separator in units of CMS/2.
Definition: BabayagaNLO.h:218
double m_massMuon
electron mass.
Definition: BabayagaNLO.h:204
double m_teveto
Maximum CMS theta of e-/e+ in final state (deg).
Definition: BabayagaNLO.h:232
double m_massW
W mass [GeV] for on shell sin2theta and GF.
Definition: BabayagaNLO.h:205
double m_temin
Minimum CMS angle between the tagged e-/e+ and -z axis (deg).
Definition: BabayagaNLO.h:228
std::string m_userMode
User mode similar to TEEGG: ETRON, EGAMMA, GAMMA or PRESCALE.
Definition: BabayagaNLO.h:226
double m_widthZ
Z width [GeV] (may be recalculated by EW library).
Definition: BabayagaNLO.h:207
int m_nSearchMax
Events used to search maximum of differential cross section.
Definition: BabayagaNLO.h:221
int m_nPhot
fixed number of nphot (hard) photons are generated.
Definition: BabayagaNLO.h:222
std::string m_vacPol
vacuum polarization: off, hadr5 (Jegerlehner) or hmnt (Teubner).
Definition: BabayagaNLO.h:209
bool m_VPUncertainty
vary all VP related parameters and extracted total uncertainty.
Definition: BabayagaNLO.h:223
double m_egmin
Minimum CMS energy of the gamma (GeV).
Definition: BabayagaNLO.h:229
double m_eemin
Minimum CMS energy of the tagged e-/e+ (GeV).
Definition: BabayagaNLO.h:227
std::string m_finalState
final state: ee, gg or mm.
Definition: BabayagaNLO.h:210
double m_massZ
Z mass [GeV].
Definition: BabayagaNLO.h:206
double m_cmsEnergyNominal
Nominal CMS Energy = 2*Ebeam [GeV].
Definition: BabayagaNLO.h:215
double m_pi
pi=3.1415....
Definition: BabayagaNLO.h:200
double m_egveto
Minimum CMS energy to veto gamma (GeV).
Definition: BabayagaNLO.h:233
double m_eMin
[GeV].
Definition: BabayagaNLO.h:219
double m_massElectron
muon mass.
Definition: BabayagaNLO.h:203
std::string m_model
model: matched or ps.
Definition: BabayagaNLO.h:211
std::string m_mode
mode: weighted or unweighted.
Definition: BabayagaNLO.h:212
double m_fMax
Maximum of differential cross section.
Definition: BabayagaNLO.h:237

◆ generateEvent()

void generateEvent ( MCParticleGraph mcGraph,
double  ecm,
ROOT::Math::XYZVector  vertex,
ROOT::Math::LorentzRotation  boost 
)

Generates one single event.

Parameters
mcGraphReference to the MonteCarlo graph into which the generated particles will be stored.
ecmCentre of mass energy.
vertexProduction vertex.
boostLorentz boost vector.

Definition at line 331 of file BabayagaNLO.cc.

333{
334 //Generate event
335 int mode = 1;
336 main_belle2_(&mode, &ecm, m_xpar, m_npar);
337
338 //Store the initial particles as initial (non-virtual) particles into the MCParticleGraph
339 storeParticle(mcGraph, momset_.bq1, 11, vertex, boost, false, true, false);
340 storeParticle(mcGraph, momset_.bp1, -11, vertex, boost, false, true, false);
341
342 //Store the final state fermions or photons (for 'gg') as real particle into the MCParticleGraph
343 int pdg = 11;
344 int antipdg = -11;
345
346 if (m_finalState == "gg") {
347 pdg = 22;
348 antipdg = 22;
349 } else if (m_finalState == "mm") {
350 pdg = 13;
351 antipdg = -13;
352 }
353
354 storeParticle(mcGraph, momset_.bq2, pdg, vertex, boost, false, false, false);
355 storeParticle(mcGraph, momset_.bp2, antipdg, vertex, boost, false, false, false);
356
357 //Store the real ISR and FSR photons into the MCParticleGraph
358 for (int iPhot = 0; iPhot < momset_.bnphot; ++iPhot) {
359 double photMom[4] = {momset_.bphot[0][iPhot], momset_.bphot[1][iPhot], momset_.bphot[2][iPhot], momset_.bphot[3][iPhot]};
360 storeParticle(mcGraph, photMom, 22, vertex, boost, false, false, true);
361 }
362
363 //set event weight
364 StoreObjPtr<EventMetaData> eventMetaDataPtr("EventMetaData", DataStore::c_Event);
365 eventMetaDataPtr->setGeneratedWeight(momset_.bweight);
366
367 //set event prescale
368 StoreObjPtr<EventExtraInfo> eventExtraInfo;
369 if (not eventExtraInfo.isValid())
370 eventExtraInfo.create();
371 if (eventExtraInfo->hasExtraInfo("GeneratedPrescale")) {
372 B2WARNING("EventExtraInfo with given name is already set! I won't set it again!");
373 } else {
374 float targetValue = prescale_.bprescale;
375 eventExtraInfo->addExtraInfo("GeneratedPrescale", targetValue);
376 }
377
378}
void storeParticle(MCParticleGraph &mcGraph, const double *mom, int pdg, ROOT::Math::XYZVector vertex, ROOT::Math::LorentzRotation boost, bool isVirtual=false, bool isInitial=false, bool isISRFSR=false)
Store a single generated particle into the MonteCarlo graph.
Definition: BabayagaNLO.cc:488
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
Definition: DataStore.h:59
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96

◆ getSDif()

double getSDif ( )
inline

Returns weight.

Definition at line 190 of file BabayagaNLO.h.

190{return m_sDif;};

◆ init()

void init ( )

Initializes the generator.

Definition at line 325 of file BabayagaNLO.cc.

326{
328}
void applySettings()
Apply the settings to the internal Fortran generator.
Definition: BabayagaNLO.cc:403

◆ initExtraInfo()

void initExtraInfo ( )

Initializes the extra info.

Definition at line 319 of file BabayagaNLO.cc.

320{
322 extrainfo.registerInDataStore();
323}
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.

◆ setCmsEnergyNominal()

void setCmsEnergyNominal ( double  cmsEnergyNominal)
inline

Sets nominal ECM.

Parameters
cmsEnergyNominalnominal ecm in GeV

Definition at line 64 of file BabayagaNLO.h.

64{ m_cmsEnergyNominal = cmsEnergyNominal; }

◆ setDefaultSettings()

void setDefaultSettings ( )

Sets the default settings for the BhWide Fortran generator.

Definition at line 274 of file BabayagaNLO.cc.

275{
276// m_cmsEnergy = -1.;
277 m_cmsEnergyNominal = -1.;
278
279 m_applyBoost = true;
280
281 m_finalState = "ee";
282 m_vacPol = "hlmnt";
283 m_order = "exp";
284 m_model = "matched";
285 m_mode = "unweighted";
286 m_userMode = "NONE";
287
288 m_pi = 3.1415926535897932384626433832795029;
289 m_conversionFactor = 0.389379660e6;
290 m_alphaQED0 = 1.0 / 137.0359895;
291 m_massElectron = 0.51099906 * Unit::MeV;
292 m_massMuon = 105.65836900 * Unit::MeV;
293 m_massW = 80.385 * Unit::GeV;
294 m_massZ = 91.1882 * Unit::GeV;
295 m_widthZ = 2.4952 * Unit::GeV;
296 m_eMin = 0.1 * Unit::GeV;
297 m_epsilon = 5.e-7;
298 m_maxAcollinearity = 180.0;// * Unit::Deg;
299
300 m_ScatteringAngleRange = make_pair(15.0, 165.0); //in [deg]
301 m_ScatteringAngleRangePhoton = make_pair(15.0, 165.0); //in [deg] (unused in original babayaga)
302
303 m_nPhot = -1;
304 m_nSearchMax = 50000;
305 m_fMax = -1.;
306 m_EnergySpread = 5e-3;
307 m_VPUncertainty = false;
308 m_eemin = 0.0;
309 m_temin = 0.0;
310 m_egmin = 0.0;
311 m_tgmin = 0.0;
312 m_eeveto = 0.0;
313 m_teveto = 0.0;
314 m_egveto = 0.0;
315 m_tgveto = 0.0;
316 m_maxprescale = 1.0;
317}
bool m_applyBoost
Apply a boost to the MCParticles.
Definition: BabayagaNLO.h:199
std::pair< double, double > m_ScatteringAngleRangePhoton
Min and Max val.
Definition: BabayagaNLO.h:217
static const double MeV
[megaelectronvolt]
Definition: Unit.h:114
static const double GeV
Standard of [energy, momentum, mass].
Definition: Unit.h:51

◆ setEEMIN()

void setEEMIN ( double  eemin)
inline

Sets the minimum CMS energy of the tagged e-/e+.

Parameters
eeminminimum CMS energy of the tagged e-/e+

Definition at line 129 of file BabayagaNLO.h.

129{ m_eemin = eemin; }

◆ setEEVETO()

void setEEVETO ( double  eeveto)
inline

Sets the minimum CMS energy to veto e-/e+.

Parameters
eevetominimum CMS energy to veto e-/e+

Definition at line 149 of file BabayagaNLO.h.

149{ m_eeveto = eeveto; }

◆ setEGMIN()

void setEGMIN ( double  egmin)
inline

Sets the minimum CMS energy of the gamma.

Parameters
egminminimum CMS energy of the gamma

Definition at line 139 of file BabayagaNLO.h.

139{ m_egmin = egmin; }

◆ setEGVETO()

void setEGVETO ( double  egveto)
inline

Sets the minimum CMS energy to veto gamma.

Parameters
egvetominimum CMS energy to veto gamma

Definition at line 159 of file BabayagaNLO.h.

159{ m_egveto = egveto; }

◆ setEnergySpread()

void setEnergySpread ( double  spread)
inline

TEMPORARY SOLUTION! Approximate energy spread per beam (CMS)

Parameters
spreadenergy spread per beam (CMS)

Definition at line 104 of file BabayagaNLO.h.

104{ m_EnergySpread = spread; }

◆ setEpsilon()

void setEpsilon ( double  epsilon)
inline

Sets soft/hard photon energy separator.

Parameters
epsilonsoft/hard photon energy separator, in units of ECMS/2

Definition at line 74 of file BabayagaNLO.h.

74{ m_epsilon = epsilon; }

◆ setFinalState()

void setFinalState ( const std::string &  finalState)
inline

Sets final state minimum energy.

Parameters
finalStateMinimum energy for leptons/photons in the final state, in GeV

Definition at line 99 of file BabayagaNLO.h.

99{ m_finalState = finalState; }

◆ setFMax()

void setFMax ( double  fMax)
inline

Maximum differential cross section.

Parameters
fMaxMaximum differential cross section

Definition at line 54 of file BabayagaNLO.h.

54{ m_fMax = fMax; }

◆ setMaxAcollinearity()

void setMaxAcollinearity ( double  maxAcollinearity)
inline

Sets maximum acollinearity angle between finale state leptons/photons in degrees.

Parameters
maxAcollinearityMaximum acollinearity angle between finale state leptons/photons in degrees

Definition at line 59 of file BabayagaNLO.h.

59{ m_maxAcollinearity = maxAcollinearity; }

◆ setMaxPrescale()

void setMaxPrescale ( double  maxprescale)
inline

Sets the maximum prescale value.

Parameters
maxprescalemaximum prescale value (at maxmin theta)

Definition at line 169 of file BabayagaNLO.h.

169{ m_maxprescale = maxprescale; }

◆ setMinEnergy()

void setMinEnergy ( double  minEnergy)
inline

Sets minimum energy for leptons/photons in the final state, in GeV.

Parameters
minEnergyMinimum energy for leptons/photons in the final state, in GeV

Definition at line 69 of file BabayagaNLO.h.

69{ m_eMin = minEnergy; }

◆ setMode()

void setMode ( const std::string &  mode)
inline

Sets mode: weighted or unweighted.

Parameters
modeweighted or unweighted

Definition at line 89 of file BabayagaNLO.h.

89{ m_mode = mode; }

◆ setModel()

void setModel ( const std::string &  model)
inline

Sets model: matched or ps.

Parameters
modelmatched or ps

Definition at line 84 of file BabayagaNLO.h.

84{ m_model = model; }

◆ setNPhotons()

void setNPhotons ( int  nPhot)
inline

Sets the fixed number of nphot (hard) photons.

Parameters
nPhotnumber of nphot (hard) photons

Definition at line 114 of file BabayagaNLO.h.

114{ m_nPhot = nPhot; }

◆ setNSearchMax()

void setNSearchMax ( int  nSearchMax)
inline

Sets the number of events used to search maximum.

Parameters
nSearchMaxNumber of events for maximum search

Definition at line 49 of file BabayagaNLO.h.

49{ m_nSearchMax = nSearchMax; }

◆ setNSKDataFile()

void setNSKDataFile ( const std::string &  NSKDataFile)
inline

Sets NSK VP data file.

Parameters
NSKDataFile(default)

Definition at line 124 of file BabayagaNLO.h.

124{ m_NSKDataFile = NSKDataFile; }

◆ setOrder()

void setOrder ( const std::string &  order)
inline

Sets Order: born, alpha or exp.

Parameters
orderborn, alpha or exp

Definition at line 94 of file BabayagaNLO.h.

94{ m_order = order; }

◆ setScatAngle()

void setScatAngle ( std::pair< double, double >  angleRange)
inline

Sets the theta scattering angle range for the scattered particles.

Parameters
angleRangeA pair of values, representing the min and max theta angle of the scattered particles in [deg].

Definition at line 44 of file BabayagaNLO.h.

44{ m_ScatteringAngleRange = angleRange; }

◆ setTEMIN()

void setTEMIN ( double  temin)
inline

Sets the minimum CMS angle between the tagged e-/e+ and -z axis.

Parameters
teminminimum CMS energy of the tagged e-/e+

Definition at line 134 of file BabayagaNLO.h.

134{ m_temin = temin; }

◆ setTEVETO()

void setTEVETO ( double  teveto)
inline

Sets the maximum CMS theta of e-/e+ in final state.

Parameters
tevetomaximum CMS theta of e-/e+ in final state

Definition at line 154 of file BabayagaNLO.h.

154{ m_teveto = teveto; }

◆ setTGMIN()

void setTGMIN ( double  tgmin)
inline

Sets the minimum CMS angle between the gamma and -z axis.

Parameters
tgminminimum CMS angle between the gamma and -z axis

Definition at line 144 of file BabayagaNLO.h.

144{ m_tgmin = tgmin; }

◆ setTGVETO()

void setTGVETO ( double  tgveto)
inline

Sets the maximum CMS angle between the gamma and -z axis.

Parameters
tgvetomaximum CMS angle between the gamma and -z axis

Definition at line 164 of file BabayagaNLO.h.

164{ m_tgveto = tgveto; }

◆ setUserMode()

void setUserMode ( const std::string &  usermode)
inline

Sets User mode similar to TEEGG: ETRON, EGAMMA, GAMMA or PRESCALE or NONE (default)

Parameters
usermodeETRON, EGAMMA, GAMMA or NONE (default)

Definition at line 119 of file BabayagaNLO.h.

119{ m_userMode = usermode; }

◆ setVacPol()

void setVacPol ( const std::string &  vacPol)
inline

Sets vacuum polarization.

Parameters
vacPolVacuum polarization option

Definition at line 79 of file BabayagaNLO.h.

79{ m_vacPol = vacPol; }

◆ setVPUncertainty()

void setVPUncertainty ( bool  vpuncertainty)
inline

Calculate VP uncertainty by internal reweighting (on/off)

Parameters
vpuncertaintyboolean on/off

Definition at line 109 of file BabayagaNLO.h.

109{ m_VPUncertainty = vpuncertainty; }

◆ storeParticle()

void storeParticle ( MCParticleGraph mcGraph,
const double *  mom,
int  pdg,
ROOT::Math::XYZVector  vertex,
ROOT::Math::LorentzRotation  boost,
bool  isVirtual = false,
bool  isInitial = false,
bool  isISRFSR = false 
)
protected

Store a single generated particle into the MonteCarlo graph.

Parameters
mcGraphReference to the MonteCarlo graph into which the particle should be stored.
momThe 3-momentum of the particle in [GeV].
pdgThe PDG code of the particle.
vertexProduction vertex.
boostLorentz boost vector.
isVirtualIf the particle is a virtual particle, such as the incoming particles, set this to true.
isInitialIf the particle is a initial particle for ISR, set this to true.
isISRFSRIf the particle is from ISR or FSR, set this to true.

Definition at line 488 of file BabayagaNLO.cc.

490{
491
492// Create particle
494 if (isVirtual) {
496 } else if (isInitial) {
498 }
499
500 // all particle of a generator are primary
502
503 // all particles produced by BABAYAGA are stable
505
506 // add ISR/FSR flags to all photons that are not the primary gg pair
507 if (isISRFSR) {
510 }
511
512 part.setPDG(pdg);
513 part.setFirstDaughter(0);
514 part.setLastDaughter(0);
515 part.setMomentum(ROOT::Math::XYZVector(mom[0], mom[1], mom[2]));
516 part.setMass(TDatabasePDG::Instance()->GetParticle(pdg)->Mass());
517 part.setEnergy(mom[3]);
518
519 //boost
520 ROOT::Math::PxPyPzEVector p4 = part.get4Vector();
521 p4 = boost * p4;
522 part.set4Vector(p4);
523
524 //set vertex
525 if (!isInitial) {
526 ROOT::Math::XYZVector v3 = part.getProductionVertex();
527 v3 = v3 + vertex;
528 part.setProductionVertex(v3);
529 part.setValidVertex(true);
530 }
531}
Class to represent Particle data in graph.
void setFirstDaughter(int daughter)
Set the 1-based index of the first daughter, 0 means no daughters.
void setLastDaughter(int daughter)
Set the 1-based index of the last daughter, 0 means no daughters.
@ c_IsFSRPhoton
bit 7: Particle is from finial state radiation
Definition: MCParticle.h:61
@ c_Initial
bit 5: Particle is initial such as e+ or e- and not going to Geant4
Definition: MCParticle.h:57
@ c_PrimaryParticle
bit 0: Particle is primary particle.
Definition: MCParticle.h:47
@ c_IsVirtual
bit 4: Particle is virtual and not going to Geant4.
Definition: MCParticle.h:55
@ c_StableInGenerator
bit 1: Particle is stable, i.e., not decaying in the generator.
Definition: MCParticle.h:49
@ c_IsISRPhoton
bit 6: Particle is from initial state radiation
Definition: MCParticle.h:59
void setMass(float mass)
Set particle mass.
Definition: MCParticle.h:366
void addStatus(unsigned short int bitmask)
Add bitmask to current status.
Definition: MCParticle.h:353
void setEnergy(float energy)
Set energy.
Definition: MCParticle.h:372
ROOT::Math::XYZVector getProductionVertex() const
Return production vertex position.
Definition: MCParticle.h:189
void setValidVertex(bool valid)
Set indication wether vertex and time information is valid or just default.
Definition: MCParticle.h:378
void setProductionVertex(const ROOT::Math::XYZVector &vertex)
Set production vertex position.
Definition: MCParticle.h:396
ROOT::Math::PxPyPzEVector get4Vector() const
Return 4Vector of particle.
Definition: MCParticle.h:207
void setPDG(int pdg)
Set PDG code of the particle.
Definition: MCParticle.h:335
void set4Vector(const ROOT::Math::PxPyPzEVector &p4)
Sets the 4Vector of particle.
Definition: MCParticle.h:438
void setMomentum(const ROOT::Math::XYZVector &momentum)
Set particle momentum.
Definition: MCParticle.h:417
void setStatus(unsigned short int status)
Set Status code for the particle.
Definition: MCParticle.h:346
GraphParticle & addParticle()
Add new particle to the graph.
const std::vector< double > v3
MATLAB generated random vector.

◆ term()

void term ( )

Terminates the generator.

Closes the internal Fortran generator.

Definition at line 381 of file BabayagaNLO.cc.

382{
383
384 B2RESULT("Babayaga.NLO: Final state: " << m_finalState);
385 B2RESULT("Babayaga.NLO: Mode: " << m_mode);
386 B2RESULT("Babayaga.NLO: Order: " << m_order);
387 B2RESULT("Babayaga.NLO: Model: " << m_model);
388 B2RESULT("Babayaga.NLO: Vac. pol. (VP): " << m_vacPol);
389 B2RESULT("Babayaga.NLO: Usercuts: " << m_userMode);
390
391 // all other results are displayed from fortran using a callback to C extern logging
392
393 int mode = 2;
394 double ecm = -1.;
395 main_belle2_(&mode, &ecm, m_xpar, m_npar);
396
397}

Member Data Documentation

◆ m_alphaQED0

double m_alphaQED0
protected

QED coupling constant at Q=0.

Definition at line 202 of file BabayagaNLO.h.

◆ m_applyBoost

bool m_applyBoost
protected

Apply a boost to the MCParticles.

Definition at line 199 of file BabayagaNLO.h.

◆ m_boostVector

ROOT::Math::LorentzRotation m_boostVector
protected

The Lorentz boost vector for the transformation CMS to LAB frame.

Definition at line 240 of file BabayagaNLO.h.

◆ m_cmsEnergyNominal

double m_cmsEnergyNominal
protected

Nominal CMS Energy = 2*Ebeam [GeV].

Definition at line 215 of file BabayagaNLO.h.

◆ m_conversionFactor

double m_conversionFactor
protected

Conversion factor for hbarc to nb.

Definition at line 201 of file BabayagaNLO.h.

◆ m_eemin

double m_eemin
protected

Minimum CMS energy of the tagged e-/e+ (GeV).

Definition at line 227 of file BabayagaNLO.h.

◆ m_eeveto

double m_eeveto
protected

Minimum CMS energy to veto e-/e+ (GeV).

Definition at line 231 of file BabayagaNLO.h.

◆ m_egmin

double m_egmin
protected

Minimum CMS energy of the gamma (GeV).

Definition at line 229 of file BabayagaNLO.h.

◆ m_egveto

double m_egveto
protected

Minimum CMS energy to veto gamma (GeV).

Definition at line 233 of file BabayagaNLO.h.

◆ m_eMin

double m_eMin
protected

[GeV].

Definition at line 219 of file BabayagaNLO.h.

◆ m_EnergySpread

double m_EnergySpread
protected

TEMPORARY SOLUTION! Approximate energy spread per beam (CMS).

Definition at line 214 of file BabayagaNLO.h.

◆ m_epsilon

double m_epsilon
protected

Soft/hard photon separator in units of CMS/2.

Definition at line 218 of file BabayagaNLO.h.

◆ m_finalState

std::string m_finalState
protected

final state: ee, gg or mm.

Definition at line 210 of file BabayagaNLO.h.

◆ m_fMax

double m_fMax
protected

Maximum of differential cross section.

Definition at line 237 of file BabayagaNLO.h.

◆ m_massElectron

double m_massElectron
protected

muon mass.

Definition at line 203 of file BabayagaNLO.h.

◆ m_massMuon

double m_massMuon
protected

electron mass.

Definition at line 204 of file BabayagaNLO.h.

◆ m_massW

double m_massW
protected

W mass [GeV] for on shell sin2theta and GF.

Definition at line 205 of file BabayagaNLO.h.

◆ m_massZ

double m_massZ
protected

Z mass [GeV].

Definition at line 206 of file BabayagaNLO.h.

◆ m_maxAcollinearity

double m_maxAcollinearity
protected

Maximum acollinearity of the electron-positron pair.

Definition at line 220 of file BabayagaNLO.h.

◆ m_maxprescale

double m_maxprescale
protected

Maximum prescale value.

Definition at line 235 of file BabayagaNLO.h.

◆ m_mode

std::string m_mode
protected

mode: weighted or unweighted.

Definition at line 212 of file BabayagaNLO.h.

◆ m_model

std::string m_model
protected

model: matched or ps.

Definition at line 211 of file BabayagaNLO.h.

◆ m_npar

int m_npar[100]
private

Integer parameters for BabayagaNLO.

Definition at line 261 of file BabayagaNLO.h.

◆ m_nPhot

int m_nPhot
protected

fixed number of nphot (hard) photons are generated.

A negative value means all possible photons.

Definition at line 222 of file BabayagaNLO.h.

◆ m_nSearchMax

int m_nSearchMax
protected

Events used to search maximum of differential cross section.

Definition at line 221 of file BabayagaNLO.h.

◆ m_NSKDataFile

std::string m_NSKDataFile
protected

data file for NSK VP.

Definition at line 224 of file BabayagaNLO.h.

◆ m_order

std::string m_order
protected

order: born, alpha or exp.

Definition at line 213 of file BabayagaNLO.h.

◆ m_pi

double m_pi
protected

pi=3.1415....

Definition at line 200 of file BabayagaNLO.h.

◆ m_ScatteringAngleRange

std::pair<double, double> m_ScatteringAngleRange
protected

Min and Max val.

for the scattering angle [deg] of the electron/positron.

Definition at line 216 of file BabayagaNLO.h.

◆ m_ScatteringAngleRangePhoton

std::pair<double, double> m_ScatteringAngleRangePhoton
protected

Min and Max val.

for the scattering angle [deg] of the g in gg mode.

Definition at line 217 of file BabayagaNLO.h.

◆ m_sDif

double m_sDif
protected

Differential xsec/weight used for event.

Definition at line 238 of file BabayagaNLO.h.

◆ m_temin

double m_temin
protected

Minimum CMS angle between the tagged e-/e+ and -z axis (deg).

Definition at line 228 of file BabayagaNLO.h.

◆ m_teveto

double m_teveto
protected

Maximum CMS theta of e-/e+ in final state (deg).

Definition at line 232 of file BabayagaNLO.h.

◆ m_tgmin

double m_tgmin
protected

Minimum CMS angle between the gamma and -z axis (deg).

Definition at line 230 of file BabayagaNLO.h.

◆ m_tgveto

double m_tgveto
protected

Maximum CMS angle between the gamma and -z axis (deg).

Definition at line 234 of file BabayagaNLO.h.

◆ m_userMode

std::string m_userMode
protected

User mode similar to TEEGG: ETRON, EGAMMA, GAMMA or PRESCALE.

Definition at line 226 of file BabayagaNLO.h.

◆ m_vacPol

std::string m_vacPol
protected

vacuum polarization: off, hadr5 (Jegerlehner) or hmnt (Teubner).

Definition at line 209 of file BabayagaNLO.h.

◆ m_VPUncertainty

bool m_VPUncertainty
protected

vary all VP related parameters and extracted total uncertainty.

Definition at line 223 of file BabayagaNLO.h.

◆ m_widthZ

double m_widthZ
protected

Z width [GeV] (may be recalculated by EW library).

Definition at line 207 of file BabayagaNLO.h.

◆ m_xpar

double m_xpar[100]
private

Double parameters for BabayagaNLO.

Definition at line 262 of file BabayagaNLO.h.


The documentation for this class was generated from the following files: