54 G4bool lmin =
true, lmax =
true, lval =
true;
95 G4double logmin = 0., logmax = 0., logval = 0.;
100 if(lmax) logmax = std::log10(
fMaxVal);
101 if(lval) logval = std::log10(val);
103 if(lmax) value = (logval-logmin)/(logmax-logmin);
105 if(value > 1.) {value=1.;}
106 if(value < 0.) {value=0.;}
109 const int NCOLOR = 6;
113 } colormap[] = {{0.0, {1., 1., 1., 1.}},
114 {0.2, {0., 0., 1., 1.}},
115 {0.4, {0., 1., 1., 1.}},
116 {0.6, {0., 1., 0., 1.}},
117 {0.8, {1., 1., 0., 1.}},
118 {1.0, {1., 0., 0., 1.}}};
121 G4int during[2] = {0, 0};
122 for(
int i = 1; i < NCOLOR; i++) {
123 if(colormap[i].val >= value) {
131 G4double a = std::fabs(value - colormap[during[0]].val);
132 G4double b = std::fabs(value - colormap[during[1]].val);
133 for(
int i = 0; i < 4; i++) {
134 color[i] = (b*colormap[during[0]].rgb[i] + a*colormap[during[1]].rgb[i])
135 /(colormap[during[1]].val - colormap[during[0]].val);
136 if(color[i] > 1.) color[i] = 1.;
145 G4bool lmin =
true, lmax =
true;
146 if(
fMinVal <= 0.) lmin =
false;
147 if(
fMaxVal <= 0.) lmax =
false;
149 if(lmin) min = std::log10(
fMinVal);
151 if(lmax) max = std::log10(
fMaxVal);
153 G4double smin = -0.89,
smax = smin + 0.05*(_nPoint)*0.83, step=0.001;
156 G4double ra = (
y-smin)/(smax-smin), rb = 1.-ra;
160 G4double val = std::pow(10., (ra*max+rb*min)/(ra+rb));
162 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == 0)
return;
163 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == -1.)
continue;
172 G4bool lmin =
true, lmax =
true;
173 if(
fMinVal <= 0.) lmin =
false;
174 if(
fMaxVal <= 0.) lmax =
false;
177 if(lmin) min = std::log10(
fMinVal);
182 if(lmax) max = std::log10(
fMaxVal);
188 for(
int n = 0;
n < _nPoint;
n++) {
193 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == 0)
return;
194 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == -1.)
continue;
197 for(
int l = 0; l < 21; l++) {
199 line.push_back(
G4Point3D(-0.908, -0.905+0.05*
n+0.002*l, 0.));
200 line.push_back(
G4Point3D(-0.705, -0.905+0.05*
n+0.002*l, 0.));
209 std::ostringstream oss;
210 oss << std::setw(8) << std::setprecision(1) << std::scientific << std::pow(10., v);
211 std::string str = oss.str();
229 for(
int l = 0; l < 22; l++) {
231 line.push_back(
G4Point3D(-0.9, -0.965+0.002*l, 0.));
232 line.push_back(
G4Point3D(-0.9+0.025*lpsname, -0.965+0.002*l, 0.));
254 for(
int l = 0; l < 21; l++) {
256 line.push_back(
G4Point3D(-0.7, -0.9+0.002*l, 0.));
257 line.push_back(
G4Point3D(-0.7+0.3, -0.9+0.002*l, 0.));
T max(const T t1, const T t2)
brief Return the largest of the two arguments
std::vector< ExP01TrackerHit * > a
virtual void DrawColorChartText(G4int nPoint)
void message(RunManager *runmanager)
G4ScoreLogColorMap(G4String mName)
G4VVisManager * fVisManager
void SetScreenSize(G4double)
virtual void GetMapColor(G4double val, G4double color[4])
const XML_Char int const XML_Char * value
virtual ~G4ScoreLogColorMap()
static G4String ConvertToString(G4bool boolVal)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
virtual void Draw2D(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
HepGeom::Point3D< G4double > G4Point3D
virtual void DrawColorChartBar(G4int nPoint)
void SetVisAttributes(const G4VisAttributes *)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments