thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.5
JetRegion.h
1 // -*- C++ -*-
2 //
3 // JetRegion.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2017 Leif Lonnblad
5 // Copyright (C) 2009-2017 Simon Platzer
6 //
7 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
8 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
9 //
10 #ifndef ThePEG_JetRegion_H
11 #define ThePEG_JetRegion_H
12 //
13 // This is the declaration of the JetRegion class.
14 //
15 
16 #include "ThePEG/Handlers/HandlerBase.h"
17 #include "ThePEG/EventRecord/Particle.h"
18 #include "ThePEG/Cuts/Cuts.h"
19 
20 namespace ThePEG {
21 
32 class JetRegion: public HandlerBase {
33 
34 public:
35 
41  JetRegion();
42 
46  virtual ~JetRegion();
48 
49 public:
50 
54  Energy ptMin() const { return thePtMin; }
55 
59  Energy ptMax() const { return thePtMax; }
60 
64  const vector<pair<double,double> >& yRanges() const { return theYRanges; }
65 
71  const vector<int>& accepts() const { return theAccepts; }
72 
76  bool fuzzy() const { return theFuzzy; }
77 
81  double cutWeight() const { return theCutWeight; }
82 
86  bool lessThanEnergy(Energy a, Energy b, double& weight) const;
87 
91  bool lessThanRapidity(double a, double b, double& weight) const;
92 
93 public:
94 
98  virtual void describe() const;
99 
103  virtual bool matches(tcCutsPtr parent, int n, const LorentzMomentum& p,
104  double yHat = 0.0);
105 
109  bool didMatch() { return theDidMatch; }
110 
114  virtual void reset() { theDidMatch = false; }
115 
119  int lastNumber() const { return theLastNumber; }
120 
124  const LorentzMomentum& lastMomentum() const { return theLastMomentum; }
125 
126 public:
127 
134  void persistentOutput(PersistentOStream & os) const;
135 
141  void persistentInput(PersistentIStream & is, int version);
143 
150  static void Init();
151 
152 protected:
153 
160  virtual IBPtr clone() const;
161 
166  virtual IBPtr fullclone() const;
168 
169 
170 // If needed, insert declarations of virtual function defined in the
171 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
172 
173 
174 private:
175 
179  string doYRange(string);
180 
185 
190 
194  vector<pair<double,double> > theYRanges;
195 
201  vector<int> theAccepts;
202 
207 
212 
217 
221  bool theFuzzy;
222 
226  double theCutWeight;
227 
232 
237 
242  JetRegion & operator=(const JetRegion &) = delete;
243 
244 };
245 
246 }
247 
248 #endif /* ThePEG_JetRegion_H */
bool fuzzy() const
Return true, if this jet region is fuzzy.
Definition: JetRegion.h:76
PersistentIStream is used to read persistent objects from a stream where they were previously written...
double theCutWeight
The cut weight encountered from the last call to matches()
Definition: JetRegion.h:226
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
const vector< int > & accepts() const
Return the jets accepted by this region (with respect to the ordering imposed by the JetCuts object)...
Definition: JetRegion.h:71
virtual void reset()
Reset this region to act on a new event.
Definition: JetRegion.h:114
bool theFuzzy
True if this region is fuzzy.
Definition: JetRegion.h:221
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Energy theEnergyCutWidth
The smearing width for the pt or mass cuts, if fuzzy.
Definition: JetRegion.h:231
bool lessThanEnergy(Energy a, Energy b, double &weight) const
Perform a (potentially) fuzzy check on energy-type quantities.
vector< pair< double, double > > theYRanges
The rapidity ranges.
Definition: JetRegion.h:194
JetRegion & operator=(const JetRegion &)=delete
The assignment operator is private and must never be called.
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
double theRapidityCutWidth
The smearing width for the rapidity cut, if fuzzy.
Definition: JetRegion.h:236
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
Energy thePtMax
The maximum pt.
Definition: JetRegion.h:189
virtual void describe() const
Describe the currently active cuts in the log file.
int lastNumber() const
Return the number of the last jet matching this region.
Definition: JetRegion.h:119
bool theDidMatch
True, if this region matched a jet in the last call to matches().
Definition: JetRegion.h:206
Energy ptMin() const
Return the minimum pt.
Definition: JetRegion.h:54
Energy ptMax() const
Return the maximum pt.
Definition: JetRegion.h:59
bool lessThanRapidity(double a, double b, double &weight) const
Perform a (potentially) fuzzy check on angular-type quantities.
static void Init()
The standard Init function used to initialize the interfaces.
int theLastNumber
The number of the last jet matching this region.
Definition: JetRegion.h:211
bool didMatch()
Return true, if this region matched a jet in the last call to matches().
Definition: JetRegion.h:109
vector< int > theAccepts
The jets accepted by this region (with respect to the ordering imposed by the JetCuts object)...
Definition: JetRegion.h:201
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
virtual ~JetRegion()
The destructor.
const vector< pair< double, double > > & yRanges() const
Return the rapidity ranges.
Definition: JetRegion.h:64
HandlerBase is an abstract base class derived from the Interfaced class via the HandlerBaseT class ad...
Definition: HandlerBase.h:151
const LorentzMomentum & lastMomentum() const
Return the momentum of the last jet matching this region.
Definition: JetRegion.h:124
string doYRange(string)
Command to insert a rapidity range.
virtual IBPtr clone() const
Make a simple clone of this object.
virtual bool matches(tcCutsPtr parent, int n, const LorentzMomentum &p, double yHat=0.0)
Return true, if the given jet matches this region.
JetRegion implements the requirement of finding a jet inside a given range of transverse momenta...
Definition: JetRegion.h:32
double cutWeight() const
Return the cut weight encountered from the last call to matches()
Definition: JetRegion.h:81
JetRegion()
The default constructor.
Energy thePtMin
The minimum pt.
Definition: JetRegion.h:184
LorentzMomentum theLastMomentum
Return the momentum of the last jet matching this region.
Definition: JetRegion.h:216