StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuMcTrack.h
1 // $Id: StMuMcTrack.h,v 1.4 2014/08/06 19:19:07 perev Exp $
2 #ifndef __StMuMcTrack_h__
3 #define __StMuMcTrack_h__
4 #include "tables/St_g2t_track_Table.h"
5 #include "StThreeVectorF.hh"
6 class StMuMcTrack : public TObject {
7  public:
8  enum EHIT {ktpc, ksvt, kssd,
9  kctb, keem, kemc, kesm, kftp, kgem, khpd, kist, kigt, kfst,
10  kfgt, kfpd, kmwc, kpgc, kpmd, ksmd, kpix, ktof, kvpd,
11  ketr, khca, kfts, keto, kstg, kwca, kpre, kepd,
12  ktot};
13  StMuMcTrack(const g2t_track_st &t);
14 #if 0
15  StMuMcTrack(const g2t_track_st &t) : TObject(), mGePid(t.ge_pid), mId(t.id), mIsShower(t.is_shower), mItrmdVertex(t.itrmd_vertex_p),
16  mIdVx(t.start_vertex_p), mIdVxEnd(t.stop_vertex_p), mCharge(t.charge), mE(t.e), mEta(t. eta), mPxyz(t.p), mpT(t.pt), mPtot(t.ptot),
17  mRapidity(t.rapidity) {
18  mHits[kctb] = 0xff & t.n_ctb_hit; /* Nhits in ctb */
19  mHits[keem] = 0xff & t.n_eem_hit; /* Nhits in eem (endcap em cal) */
20  mHits[kemc] = 0xff & t.n_emc_hit; /* Nhits in emc */
21  mHits[kesm] = 0xff & t.n_esm_hit; /* Nhits in esm (endcap shower max) */
22  mHits[kftp] = 0xff & t.n_ftp_hit; /* Nhits in forward tpc */
23  mHits[kgem] = 0xff & t.n_gem_hit; /* Nhits in gem barrel */
24  mHits[khpd] = 0xff & t.n_hpd_hit; /* Nhits in hpd */
25  mHits[kist] = 0xff & t.n_ist_hit; /* Nhits in ist */
26  mHits[kigt] = 0xff & t.n_igt_hit; /* Nhits in igt */
27  mHits[kfst] = 0xff & t.n_fst_hit; /* Nhits in fst */
28  mHits[kfgt] = 0xff & t.n_fgt_hit; /* Nhits in fgt */
29  mHits[kfpd] = 0xff & t.n_fpd_hit; /* Nhits in fpd */
30  mHits[kmwc] = 0xff & t.n_mwc_hit; /* Nhits in mwc */
31  mHits[kpgc] = 0xff & t.n_pgc_hit; /* Nhits in pgc ??? */
32  mHits[kpmd] = 0xff & t.n_pmd_hit; /* Nhits in pmd (PMD) */
33  mHits[ksmd] = 0xff & t.n_smd_hit; /* number of hits in shower max */
34  mHits[kssd] = 0xff & t.n_ssd_hit; /* Nhits in ssd */
35  mHits[ksvt] = 0xff & t.n_svt_hit; /* Nhits in svt */
36  mHits[kpix] = 0xff & t.n_pix_hit; /* Nhits in pix */
37  mHits[ktof] = 0xff & t.n_tof_hit; /* Nhits in tof */
38  mHits[ktpc] = 0xff & t.n_tpc_hit; /* Nhits in tpc */
39  mHits[kvpd] = 0xff & t.n_vpd_hit; /* Nhits in vpd */
40  }
41 #endif
42  StMuMcTrack() {}
43  virtual ~StMuMcTrack() {}
44  Int_t GePid() const {return mGePid;} /* GEANT particle id */
45  Int_t Id() const {return mId;} /* primary key */
46  Bool_t IsShower() const {return mIsShower;} /* 1 if shower track, 0 if not */
47  Int_t NoHits() const {Int_t n = 0; for (Int_t i = ktpc; i < ktot; i++) n+= NoHits(i); return n;}
48  UChar_t NoHits(Int_t k)const {return mHits[k];}
49  UChar_t No_ctb_hit() const {return NoHits(kctb);} /* Nhits in ctb */
50  UChar_t No_eem_hit() const {return NoHits(keem);} /* Nhits in eem (endcap em cal) */
51  UChar_t No_emc_hit() const {return NoHits(kemc);} /* Nhits in emc */
52  UChar_t No_esm_hit() const {return NoHits(kesm);} /* Nhits in esm (endcap shower max) */
53  UChar_t No_ftp_hit() const {return NoHits(kftp);} /* Nhits in forward tpc */
54  UChar_t No_gem_hit() const {return NoHits(kgem);} /* Nhits in gem barrel */
55  UChar_t No_hpd_hit() const {return NoHits(khpd);} /* Nhits in hpd */
56  UChar_t No_ist_hit() const {return NoHits(kist);} /* Nhits in ist */
57  UChar_t No_igt_hit() const {return NoHits(kigt);} /* Nhits in igt */
58  UChar_t No_fst_hit() const {return NoHits(kfst);} /* Nhits in fst */
59  UChar_t No_fgt_hit() const {return NoHits(kfgt);} /* Nhits in fgt */
60  UChar_t No_fpd_hit() const {return NoHits(kfpd);} /* Nhits in fpd */
61  UChar_t No_mwc_hit() const {return NoHits(kmwc);} /* Nhits in mwc */
62  UChar_t No_pgc_hit() const {return NoHits(kpgc);} /* Nhits in pgc ??? */
63  UChar_t No_pmd_hit() const {return NoHits(kpmd);} /* Nhits in pmd (PMD) */
64  UChar_t No_smd_hit() const {return NoHits(ksmd);} /* number of hits in shower max */
65  UChar_t No_ssd_hit() const {return NoHits(kssd);} /* Nhits in ssd */
66  UChar_t No_svt_hit() const {return NoHits(ksvt);} /* Nhits in svt */
67  UChar_t No_pix_hit() const {return NoHits(kpix);} /* Nhits in pix */
68  UChar_t No_tof_hit() const {return NoHits(ktof);} /* Nhits in tof */
69  UChar_t No_tpc_hit() const {return NoHits(ktpc);} /* Nhits in tpc */
70  UChar_t No_vpd_hit() const {return NoHits(kvpd);} /* Nhits in vpd */
71  UChar_t No_etr_hit() const {return NoHits(ketr);} /* Nhits in etr */
72  UChar_t No_hca_hit() const {return NoHits(khca);} /* Nhits in hca */
73  UChar_t No_fts_hit() const {return NoHits(kfts);} /* Nhits in fts (fst) */
74  UChar_t No_eto_hit() const {return NoHits(keto);} /* Nhits in eto */
75  UChar_t No_stg_hit() const {return NoHits(kstg);} /* Nhits in stgc (ftt) */
76  UChar_t No_wca_hit() const {return NoHits(kwca);} /* Nhits in wca */
77  UChar_t No_pre_hit() const {return NoHits(kpre);} /* Nhits in pre */
78  UChar_t No_epd_hit() const {return NoHits(kepd);} /* Nhits in epd */
79  Int_t ItrmdVertex() const {return mItrmdVertex;} /* First intermediate vertex */
80  Int_t IdVx () const {return mIdVx; } /* Id of start vertex of track */
81  Int_t IdVxEnd () const {return mIdVxEnd; } /* Id of stop vertex of this track */
82  Char_t Charge () const {return mCharge; } /* Charge */
83  Float_t E () const {return mE; } /* Energy */
84  Float_t Eta () const {return mEta; } /* Pseudorapidity */
85  const StThreeVectorF& Pxyz () const {return *&mPxyz; } /* Momentum */
86  Float_t pT () const {return mpT; } /* Transverse momentum */
87  Float_t Ptot () const {return mPtot; } /* Total momentum */
88  Float_t Rapidity () const {return mRapidity; } /* Rapidity */
89  virtual void Print(Option_t* option = "") const;
90  static Int_t CorrectGePid(Int_t gePid);
91  const Char_t *GeName();
92  private:
93  Int_t mGePid; /* GEANT particle id */
94  Int_t mId; /* primary key */
95  Bool_t mIsShower; /* 1 if shower track, 0 if not */
96  UChar_t mHits[ktot]; /* Nhits in a detector */
97  Int_t mItrmdVertex; /* First intermediate vertex */
98  Int_t mIdVx; /* Id of start vertex of track */
99  Int_t mIdVxEnd; /* Id of stop vertex of this track */
100  Char_t mCharge; /* Charge */
101  Float_t mE; /* Energy */
102  Float_t mEta; /* Pseudorapidity */
103  StThreeVectorF mPxyz; /* Momentum */
104  Float_t mpT; /* Transverse momentum */
105  Float_t mPtot; /* Total momentum */
106  Float_t mRapidity; /* Rapidity */
107  ClassDef(StMuMcTrack,2)
108 };
109 ostream& operator<<(ostream& os, StMuMcTrack const & v);
110 #endif
111 // $Log: StMuMcTrack.h,v $
112 // Revision 1.4 2014/08/06 19:19:07 perev
113 // Move constructor .h ==> .cxx
114 //
115 // Revision 1.3 2012/05/07 14:47:06 fisyak
116 // Add handles for track to fast detector matching
117 //
118 // Revision 1.2 2011/10/17 00:19:14 fisyak
119 // Active handing of IdTruth
120 //
virtual void Print(Option_t *option="") const
Print track info.