EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicProtoGenerator.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicProtoGenerator.cxx
1 
2 #include <TGeoMatrix.h>
3 #include <TRandom.h>
4 
5 #include <EicProtoGenerator.h>
6 
7 // ---------------------------------------------------------------------------------------
8 // ---------------------------------------------------------------------------------------
9 
11 {
12  double vtx[3];
13 
14  for(unsigned iq=0; iq<3; iq++) {
15  vtx[iq] = mCoord[iq] +
17  (mCoordSigma[iq] ? gRandom->Gaus(0.0, mCoordSigma[iq]) : 0.0) :
18  (mCoordRange[iq] ? gRandom->Uniform(-mCoordRange[iq]/2, mCoordRange[iq]/2) : 0.0));
19  } //for iq
20 
21  return TVector3(vtx);
22 } // EicProtoGenerator::GetSimulatedPrimaryVertex()
23 
24 // ---------------------------------------------------------------------------------------
25 
26 TVector3 EicProtoGenerator::GetModifiedTrack(const TVector3 track) {
28  return track;
29 
30  {
31  TVector3 trout = track;
32  TGeoRotation *rw = new TGeoRotation();
33 
34  // FIXME: admittedly these codes are not the most efficient (and also ugly);
36  double in[3] = {trout.x(), trout.y(), trout.z()}, out[3];
37  double angle = gRandom->Gaus(0.0, mVerticalBeamDivergence * TMath::RadToDeg());
38 
39  rw->RotateX(angle);
40 
41  rw->LocalToMasterVect(in, out);
42  trout = TVector3(out);
43  } //if
44  // Do not mind to apply in sequence;
46  double in[3] = {trout.x(), trout.y(), trout.z()}, out[3];
47  double angle = TMath::RadToDeg() * gRandom->Gaus(mHorizontalBeamRotation, mHorizontalBeamDivergence);
48 
49  rw->RotateY(angle);
50 
51  rw->LocalToMasterVect(in, out);
52  trout = TVector3(out);
53  } //if
54 
55  delete rw;
56  return trout;
57  }
58 } // EicProtoGenerator::GetModifiedTrack()
59 
60 // ---------------------------------------------------------------------------------------
61 // ---------------------------------------------------------------------------------------
62