Belle II Software  release-06-00-14
photospp_hepevt_interface.cc
1 
7 #include <cstdlib>
8 #include "Photos.h"
9 #include "PhotosHEPEVTEvent.h"
10 using namespace Photospp;
11 using std::cout;
12 using std::endl;
13 extern "C" {
14  void dark_init_(int& idspecial, int& ifspecial, int& normfact, int& normfmu, double& speciallife, double& mxx, double& gxx,
15  int& iddarkmother, int& iboson, int& iforce)
16  {
17  darkr.IDspecial = idspecial; // dark PDG identifier
18  darkr.ifspecial = ifspecial; // to switch resonance decaying to lepton pair
19  darkr.NormFact = normfact; // enhance with respect to QED for electron pairs.
20  darkr.NormFmu = normfmu; //20;// extra enhancement for muon pairs.
21  darkr.SpecialLife = speciallife; // its lifetime
22  darkr.MXX = mxx; // its mass
23  darkr.GXX = gxx; // and width
24  darkr.IDdarkMother = iddarkmother; // PDGid of particle decaying with dark
25  darkr.iboson = iboson; // to switch from scalar to vector
26  darkr.ifforce = iforce; //
27  darkr.Fel = 0.0;
28  darkr.Fmu = 0.0;
29  }
30  void photos_init_(int& ifpairs, int& ifphotons)
31  {
34 
35  // Turn on pair emission and turn off photon emission
36  // Note that this example loops over the same event until at least one
37  // particle is added, so uncommenting these two flags can be used
38  // to test if a pair is correctly emitted
39  if (ifpairs == 1) Photos::setPairEmission(true);
40  else Photos::setPairEmission(false);
41 
42  if (ifphotons == 1) Photos::setPhotonEmission(true);
43  else Photos::setPhotonEmission(false);
44  // darkr.IDspecial=22; // dark PDG identifier
45  // darkr.ifspecial=1; // to switch resonance decaying to lepton pair
46  // darkr.NormFact=100; // enhance with respect to QED for electron pairs.
47  // darkr.NormFmu=1; //20;// extra enhancement for muon pairs.
48  // darkr.SpecialLife=0.0; // its lifetime
49  // darkr.MXX=0.05; // its mass
50  // darkr.GXX=0.0001; // and width
51  // darkr.IDdarkMother=23; // PDGid of particle decaying with dark
52 
53  // Turn on NLO corrections
54  //Photos::setMeCorrectionWtForW(true);
55  //Photos::setMeCorrectionWtForZ(true);
56  }
57 
58  void photos_process_()
59  {
60  PhotosHEPEVTEvent* event = new PhotosHEPEVTEvent();
61 
63  //event->print();
64 
65  event->process();
66  //event->print();
67 
69 
70  delete event;
71  }
72 
73  void photos_process_particle_(int* i)
74  {
75  PhotosHEPEVTEvent* event = new PhotosHEPEVTEvent();
76 
78  //event->print();
79 
80  PhotosParticle* p = event->getParticle(*i - 1);
81 
83  //event->print();
84 
86 
87  delete event;
88  }
89 
90  void photos_process_branch_(int* i)
91  {
92  PhotosHEPEVTEvent* event = new PhotosHEPEVTEvent();
93 
95  //event->print();
96 
97  PhotosParticle* p = event->getParticle(*i - 1);
98 
100  //event->print();
101 
103 
104  delete event;
105  }
106 }
static void read_event_from_HEPEVT(PhotosHEPEVTEvent *evt)
Fill PhotosHEPEVTEvent from HEPEVT common block.
static void write_event_to_HEPEVT(PhotosHEPEVTEvent *evt)
Write to HEPEVT common block content of PhotosHEPEVTEvent.
static void initialize()
Initalize Photos with the parameters previously set via the setter methods.
Definition: Photos.cc:52
static void forceMassFromEventRecord(int pdgid)
When particles with PDGID and -PDGID will be processed by Photos, their mass value will be taken from...
Definition: Photos.cc:437
static void setPhotonEmission(bool ifphot)
Set photon emission.
Definition: Photos.cc:407
static void processBranch(PhotosParticle *p)
Process decay of whole decay branch starting from given particle.
Definition: Photos.cc:230
static void processParticle(PhotosParticle *p)
Process decay of single particle.
Definition: Photos.cc:224
static void setPairEmission(bool ifpair)
Set pair emission.
Definition: Photos.cc:402