Belle II Software  release-06-01-15
Photos.h
1 #ifndef _Photos_h_included_
2 #define _Photos_h_included_
3 
15 #include <stdarg.h>
16 #include <vector>
17 #include "PhotosParticle.h"
18 #include "PhotosRandom.h"
19 #include "photosC.h"
20 // WARNING: VARIANT B of phase space generation was not tested in C++ for all
21 // options of the program initialization..
22 //#define VARIANTB true
23 using std::vector;
24 using std::pair;
25 
26 namespace Photospp {
27 
28  class PhotosParticle;
29 
30  class Photos {
31  public:
32  static const int VER_MAJOR = 3, VER_MINOR = 64;
33  static const int DAT_DAY = 18, DAT_MONTH = 2, DAT_YEAR = 20;
34 
36  static enum MomentumUnits { DEFAULT_MOMENTUM = -1, MEV, GEV } momentumUnit;
37 
38 
39  public:
40 
43  static void initialize();
44 
47  static void iniInfo();
48 
50  static void processParticle(PhotosParticle* p);
52  static void processBranch(PhotosParticle* p);
53 
55  static void suppressBremForDecay(int count, int motherID, ...);
57  static void suppressBremForBranch(int count, int motherID, ...);
58 
60  static void suppressAll() { isSuppressed = true; }
61 
63  static void forceBremForDecay(int count, int motherID, ...);
64 
66  static void forceBremForBranch(int count, int motherID, ...);
67 
71  static void IPHEKL_setPi0KLnoEmission(int m);
72 
73  static bool IPHQRK_setQarknoEmission(int MODCOR, int PDGID);
74 
77  static void createHistoryEntries(bool flag, int status);
78 
80  static void ignoreParticlesOfStatus(int status);
81 
83  static void deIgnoreParticlesOfStatus(int status);
84 
86  static bool isStatusCodeIgnored(int status);
87  public:
89  static void setRandomGenerator(double (*gen)());
90 
92  static void setSeed(int iseed1, int iseed2) { PhotosRandom::setSeed(iseed1, iseed2); }
93 
95  static void maxWtInterference(double interference) { phokey.fint = interference; }
96 
98  static void setInfraredCutOff(double cut_off) { phocop.xphcut = cut_off; }
99 
101  static void setAlphaQED(double alpha) { phocop.alpha = alpha; }
102 
104  static void setInterference(bool interference) { phokey.interf = (int)interference; }
105 
107  static void setDoubleBrem(bool doub) { phokey.isec = (int)doub; }
108 
110  static void setQuatroBrem(bool quatroBrem) { phokey.itre = (int)quatroBrem; }
111 
112  /* Key for partial effects of matrix element (in leptonic W decays) */
113  static void setCorrectionWtForW(bool corr) { phokey.ifw = (int)corr; }
114 
116  static void setExponentiation(bool expo);
117 
119  static void setPairEmission(bool ifpair);
120 
122  static void setPhotonEmission(bool ifphot);
123 
125  static void setMeCorrectionWtForScalar(bool corr);
126 
128  static void setMeCorrectionWtForW(bool corr);
129 
131  static void setMeCorrectionWtForZ(bool corr);
132 
134  static void setTopProcessRadiation(bool top) { phokey.iftop = (int)top; }
135 
137  static void setMomentumUnit(MomentumUnits unit) { momentumUnit = unit; }
138 
139  /* Set if PHOTOS should stop at critical error. True by default.
140  WARNING: These stops are an essential source of debugging information flow
141  from event record to PHOTOS algorithm. Never switch it off! The only exception:
142  you have checked your set-up including particular physics initialization
143  with the substantially large sample and you submit large production. */
144  static void setStopAtCriticalError(bool stop);
145 
147  static void initializeKinematicCorrections(int flag) { PHCORK(flag); }
148 
153  static void forceMassFrom4Vector(bool flag) { massFrom4Vector = flag; }
154 
161  static void forceMassFromEventRecord(int pdgid);
162 
169  static void forceMass(int pdgid, double mass);
170 
172  static void setMomentumConservationThreshold(double threshold) {momentum_conservation_threshold = threshold; }
173 
175  static void setEventNo(int iEvt) {EventNo = iEvt; }
176  public:
177 
178 
180  static int EventNo;
181 
183  static bool isSuppressed;
184 
186  static bool massFrom4Vector;
187 
189  static vector<vector<int>* >* supBremList;
190 
192  static vector<vector<int>* >* forceBremList;
193 
195  static vector<pair<int, double>* >* forceMassList;
196 
198  static vector<int >* ignoreStatusCodeList;
199 
202 
205 
207  static bool meCorrectionWtForZ;
208 
210  static bool meCorrectionWtForW;
211 
214 
216  static bool IfPair;
217 
219  static bool IfPhot;
220 
221 
224 
226  static double (*randomDouble)();
227  public:
229  Photos& getInstance() { return _instance; }
230  private:
231  /* Singleton: only one instance allowed.
232  Constructor sets default values of PHOTOS parameters */
233  Photos();
234  ~Photos() {}
235  Photos(const Photos&);
236  Photos& operator=(const Photos&);
237  static Photos _instance;
238  };
239 
240 } // namespace Photospp
241 #endif
242 
Abstract base class for particle in the event.
Controls the configuration and initialization of Photos.
static bool meCorrectionWtForZ
Flag for complete effects of matrix element (in leptonic Z decays)
Definition: Photos.h:207
static void forceBremForDecay(int count, int motherID,...)
Force processing of a single decay.
Definition: Photos.cc:267
static void setQuatroBrem(bool quatroBrem)
Set bremsstrahlung generation up to multiplicity of 4.
Definition: Photos.h:110
static vector< pair< int, double > * > * forceMassList
List of forced mass values.
Definition: Photos.h:195
static void forceMass(int pdgid, double mass)
When particles with PDGID and -PDGID will be processed by Photos, their mass value will be given by u...
Definition: Photos.cc:443
static void setSeed(int iseed1, int iseed2)
Seed for RANMAR used by fortran part of the Photos.
Definition: Photos.h:92
static void initialize()
Initalize Photos with the parameters previously set via the setter methods.
Definition: Photos.cc:52
static bool isStatusCodeIgnored(int status)
Returns 'true' if status code is ignored.
Definition: Photos.cc:374
static void forceMassFrom4Vector(bool flag)
Force mass value to be sqrt(e^2-p^2) for all particle momenta taken from event record.
Definition: Photos.h:153
static vector< vector< int > * > * supBremList
List of suppressed decays.
Definition: Photos.h:189
static void suppressBremForBranch(int count, int motherID,...)
Suppress processing of whole decay branch.
Definition: Photos.cc:252
static vector< vector< int > * > * forceBremList
List of forced decays.
Definition: Photos.h:192
static void setMeCorrectionWtForW(bool corr)
Switch for complete effects of matrix element (in leptonic W decays)
Definition: Photos.cc:412
static void setMomentumConservationThreshold(double threshold)
set energy momentum conservation threshold
Definition: Photos.h:172
static int EventNo
Is event No.
Definition: Photos.h:180
static void setRandomGenerator(double(*gen)())
Substitute build-in generator with external one.
Definition: Photos.cc:384
static bool isSuppressed
Is in suppressed mode.
Definition: Photos.h:183
static void suppressAll()
Suppress all processing.
Definition: Photos.h:60
static void suppressBremForDecay(int count, int motherID,...)
Suppress processing of a single decay.
Definition: Photos.cc:237
static void createHistoryEntries(bool flag, int status)
If event record allows it, create history entries of particles before Photos processing.
Definition: Photos.cc:334
static bool IfPhot
Flag for generating emission of photons.
Definition: Photos.h:219
static double momentum_conservation_threshold
Threshold for momentum conservation check.
Definition: Photos.h:201
static void setExponentiation(bool expo)
Set exponentiation mode.
Definition: Photos.cc:390
static bool isCreateHistoryEntries
Flag for creating historic entries.
Definition: Photos.h:213
static void setInfraredCutOff(double cut_off)
Minimal energy (in units of decaying particle mass) for photons to be explicitly generated.
Definition: Photos.h:98
static void forceBremForBranch(int count, int motherID,...)
Force processing of a whole decay branch.
Definition: Photos.cc:282
static void setTopProcessRadiation(bool top)
Set photon emission in top pair production in quark (gluon) pair annihilation.
Definition: Photos.h:134
static void setInterference(bool interference)
Key for interference, matrix element weight.
Definition: Photos.h:104
static void ignoreParticlesOfStatus(int status)
Ignore particles with given status code.
Definition: Photos.cc:346
static vector< int > * ignoreStatusCodeList
List of ignored status codes.
Definition: Photos.h:198
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
Photos & getInstance()
Get instance of Photos.
Definition: Photos.h:229
static void maxWtInterference(double interference)
Maximum interference weight.
Definition: Photos.h:95
static void setMeCorrectionWtForZ(bool corr)
Switch for complete effects of matrix element (in leptonic Z decays)
Definition: Photos.cc:417
static void setPhotonEmission(bool ifphot)
Set photon emission.
Definition: Photos.cc:407
static bool meCorrectionWtForScalar
Flag for complete effects of matrix element (in scalars decays)
Definition: Photos.h:204
static void setMeCorrectionWtForScalar(bool corr)
Switch for complete effects of matrix element (in scalar to 2 scalars decays)
Definition: Photos.cc:421
static void IPHEKL_setPi0KLnoEmission(int m)
Block emissions id decays pi0 and K_L -> gamma e+ e- 1 = no suppression 2 (default) = suppressed emis...
Definition: Photos.cc:299
static void setMomentumUnit(MomentumUnits unit)
Set momentum unit.
Definition: Photos.h:137
MomentumUnits
Units.
Definition: Photos.h:36
static void processBranch(PhotosParticle *p)
Process decay of whole decay branch starting from given particle.
Definition: Photos.cc:230
static double(* randomDouble)()
Pointer to random generator function.
Definition: Photos.h:226
static bool massFrom4Vector
Is mass from 4-vector or from event record.
Definition: Photos.h:186
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
static void setEventNo(int iEvt)
set event no
Definition: Photos.h:175
static void setDoubleBrem(bool doub)
Set double bremsstrahlung generation.
Definition: Photos.h:107
static int historyEntriesStatus
Status of history entries.
Definition: Photos.h:223
static void initializeKinematicCorrections(int flag)
Initialize kinematic corrections.
Definition: Photos.h:147
static void iniInfo()
Prints info on Photos initialization (reinitialization) status.
Definition: Photos.cc:180
static void deIgnoreParticlesOfStatus(int status)
Remove 'status' from the list of ignored status codes.
Definition: Photos.cc:362
static bool meCorrectionWtForW
Flag for complete effects of matrix element (in leptonic W decays)
Definition: Photos.h:210
static bool IfPair
Flag for generating emission of pairs.
Definition: Photos.h:216
static void setAlphaQED(double alpha)
Coupling constant alpha QED.
Definition: Photos.h:101