1 #include "StEStructAcceptance.h"
3 #include "StEStructPool/AnalysisMaker/StEStructEventCuts.h"
4 #include "StEStructPool/AnalysisMaker/StEStructTrackCuts.h"
5 #include "StEStructPool/EventMaker/StEStructEvent.h"
6 #include "StEStructPool/EventMaker/StEStructTrack.h"
8 StEStructAcceptance::StEStructAcceptance() {
11 mMinDetectableRadius = 160;
14 StEStructAcceptance::StEStructAcceptance(
double sigZVertex,
16 double minDetectableRadius ) {
17 mSigZVertex = sigZVertex;
18 mMaxZVertex = maxZVertex;
19 mMinDetectableRadius = minDetectableRadius;
24 void StEStructAcceptance::SetSeed(
int iseed) {
25 cout <<
" Calling srand48(" << iseed <<
") (from StEStructAcceptance class)" << endl;
31 double StEStructAcceptance::GetNewZVertex() {
32 double z = 2*mMaxZVertex;
33 while (abs(z) > mMaxZVertex) {
34 z = mSigZVertex * gRand48();
38 bool StEStructAcceptance::isTrackInAcceptance(
double VertZ,
double pt,
double eta ) {
39 double r = maxRadius( eta, pt, VertZ );
40 if (r < mMinDetectableRadius) {
49 double StEStructAcceptance::maxRadius(
double eta,
double pt,
double VertZ) {
50 double pi = 3.14159265359;
51 double lambda = pi/2 - 2*atan(exp(-eta));
54 s = (+200 - VertZ) / sin(lambda);
56 s = (-200 - VertZ) / sin(lambda);
58 double r = pt / 0.0015;
59 double phi = s * cos(lambda) / r;
61 return r * sqrt(2 - 2*cos(phi));
66 double StEStructAcceptance::gRand48() {
74 x1 = 2.0 * drand48() - 1.0;
75 x2 = 2.0 * drand48() - 1.0;
76 w = x1 * x1 + x2 * x2;
79 w = sqrt( (-2.0 * log( w ) ) / w );