/[PAMELA software]/trieste/pamVMC/src/PamVMCPrimaryGenerator.cxx
ViewVC logotype

Diff of /trieste/pamVMC/src/PamVMCPrimaryGenerator.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by pamelats, Wed Mar 4 12:51:18 2009 UTC revision 1.2 by pamelats, Mon Mar 9 17:09:36 2009 UTC
# Line 224  void PamVMCPrimaryGenerator::GenSphDist( Line 224  void PamVMCPrimaryGenerator::GenSphDist(
224          Double_t rz = s1_pz-s3_pz;          Double_t rz = s1_pz-s3_pz;
225    
226          Double_t thmax = (180./Pi())*(ACos(rz/Sqrt(rx*rx+ry*ry+rz*rz)));          Double_t thmax = (180./Pi())*(ACos(rz/Sqrt(rx*rx+ry*ry+rz*rz)));
227          Double_t phmax = (180./Pi())*(ATan2(ry,rx));          //Double_t phmax = (180./Pi())*(ATan2(ry,rx));
228          //cout << "~~~~~~Theta max Phi max : " << thmax <<", "<< phmax << endl;          //cout << "~~~~~~Theta max Phi max : " << thmax <<", "<< phmax << endl;
229    
230          //generate a track check and let it go only if it is passing through all          //generate a track check and let it go only if it is passing through all
# Line 234  void PamVMCPrimaryGenerator::GenSphDist( Line 234  void PamVMCPrimaryGenerator::GenSphDist(
234          do          do
235          {          {
236          //cout << "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+" << endl;          //cout << "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+" << endl;
237                  GenSphDist(r, 0., thmax, 0., phmax);                  GenSphDist(r, 0., thmax, 0., 360.);
238                                    
239                  Double_t th = (Pi()/180.)*fprim.fTHETA;                  Double_t th = (Pi()/180.)*fprim.fTHETA;
240                  Double_t ph = (Pi()/180.)*fprim.fPHI;                  Double_t ph = (Pi()/180.)*fprim.fPHI;
# Line 242  void PamVMCPrimaryGenerator::GenSphDist( Line 242  void PamVMCPrimaryGenerator::GenSphDist(
242    
243                  Double_t x1, y1, x2, y2, x3, y3;                  Double_t x1, y1, x2, y2, x3, y3;
244                                    
245                  x1 = s1_pz*Tan(th)*Cos(ph);                  x1 = s1_pz*Tan(th)*Cos(ph) - fprim.fX0;
246                  y1 = s1_pz*Tan(th)*Sin(ph);                  y1 = s1_pz*Tan(th)*Sin(ph) - fprim.fY0;
247                  x2 = s2_pz*Tan(th)*Cos(ph);                  x2 = s2_pz*Tan(th)*Cos(ph) - fprim.fX0;
248                  y2 = s2_pz*Tan(th)*Sin(ph);                  y2 = s2_pz*Tan(th)*Sin(ph) - fprim.fY0;
249                  x3 = s3_pz*Tan(th)*Cos(ph);                  x3 = s3_pz*Tan(th)*Cos(ph) - fprim.fX0;
250                  y3 = s3_pz*Tan(th)*Sin(ph);                  y3 = s3_pz*Tan(th)*Sin(ph) - fprim.fY0;
251    
252                  if ( Abs(x1) <= Abs(s1_x) && Abs(y1) <= Abs(s1_y) &&                  if ( Abs(x1) <= Abs(s1_x) && Abs(y1) <= Abs(s1_y) &&
253                       Abs(x2) <= Abs(s2_x) && Abs(y2) <= Abs(s2_y) &&                       Abs(x2) <= Abs(s2_x) && Abs(y2) <= Abs(s2_y) &&

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.23