ThePEG  1.8.0
SubProcess.h
1 // -*- C++ -*-
2 //
3 // SubProcess.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 // Copyright (C) 2009-2011 Simon Platzer
6 //
7 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
8 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
9 //
10 #ifndef ThePEG_SubProcess_H
11 #define ThePEG_SubProcess_H
12 // This is the declaration of the SubProcess class.
13 
14 
15 #include <vector>
16 #include "ThePEG/EventRecord/Particle.h"
17 
18 namespace ThePEG {
19 
20  class SubProcessGroup;
21 
33 class SubProcess: public EventRecordBase {
34 
35 public:
36 
38  friend class Step;
40  friend class Collision;
42  friend class SubProcessGroup;
43 
44 public:
45 
52  SubProcess(const PPair & newIncoming,
53  tCollPtr newCollision = tCollPtr(),
54  tcEventBasePtr newHandler = tcEventBasePtr(),
55  tSubProPtr newHead = tSubProPtr(),
56  double newGroupWeight = 1.0);
57 
61  virtual ~SubProcess();
62 
66  tcEventBasePtr handler() const { return theHandler; }
67 
71  tCollPtr collision() const { return theCollision; }
72 
76  const PPair & incoming() const { return theIncoming; }
77 
81  const ParticleVector & intermediates() const { return theIntermediates; }
82 
86  const ParticleVector & outgoing() const { return theOutgoing; }
87 
91  template <class InputIterator>
92  void setOutgoing(InputIterator, InputIterator);
93 
99  void addOutgoing(tPPtr p, bool fixrelations = true);
100 
104  void changeIncoming(tPPtr pnew, tPPtr pold);
105 
109  template <class InputIterator>
110  void setIntermediates(InputIterator, InputIterator);
111 
117  void addIntermediate(tPPtr p, bool fixrelations = true);
118 
122  void removeEntry(tPPtr p);
123 
127  virtual SubProPtr clone() const;
128 
133  bool decayed() const { return isDecayed; }
134 
139  void decayed(bool x) { isDecayed = x; }
140 
147  tSubProPtr head() const { return theHead; }
148 
152  void head(tSubProPtr newHead) { theHead = newHead; }
153 
159  double groupWeight() const { return theGroupWeight; }
160 
166  void groupWeight(double w) { theGroupWeight = w; }
167 
168 protected:
169 
177  virtual void rebind(const EventTranslationMap & trans);
178 
179 
180 public:
181 
186  virtual void transform(const LorentzRotation &);
187 
192  Energy2 shat() const {
193  return (incoming().first->momentum() + incoming().second->momentum()).m2();
194  }
195 
201  Energy2 that() const {
202  return (incoming().first->momentum() - outgoing()[0]->momentum()).m2();
203  }
204 
210  Energy2 uhat() const {
211  return (incoming().second->momentum() - outgoing()[0]->momentum()).m2();
212  }
213 
214 public:
215 
219  void persistentOutput(PersistentOStream &) const;
220 
224  void persistentInput(PersistentIStream &, int);
225 
229  static void Init();
230 
231 private:
232 
237 
242 
247 
252 
257 
261  bool isDecayed;
262 
270 
277 
278 public:
279 
284  virtual void debugme() const;
285 
289  virtual void printMe(ostream&) const;
290 
291 private:
292 
296  SubProcess() : isDecayed(false), theGroupWeight(1.0) {}
297 
302 
307  friend struct ClassTraits<SubProcess>;
308 
312  SubProcess & operator=(const SubProcess &);
313 
314 };
315 
317 ostream & operator<<(ostream &, const SubProcess &);
318 
319 
324 template <>
325 struct BaseClassTrait<SubProcess,1>: public ClassTraitsType {
327  typedef EventRecordBase NthBase;
328 };
329 
332 template <>
333 struct ClassTraits<SubProcess>: public ClassTraitsBase<SubProcess> {
335  static string className() { return "ThePEG::SubProcess"; }
337  static TPtr create() { return TPtr::Create(SubProcess()); }
338 };
339 
342 }
343 
344 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
345 #include "SubProcess.tcc"
346 #endif
347 
348 #endif /* ThePEG_SubProcess_H */
void persistentOutput(PersistentOStream &) const
Standard function for writing to a persistent stream.
PersistentIStream is used to read persistent objects from a stream where they were previously written...
tSubProPtr theHead
The head SubProcess, if this SubProcess object belongs to a SubProcessGroup.
Definition: SubProcess.h:269
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
tCollPtr theCollision
A pointer to the collision to which this sub-process belongs.
Definition: SubProcess.h:241
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
virtual void debugme() const
Print out debugging information for this object on std::cerr.
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
void addOutgoing(tPPtr p, bool fixrelations=true)
Add a particle to the list of outgoing ones.
const ParticleVector & intermediates() const
A reference to the vector of intermediate partons.
Definition: SubProcess.h:81
Ptr< EventRecordBase >::transient_const_pointer tcEventBasePtr
Alias for a transient pointer to const EventRecordBase.
Definition: EventConfig.h:49
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:509
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
bool isDecayed
True if a perturbative cascade has been applied to this sub process.
Definition: SubProcess.h:261
double theGroupWeight
If this SubProcess belongs to a SubProcessGroup, this gives its relative weight w.r.t.
Definition: SubProcess.h:276
Energy2 uhat() const
Return the value of the Mandelstam variable in this SubProcess.
Definition: SubProcess.h:210
virtual void transform(const LorentzRotation &)
Perform a LorentzTransformation of all particles in the sub process.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
SubProcess & operator=(const SubProcess &)
Assignment is forbidden.
void setIntermediates(InputIterator, InputIterator)
Set the vector of intermediate particles.
A SubProcessGroup object represents a group of SubProcess objects in dependence of a head SubProcess ...
A SubProcess object represents a hard sub-process in a collision.
Definition: SubProcess.h:33
tSubProPtr head() const
Return the head SubProcess, if this SubProcess object belongs to a SubProcessGroup.
Definition: SubProcess.h:147
tcEventBasePtr handler() const
A pointer to the MEBase object which generated this SubProcess.
Definition: SubProcess.h:66
virtual SubProPtr clone() const
Return a clone of this sub process.
void changeIncoming(tPPtr pnew, tPPtr pold)
Change the incoming parton.
void setOutgoing(InputIterator, InputIterator)
Set the vector of outgoing particles.
tCollPtr collision() const
A pointer to the collision to which this sub-process belongs.
Definition: SubProcess.h:71
ThePEG::Ptr< SubProcess >::transient_pointer tSubProPtr
Alias for a transient pointer to SubProcess .
Definition: Pointers.h:86
pair< PPtr, PPtr > PPair
A pair of pointers to Particle objects.
Definition: Containers.h:127
const PPair & incoming() const
The pair of incoming partons.
Definition: SubProcess.h:76
virtual void rebind(const EventTranslationMap &trans)
Rebind to cloned objects.
void persistentInput(PersistentIStream &, int)
Standard function for reading from a persistent stream.
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
PPair theIncoming
The pair of incoming particles.
Definition: SubProcess.h:246
void addIntermediate(tPPtr p, bool fixrelations=true)
Add a particle to the list of intermediate ones.
void decayed(bool x)
Set to true if a perturbative cascade has been applied to this sub process.
Definition: SubProcess.h:139
ThePEG::Ptr< Collision >::transient_pointer tCollPtr
Alias for a transient pointer to Collision .
Definition: Pointers.h:84
This is the decalaration of the Collision class.
Definition: Collision.h:34
ParticleVector theOutgoing
The vector of outgoing particles.
Definition: SubProcess.h:256
bool decayed() const
True if a perturbative cascade has been applied to this sub process.
Definition: SubProcess.h:133
ParticleVector theIntermediates
The vector of intermediate particles,.
Definition: SubProcess.h:251
virtual void printMe(ostream &) const
Put to ostream.
static void Init()
Standard Init function.
Energy2 that() const
Return the value of the Mandelstam variable in this SubProcess.
Definition: SubProcess.h:201
static TPtr create()
Create a T object and return a smart pointer to it.
Definition: ClassTraits.h:60
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
const ParticleVector & outgoing() const
A reference to the vector of outgoing particles.
Definition: SubProcess.h:86
vector< T > & operator<<(vector< T > &tv, const U &u)
Overload the left shift operator for vector to push_back objects to a vector.
Definition: Containers.h:179
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
Energy2 shat() const
Return the value of the Mandelstam variable in this SubProcess.
Definition: SubProcess.h:192
void head(tSubProPtr newHead)
Set the head SubProcess.
Definition: SubProcess.h:152
static ClassDescription< SubProcess > initSubProcess
Describe concrete class with persistent data.
Definition: SubProcess.h:301
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
void removeEntry(tPPtr p)
Remove a particle entry from this sub-process.
void groupWeight(double w)
If this SubProcess belongs to a SubProcessGroup, set its relative weight w.r.t.
Definition: SubProcess.h:166
double groupWeight() const
If this SubProcess belongs to a SubProcessGroup, return its relative weight w.r.t.
Definition: SubProcess.h:159
virtual ~SubProcess()
Destructor.
vector< PPtr > ParticleVector
A vector of pointers to Particle objects.
Definition: Containers.h:73
SubProcess()
Default constructor.
Definition: SubProcess.h:296
ThePEG::Ptr< T >::pointer TPtr
Alias for a reference counted pointer to T .
Definition: ClassTraits.h:54
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
tcEventBasePtr theHandler
A pointer to the MEBase object which generated this sub-process.
Definition: SubProcess.h:236
static RCPtr Create()
Allocate and construct an object of class T and return a RCPtr to it.
Definition: RCPtr.h:115
The Step class contains information of all particles present after certain step in the event generati...
Definition: Step.h:34