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