00001 // -*- C++ -*- 00002 // 00003 // TmpTransform.h is a part of ThePEG - Toolkit for HEP Event Generation 00004 // Copyright (C) 1999-2007 Leif Lonnblad 00005 // 00006 // ThePEG is licenced under version 2 of the GPL, see COPYING for details. 00007 // Please respect the MCnet academic guidelines, see GUIDELINES for details. 00008 // 00009 #ifndef THEPEG_TmpTransform_H 00010 #define THEPEG_TmpTransform_H 00011 // 00012 // This is the declaration of the TmpTransform class. 00013 // 00014 00015 #include "ThePEG/Config/ThePEG.h" 00016 00017 namespace ThePEG { 00018 00028 template <typename Ptr> 00029 class TmpTransform { 00030 00031 public: 00032 00033 00038 TmpTransform(Ptr p, const LorentzRotation & r) : ptr(p), rot(r) 00039 { 00040 ptr->transform(rot); 00041 } 00042 00047 ~TmpTransform() 00048 { 00049 rot.invert(); 00050 ptr->transform(rot); 00051 } 00052 00053 private: 00054 00058 Ptr ptr; 00059 00063 LorentzRotation rot; 00064 00065 private: 00066 00071 TmpTransform & operator=(const TmpTransform &); 00072 00077 TmpTransform(); 00078 00083 TmpTransform(const TmpTransform &); 00084 00085 }; 00086 00087 } 00088 00089 #endif /* THEPEG_TmpTransform_H */