Two-dimensional graphics function TSpectrum2Painter is a set of graphical functions developed by Miroslav Morhac to paint 2D-histograms in three dimensions. This package is accessed via THistPainter in a transparent way. For the ROOT user it is enough to use the "SPEC" option to draw a 2D-Histogram. This option offers many functionalities detailed in the header of the PaintSpectrum function. Reference: Morhac M., Kliman J., Matousek V., Turzo I.: Sophisticated visualization algorithms for analysis of multidimensional experimental nuclear data. Acta Pysica Slovaca Vol. 54/ 4 (2004), pp. 385-400.
virtual | ~TSpectrum2Painter() |
void | TObject::AbstractMethod(const char* method) const |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TNamed::Clear(Option_t* option = "") |
virtual TObject* | TNamed::Clone(const char* newname = "") const |
virtual Int_t | TNamed::Compare(const TObject* obj) const |
virtual void | TNamed::Copy(TObject& named) const |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual void | TNamed::FillBuffer(char*& buffer) |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
void | GetAngles(Int_t& alpha, Int_t& beta, Int_t& view) |
void | GetBezier(Int_t& bezier) |
void | GetChanGrid(Int_t& enable, Int_t& color) |
void | GetChanMarks(Int_t& enable, Int_t& color, Int_t& width, Int_t& height, Int_t& style) |
void | GetColorAlgorithm(Int_t& colorAlgorithm) |
void | GetColorIncrements(Double_t& r, Double_t& g, Double_t& b) |
void | GetContourWidth(Int_t& width) |
void | GetDisplayMode(Int_t& modeGroup, Int_t& displayMode) |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
virtual const char* | TObject::GetIconName() const |
void | GetLightHeightWeight(Double_t& weight) |
void | GetLightPosition(Int_t& x, Int_t& y, Int_t& z) |
virtual const char* | TNamed::GetName() const |
void | GetNodes(Int_t& nodesx, Int_t& nodesy) |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
void | GetPenAttr(Int_t& color, Int_t& style, Int_t& width) |
void | GetShading(Int_t& shading, Int_t& shadow) |
virtual const char* | TNamed::GetTitle() const |
virtual UInt_t | TObject::GetUniqueID() const |
void | GetZScale(Int_t& scale) |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TNamed::Hash() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | TObject::IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TNamed::IsSortable() const |
Bool_t | TObject::IsZombie() const |
virtual void | TNamed::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
virtual Bool_t | TObject::Notify() |
void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
void | TObject::operator delete(void* ptr) |
void | TObject::operator delete(void* ptr, void* vp) |
void | TObject::operator delete[](void* ptr) |
void | TObject::operator delete[](void* ptr, void* vp) |
void* | TObject::operator new(size_t sz) |
void* | TObject::operator new(size_t sz, void* vp) |
void* | TObject::operator new[](size_t sz) |
void* | TObject::operator new[](size_t sz, void* vp) |
virtual void | Paint(Option_t* option) |
static void | PaintSpectrum(TH2* h2, Option_t* option = "", Int_t bs = 1600) |
virtual void | TObject::Pop() |
virtual void | TNamed::Print(Option_t* option = "") const |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
void | TObject::ResetBit(UInt_t f) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
void | SetAngles(Int_t alpha, Int_t beta, Int_t view) |
void | SetBezier(Int_t bezier) |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
void | SetChanGrid(Int_t enable, Int_t color) |
void | SetChanMarks(Int_t enable, Int_t color, Int_t width, Int_t height, Int_t style) |
void | SetColorAlgorithm(Int_t colorAlgorithm) |
void | SetColorIncrements(Double_t r, Double_t g, Double_t b) |
void | SetContourWidth(Int_t width) |
void | SetDisplayMode(Int_t modeGroup, Int_t displayMode) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
void | SetLightHeightWeight(Double_t weight) |
void | SetLightPosition(Int_t x, Int_t y, Int_t z) |
virtual void | TNamed::SetName(const char* name)MENU |
virtual void | TNamed::SetNameTitle(const char* name, const char* title) |
void | SetNodes(Int_t nodesx, Int_t nodesy) |
static void | TObject::SetObjectStat(Bool_t stat) |
void | SetPenAttr(Int_t color, Int_t style, Int_t width) |
void | SetShading(Int_t shading, Int_t shadow) |
virtual void | TNamed::SetTitle(const char* title = "")MENU |
virtual void | TObject::SetUniqueID(UInt_t uid) |
void | SetZScale(Int_t scale) |
virtual void | ShowMembers(TMemberInspector& insp) const |
virtual Int_t | TNamed::Sizeof() const |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
TSpectrum2Painter(TH2* h2, Int_t bs) | |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
Int_t | BezC(Int_t i) |
Double_t | BezierBlend(Int_t i, Double_t bezf) |
void | BezierSmoothing(Double_t bezf) |
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) |
void | ColorModel(unsigned int ui, unsigned int ui1, unsigned int ui2, unsigned int ui3) |
void | CopyEnvelope(Double_t xr, Double_t xs, Double_t yr, Double_t ys) |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | DrawMarker(Int_t x, Int_t y, Int_t w, Int_t h, Int_t type) |
void | Envelope(Int_t x1, Int_t y1, Int_t x2, Int_t y2) |
void | EnvelopeBars(Int_t x1, Int_t y1, Int_t x2, Int_t y2) |
void | TObject::MakeZombie() |
Double_t | ShadowColorCalculation(Double_t xtaz, Double_t ytaz, Double_t ztaz, Double_t shad_noise) |
void | Slice(Double_t xr, Double_t yr, Double_t xs, Double_t ys, TLine* line) |
void | Transform(Int_t it, Int_t jt, Int_t zmt) |
TSpectrum2Painter& | operator=(const TSpectrum2Painter&) |
TSpectrum2Painter(const TSpectrum2Painter&) |
static TSpectrum2Painter::<anonymous> | kBezierInterpol | |
static TObject::<anonymous> | TObject::kBitMask | |
static TObject::EStatusBits | TObject::kCanDelete | |
static TObject::EStatusBits | TObject::kCannotPick | |
static TSpectrum2Painter::<anonymous> | kChannelGridDrawn | |
static TSpectrum2Painter::<anonymous> | kChannelGridNotDrawn | |
static TSpectrum2Painter::<anonymous> | kChannelMarksDrawn | |
static TSpectrum2Painter::<anonymous> | kChannelMarksNotDrawn | |
static TSpectrum2Painter::<anonymous> | kChannelMarksStyleCross | |
static TSpectrum2Painter::<anonymous> | kChannelMarksStyleDiamond | |
static TSpectrum2Painter::<anonymous> | kChannelMarksStyleDot | |
static TSpectrum2Painter::<anonymous> | kChannelMarksStyleRectangle | |
static TSpectrum2Painter::<anonymous> | kChannelMarksStyleStar | |
static TSpectrum2Painter::<anonymous> | kChannelMarksStyleTriangle | |
static TSpectrum2Painter::<anonymous> | kChannelMarksStyleX | |
static TSpectrum2Painter::<anonymous> | kColorAlgCieModulo | |
static TSpectrum2Painter::<anonymous> | kColorAlgCieSmooth | |
static TSpectrum2Painter::<anonymous> | kColorAlgCmyModulo | |
static TSpectrum2Painter::<anonymous> | kColorAlgCmySmooth | |
static TSpectrum2Painter::<anonymous> | kColorAlgHvsModulo | |
static TSpectrum2Painter::<anonymous> | kColorAlgHvsSmooth | |
static TSpectrum2Painter::<anonymous> | kColorAlgRgbModulo | |
static TSpectrum2Painter::<anonymous> | kColorAlgRgbSmooth | |
static TSpectrum2Painter::<anonymous> | kColorAlgYiqModulo | |
static TSpectrum2Painter::<anonymous> | kColorAlgYiqSmooth | |
static TSpectrum2Painter::<anonymous> | kDisplayModeBars | |
static TSpectrum2Painter::<anonymous> | kDisplayModeBarsX | |
static TSpectrum2Painter::<anonymous> | kDisplayModeBarsY | |
static TSpectrum2Painter::<anonymous> | kDisplayModeContours | |
static TSpectrum2Painter::<anonymous> | kDisplayModeGrid | |
static TSpectrum2Painter::<anonymous> | kDisplayModeLinesX | |
static TSpectrum2Painter::<anonymous> | kDisplayModeLinesY | |
static TSpectrum2Painter::<anonymous> | kDisplayModeNeedles | |
static TSpectrum2Painter::<anonymous> | kDisplayModePoints | |
static TSpectrum2Painter::<anonymous> | kDisplayModeSurface | |
static TSpectrum2Painter::<anonymous> | kDisplayModeTriangles | |
static TObject::EStatusBits | TObject::kHasUUID | |
static TObject::EStatusBits | TObject::kInvalidObject | |
static TObject::<anonymous> | TObject::kIsOnHeap | |
static TObject::EStatusBits | TObject::kIsReferenced | |
static TSpectrum2Painter::<anonymous> | kModeGroupHeight | |
static TSpectrum2Painter::<anonymous> | kModeGroupLight | |
static TSpectrum2Painter::<anonymous> | kModeGroupLightHeight | |
static TSpectrum2Painter::<anonymous> | kModeGroupSimple | |
static TObject::EStatusBits | TObject::kMustCleanup | |
static TSpectrum2Painter::<anonymous> | kNoBezierInterpol | |
static TObject::EStatusBits | TObject::kNoContextMenu | |
static TObject::<anonymous> | TObject::kNotDeleted | |
static TSpectrum2Painter::<anonymous> | kNotShaded | |
static TObject::EStatusBits | TObject::kObjInCanvas | |
static TObject::<anonymous> | TObject::kOverwrite | |
static TSpectrum2Painter::<anonymous> | kPenStyleDash | |
static TSpectrum2Painter::<anonymous> | kPenStyleDashDot | |
static TSpectrum2Painter::<anonymous> | kPenStyleDot | |
static TSpectrum2Painter::<anonymous> | kPenStyleSolid | |
static TSpectrum2Painter::<anonymous> | kShaded | |
static TSpectrum2Painter::<anonymous> | kShadowsNotPainted | |
static TSpectrum2Painter::<anonymous> | kShadowsPainted | |
static TObject::<anonymous> | TObject::kSingleKey | |
static TObject::<anonymous> | TObject::kWriteDelete | |
static TSpectrum2Painter::<anonymous> | kZScaleLinear | |
static TSpectrum2Painter::<anonymous> | kZScaleLog | |
static TSpectrum2Painter::<anonymous> | kZScaleSqrt | |
static TObject::<anonymous> | TObject::kZombie |
Int_t | fAlpha | angles of display,alfa+beta must be less or equal to 90, alpha- angle between base line of Canvas and right lower edge of picture base plane |
Int_t | fBeta | angle between base line of Canvas and left lower edge of picture base plane |
Int_t | fBezier | determines Bezier interpolation (applies only for simple display modes group for grid, x_lines, y_lines display modes) |
Int_t | fBx1 | positon of picture on Canvas, min x |
Int_t | fBx2 | positon of picture on Canvas, max x |
Int_t | fBy1 | positon of picture on Canvas, min y |
Int_t | fBy2 | positon of picture on Canvas, max y |
Int_t | fBzX[4] | |
Int_t | fBzY[4] | |
Int_t | fChanlineColor | color of channel lines (grid) |
Int_t | fChanlineEnDis | decides whether the channel lines (grid) are shown |
Int_t | fChanmarkColor | color of channel marks |
Int_t | fChanmarkEnDis | decides whether the channel marks are shown |
Int_t | fChanmarkHeight | height of channel marks |
Int_t | fChanmarkStyle | style of channel marks |
Int_t | fChanmarkWidth | width of channel marks |
Int_t | fColorAlg | applies only for rainbowed display modes (rgb smooth alorithm, rgb modulo color component, cmy smooth alorithm, cmy modulo color component, cie smooth alorithm, cie modulo color component, yiq smooth alorithm, yiq modulo color component, hsv smooth alorithm, hsv modulo color component, it does not apply for simple display modes algorithm group |
Int_t | fContWidth | width between contours, applies only for contours display mode |
Int_t | fDisplayMode | spectrum display mode (points, grid, contours, bars, x_lines, y_lines, bars_x, bars_y, needles, surface, triangles) |
Double_t | fDxspline | |
Double_t | fDyspline | |
Short_t* | fEnvelope | ! |
Short_t* | fEnvelopeContour | ! |
Double_t | fGbezx | |
Double_t | fGbezy | |
TH2* | fH2 | pointer to 2D histogram TH2 |
Double_t | fKx | |
Double_t | fKy | |
Double_t | fLHweight | weight between shading according to fictive light source and according to channels counts, applies only for kModeGroupLightHeight modes group |
Int_t | fLevels | # of color levels for rainbowed display modes, it does not apply for simple display modes algorithm group |
Int_t | fLine | |
Int_t | fMaximumXScreenResolution | !buffers' size |
Int_t | fModeGroup | display mode algorithm group (simple modes-kModeGroupSimple, modes with shading according to light-kModeGroupLight, modes with shading according to channels counts-kModeGroupHeight, modes of combination of shading according to light and to channels counts-kModeGroupLightHeight) |
Double_t | fMxx | |
Double_t | fMxy | |
Double_t | fMyx | |
Double_t | fMyy | |
TString | TNamed::fName | object identifier |
TColor* | fNewColor | ! |
Int_t | fNewColorIndex | |
Int_t | fNodesx | number of nodes in x dimension of grid |
Int_t | fNodesy | number of nodes in y dimension of grid |
Double_t | fNuSli | |
Int_t | fPenColor | color of spectrum |
Int_t | fPenDash | style of pen |
Int_t | fPenWidth | width of line |
Double_t | fRainbow1Step | determines the first component step for neighbouring color levels, applies only for rainbowed display modes, it does not apply for simple display modes algorithm group |
Double_t | fRainbow2Step | determines the second component step for neighbouring color levels, applies only for rainbowed display modes, it does not apply for simple display modes algorithm group |
Double_t | fRainbow3Step | determines the third component step for neighbouring color levels, applies only for rainbowed display modes, it does not apply for simple display modes algorithm group |
Int_t | fShading | determines whether the picture will shaded, smoothed (no shading, shading), for rainbowed display modes only |
Int_t | fShadow | determines whether shadow will be drawn (no shadow, shadow), for rainbowed display modes with shading according to light |
TString | TNamed::fTitle | object title |
Double_t | fTxx | |
Double_t | fTxy | |
Double_t | fTyx | |
Double_t | fTyy | |
Double_t | fTyz | |
Int_t | fViewAngle | rotation angle of the view, it can be 0, 90, 180, 270 degrees |
Double_t | fVx | |
Double_t | fVy | |
Int_t | fXe | |
Int_t | fXlight | x position of fictive light source, applies only for rainbowed display modes with shading according to light |
Int_t | fXmax | x-end channel of spectrum |
Int_t | fXmin | x-starting channel of spectrum |
Int_t | fXs | |
Int_t | fXt | |
Int_t | fYe | |
Int_t | fYlight | y position of fictive light source, applies only for rainbowed display modes with shading according to light |
Int_t | fYmax | y-end channel of spectrum |
Int_t | fYmin | y-starting channel of spectrum |
Int_t | fYs | |
Int_t | fYt | |
Double_t | fZ | |
Double_t | fZPresetValue | |
Double_t | fZeq | |
Int_t | fZlight | z position of fictive light source, applies only for rainbowed display modes with shading according to light |
Double_t | fZmax | counts full scale |
Double_t | fZmin | base counts |
Int_t | fZscale | z scale (linear, log, sqrt) |
Reads out the value from histogram and calculates screen coordinates Parameters: -it - node in x- direction -jt - node in y- direction -zmt - control variable
Calculates and returns color value for the surface triangle given by function parameters: -dx1,dy1,z1 coordinates of the first point in 3d space -dx2,dy2,z2 coordinates of the second point in 3d space -dx3,dy3,z3 coordinates of the third point in 3d space
Determines whether the center of the triangle in 3-d space given by function parameters: -xtaz,ytaz,ztaz is in shadow or not. If yes it return 1 otherwise it returns 0.
This function calculates color for one palette entry given by function parameter ui. Other parameters -ui1,ui2,ui3 represent r, g, b color components of the basic pen color.
Calculates screen coordinates of the smoothed point. Parameter bezf changes within the interval 0 to 1 in 0.1 steps.
Ensures hidden surfuce removal for Bars, BarsX and BarsY display modes.
Draws channel mark at the screen coordinates x, y. Width of the mark is w, height is h and the type of the mark is determined by the parameter type.
Calculates screen coordinates of the line given by two nodes for contours display mode. The line is given by two points xr, yr, xs, ys. Finally it draws the line.
Copies envelope vector, which ensures hidden surface removal for the contours display mode.
Paints histogram according to preset parameters.
Simple | Light | Height | Light-Height | |
---|---|---|---|---|
Points | X | X | X | X |
Grid | X | X | X | X |
Contours | X | - | X | - |
Bars | X | - | X | - |
LinesX | X | X | X | X |
LinesY | X | X | X | X |
BarsX | X | - | X | - |
BarsY | X | - | X | - |
Needles | X | - | - | - |
Surface | - | X | X | X |
Triangles | X | X | X | X |
This function controls the display mode group and display mode of the histogram drawing. To illustrate the possible effects of the various display modes we introduce a set of examples. Default values:
Simple modes group, display mode = points, 256 x 256 channels.
Simple modes group, display mode = grid, 64 x 64 channels.
Simple modes group, display mode = contours, 64 x 64 channels.
Simple modes group, display mode = bars, 64 x 64 channels.
Simple modes group, display mode = linesX, 64 x 64 channels.
Simple modes group, display mode = linesY, 64 x 64 channels.
Simple modes group, display mode = barsX, 64 x 64 channels.
Simple modes group, display mode = barsY, 64 x 64 channels.
Simple modes group, display mode = needles, 64 x 64 channels.
Simple modes group, display mode = triangles, 64 x 64 channels.
Light modes group, display mode = points, 256 x 256 channels.
Light modes group, display mode = grid, 256 x 256 channels.
Light modes group, display mode = surface, 64 x 64 channels.
Light modes group, display mode = triangles, 64 x 64 channels.
Height modes group, display mode = points, 256 x 256 channels.
Height modes group, display mode = grid, 256 x 256 channels.
Height modes group, display mode = contours, 64 x 64 channels.
Height modes group, display mode = bars, 64 x 64 channels.
Height modes group, display mode = surface, 64 x 64 channels.
Height modes group, display mode = triangles, 64 x 64 channels.
Light - height modes group, display mode = surface, 64 x 64 channels. The weight between both shading algorithms is set to 0.5. One can observe the influence of both shadings.
Using this function one can change pen color, pen style and pen width. Possible pen styles are:
Default values:
Simple modes group, display mode = linesX, 64 x 64 channels. Pen width = 3.
Sometimes the displayed region is rather large. When displaying all channels pictures become very dense and complicated. It is very difficult to understand overall shape of the data. Therefore in the package we have implemented the possibility to change the density of displayed channels. Only channels coinciding with given nodes are displayed. In the next figure we introduce the example of the above presented spectrum with number of nodes set to 64x64.
Default values:
Simple modes group, display mode = grid, 256 x 256 channels. Number of nodes is 64x64.
One can change the angles of the position of 3-d space and to rotate the space. Alpha parameter defines the angle between bottom horizontal screen line and the displayed space on the right side of the picture and beta on the left side, respectively. One can rotate the 3-d space around vertical axis going through the center of it employing the view parameter. Allowed values are 0, 90, 180 and 270 degrees respectively.
Default values:
Light modes group, display mode = surface, 256 x 256 channels. Angles are set as follows: alpha=40, beta=30, view=0.
Light modes group, display mode = surface, 256 x 256 channels. Angles are set as follows: alpha=30, beta=30, view=90.
One can change the scale of z-axis. Possible values are:
Default value is:
Height modes group, display mode = surface, 64 x 64 channels, log scale.
For sophisticated shading (in kModeGroupLight, kModeGroupHeight and kModeGroupLightHeight display modes groups) the color palette starts from the basic pen color (see SetPenAttr function). There is a predefined number of color levels (256). Color in every level is calculated by adding the increments of the r, g, b components to the previous level. Using this function one can change the color increments between two neighboring color levels. The function does not apply for kModeGroupSimple display modes group. Default values: r=1, g=1, b=1;
Light modes group, display mode = surface, 64 x 64 channels, color increments r=1, g=2, b=3.
Light modes group, display mode = surface, 64 x 64 channels, color increments r=4, g=2, b=1.
To define the colors one can employ one of the following color algorithms (rgb, cmy, cie, yiq, hvs models [1], [2]). When the level of a component achieves the limit value one can choose either smooth transition (by decreasing the limit value) or sharp - modulo transition (continuing with 0 value). This makes possible to realize various visual effects. One can choose from the following set of the algorithms:
The function does not apply for kModeGroupSimple display modes group. Default value is:
Light modes group, display mode = surface, 64 x 64 channels, color algorithm is cmy smooth.
Light modes group, display mode = surface, 64 x 64 channels, color algorithm is hvs smooth.
Light modes group, display mode = surface, 64 x 64 channels, color algorithm is yiq smooth.
Light modes group, display mode = surface, 64 x 64 channels, color algorithm is rgb modulo.
Height modes group, display mode = surface, 256 x 256 channels, color algorithm is rgb modulo, increments r=5, g=5, b=5, angles alpha=0, beta=90, view=0.
In kModeGroupLight and kModeGroupLightHeight display modes groups the color palette is calculated according to the fictive light source position in 3-d space. Using this function one can change the position of the source and thus to achieve various graphical effects. The function does not apply for kModeGroupSimple and kModeGroupHeight display modes groups. Default values are: x=1000, y=1000, z=1000.
Light modes group, display mode = surface, 64 x 64 channels. Position of the light source was set to x=0, y=1000, z=1000.
Surface of the picture is composed of triangles. If desired the edges of the neighboring triangles can be smoothed (shaded). If desired the display of the shadow can be painted as well. The function does not apply for kModeGroupSimple display modes group.
Possible values for shading are:
Possible values for shadow are:
Default values:
Light modes group, display mode = surface, 64 x 64 channels, not shaded.
Light modes group, display mode = surface, 64 x 64 channels, shaded, with shadow.
For kModeGroupSimple display modes group and for kDisplayModeGrid, kDisplayModeLinesX >and kDisplayModeLinesY display modes one can smooth data using Bezier smoothing algorithm. The function does not apply for other display modes groups and display modes. Possible values are:
Default value is:
Simple modes group, display mode = linesX, 64 x 64 channels with Bezier smoothing.
This function applies only for kDisplayModeContours display mode. One can change the width between horizontal slices and thus their density. Default value: width=50.
Simple modes group, display mode = contours, 64 x 64 channels. Width between slices was set to 30.
For kModeGroupLightHeight display modes group one can change the weight between both shading algorithm. The function does not apply for other display modes groups. Default value is: weight=0.5.
Light - height modes group, display mode = surface, 64 x 64 channels. The weight between both shading algorithms is set to 0.7.
Light modes group, display mode = surface, 64 x 64 channels, with marks (red circles).
In addition to the surface drawn using any above given algorithm one can display grid using the color parameter. The parameter enable can be set to:
Height modes group, display mode = surface, 64 x 64 channels, with blue grid.
Height modes group, display mode = surface, 64 x 64 channels, with marks (red circles) and blue grid.
[1] Morháč M., Kliman J., Matoušek V., Turzo I., Sophisticated visualization algorithms for analysis of multidimensional experimental nuclear data, Acta Physica Slovaca 54 (2004) 385.
[2] D. Hearn, M. P. Baker: Computer Graphics, Prentice Hall International, Inc. 1994.
Example to draw source spectrum (class TSpectrum2Painter). To execute this example, do root > .x VisA.C #include "TSpectrum2Painter.h" void VisA() { TFile *f = new TFile("TSpectrum2.root"); TH2F *graph=(TH2F*) f->Get("graph2;1"); TCanvas *Graph2 = new TCanvas("Graph2","Illustration of 2D graphics",10,10,1000,700); graph->Draw("SPEC"); }
Sets display group mode and display mode: -modeGroup - the following group modes can be set: simple modes-kPicture2ModeGroupSimple, modes with shading according to light-kPicture2ModeGroupLight, modes with shading according to channels counts-kPicture2ModeGroupHeight, modes of combination of shading according to light and to channels counts-kPicture2ModeGroupLightHeight -displayMode - posible display modes are: points, grid, contours, bars, x_lines, y_lines, bars_x, bars_y, needles, surface, triangles
Sets pen attributes: -color - color of spectrum -style - style of pen (solid, dash, dot, dash-dot) -width - width of pen in pixels
Sets nodes in both directions: -nodesx, nodesy, only the bins at the nodes points are displayed
Sets angles of the view: -alpha - angles of display,alpha+beta must be less or equal to 90, alpha- angle between base line of Canvas and right lower edge of picture base plane -beta - angle between base line of Canvas and left lower edge of picture base plane -view - rotation angle of the view, it can be 0, 90, 180, 270 degrees
Sets shading color algorithm: -colorAlgorithm - applies only for rainbowed display modes (rgb smooth alorithm, rgb modulo color component, cmy smooth alorithm, cmy modulo color component, cie smooth alorithm, cie modulo color component, yiq smooth alorithm, yiq modulo color component, hsv smooth alorithm, hsv modulo color component, it does not apply for simple display modes algorithm group
Sets color increments between two color levels for r, g, b components: -r, g, b - color increments between two color levels
Sets position of fictive light source in 3D space: -x, y, z
Sets on/off shading and shadow switches: -shading - determines whether the picture will shaded, smoothed (no shading, shading), for rainbowed display modes only -shadow - determines whether shadow will be drawn, for rainbowed display modes with shading according to light
Sets on/off Bezier smoothing: -bezier - determines Bezier interpolation (applies only for simple display modes group for grid, x_lines, y_lines display modes)
Sets width between horizontal slices: -width - width between contours, applies only for contours display mode
Sets weight between shading according to fictive light source and according to channels counts: -weight - weight between shading according to fictive light source and according to channels counts, applies only for kPicture2ModeGroupLightHeight modes group
Sets enables/disables drawing of channel marks and sets their attributes: -enable - decides whether the channel marks are shown or not -color - color of channel marks -width - width of channel marks in pixels -height - height of channel marks in pixels -style - style of channel marks (dot, cross, star, rectangle, X, diamond, triangle)
This function sets enables/disables drawing of channel grid and sets its color: -enable - decides whether the channel grid is shown or not -color - color of channel grid
Gets display group mode and display mode: -modeGroup - the following group modes might have been set: simple modes-kPicture2ModeGroupSimple, modes with shading according to light-kPicture2ModeGroupLight, modes with shading according to channels counts-kPicture2ModeGroupHeight, modes of combination of shading according to light and to channels counts-kPicture2ModeGroupLightHeight -displayMode - display modes that might have been set: points, grid, contours, bars, x_lines, y_lines, bars_x, bars_y, needles, surface, triangles
Gets pen attributes: -color - color of spectrum -style - style of pen (solid, dash, dot, dash-dot) -width - width of pen in pixels
Gets nodes in both directions: -nodesx, nodesy, only the bins at the nodes points are displayed
Gets angles of the view: -alpha - angle between base line of Canvas and right lower edge of picture base plane -beta - angle between base line of Canvas and left lower edge of picture base plane -view - rotation angle of the view, it can be 0, 90, 180, 270 degrees
Gets shading color algorithm: -colorAlgorithm - rgb smooth alorithm, rgb modulo color component, cmy smooth alorithm, cmy modulo color component, cie smooth alorithm, cie modulo color component, yiq smooth alorithm, yiq modulo color component, hsv smooth alorithm, hsv modulo algorithm
Gets color increments between two color levels for r, g, b components: -r, g, b - color increments between two color levels
Gets position of fictive light source in 3D space: -x, y, z
Gets shading and shadow switches: -shading - determines whether the picture will shaded, smoothed (no shading, shading), for rainbowed display modes only -shadow - determines whether shadow will be drawn, for rainbowed display modes with shading according to light
Gets Bezier smoothing switch: -bezier - determines Bezier interpolation (applies only for simple display modes group for grid, x_lines, y_lines display modes)
Gets width between horizontal slices: -width - width between contours, applies only for contours display mode
Gets weight between shading according to fictive light source and according to channels counts: -weight - weight between shading according to fictive light source and according to channels counts, applies only for kPicture2ModeGroupLightHeight modes group
Gets drawing attributes for channel marks: -enable - decides whether the channel marks are shown or not -color - color of channel marks -width - width of channel marks in pixels -height - height of channel marks in pixels -style - style of channel marks (dot, cross, star, rectangle, X, diamond, triangle)
This function gets attributes for drawing channel: -enable - decides whether the channel grid is shown or not -color - color of channel grid
This function allows to set all the possible options available in TSpectrum2Painter and paint "h2". TSpectrum2Painter offers a large set of options/attributes. In the "option" parameter each of them can be set to specific values via "operators" in the option itself. for instance on can do: h2->Draw("SPEC a(30,30,0)"); to draw h2 with TSpectrum2Painter using all the default attributes except the viewing angles. The operators' names are case unsensitive (one can use "a" or "A"). Operators parameters are seperated by ",". The operators can be put is any order in the option. Operators must be serparated by " ". No " " characters should be put in an operator. This help page describes all the available operators. * * * The way "h2" will be painted is controled with 2 parameters the "Display modes groups" and the "Display Modes". "Display modes groups" can take the following values: 0 = Simple - it covers simple display modes using one color only 1 = Light - in this group the shading is carried out according to the position of the fictive light source 2 = Height - in this group the shading is carried out according to the channel contents 3 = LightHeight - combination of two previous shading algorithms. One can control the weight between both algorithms. "Display modes" can take the following values: 1 = Points. 2 = Grid. 3 = Contours. 4 = Bars. 5 = LinesX. 6 = LinesY. 7 = BarsX. 8 = BarsY. 9 = Needles. 10 = Surface. 11 = Triangles. Using this function these parameters can be set using the "dm" operator in the option. Example: h2->Draw("SPEC dm(1,2)"); will paint the 2D histogram h2 using the "Light Display mode group" and the "Grid Display mode". The following table summarizes all the possible combinations of the "Display modes groups" and the "Display modes". +--------+-------+--------+--------------+ | Simple | Light | Height | Light-Height | +-----------+--------+-------+--------+--------------+ | Points | X | X | X | X | +-----------+--------+-------+--------+--------------+ | Grid | X | X | X | X | +-----------+--------+-------+--------+--------------+ | Contours | X | - | X | - | +-----------+--------+-------+--------+--------------+ | Bars | X | - | X | - | +-----------+--------+-------+--------+--------------+ | LinesX | X | X | X | X | +-----------+--------+-------+--------+--------------+ | LinesY | X | X | X | X | +-----------+--------+-------+--------+--------------+ | BarsX | X | - | X | - | +-----------+--------+-------+--------+--------------+ | BarsY | X | - | X | - | +-----------+--------+-------+--------+--------------+ | Needles | X | - | - | - | +-----------+--------+-------+--------+--------------+ | Surface | - | X | X | X | +-----------+--------+-------+--------+--------------+ | Triangles | X | X | X | X | +-----------+--------+-------+--------+--------------+ * * * The Pen Attributes can be changed using pa(color, style, width). Example: h2->Draw("SPEC dm(1,2) pa(2,1,2)"); sets the line color to 2, line type to 1 and line width to2. Note that if pa() is not specified, the histogram "h2" line attributes are used. Note also that operators for SPEC option can be cummulated and specified in any order. * * * The buffer size can be change with bf(size). Example: h2->Draw("SPEC bf(8000)"); The spectrum painter needs a buffer to paint the spectrum. By default the buffer size is set to 1600. In most cases this buffer size is enough. But if the canvas size is very big, for instance 8000x5000 this buffer size is too small. An error message is issued telling to use the option bf(). * * * The number of nodes can be change with n(nodesx, nodesy). Example: h2->Draw("SPEC n(40,40)"); Sometimes the displayed region is rather large. When displaying all channels pictures become very dense and complicated. It is very difficult to understand the overall shape of data. "n(nx,ny)" allows to change the density of displayed channels. Only the channels coinciding with given nodes are displayed. * * * The visualization angles can be changed with a(alpha, beta, view). Example: h2->Draw("SPEC n(40,40) dm(0,1) a(30,30,0)"); Alpha defines the angle between bottom horizontal screen line and the displayed space on the right side of the picture and beta on the left side, respectively. One can rotate the 3-d space around vertical axis going through the center of it employing the view parameter. Allowed values are 0, 90, 180 and 270 degrees. * * * zs(scale) changes the scale of the Z-axis Possible values are: 0 = Linear (default) 1 = Log 2 = Sqrt If gPad->SetLogz() has been set, log scale on Z-axis is set automatically. No need to use the zs() operator. Note that the X and Y axis are always linear. * * * ci(r,g,b), were r,g and b are floats defines the colors increments. For sophisticated shading (Light, Height and LightHeight Display Modes Groups) the color palette starts from the basic pen color (see pa() function). There is a predefined number of color levels (256). Color in every level is calculated by adding the increments of the r, g, b components to the previous level. Using this function one can change the color increments between two neighboring color levels. The function does not apply dor the Simple Display Modes Group. The default values are: (1,1,1). * * * ca(color_algorithm) allows to choose the Color Algorithm. To define the colors one can employ one of the following color algorithms (RGB, CMY, CIE, YIQ, HVS models). When the level of a component reaches the limit value one can choose either smooth transition (by decreasing the limit value) or a sharp modulo transition (continuing with 0 value). This makes possible to realize various visual effects. One can choose from the following set of the algorithms: 0 = RGB Smooth 1 = RGB Modulo 2 = CMY Smooth 3 = CMY Modulo 4 = CIE Smooth 5 = CIE Modulo 6 = YIQ Smooth 7 = YIQ Modulo 8 = HVS Smooth 9 = HVS Modulo This function does not apply on Simple display modes group. Default value is 0. Example: h2->Draw("SPEC c1(4) dm(0,1) a(30,30,0)"); choose CMY Modulo to paint the "h2" histogram. * * * lp(x,y,z) set the light position. In Light and LightHeight display modes groups the color palette is calculated according to the fictive light source position in 3-d space. Using this function one can change the position of the source and thus to achieve various graphical effects. This function does not apply for Simple and Height display modes groups. Default is: lp(1000,1000,100). * * * s(shading,shadow) allows to set the shading. The picture's surface is composed of triangles. If desired the edges of the neighboring triangles can be smoothed (shaded). If desired the display of the shadow can be painted as well. The function does not apply for Simple display modes group. The possible values for shading are: 0 = Not Shaded 1 = Shaded The possible values for shadow are: 0 = Shadows are not painted 1 = Shadows are painted Default values: s(1,0) * * * b(bezier) set the Bezier smoothing. For Simple display modes group and for Grid, LinesX and LinesY display modes one can smooth data using Bezier smoothing algorithm. The function does not apply for other display modes groups and display modes. Possible values are: 0 = No bezier smoothing 1 = Bezier smoothing Default value is: b(0) * * * cw(width) set the contour width. This function applies only for the Contours display mode. One can change the width between horizontal slices and thus their density. Default value: cw(50) * * * lhw(weight) set the light height weight. For LightHeight display modes group one can change the weight between both shading algorithms. The function does not apply for other display modes groups. Default value is lhw(0.5). * * * cm(enable,color,width,height,style) allows to draw a marker on each node. In addition to the surface drawn using any above given algorithm one can display channel marks. One can control the color as well as the width, height (in pixels) and the style of the marks. The parameter enable can be set to 0 = Channel marks are not drawn 1 = Channel marks drawn The possible styles can be chosen from the set: 1 = Dot 2 = Cross 3 = Star 4 = Rectangle 5 = X 6 = Diamond 7 = Triangle. * * * cg(enable,color) channel grid. In addition to the surface drawn using any above given algorithm one can display grid using the color parameter. The parameter enable can be set to: 0 = Grid not drawn 1 = Grid drawn * * * See example in $ROOTSYS/tutorials/spectrum/spectrumpainter.C/* */