thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
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
14#include "ThePEG/Utilities/ClassDescription.h"
15
16namespace ThePEG {
17
48class Hint: public Base {
49
50public:
51
57 Hint() : theScale(Energy2()), theStopFlag(false) {}
59
60public:
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
116
117public:
118
126
132 void persistentInput(PersistentIStream & is, int version);
134
138 static void Init();
139
140private:
141
146
151
156
161
162private:
163
168
172 Hint & operator=(const Hint & h) = delete;
173
174};
175
176
183template <>
184struct BaseClassTrait<Hint,1>: public ClassTraitsType {
186 typedef Base NthBase;
187};
188
193template <>
194struct ClassTraits<Hint>:
195 public ClassTraitsBase<Hint> {
197 static string className() { return "ThePEG::Hint"; }
198};
199
202}
203
204#endif /* ThePEG_Hint_H */
This is the main config header file for ThePEG.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
Hint is a base class to be used to pass information between StepHandler s, which cannot be convayed t...
Definition: Hint.h:48
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
static Hint theDefaultHint
The default hint.
Definition: Hint.h:160
static tHintPtr Default()
Return a pointer to the default hint.
Definition: Hint.h:115
bool stop() const
Get the stop hint.
Definition: Hint.h:101
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
void tag(tPPtr p)
Add a particle to the list of tagged particles.
Definition: Hint.h:87
tPVector theTagged
The vector of tagged particles.
Definition: Hint.h:145
const Scale & scale() const
Get the scale.
Definition: Hint.h:110
static ClassDescription< Hint > initHint
Describe a concrete class with persistent data.
Definition: Hint.h:167
static void Init()
Standard Init function used to initialize the interface.
tPVector tagged(const Step &s) const
Return a list of pointers to particles to be handled.
void scale(const Scale &newScale)
Set the scale.
Definition: Hint.h:106
Hint & operator=(const Hint &h)=delete
Assignment is private and non-existing.
Hint()
Default constructor.
Definition: Hint.h:57
void tag(InputIterator first, InputIterator last)
Add a range of particles to the list of tagged particles.
Definition: Hint.h:79
bool tagged() const
Return true if there are tagged particles in the hint.
Definition: Hint.h:65
Scale theScale
The scale.
Definition: Hint.h:150
void stop(bool newStopFlag)
Set the stop hint.
Definition: Hint.h:92
bool theStopFlag
The stop hint.
Definition: Hint.h:155
PersistentIStream is used to read persistent objects from a stream where they were previously written...
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
The Step class contains information of all particles present after certain step in the event generati...
Definition: Step.h:34
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition: Containers.h:82
ThePEG::Ptr< Hint >::transient_pointer tHintPtr
Alias for a transient pointer to Hint .
Definition: Pointers.h:71
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
Define the base class from which all (polymorphic) classes in ThePEG are derived.
Definition: ThePEG.h:54
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30