StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEStructHijing.h
1 /**********************************************************************
2  *
3  * $Id: StEStructHijing.h,v 1.9 2012/11/16 21:28:32 prindle Exp $
4  *
5  * Author: Chunhui Han
6  *
7  **********************************************************************
8  *
9  * Description: EStructEventReader wrapper for (T)Hijing event generator
10  *
11  **********************************************************************/
12 #ifndef __STESTRUCTHIJING__H
13 #define __STESTRUCTHIJING__H
14 
15 #include "StEStructPool/AnalysisMaker/StEStructEventReader.h"
16 
17 #include "TROOT.h"
18 #include "TMath.h"
19 #include "../THijing/THijing.h"
20 
22 
23  public:
24 
25  THijing* mHijing;
26  bool mInChain;
27  bool mAmDone;
28  bool museImpactParameter;
29  float mImpact;
30  int mnumTracks;
31  int mEventsToDo;
32  int *mTrackList;
33  double *rTrackList;
34 
35  int filterTracks();
36  int filterTrackArea();
37  void fillTracks(StEStructEvent* estructEvent);
38  bool isTrackGood(int i);
39  int countGoodTracks();
40 
41  int mEventCount;
42 
44  StEStructHijing(THijing* hijing,
45  StEStructEventCuts* ecuts,
46  StEStructTrackCuts* tcuts,
47  bool useImpactParameter = true,
48  int eventsToDo = 100);
49 
50  virtual ~StEStructHijing(){};
51  void setHijingReader(THijing* hijing); // This method appears to be un-used.
52  bool hasGenerator();
53  bool setInChain(bool inChain);
54  bool InChain();
55  bool measureable(int pid);
56  float* globalDCA(float* p, float* v);
57 
58  virtual StEStructEvent* next();
59  virtual bool done();
60 
61  virtual double getImpact(); // impact parameter
62  virtual double getBinary(); // N binary collisions
63  virtual double getParticipants(); // N participants
64 
65 
66  ClassDef(StEStructHijing,1)
67 };
68 
69 inline bool StEStructHijing::done(){ return mAmDone; };
70 inline bool StEStructHijing::setInChain(bool inChain) {
71  mInChain = inChain;
72  return mInChain;
73 };
74 inline bool StEStructHijing::InChain(){ return mInChain; };
75 
76 inline double StEStructHijing::getImpact(){ return mHijing->GetImpactParameter(); };
77 inline double StEStructHijing::getBinary(){ return mHijing->GetBinaryCollisions(); };
78 inline double StEStructHijing::getParticipants(){ return mHijing->GetParticipants(); };
79 
80 
81 inline bool StEStructHijing::measureable(int pid){
82  bool retVal=false;
83 
84  switch(pid){
85 
86  // I don't think Hijing can produce these, but they are
87  // defined by the pdg (I think, see www.slac.stanford.edu/BFROOT/www/Computing/Environment/NewUser/htmlbug/node51.html)
88  // because GEANT can make them and they are measurable so I
89  // include them here. djp Sept. 12, 2005
90  case 95:
91  { // deuteron
92  retVal=true;
93  break;
94  }
95  case 96:
96  { // triton
97  retVal=true;
98  break;
99  }
100  case 97:
101  { // Helium 4
102  retVal=true;
103  break;
104  }
105  default:
106  {
107  break;
108  }
109  }
110 
111 
112  if(pid<0)pid*=-1;
113 
114  switch(pid){
115 
116  case 211:
117  { // charged pion
118  retVal=true;
119  break;
120  }
121  case 321:
122  { // charged kaon
123  retVal=true;
124  break;
125  }
126  case 2212:
127  { // proton
128  retVal=true;
129  break;
130  }
131  case 11:
132  { // electron
133  retVal=true;
134  break;
135  }
136  case 13:
137  { // muon
138  retVal=true;
139  break;
140  }
141  default:
142  {
143  break;
144  }
145  }
146  return retVal;
147 }
148 
149 inline float* StEStructHijing::globalDCA(float* p, float* v){
150 
151  // assumes primaryVertex at origin
152  float* r=new float[4];
153  r[0]=r[1]=r[2]=r[3]=0;
154 
155  // a is the component of v vector that is parallel to p.
156  float a = v[0] * p[0] + v[1] * p[1] + v[2] * p[2] ;
157  a = a / sqrt(p[0]*p[0] + p[1]*p[1] + p[2]*p[2]);
158  // r is the component of v vector perpendicular to p.
159  r[3] = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2] - a*a);
160  // Since only the magnitude of globalDCA is used,
161  // leave r[0], r[1], r[2] to be 0 here.
162  return r;
163 }
164 
165 #endif
166 
167 /**********************************************************************
168  *
169  *
170  *********************************************************************/