106 for(iMat=0;iMat<numOfCouples;iMat++)
115 if(iMat == numOfCouples)
117 G4Exception(
"G4ForwardXrayTR::G4ForwardXrayTR",
"ForwardXrayTR01",
JustWarning,
"Invalid first material name in G4ForwardXrayTR constructor!");
122 for(iMat=0;iMat<numOfCouples;iMat++)
131 if(iMat == numOfCouples)
133 G4Exception(
"G4ForwardXrayTR::G4ForwardXrayTR",
"ForwardXrayTR02",
JustWarning,
"Invalid second material name in G4ForwardXrayTR constructor!");
190 G4int iMat, jMat, iTkin, iTR, iPlace;
201 for(iMat=0;iMat<numOfCouples;iMat++)
205 for(jMat=0;jMat<numOfCouples;jMat++)
241 for(iTkin=0;iTkin<
fTotBin;iTkin++)
275 for(iTR=
fBinTR-2;iTR>=0;iTR--)
283 energyVector->
PutValue(iTR,energySum);
284 angleVector ->
PutValue(iTR,angleSum);
290 iPlace = fTotBin+iTkin;
319 G4double formationLength1, formationLength2;
320 formationLength1 = 1.0/
324 formationLength2 = 1.0/
328 return (varAngle/energy)*(formationLength1 - formationLength2)
329 *(formationLength1 - formationLength2);
355 cof1 = c*c*(0.5/(a2*(x2 +a2)) +0.5*std::log(x2/(x2 +a2))/a4);
356 cof3 = d*d*(0.5/(b2*(x2 +b2)) +0.5*std::log(x2/(x2 +b2))/b4);
357 cof2 = -c*d*(std::log(x2/(x2 +b2))/b2 - std::log(x2/(x2 +a2))/a2)/(a2 - b2) ;
358 return -varAngle*(cof1 + cof2 + cof3);
385 G4double h , sumEven = 0.0 , sumOdd = 0.0;
391 varAngle1 + (2*i - 1)*h );
394 varAngle1 + (2*fSympsonNumber - 1)*h );
398 + 4.0*sumOdd + 2.0*sumEven )/3.0;
415 return ( (a + b)*std::log((x + b)/(x + a))/(a -
b)
416 + a/(x + a) + b/(x +
b) )/
energy;
444 G4double h , sumEven = 0.0 , sumOdd = 0.0;
456 + 4.0*sumOdd + 2.0*sumEven )/3.0;
470 G4int iMat, jMat, iTkin, iPlace, numOfTR, iTR, iTransfer;
490 GetLogicalVolume()->GetMaterialCutsCouple();
492 GetLogicalVolume()->GetMaterialCutsCouple();
527 G4double TkinScaled = kinEnergy*massRatio;
528 for(iTkin=0;iTkin<
fTotBin;iTkin++)
530 if(TkinScaled < fProtonEnergyVector->GetLowEdgeEnergy(iTkin))
537 iPlace = fTotBin + iTkin - 1;
570 for(iTR=0;iTR<numOfTR;iTR++)
572 energyPos = (*(*fEnergyDistrTable)(iPlace))(0)*
G4UniformRand();
573 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
577 energyTR = (*fEnergyDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer);
581 kinEnergy -= energyTR;
584 anglePos = (*(*fAngleDistrTable)(iPlace))(0)*
G4UniformRand();
585 for(iTransfer=0;iTransfer<fBinTR-1;iTransfer++)
589 theta = std::sqrt((*
fAngleDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer-1));
594 dirX = std::sin(theta)*std::cos(phi) ;
595 dirY = std::sin(theta)*std::sin(phi) ;
596 dirZ = std::cos(theta) ;
617 W1 = (E2 - TkinScaled)*W;
618 W2 = (TkinScaled - E1)*W;
640 for(iTR=0;iTR<numOfTR;iTR++)
642 energyPos = ((*(*fEnergyDistrTable)(iPlace))(0)*W1+
644 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
649 energyTR = ((*fEnergyDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer))*W1+
654 kinEnergy -= energyTR;
657 anglePos = ((*(*fAngleDistrTable)(iPlace))(0)*W1+
659 for(iTransfer=0;iTransfer<fBinTR-1;iTransfer++)
665 GetLowEdgeEnergy(iTransfer-1))*W1+
667 GetLowEdgeEnergy(iTransfer-1))*W2);
672 dirX = std::sin(theta)*std::cos(phi) ;
673 dirY = std::sin(theta)*std::sin(phi) ;
674 dirZ = std::cos(theta) ;
697 G4int iPlace, numOfTR, iTR, iTransfer;
728 iPlace = (iMat*(numOfCouples - 1) + jMat)*
fTotBin + iTkin - 1;
732 iPlace = (iMat*(numOfCouples - 1) + jMat - 1)*
fTotBin + iTkin - 1;
739 numOfTR =
G4Poisson( (*energyVector1)(0) );
746 for(iTR=0;iTR<numOfTR;iTR++)
749 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
751 if(energyPos >= (*energyVector1)(iTransfer))
break;
767 numOfTR =
G4Poisson( (*energyVector1)(0)*W1 +
768 (*energyVector2)(0)*W2 );
775 G4cout<<
"It is still OK in GetEnergyTR(int,int,int)"<<
G4endl;
776 for(iTR=0;iTR<numOfTR;iTR++)
778 energyPos = ((*energyVector1)(0)*W1+
780 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
782 if(energyPos >= ((*energyVector1)(iTransfer)*W1+
783 (*energyVector2)(iTransfer)*W2))
break;
786 (energyVector2->GetLowEdgeEnergy(iTransfer))*W2;