StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcHitT.hh
1 /***************************************************************************
2  *
3  * $Id: StMcHitT.hh,v 2.3 2010/05/04 23:58:43 fine Exp $
4  * $Log: StMcHitT.hh,v $
5  * Revision 2.3 2010/05/04 23:58:43 fine
6  * Vertex, and emc models
7  *
8  * Revision 2.2 2010/04/28 20:15:45 fine
9  * Implementation if the new OO for Mc hits
10  *
11  * Revision 2.1 2010/04/28 18:10:11 fine
12  * New OO model for Mc event components
13  *
14  * Revision 2.10 2005/11/22 21:44:52 fisyak
15  * Add compress Print for McEvent, add Ssd collections
16  *
17  *
18  **************************************************************************/
19 #ifndef StMcHitT_hh
20 #define StMcHitT_hh
21 
22 #include "StEventObject.h"
23 #include "StMcHitI.h"
24 
25 template <class T>
26 class StMcHitT : public StEventObject<T>, public StMcHitI {
27 protected:
28  StMcHitT(){;}
29 public:
30  StMcHitT(T data) :StEventObject<T>(data) {;}
31  // StMcHitT(const StSvtHit&); use default
32  // const StMcHitT & operator=(const StMcHitT&); use default
33  virtual ~StMcHitT(){;}
34 
35  int operator==(const StMcHitT&r) const
36  { return StEventObject<T>::operator==(r); }
37  int operator!=(const StMcHitT&r) const
38  { return StEventObject<T>::operator!=(r); }
39  // "Get" Methods
40  virtual float x() const { return StEventObject<T>::fData->x[0]; }
41  virtual float y() const { return StEventObject<T>::fData->x[1]; }
42  virtual float z() const { return StEventObject<T>::fData->x[2]; }
43  virtual float px() const { return StEventObject<T>::fData->p[0]; }
44  virtual float py() const { return StEventObject<T>::fData->p[1]; }
45  virtual float pz() const { return StEventObject<T>::fData->p[2]; }
46  virtual float dE() const { return StEventObject<T>::fData->de; }
47  virtual float dS() const { return StEventObject<T>::fData->ds; }
48  virtual long key() const { return StEventObject<T>::fData->id; }
49  virtual long volumeId() const { return StEventObject<T>::fData->volume_id; }
50  virtual long parentTrackIndex() const { return StEventObject<T>::fData->track_p; }
51  virtual float tof() const { return StEventObject<T>::fData->tof; }
52 };
53 
54 struct g2t_emc_hit_st;
55 template <>
56 class StMcHitT<g2t_emc_hit_st*> : public StEventObject<g2t_emc_hit_st*>, public StMcHitI {
57 protected:
58  StMcHitT(){;}
59 public:
60  StMcHitT(g2t_emc_hit_st *data) :StEventObject<g2t_emc_hit_st*>(data) {;}
61  // StMcHitT(const StSvtHit&); use default
62  // const StMcHitT & operator=(const StMcHitT&); use default
63  virtual ~StMcHitT(){;}
64 #if 0
65  int operator==(const StMcHitT&r) const
67  int operator!=(const StMcHitT&r) const
69 #endif
70  // "Get" Methods
71  virtual float dE() const { return StEventObject<g2t_emc_hit_st*>::fData->de; }
72  virtual long key() const { return StEventObject<g2t_emc_hit_st*>::fData->id; }
73  virtual long volumeId() const { return StEventObject<g2t_emc_hit_st*>::fData->volume_id; }
74  virtual long parentTrackIndex() const { return StEventObject<g2t_emc_hit_st*>::fData->track_p; }
75 };
76 
77 #endif
78 
Definition: tof.h:15
base class for all StMcEvent objects
Definition: StEventObject.h:9