00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_SubProcess_H
00010 #define ThePEG_SubProcess_H
00011
00012
00013
00014 #include <vector>
00015 #include "ThePEG/EventRecord/Particle.h"
00016
00017 namespace ThePEG {
00018
00029 class SubProcess: public EventRecordBase {
00030
00031 public:
00032
00034 friend class Step;
00036 friend class Collision;
00037
00038 public:
00039
00046 SubProcess(const PPair & newIncoming,
00047 tCollPtr newCollision = tCollPtr(),
00048 tcEventBasePtr newHandler = tcEventBasePtr());
00049
00053 virtual ~SubProcess();
00054
00058 tcEventBasePtr handler() const { return theHandler; }
00059
00063 tCollPtr collision() const { return theCollision; }
00064
00068 const PPair & incoming() const { return theIncoming; }
00069
00073 const ParticleVector & intermediates() const { return theIntermediates; }
00074
00078 const ParticleVector & outgoing() const { return theOutgoing; }
00079
00083 template <class InputIterator>
00084 void setOutgoing(InputIterator, InputIterator);
00085
00091 void addOutgoing(tPPtr p, bool fixrelations = true);
00092
00096 void changeIncoming(tPPtr pnew, tPPtr pold);
00097
00101 template <class InputIterator>
00102 void setIntermediates(InputIterator, InputIterator);
00103
00109 void addIntermediate(tPPtr p, bool fixrelations = true);
00110
00114 void removeEntry(tPPtr p);
00115
00119 SubProPtr clone() const;
00120
00125 bool decayed() const { return isDecayed; }
00126
00131 void decayed(bool x) { isDecayed = x; }
00132
00133
00134 protected:
00135
00143 void rebind(const EventTranslationMap & trans);
00144
00145
00146 public:
00147
00152 void transform(const LorentzRotation &);
00153
00158 Energy2 shat() const {
00159 return (incoming().first->momentum() + incoming().second->momentum()).m2();
00160 }
00161
00167 Energy2 that() const {
00168 return (incoming().first->momentum() - outgoing()[0]->momentum()).m2();
00169 }
00170
00176 Energy2 uhat() const {
00177 return (incoming().second->momentum() - outgoing()[0]->momentum()).m2();
00178 }
00179
00180 public:
00181
00185 void persistentOutput(PersistentOStream &) const;
00186
00190 void persistentInput(PersistentIStream &, int);
00191
00195 static void Init();
00196
00197 private:
00198
00202 tcEventBasePtr theHandler;
00203
00207 tCollPtr theCollision;
00208
00212 PPair theIncoming;
00213
00217 ParticleVector theIntermediates;
00218
00222 ParticleVector theOutgoing;
00223
00227 bool isDecayed;
00228
00229 public:
00230
00235 virtual void debugme() const;
00236
00237 private:
00238
00242 static ClassDescription<SubProcess> initSubProcess;
00243
00248 SubProcess() : isDecayed(false) {}
00249
00254 friend class ClassTraits<SubProcess>;
00255
00259 SubProcess & operator=(const SubProcess &);
00260
00261 };
00262
00264 ostream & operator<<(ostream &, const SubProcess &);
00265
00266
00271 template <>
00272 struct BaseClassTrait<SubProcess,1>: public ClassTraitsType {
00274 typedef EventRecordBase NthBase;
00275 };
00276
00279 template <>
00280 struct ClassTraits<SubProcess>: public ClassTraitsBase<SubProcess> {
00282 static string className() { return "ThePEG::SubProcess"; }
00284 static TPtr create() { return TPtr::Create(SubProcess()); }
00285 };
00286
00289 }
00290
00291 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
00292 #include "SubProcess.tcc"
00293 #endif
00294
00295 #endif