60 gPad->Range(0, 0, 1 ,1);
62 fXmax = h2->GetNbinsX() - 1;
64 fYmax = h2->GetNbinsY() - 1;
66 fMaximumXScreenResolution =
bs;
68 for (i = 0;i <= fXmax; i++) {
69 for (
j = 0;
j <= fYmax;
j++) {
70 val = h2->GetBinContent(i + 1,
j + 1);
71 if (val > fZmax) fZmax = val;
75 fBx1 =
gPad->XtoPixel(0.1);
76 fBx2 =
gPad->XtoPixel(0.99);
77 fBy1 =
gPad->YtoPixel(0.99);
78 fBy2 =
gPad->YtoPixel(0.05);
80 fModeGroup = kModeGroupLightHeight;
82 fDisplayMode = kDisplayModeSurface;
84 fZscale = kZScaleLinear;
86 fNodesx = fXmax-fXmin+1;
87 fNodesy = fYmax-fYmin+1;
115 fColorAlg = kColorAlgRgbSmooth;
137 fShadow = kShadowsNotPainted;
146 fBezier = kNoBezierInterpol;
152 fPenDash = kPenStyleSolid;
154 fChanmarkEnDis = kChannelMarksNotDrawn;
156 fChanmarkColor =
kBlue;
159 fChanmarkStyle = kChannelMarksStyleDot;
161 fChanlineEnDis = kChannelGridNotDrawn;
163 fChanlineColor =
kRed;
165 fEnvelope =
new Short_t [fMaximumXScreenResolution];
166 fEnvelopeContour =
new Short_t [fMaximumXScreenResolution];
167 for (i=0;i<fMaximumXScreenResolution;i++) {
169 fEnvelopeContour[i] = fBy2;
181 for (
int i=0; i<256; i++) {
216 if (
zf>=1.0)
zf = log(
zf);
249 Double_t da,
db,
dc=0,dd,
dl,dm,
dn,
xtaz,
ytaz,
ztaz,
v=0,
v1;
254 if (
z1>900)
z1 = 900;
256 if (
z2>900)
z2 = 900;
258 if (
z3>900)
z3 = 900;
269 if ((i==1)||(i==3)) {
484 else if (
iv>255)
iv = 255;
757 for (
j=i+1;
j<=3;
j++)
a =
a*
j;
758 for (
j=1;
j<=3-i;
j++)
a =
a/
j;
1087 Int_t krok,xi,
yi,
xj,
yj,
a,
b,as,
bs,
pr,
ae,
be;
1151 for (
a=xi;
a<=
xj;
a++) {
1157 for (
a=
xj;
a<=xi;
a++) {
1588 Int_t q1=0,
q2=0,
qv=0,
smer=0,
flag=0,i=0,
j=0,
x1=0,
y1=0,
x2=0,
y2=0,
x3=0,
y3=0,
x4=0,
y4=0,
uhl=0,
xp1=0,
yp1=0,
xp2=0,
yp2=0;
1589 Int_t ix5,
iy5,
x6,
y6,
x7,
y7,
y8,
x1d,
y1d,
x2d=0,
y2d=0;
1592 Double_t dx1,
dx2,
dx3,
dx4,
dy1,
dy2,
dy3,
dy4,
z1,
z2,
z3,
z4,
zl,
zh;
1595 Int_t iv=0,
ekv,
stvor,
sx1,
sx2,
sx3,
sx4,
sx5,
sy1,
sy2,
sy3,
sy4,
sy5;
1600 Double_t v1=0,
v2=0,
v3=0,
v4=0,
dxr1,
dxr2,
dyr1,
dyr2,
zr1,
zr2,
bezf;
1601 Double_t dcount_reg,
z1l,
z2l,
z3l,
z4l,
sdx2p,
sdy2p,
dap,
dbp,
dcp,
ddp;
1621 printf(
"The canvas size exceed the maximum X screen resolution.\n");
1622 printf(
"Use the option bf() to increase the buffer size (it should be greater than %d).\n",
fBx2);
1658 beta = (
fBeta*3.1415927)/180;
1691 mz =
mz/((zmax-zmin)*(cos(
alfa)+cos(beta)));
1699 if (zmin>=1) zmin = log(zmin);
1701 if (zmax>=1) zmax = log(zmax);
1703 if ((zmax-zmin)<0.000001) zmax = zmin+0.000001;
1705 mz =
mz/((zmax-zmin)*(cos(
alfa)+cos(beta)));
1713 if (zmin>=1) zmin = sqrt(zmin);
1715 if (zmax>=1) zmax = sqrt(zmax);
1717 if ((zmax-zmin)<0.000001) zmax = zmin+0.000001;
1719 mz =
mz/((zmax-zmin)*(cos(
alfa)+cos(beta)));
1791 nbins, binWidth,
" ");
1792 for (i = 0; i < nbins + 1; i++) {
1815 nbins, binWidth,
" ");
1816 for (i = 0; i < nbins + 1; i++) {
1839 nbins, binWidth,
" ");
1840 for (i = 0; i < nbins + 1; i++) {
1863 nbins, binWidth,
" ");
1864 for (i = 0; i < nbins + 1; i++) {
3167 if (
fZ>=1.0)
fZ = log(
fZ);
5100 box->SetFillStyle(1001);
6855 static char chopt[10] =
"";
6893 a1->SetLabelOffset(
a1->GetLabelOffset()-
a1->GetTickSize());
6943 a1->SetLabelOffset(
a1->GetLabelOffset()-
a1->GetTickSize());
6993 a1->SetLabelOffset(
a1->GetLabelOffset()-
a1->GetTickSize());
7043 a1->SetLabelOffset(
a1->GetLabelOffset()-
a1->GetTickSize());
7178 if (
x>=0&&
y>=0&&z>=0) {
7231 if (weight>=0&&weight<=1)
fLHweight = weight;
7681 sp.SetPenAttr(h2->GetLineColor(), h2->GetLineStyle(), h2->GetLineWidth());
7695 printf(
"PaintSpectrum: Display modes groups should be in the [0,3] range\n");
7700 printf(
"PaintSpectrum: Display modes should be in the [1,11] range\n");
7703 sp.SetDisplayMode(
i1,
i2);
7706 }
else if (
token==
"pa") {
7713 }
else if (
token==
"n") {
7719 }
else if (
token==
"ca") {
7722 printf(
"PaintSpectrum: Color Algorithm should be in the [0,9] range\n");
7725 sp.SetColorAlgorithm(
i1);
7728 }
else if (
token==
"zs") {
7731 printf(
"PaintSpectrum: Z-Scale should be in the [0,2] range\n");
7737 }
else if (
token==
"ci") {
7741 sp.SetColorIncrements(
f1, f2, f3);
7744 }
else if (
token==
"lhw") {
7746 sp.SetLightHeightWeight(
f1);
7749 }
else if (
token==
"lp") {
7756 }
else if (
token==
"cw") {
7758 sp.SetContourWidth(
i1);
7761 }
else if (
token==
"b") {
7764 printf(
"PaintSpectrum: Bezier should be in the [0,1] range\n");
7770 }
else if (
token==
"s") {
7773 printf(
"PaintSpectrum: Shading should be in the [0,1] range\n");
7778 printf(
"PaintSpectrum: Shadow should be in the [0,1] range\n");
7784 }
else if (
token==
"cm") {
7793 }
else if (
token==
"cg") {
7806 }
else if (
token==
"bf") {
7813 if (!
token.IsNull()) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char mx
Option_t Option_t TPoint TPoint const char y1
virtual Int_t GetNdivisions() const
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void ResetAttLine(Option_t *option="")
Reset this line attributes to default values.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Int_t GetLast() const
Return last bin on the axis i.e.
Int_t GetFirst() const
Return first bin on the axis i.e.
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
virtual void PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Double_t &wmin, Double_t &wmax, Int_t &ndiv, Option_t *chopt="", Double_t gridlength=0, Bool_t drawGridOnly=kFALSE)
Control function to draw an axis.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
Service class for 2-D histogram classes.
Double_t GetBinContent(Int_t binx, Int_t biny) const override
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
Use the TLine constructor to create a simple line.
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
The TNamed class is the base class for all named ROOT classes.
<div class="legacybox"><h2>Legacy Code</h2> TSpectrum2Painter is a legacy interface: there will be no...
void GetZScale(Int_t &scale)
Gets z-axis scale:
void SetColorIncrements(Double_t r, Double_t g, Double_t b)
Sets color increments between two color levels for r, g, b components:
void ColorModel(unsigned ui, unsigned ui1, unsigned ui2, unsigned ui3)
This function calculates color for one palette entry given by function parameter ui.
void GetLightPosition(Int_t &x, Int_t &y, Int_t &z)
Gets position of fictive light source in 3D space:
void CopyEnvelope(Double_t xr, Double_t xs, Double_t yr, Double_t ys)
Copies envelope vector, which ensures hidden surface removal for the contours display mode.
Double_t BezierBlend(Int_t i, Double_t bezf)
This function calculates Bezier approximation.
void BezierSmoothing(Double_t bezf)
Calculates screen coordinates of the smoothed point.
Int_t BezC(Int_t i)
This function is called from BezierBlend function.
void DrawMarker(Int_t x, Int_t y, Int_t w, Int_t h, Int_t type)
Draws channel mark at the screen coordinates x, y.
Double_t ColorCalculation(Double_t dx1, Double_t dy1, Double_t z1, Double_t dx2, Double_t dy2, Double_t z2, Double_t dx3, Double_t dy3, Double_t z3)
Calculates and returns color value for the surface triangle given by function parameters: -dx1,...
void SetNodes(Int_t nodesx, Int_t nodesy)
Sets nodes in both directions:
void SetPenAttr(Int_t color, Int_t style, Int_t width)
Sets pen attributes:
void SetDisplayMode(Int_t modeGroup, Int_t displayMode)
Sets display group mode and display mode:
void GetContourWidth(Int_t &width)
Gets width between horizontal slices:
void SetLightPosition(Int_t x, Int_t y, Int_t z)
Sets position of fictive light source in 3D space:
Int_t fNewColorIndex
buffers' size
void GetDisplayMode(Int_t &modeGroup, Int_t &displayMode)
Gets display group mode and display mode: -modeGroup - the following group modes might have been set:...
void GetNodes(Int_t &nodesx, Int_t &nodesy)
Gets nodes in both directions:
void GetPenAttr(Int_t &color, Int_t &style, Int_t &width)
Gets pen attributes: -color - color of spectrum -style - style of pen (solid, dash,...
void GetBezier(Int_t &bezier)
Gets Bezier smoothing switch:
void EnvelopeBars(Int_t x1, Int_t y1, Int_t x2, Int_t y2)
Ensures hidden surface removal for Bars, BarsX and BarsY display modes.
void GetLightHeightWeight(Double_t &weight)
Gets weight between shading according to fictive light source and according to channels counts:
void SetAngles(Int_t alpha, Int_t beta, Int_t view)
Sets angles of the view:
void SetZScale(Int_t scale)
Sets z-axis scale:
void Paint(Option_t *option) override
Paints histogram according to preset parameters.
void Slice(Double_t xr, Double_t yr, Double_t xs, Double_t ys, TLine *line)
Calculates screen coordinates of the line given by two nodes for contours display mode.
void GetColorAlgorithm(Int_t &colorAlgorithm)
Gets shading color algorithm:
@ kChannelMarksStyleCross
@ kChannelMarksStyleTriangle
@ kChannelMarksStyleDiamond
@ kChannelMarksStyleRectangle
static void PaintSpectrum(TH2 *h2, Option_t *option="", Int_t bs=1600)
This function allows to set all the possible options available in TSpectrum2Painter and paint "h2".
Short_t * fEnvelopeContour
void SetChanGrid(Int_t enable, Int_t color)
This function sets enables/disables drawing of channel grid and sets its color: -enable - decides whe...
void GetChanGrid(Int_t &enable, Int_t &color)
This function gets attributes for drawing channel:
void SetLightHeightWeight(Double_t weight)
Sets weight between shading according to fictive light source and according to channels counts:
void SetContourWidth(Int_t width)
Sets width between horizontal slices:
void SetColorAlgorithm(Int_t colorAlgorithm)
Sets shading color algorithm:
void SetShading(Int_t shading, Int_t shadow)
Sets on/off shading and shadow switches:
void GetChanMarks(Int_t &enable, Int_t &color, Int_t &width, Int_t &height, Int_t &style)
Gets drawing attributes for channel marks:
void Envelope(Int_t x1, Int_t y1, Int_t x2, Int_t y2)
Ensures hidden surface removal.
void SetBezier(Int_t bezier)
Sets on/off Bezier smoothing:
void Transform(Int_t it, Int_t jt, Int_t zmt)
Reads out the value from histogram and calculates screen coordinates.
void GetColorIncrements(Double_t &r, Double_t &g, Double_t &b)
Gets color increments between two color levels for r, g, b components:
void SetChanMarks(Int_t enable, Int_t color, Int_t width, Int_t height, Int_t style)
Sets enables/disables drawing of channel marks and sets their attributes:
void GetAngles(Int_t &alpha, Int_t &beta, Int_t &view)
Gets angles of the view:
~TSpectrum2Painter() override
TSpectrum2Painter destructor.
Int_t fMaximumXScreenResolution
Double_t ShadowColorCalculation(Double_t xtaz, Double_t ytaz, Double_t ztaz, Double_t shad_noise)
Determines whether the center of the triangle in 3-d space given by function parameters:
void GetShading(Int_t &shading, Int_t &shadow)
Gets shading and shadow switches:
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.