Skip to content

Commit

Permalink
fix missing unit conversion factors
Browse files Browse the repository at this point in the history
  • Loading branch information
atolosadelgado authored and andresailer committed May 13, 2024
1 parent 5344e6f commit 372f09b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DDRec/include/DDRec/DCH_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ struct DCH_info_struct

/// tan(stereoangle) = R(z=0) / (L/2) * tan( twist_angle/2)
DCH_angle_t stereoangle_z0(DCH_length_t r_z0) const {
return atan( r_z0/Lhalf*tan(twist_angle/2));
return atan( r_z0/Lhalf*tan(twist_angle/2/dd4hep::rad));
}

/// tan(stereoangle) = R(z=L/2) / (L/2) * sin( twist_angle/2)
DCH_angle_t stereoangle_zLhalf(DCH_length_t r_zLhalf) const {
return atan( r_zLhalf/Lhalf*sin(twist_angle/2));
return atan( r_zLhalf/Lhalf*sin(twist_angle/2/dd4hep::rad));
}

/// WireLength = 2*dch_Lhalf/cos(atan(Pitch_z0(r_z0)/(2*dch_Lhalf)))/cos(stereoangle_z0(r_z0))
DCH_length_t WireLength(int nlayer, DCH_length_t r_z0) const {
auto Pitch_z0 = database.at(nlayer).Pitch_z0(r_z0);
return 2*Lhalf/cos(atan(Pitch_z0/(2*Lhalf)))/cos(stereoangle_z0(r_z0)) ;
return 2*Lhalf/cos(atan(Pitch_z0/(2*Lhalf)))/cos(stereoangle_z0(r_z0)/dd4hep::rad) ;
};

/// Internal helper struct for defining the layer layout
Expand Down

0 comments on commit 372f09b

Please sign in to comment.