Changeset 337 for trunk/MagicSoft/Simulation/Detector/Reflector
- Timestamp:
- 01/14/00 16:30:39 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Reflector/reflector.cxx
r336 r337 20 20 // 21 21 // $RCSfile: reflector.cxx,v $ 22 // $Revision: 1. 3$23 // $Author: harald$24 // $Date: 2000-01- 03 12:41:26$22 // $Revision: 1.4 $ 23 // $Author: blanch $ 24 // $Date: 2000-01-14 16:30:39 $ 25 25 // 26 26 //////////////////////////////////////////////////////////////////////// … … 3496 3496 float sin_iphi, cos_iphi; 3497 3497 float iphi; 3498 3499 // for the moment, we only simulate an uniform distribution, 3500 // since our theta distribution in the generation of events is 3501 // already uniform for hadrons, which are the main targets for 3502 // using this option 3503 3504 it = RandomNumber * range; 3498 float range_aux; 3499 int i; 3500 3501 //Random position of the CT. Theta distribution 3502 //follows sin(theta) and ohi distribution is flat 3503 3504 range_aux=1.0-sin(M_PI/2-range); 3505 Nit = RandomNumber * range_aux; 3505 3506 ip = RandomNumber * 2.0 * M_PI; 3507 it = M_PI/2-asin((1.0-Nit)); 3506 3508 3507 3509 sin_theta = sin(theta); … … 3511 3513 *newtheta = acos( cos_newtheta ); 3512 3514 sin_newtheta = sin( *newtheta ); 3513 3514 sin_iphi = sin(it)*sin(ip) / sin_newtheta; 3515 cos_iphi = (( cos(it) - cos_newtheta * cos_theta ) / 3516 ( sin_newtheta * sin_theta )); 3517 3518 iphi = atan2( sin_iphi, cos_iphi ); 3515 3516 if(theta!=0){ 3517 sin_iphi = sin(it)*sin(ip)/sin_newtheta; 3518 cos_iphi = ((cos(it)-cos_newtheta*cos_theta)/(sin_newtheta*sin_theta)); 3519 3520 iphi = atan2( sin_iphi, cos_iphi ); 3521 } 3522 else iphi=ip; 3519 3523 3520 3524 *newphi = phi + iphi; … … 3531 3535 // 3532 3536 // $Log: not supported by cvs2svn $ 3537 // Revision 1.4 2000/01/04 blanch 3538 // Sin(theta) distribution has been implemented in the 3539 // get_new_ct_pointing subroutine. 3540 // 3541 // Revision 1.3 2000/01/03 12:41:26 harald 3542 // There was a small mistake with +/- signs in the prevois versions. This 3543 // line was founded by Jose Carlos. His remark is following: 3544 // 3545 // Look for the comment I include here in this block: you will see that 3546 // now the following expression has a +- sign, where before it was only 3547 // + (or -, I don't remember, but only one) 3548 // 3533 3549 // Revision 1.2 1999/11/01 11:05:54 harald 3534 3550 // Small changes to comile the reflector program under linux.
Note:
See TracChangeset
for help on using the changeset viewer.