Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:15

0001 // -*- C++ -*-
0002 //
0003 // MatchboxXComb.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef Herwig_LastMatchboxXCombInfo_H
0010 #define Herwig_LastMatchboxXCombInfo_H
0011 //
0012 // This is the declaration of the MatchboxXComb class.
0013 //
0014 
0015 #include "Herwig/MatrixElement/Matchbox/Utility/MatchboxXCombData.h"
0016 
0017 namespace Herwig {
0018 
0019 using namespace ThePEG;
0020 
0021 /**
0022  * \ingroup Matchbox
0023  * \author Simon Platzer
0024  *
0025  * \brief Provide easy access to MatchboxXComb XComb extensions
0026  */
0027 class LastMatchboxXCombInfo {
0028 
0029 public:
0030 
0031   /**
0032    * Default constructor
0033    */
0034   LastMatchboxXCombInfo()
0035     : theLastMatchboxXComb(0), theLastHeadMatchboxXComb(0) {}
0036 
0037   /**
0038    * Return a pointer to the last selected XComb.
0039    */
0040   MatchboxXCombData* lastMatchboxXComb() const { return theLastMatchboxXComb; }
0041 
0042   /**
0043    * If the last selected XComb object belongs to a
0044    * group of XComb's return a pointer to the head 
0045    * XComb object for this group.
0046    */
0047   MatchboxXCombData* lastHeadMatchboxXComb() const { return theLastHeadMatchboxXComb; }
0048 
0049 public:
0050 
0051   /**
0052    * The crossing information as filled by the last call to
0053    * fillCrossingMap()
0054    */
0055   const vector<int>& crossingMap() const { return lastMatchboxXComb()->crossingMap(); }
0056 
0057   /**
0058    * The colour crossing information as filled by the last call to
0059    * fillCrossingMap()
0060    */
0061   const map<size_t,size_t>& amplitudeToColourMap() const { return lastMatchboxXComb()->amplitudeToColourMap(); }
0062 
0063   /**
0064    * The colour crossing information as filled by the last call to
0065    * fillCrossingMap()
0066    */
0067   const map<size_t,size_t>& colourToAmplitudeMap() const { return lastMatchboxXComb()->colourToAmplitudeMap(); }
0068 
0069   /**
0070    * The crossing sign as filled by the last call to
0071    * fillCrossingMap()
0072    */
0073   double crossingSign() const { return lastMatchboxXComb()->crossingSign(); }
0074 
0075   /**
0076    * The last renormalization scale
0077    */
0078   Energy2 lastRenormalizationScale() const { return lastMatchboxXComb()->lastRenormalizationScale(); }
0079 
0080   /**
0081    * The amplitude parton data.
0082    */
0083   const cPDVector& amplitudePartonData() const { return lastMatchboxXComb()->amplitudePartonData(); }
0084 
0085   /**
0086    * The crossed momenta
0087    */
0088   const vector<Lorentz5Momentum>& amplitudeMomenta() const { return lastMatchboxXComb()->amplitudeMomenta(); }
0089 
0090   /**
0091    * True, if the the tree level amplitudes need to be calculated
0092    */
0093   bool calculateTreeAmplitudes() const { return lastMatchboxXComb()->calculateTreeAmplitudes(); }
0094 
0095   /**
0096    * The amplitude values which have been contributing
0097    * to the last call of prepareAmplitudes.
0098    */
0099   const map<vector<int>,CVector>& lastAmplitudes() const { return lastMatchboxXComb()->lastAmplitudes(); }
0100 
0101   /**
0102    * The leading N amplitude values which have been
0103    * contributing to the last call of prepareAmplitudes.
0104    */
0105   const map<vector<int>,CVector>& lastLargeNAmplitudes() const { return lastMatchboxXComb()->lastLargeNAmplitudes(); }
0106 
0107   /**
0108    * True, if the the one-loop amplitudes need to be calculated
0109    */
0110   bool calculateOneLoopAmplitudes() const { return lastMatchboxXComb()->calculateOneLoopAmplitudes(); }
0111 
0112   /**
0113    * The one-loop amplitude values which have been contributing
0114    * to the last call of prepareAmplitudes.
0115    */
0116   const map<vector<int>,CVector>& lastOneLoopAmplitudes() const { return lastMatchboxXComb()->lastOneLoopAmplitudes(); }
0117 
0118   /**
0119    * True, if the tree-level matrix element squared needs to be
0120    * calculated.
0121    */
0122   bool calculateTreeME2() const { return lastMatchboxXComb()->calculateTreeME2(); }
0123 
0124   /**
0125    * The last tree-level matrix element squared
0126    */
0127   double lastTreeME2() const { return lastMatchboxXComb()->lastTreeME2(); }
0128 
0129   /**
0130    * True, if the tree-level matrix element squared needs to be
0131    * calculated.
0132    */
0133   bool calculateLargeNME2() const { return lastMatchboxXComb()->calculateLargeNME2(); }
0134 
0135   /**
0136    * The last tree-level matrix element squared
0137    */
0138   double lastLargeNME2() const { return lastMatchboxXComb()->lastLargeNME2(); }
0139 
0140   /**
0141    * True, if the one-loop/tree-level interference.
0142    * be calculated.
0143    */
0144   bool calculateOneLoopInterference() const { return lastMatchboxXComb()->calculateOneLoopInterference(); }
0145 
0146   /**
0147    * The last one-loop/tree-level interference.
0148    */
0149   double lastOneLoopInterference() const { return lastMatchboxXComb()->lastOneLoopInterference(); }
0150 
0151   /**
0152    * True, if the one-loop/tree-level interference.
0153    * be calculated.
0154    */
0155   bool calculateOneLoopPoles() const { return lastMatchboxXComb()->calculateOneLoopPoles(); }
0156 
0157   /**
0158    * The last one-loop/tree-level interference.
0159    */
0160   pair<double,double> lastOneLoopPoles() const { return lastMatchboxXComb()->lastOneLoopPoles(); }
0161 
0162 
0163   /**
0164    * True, if the indexed colour correlated matrix element needs to be
0165    * calculated.
0166    */
0167   bool calculateColourCorrelator(const pair<int,int>& ij) const { return lastMatchboxXComb()->calculateColourCorrelator(ij); }
0168 
0169   /**
0170    * The colour correlated matrix element.
0171    */
0172   double lastColourCorrelator(const pair<int,int>& ij) const { return lastMatchboxXComb()->lastColourCorrelator(ij); }
0173 
0174   /**
0175    * True, if the indexed large-N colour correlated matrix element needs to be
0176    * calculated.
0177    */
0178   bool calculateLargeNColourCorrelator(const pair<int,int>& ij) const { return lastMatchboxXComb()->calculateLargeNColourCorrelator(ij); }
0179 
0180   /**
0181    * The large-N colour correlated matrix element.
0182    */
0183   double lastLargeNColourCorrelator(const pair<int,int>& ij) const { return lastMatchboxXComb()->lastLargeNColourCorrelator(ij); }
0184 
0185   /**
0186    * True, if the indexed colour/spin correlated matrix element needs to be
0187    * calculated.
0188    */
0189   bool calculateColourSpinCorrelator(const pair<int,int>& ij) const { return lastMatchboxXComb()->calculateColourSpinCorrelator(ij); }
0190 
0191   /**
0192    * The colour/spin correlated matrix element.
0193    */
0194   Complex lastColourSpinCorrelator(const pair<int,int>& ij) const { return lastMatchboxXComb()->lastColourSpinCorrelator(ij); }
0195 
0196   /**
0197    * True, if the indexed spin correlated matrix element needs to be
0198    * calculated.
0199    */
0200   bool calculateSpinCorrelator(const pair<int,int>& ij) const { return lastMatchboxXComb()->calculateSpinCorrelator(ij); }
0201 
0202   /**
0203    * The spin correlated matrix element.
0204    */
0205   Complex lastSpinCorrelator(const pair<int,int>& ij) const { return lastMatchboxXComb()->lastSpinCorrelator(ij); }
0206 
0207   /**
0208    * Return the number of light flavours to be considered for this process.
0209    */
0210   unsigned int nLight() const { return lastMatchboxXComb()->nLight(); }
0211 
0212   /**
0213    * Return the vector that contains the PDG ids of 
0214    * the light flavours, which are contained in the
0215    * jet particle group.
0216    */
0217   vector<long> nLightJetVec() const { return lastMatchboxXComb()->nLightJetVec(); }
0218 
0219   /**
0220    * Return the vector that contains the PDG ids of 
0221    * the heavy flavours, which are contained in the
0222    * jet particle group.
0223    */
0224   vector<long> nHeavyJetVec() const { return lastMatchboxXComb()->nHeavyJetVec(); }
0225 
0226   /**
0227    * Return the vector that contains the PDG ids of 
0228    * the light flavours, which are contained in the
0229    * proton particle group.
0230    */
0231   vector<long> nLightProtonVec() const { return lastMatchboxXComb()->nLightProtonVec(); }
0232 
0233   /**
0234    * Get the dimensionality of the colour basis for this process.
0235    */
0236   size_t colourBasisDim() const { return lastMatchboxXComb()->colourBasisDim(); }
0237 
0238   /**
0239    * Return the number of degrees of freedom required by the phase space generator
0240    */
0241   int nDimPhasespace() const { return lastMatchboxXComb()->nDimPhasespace(); }
0242 
0243   /**
0244    * Return the number of degrees of freedom required by the amplitude
0245    */
0246   int nDimAmplitude() const { return lastMatchboxXComb()->nDimAmplitude(); }
0247 
0248   /**
0249    * Return the number of degrees of freedom required by the insertion operators
0250    */
0251   int nDimInsertions() const { return lastMatchboxXComb()->nDimInsertions(); }
0252 
0253   /**
0254    * Get the additional random numbers required by the amplitude
0255    */
0256   const vector<double>& amplitudeRandomNumbers() const { return lastMatchboxXComb()->amplitudeRandomNumbers(); }
0257 
0258   /**
0259    * Get the additional random numbers required by the insertion operator
0260    */
0261   const vector<double>& insertionRandomNumbers() const { return lastMatchboxXComb()->insertionRandomNumbers(); }
0262 
0263   /**
0264    * Return the diagram weights indexed by diagram id.
0265    */
0266   const map<int,double>& diagramWeights() const { return lastMatchboxXComb()->diagramWeights(); }
0267 
0268   /**
0269    * Return the singular limits
0270    */
0271   const set<pair<size_t,size_t> >& singularLimits() const { return lastMatchboxXComb()->singularLimits(); }
0272 
0273   /**
0274    * Return the last matched singular limit.
0275    */
0276   const set<pair<size_t,size_t> >::const_iterator& lastSingularLimit() const { return lastMatchboxXComb()->lastSingularLimit(); }
0277 
0278   /**
0279    * Get the Herwig StandardModel object
0280    */
0281   Ptr<StandardModel>::tcptr hwStandardModel() const { return lastMatchboxXComb()->hwStandardModel(); }
0282 
0283   /**
0284    * Return the symmetry factor
0285    */
0286   double symmetryFactor() const { return lastMatchboxXComb()->symmetryFactor(); }
0287    
0288   /**
0289    * Return the OLP process id
0290    */
0291   const vector<int>& olpId() const { return lastMatchboxXComb()->olpId(); }
0292 
0293   /**
0294    * Return the olp momentum vector
0295    */
0296   double* olpMomenta() const { return lastMatchboxXComb()->olpMomenta(); }
0297 
0298   /**
0299    * Fill the olp momentum vector
0300    */
0301   void fillOLPMomenta(const vector<Lorentz5Momentum>& mm,
0302               const cPDVector& mePartonData,
0303               const map<long,Energy>& reshuffleMap) const { 
0304     lastMatchboxXComb()->fillOLPMomenta(mm,mePartonData,reshuffleMap);
0305   }
0306 
0307 protected:
0308 
0309   /**
0310    * The crossing information as filled by the last call to
0311    * fillCrossingMap()
0312    */
0313   vector<int>& crossingMap() { return lastMatchboxXComb()->crossingMap(); }
0314 
0315   /**
0316    * The colour crossing information as filled by the last call to
0317    * fillCrossingMap()
0318    */
0319   map<size_t,size_t>& amplitudeToColourMap() { return lastMatchboxXComb()->amplitudeToColourMap(); }
0320 
0321   /**
0322    * The colour crossing information as filled by the last call to
0323    * fillCrossingMap()
0324    */
0325   map<size_t,size_t>& colourToAmplitudeMap() { return lastMatchboxXComb()->colourToAmplitudeMap(); }
0326 
0327   /**
0328    * The crossing sign as filled by the last call to
0329    * fillCrossingMap()
0330    */
0331   void crossingSign(double c) { lastMatchboxXComb()->crossingSign(c); }
0332 
0333   /**
0334    * The last renormalization scale
0335    */
0336   void lastRenormalizationScale(Energy2 lrs) { lastMatchboxXComb()->lastRenormalizationScale(lrs); }
0337 
0338   /**
0339    * The amplitude parton data.
0340    */
0341   cPDVector& amplitudePartonData() { return lastMatchboxXComb()->amplitudePartonData(); }
0342 
0343   /**
0344    * The crossed momenta
0345    */
0346   vector<Lorentz5Momentum>& amplitudeMomenta() { return lastMatchboxXComb()->amplitudeMomenta(); }
0347 
0348   /**
0349    * True, if the the tree level amplitudes need to be calculated
0350    */
0351   void haveTreeAmplitudes(bool f = true) { lastMatchboxXComb()->haveTreeAmplitudes(f); }
0352 
0353   /**
0354    * The amplitude values which have been contributing
0355    * to the last call of prepareAmplitudes.
0356    */
0357   map<vector<int>,CVector>& lastAmplitudes() { return lastMatchboxXComb()->lastAmplitudes(); }
0358 
0359   /**
0360    * The leading N amplitude values which have been
0361    * contributing to the last call of prepareAmplitudes.
0362    */
0363   map<vector<int>,CVector>& lastLargeNAmplitudes() { return lastMatchboxXComb()->lastLargeNAmplitudes(); }
0364 
0365   /**
0366    * True, if the the one-loop amplitudes need to be calculated
0367    */
0368   void haveOneLoopAmplitudes(bool f = true) { lastMatchboxXComb()->haveOneLoopAmplitudes(f); }
0369 
0370   /**
0371    * The one-loop amplitude values which have been contributing
0372    * to the last call of prepareAmplitudes.
0373    */
0374   map<vector<int>,CVector>& lastOneLoopAmplitudes() { return lastMatchboxXComb()->lastOneLoopAmplitudes(); }
0375 
0376   /**
0377    * The last tree-level matrix element squared
0378    */
0379   void lastTreeME2(double v) const { lastMatchboxXComb()->lastTreeME2(v); }
0380 
0381   /**
0382    * The last tree-level matrix element squared
0383    */
0384   void lastLargeNME2(double v) const { lastMatchboxXComb()->lastLargeNME2(v); }
0385 
0386   /**
0387    * The last one-loop/tree-level interference.
0388    */
0389   void lastOneLoopInterference(double v) const { lastMatchboxXComb()->lastOneLoopInterference(v); }
0390 
0391   /**
0392    * The last one-loop/tree-level interference.
0393    */
0394   void lastOneLoopPoles(pair<double,double> v) const { lastMatchboxXComb()->lastOneLoopPoles(v); }
0395 
0396   /**
0397    * The colour correlated matrix element.
0398    */
0399   void lastColourCorrelator(const pair<int,int>& ij, double v) const { lastMatchboxXComb()->lastColourCorrelator(ij,v); }
0400 
0401   /**
0402    * The large-N colour correlated matrix element.
0403    */
0404   void lastLargeNColourCorrelator(const pair<int,int>& ij, double v) const { lastMatchboxXComb()->lastLargeNColourCorrelator(ij,v); }
0405 
0406   /**
0407    * The colour/spin correlated matrix element.
0408    */
0409   void lastColourSpinCorrelator(const pair<int,int>& ij, Complex v) const { lastMatchboxXComb()->lastColourSpinCorrelator(ij,v); }
0410 
0411   /**
0412    * The spin correlated matrix element.
0413    */
0414   void lastSpinCorrelator(const pair<int,int>& ij, Complex v) const { lastMatchboxXComb()->lastSpinCorrelator(ij,v); }
0415 
0416   /**
0417    * Set the number of light flavours to be considered for this process.
0418    */
0419   void nLight(unsigned int n) { lastMatchboxXComb()->nLight(n); }
0420 
0421   /**
0422    * Set the elements of the vector that contains the PDG
0423    * ids of the light flavours, which are contained in the
0424    * jet particle group.
0425    */
0426   void nLightJetVec(int n) { lastMatchboxXComb()->nLightJetVec(n); }
0427 
0428   /**
0429    * Set the elements of the vector that contains the PDG
0430    * ids of the heavy flavours, which are contained in the
0431    * jet particle group.
0432    */
0433   void nHeavyJetVec(int n) { lastMatchboxXComb()->nHeavyJetVec(n); }
0434 
0435   /**
0436    * Set the elements of the vector that contains the PDG
0437    * ids of the light flavours, which are contained in the
0438    * proton particle group.
0439    */
0440   void nLightProtonVec(int n) { lastMatchboxXComb()->nLightProtonVec(n); }
0441 
0442   /**
0443    * Set the dimensionality of the colour basis for this process.
0444    */
0445   void colourBasisDim(size_t d) { lastMatchboxXComb()->colourBasisDim(d); }
0446 
0447   /**
0448    * Set the number of degrees of freedom required by the phase space generator
0449    */
0450   void nDimPhasespace(int d) { lastMatchboxXComb()->nDimPhasespace(d); }
0451 
0452   /**
0453    * Set the number of degrees of freedom required by the amplitude
0454    */
0455   void nDimAmplitude(int d) { lastMatchboxXComb()->nDimAmplitude(d); }
0456 
0457   /**
0458    * Set the number of degrees of freedom required by the insertion operators
0459    */
0460   void nDimInsertions(int d) { lastMatchboxXComb()->nDimInsertions(d); }
0461 
0462   /**
0463    * Access the additional random numbers required by the amplitude
0464    */
0465   vector<double>& amplitudeRandomNumbers() { return lastMatchboxXComb()->amplitudeRandomNumbers(); }
0466 
0467   /**
0468    * Access the additional random numbers required by the insertion operator
0469    */
0470   vector<double>& insertionRandomNumbers() { return lastMatchboxXComb()->insertionRandomNumbers(); }
0471 
0472   /**
0473    * Access the diagram weights indexed by diagram id.
0474    */
0475   map<int,double>& diagramWeights() { return lastMatchboxXComb()->diagramWeights(); }
0476 
0477   /**
0478    * Access the singular limits
0479    */
0480   set<pair<size_t,size_t> >& singularLimits() { return lastMatchboxXComb()->singularLimits(); }
0481 
0482   /**
0483    * Access the last matched singular limit.
0484    */
0485   set<pair<size_t,size_t> >::const_iterator& lastSingularLimit() { return lastMatchboxXComb()->lastSingularLimit(); }
0486 
0487   /**
0488    * Set the Herwig StandardModel object
0489    */
0490   void hwStandardModel(Ptr<StandardModel>::tcptr sm) { lastMatchboxXComb()->hwStandardModel(sm); }
0491 
0492   /**
0493    * Set the symmetry factor
0494    */
0495   void symmetryFactor(double f) const { lastMatchboxXComb()->symmetryFactor(f); }
0496 
0497   /**
0498    * Set the OLP process id
0499    */
0500   void olpId(int pType, int id) { lastMatchboxXComb()->olpId(pType,id); }
0501 
0502 protected:
0503 
0504   /**
0505    * Set the XComb pointer cast to MatchboxXComb
0506    */
0507   void lastMatchboxXComb(tStdXCombPtr xc) {
0508     theLastMatchboxXComb = xc ?
0509       dynamic_cast<MatchboxXCombData*>(PtrTraits<tStdXCombPtr>::barePointer(xc)) : 0;
0510     theLastHeadMatchboxXComb = 
0511       xc && xc->head() ? 
0512       dynamic_cast<MatchboxXCombData*>(PtrTraits<tStdXCombPtr>::barePointer(xc->head())) : 0;
0513   }
0514 
0515   /**
0516    * The XComb pointer cast to MatchboxXComb
0517    */
0518   MatchboxXCombData* theLastMatchboxXComb;
0519 
0520   /**
0521    * The head XComb pointer cast to MatchboxXComb
0522    */
0523   MatchboxXCombData* theLastHeadMatchboxXComb;
0524 
0525 };
0526 
0527 }
0528 
0529 #endif // Herwig_LastMatchboxXCombInfo_H
0530