Photos.h

00001 #ifndef _Photos_h_included_
00002 #define _Photos_h_included_
00003 
00004 /**
00005  * @class Photos
00006  *
00007  * @brief Controls the configuration and initialization of Photos.
00008  *
00009  * This is the main configuration class for Photos C++ Interface.
00010  * It is also used for invoking methods for processing single particle or branch.
00011  *
00012  * @author Nadia Davidson
00013  * @date 16th June 2008
00014  */
00015 #include <stdarg.h>
00016 #include <vector>
00017 #include "PhotosParticle.h"
00018 #include "PhotosRandom.h"
00019 #include "f_Init.h"
00020 using std::vector;
00021 using std::pair;
00022 
00023 namespace Photospp
00024 {
00025 
00026 class PhotosParticle;
00027 
00028 class Photos
00029 {
00030 public:
00031         static const int VER_MAJOR=3, VER_MINOR=52;
00032         static const int DAT_DAY  =4,DAT_MONTH=11,DAT_YEAR=12;
00033 public:
00034 
00035         /** Initalize Photos with the parameters previously set via the
00036            setter methods */
00037         static void initialize();
00038 
00039         /** Prints info on  Photos initialization (reinitialization)
00040            status */
00041         static void iniInfo();
00042 
00043         /** Process decay of single particle */
00044         static void processParticle(PhotosParticle *p);
00045         /** Process decay of whole decay branch starting from given particle */
00046         static void processBranch(PhotosParticle *p);
00047 
00048         /** Suppress processing of a single decay */
00049         static void suppressBremForDecay (int count, int motherID, ... );
00050         /** Suppress processing of whole decay branch */
00051         static void suppressBremForBranch(int count, int motherID, ... );
00052 
00053         /** Suppress all processing. Only forced decays will be processed. */
00054         static void suppressAll()                      { isSuppressed=true; }
00055 
00056         /** Force processing of a single decay */
00057         static void forceBremForDecay (int count, int motherID, ... );
00058 
00059         /** Force processing of a whole decay branch */
00060         static void forceBremForBranch(int count, int motherID, ... );
00061 
00062   /** If event record allows it, create history entries of particles
00063       before Photos processing */
00064   static void createHistoryEntries(bool flag, int status);
00065 
00066   /** Ignore particles with given status code */
00067   static void ignoreParticlesOfStatus(int status);
00068 
00069   /** Remove 'status' from the list of ignored status codes */
00070   static void deIgnoreParticlesOfStatus(int status);
00071   
00072   /** Returns 'true' if status code is ignored */
00073   static bool isStatusCodeIgnored(int status);
00074 public:
00075   /** Substitute build-in generator with external one */
00076   static void setRandomGenerator( double (*gen)() );
00077 
00078         /** Seed for RANMAR used by fortran part of the Photos */
00079         static void setSeed(int iseed1, int iseed2)    { PhotosRandom::setSeed(iseed1,iseed2); }
00080 
00081         /** Maximum interference weight */
00082         static void maxWtInterference(double interference) { phokey_.fint=interference; }
00083 
00084         /** Minimal energy (in units of decaying particle mass) for photons to be explicitly generated */
00085         static void setInfraredCutOff(double cut_off)  { phocop_.xphcut=cut_off; }
00086 
00087         /** Coupling constant alpha QED */
00088         static void setAlphaQED(double alpha)          { phocop_.alpha=alpha; }
00089 
00090         /** Key for interference, matrix element weight */
00091         static void setInterference(bool interference) { phokey_.interf=(int)interference; }
00092 
00093         /** Set double bremsstrahlung generation */
00094         static void setDoubleBrem(bool doub)           { phokey_.isec=(int)doub; }
00095 
00096         /** Set bremsstrahlung generation up to multiplicity of 4 */
00097         static void setQuatroBrem(bool quatroBrem)     { phokey_.itre=(int)quatroBrem; }
00098 
00099         /* Key for partial effects of  matrix element (in leptonic W decays) */
00100         static void setCorrectionWtForW(bool corr) { phokey_.ifw=(int)corr; }
00101 
00102         /** Set exponentiation mode */
00103         static void setExponentiation(bool expo);
00104 
00105         /** Switch for complete effects of matrix element (in  scalar  to 2 scalars decays) */
00106         static void setMeCorrectionWtForScalar(bool corr);
00107 
00108         /** Switch for complete effects of matrix element (in leptonic W decays) */
00109         static void setMeCorrectionWtForW(bool corr);
00110 
00111         /** Switch for complete effects of matrix element (in leptonic Z decays) */
00112         static void setMeCorrectionWtForZ(bool corr);
00113 
00114         /** Set photon emission in top pair production in quark (gluon) pair annihilation */
00115         static void setTopProcessRadiation(bool top)         { phokey_.iftop=(int)top; }
00116 
00117         /* Set if PHOTOS should stop at critical error. True by default.
00118            WARNING: These stops are an essential source of debugging information flow
00119                     from event record to PHOTOS algorithm. Never switch it off! The only exception:
00120                     you have checked your set-up including particular physics initialization
00121                     with the substantially large sample and you submit large production. */
00122         static void setStopAtCriticalError(bool stop);
00123 
00124         /** Initialize kinematic corrections */
00125         static void initializeKinematicCorrections(int flag) { phcork_(&flag); }
00126 
00127         /** Force mass value to be sqrt(e^2-p^2) for all particle momenta
00128             taken from event record. May be important for numerical stability.
00129                 May lead to faulty results due to rounding errors for
00130                 hiper-relativistic electron, for example. */
00131         static void forceMassFrom4Vector(bool flag) { massFrom4Vector=flag; }
00132         
00133   /** When particles with PDGID and -PDGID will be processed by Photos,
00134       their mass value will be taken from event record instead of being
00135       calculated from 4-vector.
00136 
00137       This works only if 'forceMassFrom4Vector' is set to 'true' (default)      
00138       This routine may be executed several times with different PDGID values. */
00139   static void forceMassFromEventRecord(int pdgid);
00140 
00141   /** When particles with PDGID and -PDGID will be processed by Photos,
00142       their mass value will be given by user instead of being calculated
00143       from 4-vector.
00144 
00145       This works only if 'forceMassFrom4Vector' is set to 'true' (default)
00146       This routine may be executed several times with different PDGID values. */  
00147   static void forceMass(int pdgid, double mass);
00148 
00149         /** set energy momentum conservation threshold */
00150         static void setMomentumConservationThreshold(double threshold){momentum_conservation_threshold=threshold; }
00151 
00152 public:
00153         /** Is in suppressed mode */
00154         static bool isSuppressed;
00155 
00156         /** Is mass from 4-vector or from event record */
00157         static bool massFrom4Vector;
00158         
00159         /** List of suppressed decays */
00160         static vector<vector<int>* >    *supBremList;
00161 
00162         /** List of forced decays */
00163         static vector<vector<int>* >    *forceBremList;
00164 
00165         /** List of forced mass values */
00166         static vector<pair<int,double>* > *forceMassList;
00167   
00168   /** List of ignored status codes */
00169         static vector<int >             *ignoreStatusCodeList;
00170 
00171         /** Threshold for momentum conservation check */
00172         static double momentum_conservation_threshold;
00173 
00174         /** Flag for complete effects of matrix element (in scalars decays) */
00175         static bool meCorrectionWtForScalar;
00176 
00177         /** Flag for complete effects of matrix element (in leptonic Z decays) */
00178         static bool meCorrectionWtForZ;
00179         
00180         /** Flag for complete effects of matrix element (in leptonic W decays) */
00181         static bool meCorrectionWtForW;
00182   
00183   /** Flag for creating historic entries */
00184   static bool isCreateHistoryEntries;
00185 
00186   /** Status of history entries */
00187   static int  historyEntriesStatus;
00188 
00189   /** Pointer to random generator function */
00190   static double (*randomDouble)();
00191 public:
00192         /** Get instance of Photos */
00193         Photos& getInstance() { return _instance; }
00194 private:
00195         /* Singleton: only one instance allowed.
00196            Constructor sets default values of PHOTOS parameters */
00197          Photos();
00198         ~Photos() {}
00199         Photos(const Photos&);
00200         Photos& operator=(const Photos&);
00201         static Photos _instance;
00202 };
00203 
00204 } // namespace Photospp
00205 #endif
00206 
Generated on Sun Oct 20 20:23:56 2013 for C++InterfacetoPHOTOS by  doxygen 1.6.3