LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
LCFourVector.h
1 // -*- C++ -*-
2 #ifndef UTIL_LCFourVector_H
3 #define UTIL_LCFourVector_H 1
4 
5 #include "EVENT/LCObject.h"
6 #include "CLHEP/Vector/LorentzVector.h"
7 
8 
9 // CLHEP 1.9 and higher introduce a namespace:
10 namespace CLHEP{}
11 using namespace CLHEP ;
12 
13 
14 namespace UTIL {
15 
16 
29  template<class TT>
30  class LCFourVector : public HepLorentzVector {
31 
32  protected:
33  const TT* _lcObj ;
34 
35  public:
36  virtual ~LCFourVector() { /*no_op*/; }
37 
40  inline LCFourVector( const TT* lcObj) : _lcObj(lcObj) {
41  }
42 
43 
49 
50  _lcObj = dynamic_cast< const TT* >( lcObj ) ;
51 
52  if( _lcObj == 0 )
53  throw EVENT::Exception("Dynamic cast failed for LCFourVector() !") ;
54  }
55 
65  const TT* operator->() const { return _lcObj ; }
66 
67 
72  const TT* lcObj() const { return _lcObj ; }
73 
74 
75 
76  protected:
77  LCFourVector() {} // no default c'tor
78 
79  }; // class
80 
81 } // namespace UTIL
82 
83 
84 #include "UTIL/LCFourVector.icc"
85 
86 
87 #endif /* ifndef UTIL_LCFOURVECTOR_H */
88 
The generic object that is held in an LCCollection.
Definition: LCObject.h:30
Base exception class for LCIO - all other exceptions extend this.
Definition: Exceptions.h:21
const TT * operator->() const
Instances of LCFourVector serve as a handle to the templated type.
Definition: LCFourVector.h:65
LCFourVector(const TT *lcObj)
Constructor for templated type,e.g.
Definition: LCFourVector.h:40
Four vector used in LCIO.
Definition: LCFourVector.h:30
LCFourVector(const EVENT::LCObject *lcObj)
Constructor for LCObject.
Definition: LCFourVector.h:48
const TT * lcObj() const
Pointer to the LCObject that has been used to create the four vector.
Definition: LCFourVector.h:72