00001
00002 #ifndef UTIL_LCFourVector_H
00003 #define UTIL_LCFourVector_H 1
00004
00005 #include "EVENT/LCObject.h"
00006 #include "CLHEP/Vector/LorentzVector.h"
00007
00008
00009
00010 namespace CLHEP{}
00011 using namespace CLHEP ;
00012
00013
00014 namespace UTIL {
00015
00016
00029 template<class TT>
00030 class LCFourVector : public HepLorentzVector {
00031
00032 protected:
00033 const TT* _lcObj = nullptr ;
00034
00035 public:
00036 virtual ~LCFourVector() { ; }
00037
00038 LCFourVector(const LCFourVector& ) = default ;
00039 LCFourVector& operator=(const LCFourVector& ) = default ;
00040
00043 inline LCFourVector( const TT* lcObj) : _lcObj(lcObj) {
00044 }
00045
00046
00051 LCFourVector(const EVENT::LCObject* lcObj){
00052
00053 _lcObj = dynamic_cast< const TT* >( lcObj ) ;
00054
00055 if( _lcObj == 0 )
00056 throw EVENT::Exception("Dynamic cast failed for LCFourVector() !") ;
00057 }
00058
00068 const TT* operator->() const { return _lcObj ; }
00069
00070
00075 const TT* lcObj() const { return _lcObj ; }
00076
00077
00078
00079 protected:
00080 LCFourVector() {}
00081
00082 };
00083
00084 }
00085
00086
00087 #include "UTIL/LCFourVector.icc"
00088
00089
00090 #endif
00091