thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
Hint.h
1 // -*- C++ -*-
2 //
3 // Hint.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2019 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_Hint_H
10 #define ThePEG_Hint_H
11 // This is the declaration of the Hint class.
12 
13 #include "ThePEG/Config/ThePEG.h"
14 #include "ThePEG/Utilities/ClassDescription.h"
15 
16 namespace ThePEG {
17 
48 class Hint: public Base {
49 
50 public:
51 
57  Hint() : theScale(Energy2()), theStopFlag(false) {}
59 
60 public:
61 
65  bool tagged() const { return !theTagged.empty(); }
66 
73  tPVector tagged(const Step & s) const;
74 
78  template <typename InputIterator>
79  void tag(InputIterator first, InputIterator last)
80  {
81  theTagged.insert(theTagged.end(), first, last);
82  }
83 
87  void tag(tPPtr p) { if (p) theTagged.push_back(p); }
88 
92  void stop(bool newStopFlag)
93  {
94  theStopFlag = newStopFlag;
95  if ( theStopFlag ) theTagged.clear();
96  }
97 
101  bool stop() const { return theStopFlag; }
102 
106  void scale(const Scale & newScale) { theScale = newScale; }
110  const Scale & scale() const { return theScale; }
111 
115  static tHintPtr Default() { return tHintPtr(&theDefaultHint); }
116 
117 public:
118 
125  void persistentOutput(PersistentOStream & os) const;
126 
132  void persistentInput(PersistentIStream & is, int version);
134 
138  static void Init();
139 
140 private:
141 
146 
151 
156 
161 
162 private:
163 
168 
172  Hint & operator=(const Hint & h) = delete;
173 
174 };
175 
176 
183 template <>
184 struct BaseClassTrait<Hint,1>: public ClassTraitsType {
186  typedef Base NthBase;
187 };
188 
193 template <>
194 struct ClassTraits<Hint>:
195  public ClassTraitsBase<Hint> {
197  static string className() { return "ThePEG::Hint"; }
198 };
199 
202 }
203 
204 #endif /* ThePEG_Hint_H */
PersistentIStream is used to read persistent objects from a stream where they were previously written...
static Hint theDefaultHint
The default hint.
Definition: Hint.h:160
Define the base class from which all (polymorphic) classes in ThePEG are derived. ...
Definition: ThePEG.h:54
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
Hint()
Default constructor.
Definition: Hint.h:57
Scale theScale
The scale.
Definition: Hint.h:150
void scale(const Scale &newScale)
Set the scale.
Definition: Hint.h:106
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
ThePEG::Ptr< Hint >::transient_pointer tHintPtr
Alias for a transient pointer to Hint .
Definition: Pointers.h:71
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
This is the main config header file for ThePEG.
static void Init()
Standard Init function used to initialize the interface.
bool tagged() const
Return true if there are tagged particles in the hint.
Definition: Hint.h:65
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Hint is a base class to be used to pass information between StepHandler s, which cannot be convayed t...
Definition: Hint.h:48
void stop(bool newStopFlag)
Set the stop hint.
Definition: Hint.h:92
static tHintPtr Default()
Return a pointer to the default hint.
Definition: Hint.h:115
Hint & operator=(const Hint &h)=delete
Assignment is private and non-existing.
bool theStopFlag
The stop hint.
Definition: Hint.h:155
void tag(InputIterator first, InputIterator last)
Add a range of particles to the list of tagged particles.
Definition: Hint.h:79
bool stop() const
Get the stop hint.
Definition: Hint.h:101
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
const Scale & scale() const
Get the scale.
Definition: Hint.h:110
tPVector theTagged
The vector of tagged particles.
Definition: Hint.h:145
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition: Containers.h:82
static ClassDescription< Hint > initHint
Describe a concrete class with persistent data.
Definition: Hint.h:167
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
void tag(tPPtr p)
Add a particle to the list of tagged particles.
Definition: Hint.h:87
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52
The Step class contains information of all particles present after certain step in the event generati...
Definition: Step.h:34
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.