Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:20

0001 // -*- C++ -*-
0002 //
0003 // JetRegion.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 // Copyright (C) 2009-2019 Simon Platzer
0006 //
0007 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0008 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0009 //
0010 #ifndef ThePEG_JetRegion_H
0011 #define ThePEG_JetRegion_H
0012 //
0013 // This is the declaration of the JetRegion class.
0014 //
0015 
0016 #include "ThePEG/Handlers/HandlerBase.h"
0017 #include "ThePEG/EventRecord/Particle.h"
0018 #include "ThePEG/Cuts/Cuts.h"
0019 
0020 namespace ThePEG {
0021 
0022 /**
0023  * JetRegion implements the requirement of finding a jet inside a
0024  * given range of transverse momenta, and (pseudo-)rapidity.
0025  *
0026  * @see JetPairRegion
0027  * @see JetCuts
0028  *
0029  * @see \ref JetRegionInterfaces "The interfaces"
0030  * defined for JetRegion.
0031  */
0032 class JetRegion: public HandlerBase {
0033 
0034 public:
0035 
0036   /**
0037    * The default constructor.
0038    */
0039   JetRegion();
0040 
0041 public:
0042 
0043   /**
0044    * Return the minimum pt.
0045    */
0046   Energy ptMin() const { return thePtMin; }
0047 
0048   /**
0049    * Return the maximum pt.
0050    */
0051   Energy ptMax() const { return thePtMax; }
0052 
0053   /**
0054    * Return the rapidity ranges.
0055    */
0056   const vector<pair<double,double> >& yRanges() const { return theYRanges; }
0057 
0058   /**
0059    * Return the jets accepted by this region (with respect to the
0060    * ordering imposed by the JetCuts object). If empty, any jet will
0061    * be accepted.
0062    */
0063   const vector<int>& accepts() const { return theAccepts; }
0064 
0065   /**
0066    * Return true, if this jet region is fuzzy
0067    */
0068   bool fuzzy() const { return theFuzzy; }
0069 
0070   /**
0071    * Return the cut weight encountered from the last call to matches()
0072    */
0073   double cutWeight() const { return theCutWeight; }
0074 
0075   /**
0076    * Perform a (potentially) fuzzy check on energy-type quantities
0077    */
0078   bool lessThanEnergy(Energy a, Energy b, double& weight) const;
0079 
0080   /**
0081    * Perform a (potentially) fuzzy check on angular-type quantities
0082    */
0083   bool lessThanRapidity(double a, double b, double& weight) const;
0084 
0085 public:
0086 
0087   /**
0088    * Describe the currently active cuts in the log file.
0089    */
0090   virtual void describe() const;
0091 
0092   /**
0093    * Return true, if the given jet matches this region.
0094    */
0095   virtual bool matches(tcCutsPtr parent, int n, const LorentzMomentum& p,
0096                double yHat = 0.0);
0097 
0098   /**
0099    * Return true, if this region matched a jet in the last call to matches().
0100    */
0101   bool didMatch() { return theDidMatch; }
0102 
0103   /**
0104    * Reset this region to act  on a new event.
0105    */
0106   virtual void reset() { theDidMatch = false; }
0107 
0108   /**
0109    * Return the number of the last jet matching this region.
0110    */
0111   int lastNumber() const { return theLastNumber; }
0112 
0113   /**
0114    * Return the momentum of the last jet matching this region.
0115    */
0116   const LorentzMomentum& lastMomentum() const { return theLastMomentum; }
0117 
0118 public:
0119 
0120   /** @name Functions used by the persistent I/O system. */
0121   //@{
0122   /**
0123    * Function used to write out object persistently.
0124    * @param os the persistent output stream written to.
0125    */
0126   void persistentOutput(PersistentOStream & os) const;
0127 
0128   /**
0129    * Function used to read in object persistently.
0130    * @param is the persistent input stream read from.
0131    * @param version the version number of the object when written.
0132    */
0133   void persistentInput(PersistentIStream & is, int version);
0134   //@}
0135 
0136   /**
0137    * The standard Init function used to initialize the interfaces.
0138    * Called exactly once for each class by the class description system
0139    * before the main function starts or
0140    * when this class is dynamically loaded.
0141    */
0142   static void Init();
0143 
0144 protected:
0145 
0146   /** @name Clone Methods. */
0147   //@{
0148   /**
0149    * Make a simple clone of this object.
0150    * @return a pointer to the new object.
0151    */
0152   virtual IBPtr clone() const;
0153 
0154   /** Make a clone of this object, possibly modifying the cloned object
0155    * to make it sane.
0156    * @return a pointer to the new object.
0157    */
0158   virtual IBPtr fullclone() const;
0159   //@}
0160 
0161 
0162 // If needed, insert declarations of virtual function defined in the
0163 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
0164 
0165 
0166 private:
0167 
0168   /**
0169    * Command to insert a rapidity range
0170    */
0171   string doYRange(string);
0172 
0173   /**
0174    * The minimum pt.
0175    */
0176   Energy thePtMin;
0177 
0178   /**
0179    * The maximum pt.
0180    */
0181   Energy thePtMax;
0182 
0183   /**
0184    * The rapidity ranges.
0185    */
0186   vector<pair<double,double> > theYRanges;
0187 
0188   /**
0189    * The jets accepted by this region (with respect to the ordering
0190    * imposed by the JetCuts object). If empty, any jet will be
0191    * accepted.
0192    */
0193   vector<int> theAccepts;
0194 
0195   /**
0196    * True, if this region matched a jet in the last call to matches().
0197    */
0198   bool theDidMatch;
0199 
0200   /**
0201    * The number of the last jet matching this region.
0202    */
0203   int theLastNumber;
0204 
0205   /**
0206    * Return the momentum of the last jet matching this region.
0207    */
0208   LorentzMomentum theLastMomentum;
0209 
0210   /**
0211    * True if this region is fuzzy
0212    */
0213   bool theFuzzy;
0214 
0215   /**
0216    * The cut weight encountered from the last call to matches()
0217    */
0218   double theCutWeight;
0219 
0220   /**
0221    * The smearing width for the pt or mass cuts, if fuzzy
0222    */
0223   Energy theEnergyCutWidth;
0224 
0225   /**
0226    * The smearing width for the rapidity cut, if fuzzy
0227    */
0228   double theRapidityCutWidth;
0229 
0230   /**
0231    * The assignment operator is private and must never be called.
0232    * In fact, it should not even be implemented.
0233    */
0234   JetRegion & operator=(const JetRegion &) = delete;
0235 
0236 };
0237 
0238 }
0239 
0240 #endif /* ThePEG_JetRegion_H */