54 G4bool lmin =
true, lmax =
true, lval =
true;
57 G4String message =
" The min. value (fMinVal) is negative. : ";
65 G4String message =
" The max. value (fMaxVal) is negative. : ";
81 G4String message =
" 'val' (first argument) is negative : ";
95 G4double logmin = 0., logmax = 0., logval = 0.;
96 if(lmin) logmin = std::log10(
fMinVal);
97 if(lmax) logmax = std::log10(
fMaxVal);
98 if(lval) logval = std::log10(val);
100 if(lmax) value = (logval-logmin)/(logmax-logmin);
102 if(value > 1.) {value=1.;}
103 if(value < 0.) {value=0.;}
106 const int NCOLOR = 6;
110 } colormap[NCOLOR] = {{0.0, {1., 1., 1., 1.}},
111 {0.2, {0., 0., 1., 1.}},
112 {0.4, {0., 1., 1., 1.}},
113 {0.6, {0., 1., 0., 1.}},
114 {0.8, {1., 1., 0., 1.}},
115 {1.0, {1., 0., 0., 1.}}};
118 G4int during[2] = {0, 0};
119 for(
int i = 1; i < NCOLOR; i++) {
120 if(colormap[i].val >= value) {
128 G4double a = std::fabs(value - colormap[during[0]].val);
129 G4double b = std::fabs(value - colormap[during[1]].val);
130 for(
int i = 0; i < 4; i++) {
131 color[i] = (b*colormap[during[0]].rgb[i] + a*colormap[during[1]].rgb[i])
132 /(colormap[during[1]].val - colormap[during[0]].val);
141 G4bool lmin =
true, lmax =
true;
142 if(
fMinVal <= 0.) lmin =
false;
143 if(
fMaxVal <= 0.) lmax =
false;
145 if(lmin) min = std::log10(
fMinVal);
147 if(lmax) max = std::log10(
fMaxVal);
149 G4double smin = -0.89,
smax = smin + 0.05*(_nPoint)*0.83, step=0.001;
152 G4double ra = (y-smin)/(smax-smin), rb = 1.-ra;
156 G4double val = std::pow(10., (ra*max+rb*min)/(ra+rb));
158 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == 0)
return;
159 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == -1.)
continue;
168 G4bool lmin =
true, lmax =
true;
169 if(
fMinVal <= 0.) lmin =
false;
170 if(
fMaxVal <= 0.) lmax =
false;
173 if(lmin) min = std::log10(
fMinVal);
178 if(lmax) max = std::log10(
fMaxVal);
184 for(
int n = 0;
n < _nPoint;
n++) {
189 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == 0)
return;
190 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == -1.)
continue;
193 for(
int l = 0; l < 21; l++) {
195 line.push_back(
G4Point3D(-0.908, -0.905+0.05*
n+0.002*l, 0.));
196 line.push_back(
G4Point3D(-0.705, -0.905+0.05*
n+0.002*l, 0.));
205 std::ostringstream oss;
206 oss << std::setw(8) << std::setprecision(1) << std::scientific << std::pow(10., v);
207 std::string str = oss.str();
211 text.SetScreenSize(size);
215 text.SetVisAttributes(&att);
225 for(
int l = 0; l < 22; l++) {
227 line.push_back(
G4Point3D(-0.9, -0.965+0.002*l, 0.));
228 line.push_back(
G4Point3D(-0.9+0.025*lpsname, -0.965+0.002*l, 0.));
250 for(
int l = 0; l < 21; l++) {
252 line.push_back(
G4Point3D(-0.7, -0.9+0.002*l, 0.));
253 line.push_back(
G4Point3D(-0.7+0.3, -0.9+0.002*l, 0.));
G4VVisManager * fVisManager
static G4String ConvertToString(G4bool boolVal)
HepGeom::Point3D< G4double > G4Point3D
virtual void GetMapColor(G4double val, G4double color[4])
virtual ~G4ScoreLogColorMap()
virtual void DrawColorChartBar(G4int nPoint)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetVisAttributes(const G4VisAttributes *)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
const XML_Char int const XML_Char * value
virtual void DrawColorChartText(G4int nPoint)
virtual void Draw2D(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
G4ScoreLogColorMap(G4String mName)
void SetScreenSize(G4double)