StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
McParticle.h
1 /*
2  * Created by S. Gliske, May 2012
3  *
4  * Description: McParticle_t, used in the McEEmcTree.
5  *
6  * Note: this class does not explicitly depend on the STAR framework,
7  * and so the trees can be read outside of the STAR framework. Note:
8  * data members are all public, to allow a lighter weight implementation.
9  *
10  *
11  */
12 
13 #ifndef McParticle_H_
14 #define McParticle_H_
15 
16 #include <Rtypes.h>
17 #include <TObject.h>
18 #include <TVector3.h>
19 
20 //
21 // McParticle_t
22 //
23 class McParticle_t : public TObject {
24  public:
25  McParticle_t();
26  McParticle_t( Int_t pIdx, Int_t v1Idx, Int_t v2Idx, Long_t gPID, Long_t pPID, Float_t e, const TVector3& mom,
27  Short_t sector_, Float_t uPos_, Float_t vPos_, Float_t uE_, Float_t vE_, const TVector3& position,
28  Float_t eTow_, Float_t ePre1_, Float_t ePre2_, Float_t ePost_ );
29  virtual ~McParticle_t();
30 
31  void Clear( const Option_t* );
32 
33  Int_t parentIdx; // idx in TClonesArray of parent particle
34  Int_t startVertexIdx; // idx in TClonesArray of starting vertex
35  Int_t stopVertexIdx; // idx in TClonesArray of stop (ending) vertex
36 
37  Long_t gId; // Geant PID, copied from StMcTrack
38  Long_t pId; // PDG PID, copied from StMcTrack
39 
40  Float_t E; // copied from StMcTrack
41  TVector3 momentum; // copied from StMcTrack
42 
43  Short_t sector; // sector in which the most energy is deposited in the SMD
44  Float_t uPos, vPos; // energy weighted mean strip position in each layer, in the above sector
45  Float_t uE, vE; // energy in the u and v layers, in the specified sector
46  TVector3 position; // where it hits the detector, computed based on uPos, vPos.
47  // Set to 0,0,0 if doesn't hit
48 
49  Float_t eTow, ePre1, ePre2, ePost; // energy deposited in each of these layers
50 
51  private:
52  ClassDef( McParticle_t, 3 );
53 };
54 
55 // inline functions
56 
57 inline McParticle_t::McParticle_t( Int_t pIdx, Int_t v1Idx, Int_t v2Idx, Long_t gPID, Long_t pPID,
58  Float_t e, const TVector3& mom, Short_t sector_,
59  Float_t uPos_, Float_t vPos_, Float_t uE_, Float_t vE_,
60  const TVector3& pos,
61  Float_t eTow_, Float_t ePre1_, Float_t ePre2_, Float_t ePost_ )
62  : parentIdx(pIdx), startVertexIdx(v1Idx), stopVertexIdx(v2Idx),
63  gId(gPID), pId(pPID), E(e), momentum(mom), sector(sector_),
64  uPos(uPos_), vPos(vPos_), uE(uE_), vE(vE_), position(pos),
65  eTow(eTow_), ePre1(ePre1_), ePre2(ePre2_), ePost(ePost_) { /* */ };
66 
67 inline void McParticle_t::Clear( const Option_t* ){
68  parentIdx = startVertexIdx = stopVertexIdx = -1;
69  gId = pId = 0;
70  E = 0;
71  sector = 0;
72  uPos = vPos = -1;
73  uE = vE = eTow = ePre1 = ePre2 = ePost = 0;
74 
75  momentum.SetXYZ(0,0,0);
76  position.SetXYZ(0,0,0);
77 };
78 
79 #endif
80 
81 /*
82  * $Id: McParticle.h,v 1.1 2012/11/26 19:04:30 sgliske Exp $
83  * $Log: McParticle.h,v $
84  * Revision 1.1 2012/11/26 19:04:30 sgliske
85  * moved from offline/users/sgliske/StRoot/StEEmcPool/EEmcTreeContainers to StRoot/StEEmcPool/EEmcTreeContainers
86  *
87  *
88  */