Import Geant4 7.0.0 source tree
This commit is contained in:
@@ -179,7 +179,7 @@ G4LogicalVolume* CCalG4Ecal::constructGlobal() {
|
||||
for (i = 0; i < getLayNum(); i++) {
|
||||
angle = 0.5 * getLayAngle() * (2*i + 1 - getLayNum());
|
||||
xp = angle * (getLayPar(4) + getLayRadius()) * mm;
|
||||
zp = (zshift + getLayPar(0)*abs(sin(angle))) * mm;
|
||||
zp = (zshift + getLayPar(0)*std::abs(std::sin(angle))) * mm;
|
||||
rotstr = idName + "Layer" + i;
|
||||
rot = rotfact->findMatrix(rotstr);
|
||||
if (!rot) {
|
||||
@@ -218,7 +218,7 @@ G4LogicalVolume* CCalG4Ecal::constructGlobal() {
|
||||
for (i = 0; i < getCrystNum(); i++) {
|
||||
angle = 0.5 * getLayAngle() * (2*i + 1 - getCrystNum());
|
||||
yp = angle * (getCrystPar(4) + getLayRadius()) * mm;
|
||||
zp = (getCrystPar(0)*abs(sin(angle)) - getCrystTol()) * mm;
|
||||
zp = (getCrystPar(0)*std::abs(std::sin(angle)) - getCrystTol()) * mm;
|
||||
rotstr = idName + "Crystal" + i;
|
||||
rot = rotfact->findMatrix(rotstr);
|
||||
if (!rot) {
|
||||
|
||||
@@ -388,7 +388,7 @@ void CCalMaterialFactory::readMaterials(std::ifstream& is){
|
||||
<< G4endl;
|
||||
#endif
|
||||
|
||||
G4int absnelem = abs(nElem);
|
||||
G4int absnelem = std::abs(nElem);
|
||||
|
||||
G4String* mats = new G4String[absnelem];
|
||||
G4double* weights = new G4double[absnelem];
|
||||
@@ -398,7 +398,7 @@ void CCalMaterialFactory::readMaterials(std::ifstream& is){
|
||||
readName(is, name);
|
||||
is >> prop >> jump;
|
||||
mats[i]=name;
|
||||
weights[i]=abs(prop);
|
||||
weights[i]=std::abs(prop);
|
||||
} //for...
|
||||
MatDescription md;
|
||||
if (nElem>0 && prop<0)
|
||||
|
||||
@@ -89,10 +89,10 @@ void CCalPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) {
|
||||
|
||||
G4double eta = RandFlat::shoot(etaMin,etaMax);
|
||||
G4double phi = RandFlat::shoot(phiMin,phiMax);
|
||||
G4double theta = atan(exp(-eta))*2.;
|
||||
G4double randomX = sin(theta)*cos(phi);
|
||||
G4double randomY = sin(theta)*sin(phi);
|
||||
G4double randomZ = cos(theta);
|
||||
G4double theta = std::atan(std::exp(-eta))*2.;
|
||||
G4double randomX = std::sin(theta)*std::cos(phi);
|
||||
G4double randomY = std::sin(theta)*std::sin(phi);
|
||||
G4double randomZ = std::cos(theta);
|
||||
|
||||
particleDir = G4ThreeVector(randomX,randomY,randomZ);
|
||||
particleGun->SetParticleMomentumDirection(particleDir);
|
||||
@@ -134,11 +134,11 @@ void CCalPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) {
|
||||
} else {
|
||||
phiValue += scanPhiStep;
|
||||
}
|
||||
G4double theta = atan(exp(-etaValue))*2.;
|
||||
G4double theta = std::atan(std::exp(-etaValue))*2.;
|
||||
|
||||
G4double scanX = sin(theta)*cos(phiValue);
|
||||
G4double scanY = sin(theta)*sin(phiValue);
|
||||
G4double scanZ = cos(theta);
|
||||
G4double scanX = std::sin(theta)*std::cos(phiValue);
|
||||
G4double scanY = std::sin(theta)*std::sin(phiValue);
|
||||
G4double scanZ = std::cos(theta);
|
||||
if (verboseLevel >= 2 ) {
|
||||
G4cout << "Scan eta " << etaValue << " Phi " << phiValue/deg
|
||||
<< " theta " << theta/deg << G4endl;
|
||||
@@ -226,12 +226,12 @@ void CCalPrimaryGeneratorAction::SetMaximumEnergy(G4double p){
|
||||
|
||||
void CCalPrimaryGeneratorAction::SetMinimumPhi(G4double p){
|
||||
|
||||
if (fabs(p)>2.*pi) {
|
||||
if (std::fabs(p)>2.*pi) {
|
||||
G4cerr << "CCalPrimaryGeneratorAction::SetMinimumPhi: setting value quite "
|
||||
<< "large" << G4endl;
|
||||
G4cerr << " Should be given in radians - Please check" << G4endl;
|
||||
} else {
|
||||
phiMin = fabs(p);
|
||||
phiMin = std::fabs(p);
|
||||
#ifdef debug
|
||||
if (verboseLevel >= 1 ) {
|
||||
G4cout << " CCalPrimaryGeneratorAction: setting min. value of phi to "
|
||||
@@ -244,12 +244,12 @@ void CCalPrimaryGeneratorAction::SetMinimumPhi(G4double p){
|
||||
|
||||
void CCalPrimaryGeneratorAction::SetMaximumPhi(G4double p){
|
||||
|
||||
if (fabs(p)>2.*pi) {
|
||||
if (std::fabs(p)>2.*pi) {
|
||||
G4cerr << "CCalPrimaryGeneratorAction::SetMaximumPhi: setting value quite "
|
||||
<< "large" << G4endl;
|
||||
G4cerr << " Should be given in radians - Please check" << G4endl;
|
||||
} else {
|
||||
phiMax = fabs(p);
|
||||
phiMax = std::fabs(p);
|
||||
#ifdef debug
|
||||
if (verboseLevel >= 1 ) {
|
||||
G4cout << " CCalPrimaryGeneratorAction: setting max. value of phi to "
|
||||
|
||||
@@ -118,7 +118,7 @@ G4RotationMatrix* CCalRotationMatrixFactory::AddMatrix(const G4String& name,
|
||||
} else if (TH1 == 270.0 || TH1 == -90.0) {
|
||||
sinth1 = -1.0; costh1 = 0.0;
|
||||
} else {
|
||||
sinth1 = sin(th1); costh1 = cos(th1);
|
||||
sinth1 = std::sin(th1); costh1 = std::cos(th1);
|
||||
}
|
||||
|
||||
if (TH2 == 0.0 || TH2 == 360) {
|
||||
@@ -130,7 +130,7 @@ G4RotationMatrix* CCalRotationMatrixFactory::AddMatrix(const G4String& name,
|
||||
} else if (TH2 == 270.0 || TH2 == -90.0) {
|
||||
sinth2 = -1.0; costh2 = 0.0;
|
||||
} else {
|
||||
sinth2 = sin(th2); costh2 = cos(th2);
|
||||
sinth2 = std::sin(th2); costh2 = std::cos(th2);
|
||||
}
|
||||
|
||||
if (TH3 == 0.0 || TH3 == 360) {
|
||||
@@ -142,7 +142,7 @@ G4RotationMatrix* CCalRotationMatrixFactory::AddMatrix(const G4String& name,
|
||||
} else if (TH3 == 270.0 || TH3 == -90.0) {
|
||||
sinth3 = -1.0; costh3 = 0.0;
|
||||
} else {
|
||||
sinth3 = sin(th3); costh3 = cos(th3);
|
||||
sinth3 = std::sin(th3); costh3 = std::cos(th3);
|
||||
}
|
||||
|
||||
if (PH1 == 0.0 || PH1 == 360) {
|
||||
@@ -154,7 +154,7 @@ G4RotationMatrix* CCalRotationMatrixFactory::AddMatrix(const G4String& name,
|
||||
} else if (PH1 == 270.0 || PH1 == -90.0) {
|
||||
sinph1 = -1.0; cosph1 = 0.0;
|
||||
} else {
|
||||
sinph1 = sin(phi1); cosph1 = cos(phi1);
|
||||
sinph1 = std::sin(phi1); cosph1 = std::cos(phi1);
|
||||
}
|
||||
|
||||
if (PH2 == 0.0 || PH2 == 360) {
|
||||
@@ -166,7 +166,7 @@ G4RotationMatrix* CCalRotationMatrixFactory::AddMatrix(const G4String& name,
|
||||
} else if (PH2 == 270.0 || PH2 == -90.0) {
|
||||
sinph2 = -1.0; cosph2 = 0.0;
|
||||
} else {
|
||||
sinph2 = sin(phi2); cosph2 = cos(phi2);
|
||||
sinph2 = std::sin(phi2); cosph2 = std::cos(phi2);
|
||||
}
|
||||
|
||||
if (PH3 == 0.0 || PH3 == 360) {
|
||||
@@ -178,7 +178,7 @@ G4RotationMatrix* CCalRotationMatrixFactory::AddMatrix(const G4String& name,
|
||||
} else if (PH3 == 270.0 || PH3 == -90.0) {
|
||||
sinph3 = -1.0; cosph3 = 0.0;
|
||||
} else {
|
||||
sinph3 = sin(phi3); cosph3 = cos(phi3);
|
||||
sinph3 = std::sin(phi3); cosph3 = std::cos(phi3);
|
||||
}
|
||||
|
||||
//xprime axis coordinates
|
||||
|
||||
@@ -72,7 +72,7 @@ void CCalSteppingAction::UserSteppingAction(const G4Step* aStep){
|
||||
PreStepPoint->GetPosition());
|
||||
// Because the beam axis has been defined as the x-axis,
|
||||
// the lateral displacement is given in terms of the y and z positions.
|
||||
double perp = sqrt(HitPoint.y()*HitPoint.y()+HitPoint.z()*HitPoint.z());
|
||||
double perp = std::sqrt(HitPoint.y()*HitPoint.y()+HitPoint.z()*HitPoint.z());
|
||||
int radialPosition = std::min(69,int(perp/cm));
|
||||
LateralProfile[radialPosition] += aStep->GetTotalEnergyDeposit() / GeV;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user