1 #ifndef _Photos_h_included_
2 #define _Photos_h_included_
7 * @brief Controls the configuration and initialization of Photos.
9 * This is the main configuration class for Photos C++ Interface.
10 * It is also used for invoking methods for processing single particle or branch.
12 * @author Nadia Davidson
13 * @date 16th June 2008
18 #include "PhotosParticle.h"
19 #include "PhotosRandom.h"
21 // WARNING: VARIANT B of phase space generation was not tested in C++ for all
22 // options of the program initialization..
23 //#define VARIANTB true
35 static const int VER_MAJOR=3, VER_MINOR=54;
36 static const int DAT_DAY =2, DAT_MONTH=12,DAT_YEAR=13;
39 /** Initalize Photos with the parameters previously set via the
41 static void initialize();
43 /** Prints info on Photos initialization (reinitialization)
45 static void iniInfo();
47 /** Process decay of single particle */
48 static void processParticle(PhotosParticle *p);
49 /** Process decay of whole decay branch starting from given particle */
50 static void processBranch(PhotosParticle *p);
52 /** Suppress processing of a single decay */
53 static void suppressBremForDecay (int count, int motherID, ... );
54 /** Suppress processing of whole decay branch */
55 static void suppressBremForBranch(int count, int motherID, ... );
57 /** Suppress all processing. Only forced decays will be processed. */
58 static void suppressAll() { isSuppressed=true; }
60 /** Force processing of a single decay */
61 static void forceBremForDecay (int count, int motherID, ... );
63 /** Force processing of a whole decay branch */
64 static void forceBremForBranch(int count, int motherID, ... );
66 /** Block emissions id decays pi0 and K_L -> gamma e+ e-
68 2 (default) = suppressed emissions in K_L -> gamma e+ e- ... and all pi0 decays */
69 static void IPHEKL_setPi0KLnoEmission(int m);
71 static bool IPHQRK_setQarknoEmission(int MODCOR, int PDGID);
73 /** If event record allows it, create history entries of particles
74 before Photos processing */
75 static void createHistoryEntries(bool flag, int status);
77 /** Ignore particles with given status code */
78 static void ignoreParticlesOfStatus(int status);
80 /** Remove 'status' from the list of ignored status codes */
81 static void deIgnoreParticlesOfStatus(int status);
83 /** Returns 'true' if status code is ignored */
84 static bool isStatusCodeIgnored(int status);
86 /** Substitute build-in generator with external one */
87 static void setRandomGenerator( double (*gen)() );
89 /** Seed for RANMAR used by fortran part of the Photos */
90 static void setSeed(int iseed1, int iseed2) { PhotosRandom::setSeed(iseed1,iseed2); }
92 /** Maximum interference weight */
93 static void maxWtInterference(double interference) { phokey_.fint=interference; }
95 /** Minimal energy (in units of decaying particle mass) for photons to be explicitly generated */
96 static void setInfraredCutOff(double cut_off) { phocop_.xphcut=cut_off; }
98 /** Coupling constant alpha QED */
99 static void setAlphaQED(double alpha) { phocop_.alpha=alpha; }
101 /** Key for interference, matrix element weight */
102 static void setInterference(bool interference) { phokey_.interf=(int)interference; }
104 /** Set double bremsstrahlung generation */
105 static void setDoubleBrem(bool doub) { phokey_.isec=(int)doub; }
107 /** Set bremsstrahlung generation up to multiplicity of 4 */
108 static void setQuatroBrem(bool quatroBrem) { phokey_.itre=(int)quatroBrem; }
110 /* Key for partial effects of matrix element (in leptonic W decays) */
111 static void setCorrectionWtForW(bool corr) { phokey_.ifw=(int)corr; }
113 /** Set exponentiation mode */
114 static void setExponentiation(bool expo);
116 /** Switch for complete effects of matrix element (in scalar to 2 scalars decays) */
117 static void setMeCorrectionWtForScalar(bool corr);
119 /** Switch for complete effects of matrix element (in leptonic W decays) */
120 static void setMeCorrectionWtForW(bool corr);
122 /** Switch for complete effects of matrix element (in leptonic Z decays) */
123 static void setMeCorrectionWtForZ(bool corr);
125 /** Set photon emission in top pair production in quark (gluon) pair annihilation */
126 static void setTopProcessRadiation(bool top) { phokey_.iftop=(int)top; }
128 /* Set if PHOTOS should stop at critical error. True by default.
129 WARNING: These stops are an essential source of debugging information flow
130 from event record to PHOTOS algorithm. Never switch it off! The only exception:
131 you have checked your set-up including particular physics initialization
132 with the substantially large sample and you submit large production. */
133 static void setStopAtCriticalError(bool stop);
135 /** Initialize kinematic corrections */
136 static void initializeKinematicCorrections(int flag) { PHCORK(flag); }
138 /** Force mass value to be sqrt(e^2-p^2) for all particle momenta
139 taken from event record. May be important for numerical stability.
140 May lead to faulty results due to rounding errors for
141 hiper-relativistic electron, for example. */
142 static void forceMassFrom4Vector(bool flag) { massFrom4Vector=flag; }
144 /** When particles with PDGID and -PDGID will be processed by Photos,
145 their mass value will be taken from event record instead of being
146 calculated from 4-vector.
148 This works only if 'forceMassFrom4Vector' is set to 'true' (default)
149 This routine may be executed several times with different PDGID values. */
150 static void forceMassFromEventRecord(int pdgid);
152 /** When particles with PDGID and -PDGID will be processed by Photos,
153 their mass value will be given by user instead of being calculated
156 This works only if 'forceMassFrom4Vector' is set to 'true' (default)
157 This routine may be executed several times with different PDGID values. */
158 static void forceMass(int pdgid, double mass);
160 /** set energy momentum conservation threshold */
161 static void setMomentumConservationThreshold(double threshold){momentum_conservation_threshold=threshold; }
164 /** Is in suppressed mode */
165 static bool isSuppressed;
167 /** Is mass from 4-vector or from event record */
168 static bool massFrom4Vector;
170 /** List of suppressed decays */
171 static vector<vector<int>* > *supBremList;
173 /** List of forced decays */
174 static vector<vector<int>* > *forceBremList;
176 /** List of forced mass values */
177 static vector<pair<int,double>* > *forceMassList;
179 /** List of ignored status codes */
180 static vector<int > *ignoreStatusCodeList;
182 /** Threshold for momentum conservation check */
183 static double momentum_conservation_threshold;
185 /** Flag for complete effects of matrix element (in scalars decays) */
186 static bool meCorrectionWtForScalar;
188 /** Flag for complete effects of matrix element (in leptonic Z decays) */
189 static bool meCorrectionWtForZ;
191 /** Flag for complete effects of matrix element (in leptonic W decays) */
192 static bool meCorrectionWtForW;
194 /** Flag for creating historic entries */
195 static bool isCreateHistoryEntries;
197 /** Status of history entries */
198 static int historyEntriesStatus;
200 /** Pointer to random generator function */
201 static double (*randomDouble)();
203 /** Get instance of Photos */
204 Photos& getInstance() { return _instance; }
206 /* Singleton: only one instance allowed.
207 Constructor sets default values of PHOTOS parameters */
210 Photos(const Photos&);
211 Photos& operator=(const Photos&);
212 static Photos _instance;
215 } // namespace Photospp