|
|
|||
File indexing completed on 2026-08-06 09:38:19
0001 // -*- C++ -*- 0002 #ifndef THEPEG_XSecCheck_H 0003 #define THEPEG_XSecCheck_H 0004 // 0005 // This is the declaration of the XSecCheck class. 0006 // 0007 0008 #include "ThePEG/Handlers/AnalysisHandler.h" 0009 0010 namespace ThePEG { 0011 0012 /** 0013 * The XSecCheck class is a simple analysis class used for testing 0014 * purposes. If the total cross section does not match the one 0015 * specified by TargetXSec, an exception will 0016 * be thrown. 0017 * 0018 * @see \ref XSecCheckInterfaces "The interfaces" 0019 * defined for XSecCheck. 0020 */ 0021 class XSecCheck: public AnalysisHandler { 0022 0023 public: 0024 0025 /** 0026 * The default constructor. 0027 */ 0028 XSecCheck() : target(ZERO), tol(0.01), sumw(0.0) {} 0029 0030 public: 0031 0032 /** 0033 * The exception class used if the target cross section was not met. 0034 */ 0035 struct UnexpectedXSec: public Exception {}; 0036 0037 public: 0038 0039 /** @name Virtual functions required by the AnalysisHandler class. */ 0040 //@{ 0041 /** 0042 * Analyze a given Event. Note that a fully generated event 0043 * may be presented several times, if it has been manipulated in 0044 * between. The default version of this function will call transform 0045 * to make a lorentz transformation of the whole event, then extract 0046 * all final state particles and call analyze(tPVector) of this 0047 * analysis object and those of all associated analysis objects. The 0048 * default version will not, however, do anything on events which 0049 * have not been fully generated, or have been manipulated in any 0050 * way. 0051 * @param event pointer to the Event to be analyzed. 0052 * @param ieve the event number. 0053 * @param loop the number of times this event has been presented. 0054 * If negative the event is now fully generated. 0055 * @param state a number different from zero if the event has been 0056 * manipulated in some way since it was last presented. 0057 */ 0058 virtual void analyze(tEventPtr event, long ieve, int loop, int state); 0059 //@} 0060 0061 public: 0062 0063 /** @name Functions used by the persistent I/O system. */ 0064 //@{ 0065 /** 0066 * Function used to write out object persistently. 0067 * @param os the persistent output stream written to. 0068 */ 0069 void persistentOutput(PersistentOStream & os) const; 0070 0071 /** 0072 * Function used to read in object persistently. 0073 * @param is the persistent input stream read from. 0074 * @param version the version number of the object when written. 0075 */ 0076 void persistentInput(PersistentIStream & is, int version); 0077 //@} 0078 0079 /** 0080 * The standard Init function used to initialize the interfaces. 0081 * Called exactly once for each class by the class description system 0082 * before the main function starts or 0083 * when this class is dynamically loaded. 0084 */ 0085 static void Init(); 0086 0087 protected: 0088 0089 /** @name Clone Methods. */ 0090 //@{ 0091 /** 0092 * Make a simple clone of this object. 0093 * @return a pointer to the new object. 0094 */ 0095 virtual IBPtr clone() const; 0096 0097 /** Make a clone of this object, possibly modifying the cloned object 0098 * to make it sane. 0099 * @return a pointer to the new object. 0100 */ 0101 virtual IBPtr fullclone() const; 0102 //@} 0103 0104 0105 0106 protected: 0107 0108 /** @name Standard Interfaced functions. */ 0109 //@{ 0110 /** 0111 * Initialize this object. Called in the run phase just before 0112 * a run begins. 0113 */ 0114 virtual void doinitrun() { 0115 AnalysisHandler::doinitrun(); 0116 sumw = 0.0; 0117 } 0118 0119 /** 0120 * Finalize this object. Called in the run phase just after a 0121 * run has ended. Used eg. to write out statistics. 0122 */ 0123 virtual void dofinish(); 0124 //@} 0125 0126 private: 0127 0128 /** 0129 * The expected total cross section. 0130 */ 0131 CrossSection target; 0132 0133 /** 0134 * The relative tolerance accepted when comparing the total cross 0135 * section with the target. 0136 */ 0137 double tol; 0138 0139 /** 0140 * The sum of the weights of the events analyzed. 0141 */ 0142 double sumw; 0143 0144 private: 0145 0146 /** 0147 * The static object used to initialize the description of this class. 0148 * Indicates that this is a concrete class with persistent data. 0149 */ 0150 static ClassDescription<XSecCheck> initXSecCheck; 0151 0152 /** 0153 * The assignment operator is private and must never be called. 0154 * In fact, it should not even be implemented. 0155 */ 0156 XSecCheck & operator=(const XSecCheck &) = delete; 0157 0158 }; 0159 0160 } 0161 0162 #include "ThePEG/Utilities/ClassTraits.h" 0163 0164 namespace ThePEG { 0165 0166 /** @cond TRAITSPECIALIZATIONS */ 0167 0168 /** This template specialization informs ThePEG about the 0169 * base classes of XSecCheck. */ 0170 template <> 0171 struct BaseClassTrait<XSecCheck,1> { 0172 /** Typedef of the first base class of XSecCheck. */ 0173 typedef AnalysisHandler NthBase; 0174 }; 0175 0176 /** This template specialization informs ThePEG about the name of 0177 * the XSecCheck class and the shared object where it is defined. */ 0178 template <> 0179 struct ClassTraits<XSecCheck> 0180 : public ClassTraitsBase<XSecCheck> { 0181 /** Return a platform-independent class name */ 0182 static string className() { return "ThePEG::XSecCheck"; } 0183 /** 0184 * The name of a file containing the dynamic library where the class 0185 * XSecCheck is implemented. It may also include several, space-separated, 0186 * libraries if the class XSecCheck depends on other classes (base classes 0187 * excepted). In this case the listed libraries will be dynamically 0188 * linked in the order they are specified. 0189 */ 0190 static string library() { return "XSecCheck.so"; } 0191 }; 0192 0193 /** @endcond */ 0194 0195 } 0196 0197 #endif /* THEPEG_XSecCheck_H */
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|