Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:41

0001 // -*- C++ -*-
0002 //
0003 // Copyright (C) 1999-2007 Leif Lonnblad
0004 //
0005 // Modified by C.Saout
0006 //
0007 #ifndef SimDataFormats_GeneratorProducts_LesHouches_h
0008 #define SimDataFormats_GeneratorProducts_LesHouches_h
0009 
0010 #include <utility>
0011 #include <vector>
0012 
0013 namespace lhef {
0014 
0015   /**
0016  * The HEPRUP class is a simple container corresponding to the Les
0017  * Houches accord (hep-ph/0109068) common block with the same
0018  * name. The members are named in the same way as in the common
0019  * block. However, fortran arrays are represented by vectors, except
0020  * for the arrays of length two which are represented by pair objects.
0021  */
0022   class HEPRUP {
0023   public:
0024     /** @name Standard constructors and destructors. */
0025     //@{
0026     /**
0027      * Default constructor.
0028      */
0029     HEPRUP() : IDWTUP(0), NPRUP(0) {}
0030     //@}
0031 
0032   public:
0033     bool operator==(const HEPRUP &other) const {
0034       return IDBMUP == other.IDBMUP && EBMUP == other.EBMUP && PDFGUP == other.PDFGUP && PDFSUP == other.PDFSUP &&
0035              IDWTUP == other.IDWTUP && NPRUP == other.NPRUP && XSECUP == other.XSECUP && XERRUP == other.XERRUP &&
0036              XMAXUP == other.XMAXUP && LPRUP == other.LPRUP;
0037     }
0038 
0039     /**
0040      * Set the NPRUP variable, corresponding to the number of
0041      * sub-processes, to \a nrup, and resize all relevant vectors
0042      * accordingly.
0043      */
0044     void resize(int nrup) {
0045       NPRUP = nrup;
0046       resize();
0047     }
0048 
0049     /**
0050      * Assuming the NPRUP variable, corresponding to the number of
0051      * sub-processes, is correctly set, resize the relevant vectors
0052      * accordingly.
0053      */
0054     void resize() {
0055       XSECUP.resize(NPRUP);
0056       XERRUP.resize(NPRUP);
0057       XMAXUP.resize(NPRUP);
0058       LPRUP.resize(NPRUP);
0059     }
0060 
0061     void swap(HEPRUP &other) {
0062       IDBMUP.swap(other.IDBMUP);
0063       EBMUP.swap(other.EBMUP);
0064       PDFGUP.swap(other.PDFGUP);
0065       PDFSUP.swap(other.PDFSUP);
0066       std::swap(IDWTUP, other.IDWTUP);
0067       std::swap(NPRUP, other.NPRUP);
0068       XSECUP.swap(other.XSECUP);
0069       XERRUP.swap(other.XERRUP);
0070       XMAXUP.swap(other.XMAXUP);
0071       LPRUP.swap(other.LPRUP);
0072     }
0073 
0074     /**
0075      * PDG id's of beam particles. (first/second is in +/-z direction).
0076      */
0077     std::pair<int, int> IDBMUP;
0078 
0079     /**
0080      * Energy of beam particles given in GeV.
0081      */
0082     std::pair<double, double> EBMUP;
0083 
0084     /**
0085      * The author group for the PDF used for the beams according to the
0086      * PDFLib specification.
0087      */
0088     std::pair<int, int> PDFGUP;
0089 
0090     /**
0091      * The id number the PDF used for the beams according to the
0092      * PDFLib specification.
0093      */
0094     std::pair<int, int> PDFSUP;
0095 
0096     /**
0097      * Master switch indicating how the ME generator envisages the
0098      * events weights should be interpreted according to the Les Houches
0099      * accord.
0100      */
0101     int IDWTUP;
0102 
0103     /**
0104      * The number of different subprocesses in this file (should
0105      * typically be just one)
0106      */
0107     int NPRUP;
0108 
0109     /**
0110      * The cross sections for the different subprocesses in pb.
0111      */
0112     std::vector<double> XSECUP;
0113 
0114     /**
0115      * The statistical error in the cross sections for the different
0116      * subprocesses in pb.
0117      */
0118     std::vector<double> XERRUP;
0119 
0120     /**
0121      * The maximum event weights (in XWGTUP) for different subprocesses.
0122      */
0123     std::vector<double> XMAXUP;
0124 
0125     /**
0126      * The subprocess code for the different subprocesses.
0127      */
0128     std::vector<int> LPRUP;
0129   };
0130 
0131   /**
0132  * The HEPEUP class is a simple container corresponding to the Les
0133  * Houches accord (hep-ph/0109068) common block with the same
0134  * name. The members are named in the same way as in the common
0135  * block. However, fortran arrays are represented by vectors, except
0136  * for the arrays of length two which are represented by pair objects.
0137  */
0138   class HEPEUP {
0139   public:
0140     /** @name Standard constructors and destructors. */
0141     //@{
0142     /**
0143      * Default constructor.
0144      */
0145     HEPEUP() : NUP(0), IDPRUP(0), XWGTUP(0.0), XPDWUP(0.0, 0.0), SCALUP(0.0), AQEDUP(0.0), AQCDUP(0.0) {}
0146     //@}
0147 
0148   public:
0149     struct FiveVector {
0150       double operator[](unsigned int i) const { return x[i]; }
0151       double &operator[](unsigned int i) { return x[i]; }
0152 
0153       double x[5];
0154     };
0155 
0156     /**
0157      * Set the NUP variable, corresponding to the number of particles in
0158      * the current event, to \a nup, and resize all relevant vectors
0159      * accordingly.
0160      */
0161     void resize(int nup) {
0162       NUP = nup;
0163       resize();
0164     }
0165 
0166     /**
0167      * Assuming the NUP variable, corresponding to the number of
0168      * particles in the current event, is correctly set, resize the
0169      * relevant vectors accordingly.
0170      */
0171     void resize() {
0172       IDUP.resize(NUP);
0173       ISTUP.resize(NUP);
0174       MOTHUP.resize(NUP);
0175       ICOLUP.resize(NUP);
0176       PUP.resize(NUP);
0177       VTIMUP.resize(NUP);
0178       SPINUP.resize(NUP);
0179     }
0180 
0181     /**
0182      * The number of particle entries in the current event.
0183      */
0184     int NUP;
0185 
0186     /**
0187      * The subprocess code for this event (as given in LPRUP).
0188      */
0189     int IDPRUP;
0190 
0191     /**
0192      * The weight for this event.
0193      */
0194     double XWGTUP;
0195 
0196     /**
0197      * The PDF weights for the two incoming partons. Note that this
0198      * variable is not present in the current LesHouches accord
0199      * (hep-ph/0109068), hopefully it will be present in a future
0200      * accord.
0201      */
0202     std::pair<double, double> XPDWUP;
0203 
0204     /**
0205      * The scale in GeV used in the calculation of the PDF's in this
0206      * event.
0207      */
0208     double SCALUP;
0209 
0210     /**
0211      * The value of the QED coupling used in this event.
0212      */
0213     double AQEDUP;
0214 
0215     /**
0216      * The value of the QCD coupling used in this event.
0217      */
0218     double AQCDUP;
0219 
0220     /**
0221      * The PDG id's for the particle entries in this event.
0222      */
0223     std::vector<int> IDUP;
0224 
0225     /**
0226      * The status codes for the particle entries in this event.
0227      */
0228     std::vector<int> ISTUP;
0229 
0230     /**
0231      * Indices for the first and last mother for the particle entries in
0232      * this event.
0233      */
0234     std::vector<std::pair<int, int> > MOTHUP;
0235 
0236     /**
0237      * The colour-line indices (first(second) is (anti)colour) for the
0238      * particle entries in this event.
0239      */
0240     std::vector<std::pair<int, int> > ICOLUP;
0241 
0242     /**
0243      * Lab frame momentum (Px, Py, Pz, E and M in GeV) for the particle
0244      * entries in this event.
0245      */
0246     std::vector<FiveVector> PUP;
0247 
0248     /**
0249      * Invariant lifetime (c*tau, distance from production to decay im
0250      * mm) for the particle entries in this event.
0251      */
0252     std::vector<double> VTIMUP;
0253 
0254     /**
0255      * Spin info for the particle entries in this event given as the
0256      * cosine of the angle between the spin vector of a particle and the
0257      * 3-momentum of the decaying particle, specified in the lab frame.
0258      */
0259     std::vector<double> SPINUP;
0260   };
0261 
0262 }  // namespace lhef
0263 
0264 #endif  // SimDataFormats_GeneratorProducts_LesHouches_h