Logo ROOT   6.18/05
Reference Guide
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
TSpectrum2Painter Class Reference

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.

Definition at line 30 of file TSpectrum2Painter.h.

Public Types

enum  {
  kModeGroupSimple =0 , kModeGroupHeight =1 , kModeGroupLight =2 , kModeGroupLightHeight =3 ,
  kDisplayModePoints =1 , kDisplayModeGrid =2 , kDisplayModeContours =3 , kDisplayModeBars =4 ,
  kDisplayModeLinesX =5 , kDisplayModeLinesY =6 , kDisplayModeBarsX =7 , kDisplayModeBarsY =8 ,
  kDisplayModeNeedles =9 , kDisplayModeSurface =10 , kDisplayModeTriangles =11 , kZScaleLinear =0 ,
  kZScaleLog =1 , kZScaleSqrt =2 , kColorAlgRgbSmooth =0 , kColorAlgRgbModulo =1 ,
  kColorAlgCmySmooth =2 , kColorAlgCmyModulo =3 , kColorAlgCieSmooth =4 , kColorAlgCieModulo =5 ,
  kColorAlgYiqSmooth =6 , kColorAlgYiqModulo =7 , kColorAlgHvsSmooth =8 , kColorAlgHvsModulo =9 ,
  kShadowsNotPainted =0 , kShadowsPainted =1 , kNotShaded =0 , kShaded =1 ,
  kNoBezierInterpol =0 , kBezierInterpol =1 , kPenStyleSolid =1 , kPenStyleDash =2 ,
  kPenStyleDot =3 , kPenStyleDashDot =4 , kChannelMarksNotDrawn =0 , kChannelMarksDrawn =1 ,
  kChannelMarksStyleDot =1 , kChannelMarksStyleCross =2 , kChannelMarksStyleStar =3 , kChannelMarksStyleRectangle =4 ,
  kChannelMarksStyleX =5 , kChannelMarksStyleDiamond =6 , kChannelMarksStyleTriangle =7 , kChannelGridNotDrawn =0 ,
  kChannelGridDrawn =1
}
 
- Public Types inherited from TObject
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = BIT(0) , kOverwrite = BIT(1) , kWriteDelete = BIT(2) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = BIT(3) }
 
enum  EStatusBits {
  kCanDelete = BIT(0) , kMustCleanup = BIT(3) , kIsReferenced = BIT(4) , kHasUUID = BIT(5) ,
  kCannotPick = BIT(6) , kNoContextMenu = BIT(8) , kInvalidObject = BIT(13)
}
 

Public Member Functions

 TSpectrum2Painter (TH2 *h2, Int_t bs)
 TSpectrum2Painter normal constructor. More...
 
virtual ~TSpectrum2Painter ()
 TSpectrum2Painter destructor. More...
 
void GetAngles (Int_t &alpha, Int_t &beta, Int_t &view)
 Gets angles of the view: More...
 
void GetBezier (Int_t &bezier)
 Gets Bezier smoothing switch: More...
 
void GetChanGrid (Int_t &enable, Int_t &color)
 This function gets attributes for drawing channel: More...
 
void GetChanMarks (Int_t &enable, Int_t &color, Int_t &width, Int_t &height, Int_t &style)
 Gets drawing attributes for channel marks: More...
 
void GetColorAlgorithm (Int_t &colorAlgorithm)
 Gets shading color algorithm: More...
 
void GetColorIncrements (Double_t &r, Double_t &g, Double_t &b)
 Gets color increments between two color levels for r, g, b components: More...
 
void GetContourWidth (Int_t &width)
 Gets width between horizontal slices: More...
 
void GetDisplayMode (Int_t &modeGroup, Int_t &displayMode)
 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. More...
 
void GetLightHeightWeight (Double_t &weight)
 Gets weight between shading according to fictive light source and according to channels counts: More...
 
void GetLightPosition (Int_t &x, Int_t &y, Int_t &z)
 Gets position of fictive light source in 3D space: More...
 
void GetNodes (Int_t &nodesx, Int_t &nodesy)
 Gets nodes in both directions: More...
 
void GetPenAttr (Int_t &color, Int_t &style, Int_t &width)
 Gets pen attributes: -color - color of spectrum -style - style of pen (solid, dash, dot, dash-dot) -width - width of pen in pixels. More...
 
void GetShading (Int_t &shading, Int_t &shadow)
 Gets shading and shadow switches: More...
 
void GetZScale (Int_t &scale)
 Gets z-axis scale: More...
 
void Paint (Option_t *option)
 Paints histogram according to preset parameters. More...
 
void SetAngles (Int_t alpha, Int_t beta, Int_t view)
 Sets angles of the view: More...
 
void SetBezier (Int_t bezier)
 Sets on/off Bezier smoothing: More...
 
void SetChanGrid (Int_t enable, Int_t color)
 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. More...
 
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: More...
 
void SetColorAlgorithm (Int_t colorAlgorithm)
 Sets shading color algorithm: More...
 
void SetColorIncrements (Double_t r, Double_t g, Double_t b)
 Sets color increments between two color levels for r, g, b components: More...
 
void SetContourWidth (Int_t width)
 Sets width between horizontal slices: More...
 
void SetDisplayMode (Int_t modeGroup, Int_t displayMode)
 Sets display group mode and display mode: More...
 
void SetLightHeightWeight (Double_t weight)
 Sets weight between shading according to fictive light source and according to channels counts: More...
 
void SetLightPosition (Int_t x, Int_t y, Int_t z)
 Sets position of fictive light source in 3D space: More...
 
void SetNodes (Int_t nodesx, Int_t nodesy)
 Sets nodes in both directions: More...
 
void SetPenAttr (Int_t color, Int_t style, Int_t width)
 Sets pen attributes: More...
 
void SetShading (Int_t shading, Int_t shadow)
 Sets on/off shading and shadow switches: More...
 
void SetZScale (Int_t scale)
 Sets z-axis scale: More...
 
- Public Member Functions inherited from TNamed
 TNamed ()
 
 TNamed (const char *name, const char *title)
 
 TNamed (const TNamed &named)
 TNamed copy ctor. More...
 
 TNamed (const TString &name, const TString &title)
 
virtual ~TNamed ()
 TNamed destructor. More...
 
virtual void Clear (Option_t *option="")
 Set name and title to empty strings (""). More...
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare two TNamed objects. More...
 
virtual void Copy (TObject &named) const
 Copy this to obj. More...
 
virtual void FillBuffer (char *&buffer)
 Encode TNamed into output buffer. More...
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
virtual Bool_t IsSortable () const
 
virtual void ls (Option_t *option="") const
 List TNamed name and title. More...
 
TNamedoperator= (const TNamed &rhs)
 TNamed assignment operator. More...
 
virtual void Print (Option_t *option="") const
 Print TNamed name and title. More...
 
virtual void SetName (const char *name)
 Set the name of the TNamed. More...
 
virtual void SetNameTitle (const char *name, const char *title)
 Set all the TNamed parameters (name and title). More...
 
virtual void SetTitle (const char *title="")
 Set the title of the TNamed. More...
 
virtual Int_t Sizeof () const
 Return size of the TNamed part of the TObject. More...
 
- Public Member Functions inherited from TObject
 TObject ()
 TObject constructor. More...
 
 TObject (const TObject &object)
 TObject copy ctor. More...
 
virtual ~TObject ()
 TObject destructor. More...
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract. More...
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad. More...
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action. More...
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object. More...
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs. More...
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method. More...
 
virtual void Copy (TObject &object) const
 Copy this to obj. More...
 
virtual void Delete (Option_t *option="")
 Delete this object. More...
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object. More...
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects. More...
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs. More...
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad). More...
 
virtual void Dump () const
 Dump contents of object on stdout. More...
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message. More...
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 Execute method on this object with the given parameter string, e.g. More...
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py). More...
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message. More...
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes. More...
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes. More...
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object. More...
 
virtual const char * GetIconName () const
 Returns mime type name of object. More...
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py). More...
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
virtual UInt_t GetUniqueID () const
 Return the unique object id. More...
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e. More...
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message. More...
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname". More...
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl. More...
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas. More...
 
void InvertBit (UInt_t f)
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory). More...
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More...
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 The ls function lists the contents of a class on stdout. More...
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More...
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification. More...
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete. More...
 
void operator delete (void *ptr)
 Operator delete. More...
 
void operator delete[] (void *ptr)
 Operator delete []. More...
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator. More...
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself. More...
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list. More...
 
virtual void Print (Option_t *option="") const
 This method must be overridden when a class wants to print itself. More...
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory. More...
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list. More...
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename. More...
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out". More...
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f. More...
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object. More...
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id. More...
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message. More...
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More...
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory. More...
 

Static Public Member Functions

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". More...
 
- Static Public Member Functions inherited from TObject
static Long_t GetDtorOnly ()
 Return destructor only flag. More...
 
static Bool_t GetObjectStat ()
 Get status of object stat flag. More...
 
static void SetDtorOnly (void *obj)
 Set destructor only flag. More...
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable. More...
 

Protected Member Functions

Int_t BezC (Int_t i)
 This function is called from BezierBlend function. More...
 
Double_t BezierBlend (Int_t i, Double_t bezf)
 This function calculates Bezier approximation. More...
 
void BezierSmoothing (Double_t bezf)
 Calculates screen coordinates of the smoothed point. More...
 
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,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. More...
 
void ColorModel (unsigned ui, unsigned ui1, unsigned ui2, unsigned ui3)
 This function calculates color for one palette entry given by function parameter ui. More...
 
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. More...
 
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. More...
 
void Envelope (Int_t x1, Int_t y1, Int_t x2, Int_t y2)
 Ensures hidden surface removal. More...
 
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. More...
 
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: More...
 
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. More...
 
void Transform (Int_t it, Int_t jt, Int_t zmt)
 Reads out the value from histogram and calculates screen coordinates. More...
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected). More...
 
void MakeZombie ()
 

Protected Attributes

Int_t fAlpha
 
Int_t fBeta
 
Int_t fBezier
 
Int_t fBx1
 
Int_t fBx2
 
Int_t fBy1
 
Int_t fBy2
 
Int_t fBzX [4]
 
Int_t fBzY [4]
 
Int_t fChanlineColor
 
Int_t fChanlineEnDis
 
Int_t fChanmarkColor
 
Int_t fChanmarkEnDis
 
Int_t fChanmarkHeight
 
Int_t fChanmarkStyle
 
Int_t fChanmarkWidth
 
Int_t fColorAlg
 
Int_t fContWidth
 
Int_t fDisplayMode
 
Double_t fDxspline
 
Double_t fDyspline
 
Short_tfEnvelope
 
Short_tfEnvelopeContour
 
Double_t fGbezx
 
Double_t fGbezy
 
TH2fH2
 
Double_t fKx
 
Double_t fKy
 
Int_t fLevels
 
Double_t fLHweight
 
Int_t fLine
 
Int_t fMaximumXScreenResolution
 
Int_t fModeGroup
 
Double_t fMxx
 
Double_t fMxy
 
Double_t fMyx
 
Double_t fMyy
 
TColorfNewColor
 
Int_t fNewColorIndex
 buffers' size More...
 
Int_t fNodesx
 
Int_t fNodesy
 
Double_t fNuSli
 
Int_t fPenColor
 
Int_t fPenDash
 
Int_t fPenWidth
 
Double_t fRainbow1Step
 
Double_t fRainbow2Step
 
Double_t fRainbow3Step
 
Int_t fShading
 
Int_t fShadow
 
Double_t fTxx
 
Double_t fTxy
 
Double_t fTyx
 
Double_t fTyy
 
Double_t fTyz
 
Int_t fViewAngle
 
Double_t fVx
 
Double_t fVy
 
Int_t fXe
 
Int_t fXlight
 
Int_t fXmax
 
Int_t fXmin
 
Int_t fXs
 
Int_t fXt
 
Int_t fYe
 
Int_t fYlight
 
Int_t fYmax
 
Int_t fYmin
 
Int_t fYs
 
Int_t fYt
 
Double_t fZ
 
Double_t fZeq
 
Int_t fZlight
 
Double_t fZmax
 
Double_t fZmin
 
Double_t fZPresetValue
 
Int_t fZscale
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 

Private Member Functions

 TSpectrum2Painter (const TSpectrum2Painter &)
 
TSpectrum2Painteroperator= (const TSpectrum2Painter &)
 

#include <TSpectrum2Painter.h>

Inheritance diagram for TSpectrum2Painter:
[legend]

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kModeGroupSimple 
kModeGroupHeight 
kModeGroupLight 
kModeGroupLightHeight 
kDisplayModePoints 
kDisplayModeGrid 
kDisplayModeContours 
kDisplayModeBars 
kDisplayModeLinesX 
kDisplayModeLinesY 
kDisplayModeBarsX 
kDisplayModeBarsY 
kDisplayModeNeedles 
kDisplayModeSurface 
kDisplayModeTriangles 
kZScaleLinear 
kZScaleLog 
kZScaleSqrt 
kColorAlgRgbSmooth 
kColorAlgRgbModulo 
kColorAlgCmySmooth 
kColorAlgCmyModulo 
kColorAlgCieSmooth 
kColorAlgCieModulo 
kColorAlgYiqSmooth 
kColorAlgYiqModulo 
kColorAlgHvsSmooth 
kColorAlgHvsModulo 
kShadowsNotPainted 
kShadowsPainted 
kNotShaded 
kShaded 
kNoBezierInterpol 
kBezierInterpol 
kPenStyleSolid 
kPenStyleDash 
kPenStyleDot 
kPenStyleDashDot 
kChannelMarksNotDrawn 
kChannelMarksDrawn 
kChannelMarksStyleDot 
kChannelMarksStyleCross 
kChannelMarksStyleStar 
kChannelMarksStyleRectangle 
kChannelMarksStyleX 
kChannelMarksStyleDiamond 
kChannelMarksStyleTriangle 
kChannelGridNotDrawn 
kChannelGridDrawn 

Definition at line 68 of file TSpectrum2Painter.h.

Constructor & Destructor Documentation

◆ TSpectrum2Painter() [1/2]

TSpectrum2Painter::TSpectrum2Painter ( TH2 h2,
Int_t  bs 
)

TSpectrum2Painter normal constructor.

Definition at line 54 of file TSpectrum2Painter.cxx.

◆ ~TSpectrum2Painter()

TSpectrum2Painter::~TSpectrum2Painter ( )
virtual

TSpectrum2Painter destructor.

Definition at line 177 of file TSpectrum2Painter.cxx.

◆ TSpectrum2Painter() [2/2]

TSpectrum2Painter::TSpectrum2Painter ( const TSpectrum2Painter )
private

Member Function Documentation

◆ BezC()

Int_t TSpectrum2Painter::BezC ( Int_t  i)
protected

This function is called from BezierBlend function.

Definition at line 752 of file TSpectrum2Painter.cxx.

◆ BezierBlend()

Double_t TSpectrum2Painter::BezierBlend ( Int_t  i,
Double_t  bezf 
)
protected

This function calculates Bezier approximation.

Definition at line 765 of file TSpectrum2Painter.cxx.

◆ BezierSmoothing()

void TSpectrum2Painter::BezierSmoothing ( Double_t  bezf)
protected

Calculates screen coordinates of the smoothed point.

Parameter bezf changes within the interval 0 to 1 in 0.1 steps.

Definition at line 780 of file TSpectrum2Painter.cxx.

◆ ColorCalculation()

Double_t TSpectrum2Painter::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 
)
protected

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.

Definition at line 243 of file TSpectrum2Painter.cxx.

◆ ColorModel()

void TSpectrum2Painter::ColorModel ( unsigned  ui,
unsigned  ui1,
unsigned  ui2,
unsigned  ui3 
)
protected

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.

Definition at line 475 of file TSpectrum2Painter.cxx.

◆ CopyEnvelope()

void TSpectrum2Painter::CopyEnvelope ( Double_t  xr,
Double_t  xs,
Double_t  yr,
Double_t  ys 
)
protected

Copies envelope vector, which ensures hidden surface removal for the contours display mode.

Definition at line 1143 of file TSpectrum2Painter.cxx.

◆ DrawMarker()

void TSpectrum2Painter::DrawMarker ( Int_t  x,
Int_t  y,
Int_t  w,
Int_t  h,
Int_t  type 
)
protected

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.

Definition at line 1000 of file TSpectrum2Painter.cxx.

◆ Envelope()

void TSpectrum2Painter::Envelope ( Int_t  x1,
Int_t  y1,
Int_t  x2,
Int_t  y2 
)
protected

Ensures hidden surface removal.

Definition at line 798 of file TSpectrum2Painter.cxx.

◆ EnvelopeBars()

void TSpectrum2Painter::EnvelopeBars ( Int_t  x1,
Int_t  y1,
Int_t  x2,
Int_t  y2 
)
protected

Ensures hidden surface removal for Bars, BarsX and BarsY display modes.

Definition at line 911 of file TSpectrum2Painter.cxx.

◆ GetAngles()

void TSpectrum2Painter::GetAngles ( Int_t alpha,
Int_t beta,
Int_t view 
)

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

Definition at line 7324 of file TSpectrum2Painter.cxx.

◆ GetBezier()

void TSpectrum2Painter::GetBezier ( Int_t bezier)

Gets Bezier smoothing switch:

  • bezier - determines Bezier interpolation (applies only for simple display modes group for grid, x_lines, y_lines display modes)

Definition at line 7392 of file TSpectrum2Painter.cxx.

◆ GetChanGrid()

void TSpectrum2Painter::GetChanGrid ( Int_t enable,
Int_t color 
)

This function gets attributes for drawing channel:

  • enable - decides whether the channel grid is shown or not
  • color - color of channel grid

Definition at line 7438 of file TSpectrum2Painter.cxx.

◆ GetChanMarks()

void TSpectrum2Painter::GetChanMarks ( Int_t enable,
Int_t color,
Int_t width,
Int_t height,
Int_t style 
)

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)

Definition at line 7426 of file TSpectrum2Painter.cxx.

◆ GetColorAlgorithm()

void TSpectrum2Painter::GetColorAlgorithm ( Int_t colorAlgorithm)

Gets shading color algorithm:

  • colorAlgorithm - rgb smooth algorithm, rgb modulo color component, cmy smooth algorithm, cmy modulo color component, cie smooth algorithm, cie modulo color component, yiq smooth algorithm, yiq modulo color component, hsv smooth algorithm, hsv modulo algorithm

Definition at line 7346 of file TSpectrum2Painter.cxx.

◆ GetColorIncrements()

void TSpectrum2Painter::GetColorIncrements ( Double_t r,
Double_t g,
Double_t b 
)

Gets color increments between two color levels for r, g, b components:

  • r, g, b - color increments between two color levels

Definition at line 7356 of file TSpectrum2Painter.cxx.

◆ GetContourWidth()

void TSpectrum2Painter::GetContourWidth ( Int_t width)

Gets width between horizontal slices:

  • width - width between contours, applies only for contours display mode

Definition at line 7402 of file TSpectrum2Painter.cxx.

◆ GetDisplayMode()

void TSpectrum2Painter::GetDisplayMode ( Int_t modeGroup,
Int_t displayMode 
)

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.

Definition at line 7286 of file TSpectrum2Painter.cxx.

◆ GetLightHeightWeight()

void TSpectrum2Painter::GetLightHeightWeight ( Double_t weight)

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

Definition at line 7412 of file TSpectrum2Painter.cxx.

◆ GetLightPosition()

void TSpectrum2Painter::GetLightPosition ( Int_t x,
Int_t y,
Int_t z 
)

Gets position of fictive light source in 3D space:

  • x, y, z

Definition at line 7368 of file TSpectrum2Painter.cxx.

◆ GetNodes()

void TSpectrum2Painter::GetNodes ( Int_t nodesx,
Int_t nodesy 
)

Gets nodes in both directions:

  • nodesx, nodesy, only the bins at the nodes points are displayed

Definition at line 7311 of file TSpectrum2Painter.cxx.

◆ GetPenAttr()

void TSpectrum2Painter::GetPenAttr ( Int_t color,
Int_t style,
Int_t width 
)

Gets pen attributes: -color - color of spectrum -style - style of pen (solid, dash, dot, dash-dot) -width - width of pen in pixels.

Definition at line 7299 of file TSpectrum2Painter.cxx.

◆ GetShading()

void TSpectrum2Painter::GetShading ( Int_t shading,
Int_t shadow 
)

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

Definition at line 7381 of file TSpectrum2Painter.cxx.

◆ GetZScale()

void TSpectrum2Painter::GetZScale ( Int_t scale)

Gets z-axis scale:

  • scale - it can be linear, sqrt or log

Definition at line 7336 of file TSpectrum2Painter.cxx.

◆ operator=()

TSpectrum2Painter & TSpectrum2Painter::operator= ( const TSpectrum2Painter )
private

◆ Paint()

void TSpectrum2Painter::Paint ( Option_t option)
virtual

Paints histogram according to preset parameters.

Visualization

Goal: to present 2-dimensional spectra in suitable visual form

This package has several display mode groups and display modes, which can be employed for the presentation of 2-dimensional histograms

Display modes groups:

  • kModeGroupSimple - it covers simple display modes using one color only
  • kModeGroupLight - in this group the shading is carried out according to the position of the fictive light source
  • kModeGroupHeight - in this group the shading is carried out according to the channel contents
  • kModeGroupLightHeight - combination of two previous shading algorithms. One can control the weight between both algorithms.

Display modes:

  • kDisplayModePoints,
  • kDisplayModeGrid,
  • kDisplayModeContours,
  • kDisplayModeBars,
  • kDisplayModeLinesX,
  • kDisplayModeLinesY,
  • kDisplayModeBarsX,
  • kDisplayModeBarsY,
  • kDisplayModeNeedles,
  • kDisplayModeSurface,
  • kDisplayModeTriangles.

one can combine the above given modes groups and display modes. The meaningful combinations (denoted by x) are given in the next table.

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

Function: void TSpectrum2Painter::SetDisplayMode (Int_t modeGroup, Int_t displayMode)

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:

  • modeGroup = kModeGroupLightHeight
  • displayMode = kDisplayModeSurface

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.

Function: TSpectrum2Painter::SetPenAttr(Int_t color,Int_t style,Int_t width)

Using this function one can change pen color, pen style and pen width. Possible pen styles are:

  • kPenStyleSolid,
  • kPenStyleDash,
  • kPenStyleDot,
  • kPenStyleDashDot.

Default values:

  • color = kBlack
  • style = kPenStyleSolid
  • width = 1

Simple modes group, display mode = linesX, 64 x 64 channels. Pen width = 3.

Function: TSpectrum2Painter::SetNodes(Int_t nodesx,Int_t nodesy)

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:

  • nodesx = Xmax-Xmin+1
  • nodesy = Ymax-Ymin+1

Simple modes group, display mode = grid, 256 x 256 channels. Number of nodes is 64x64.

Function: void TSpectrum2Painter::SetAngles (Int_t alpha,Int_t beta, Int_t view)

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:

  • alpha = 20
  • beta = 60
  • view = 0

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.

Function: TSpectrum2Painter::SetZScale(Int_t scale)

One can change the scale of z-axis. Possible values are:

  • kZScaleLinear
  • kZScaleLog
  • kZScaleSqrt

Default value is:

  • scale = kZScaleLinear

Height modes group, display mode = surface, 64 x 64 channels, log scale.

Function: TSpectrum2Painter::SetColorIncrements(Double_t r,Double_t g,Double_t b);

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 neighbouring 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.

Function: TSpectrum2Painter::SetColorAlgorithm(Int_t colorAlgorithm)

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:

  • kColorAlgRgbSmooth
  • kColorAlgRgbModulo
  • kColorAlgCmySmooth
  • kColorAlgCmyModulo
  • kColorAlgCieSmooth
  • kColorAlgCieModulo
  • kColorAlgYiqSmooth
  • kColorAlgYiqModulo
  • kColorAlgHvsSmooth
  • kColorAlgHvsModulo

The function does not apply for kModeGroupSimple display modes group. Default value is:

  • colorAlgorithm = kColorAlgRgbSmooth

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.

Function: TSpectrum2Painter::SetLightPosition(Int_t x, Int_t y, Int_t z)

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.

Function: TSpectrum2Painter::SetShading(Int_t shading,Int_t shadow)

Surface of the picture is composed of triangles. If desired the edges of the neighbouring 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:

  • kNotShaded
  • kShaded.

Possible values for shadow are:

  • kShadowsNotPainted
  • kShadowsPainted

Default values:

  • shading = kShaded
  • shadow = kShadowsNotPainted

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.

Function: TSpectrum2Painter::SetBezier(Int_t bezier)

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:

  • kNoBezierInterpol
  • kBezierInterpol

Default value is:

  • bezier = kNoBezierInterpol.

Simple modes group, display mode = linesX, 64 x 64 channels with Bezier smoothing.

Function: TSpectrum2Painter::SetContourWidth(Int_t width)

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.

Function: TSpectrum2Painter::SetLightHeightWeight(Double_t weight)

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.

Function: TSpectrum2Painter::SetChanMarks(Int_t enable,Int_t color,Int_t width,Int_t height,Int_t style)

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:

  • kChannelMarksNotDrawn
  • kChannelMarksDrawn.

The possible styles can be chosen from the set:

  • kChannelMarksStyleDot
  • kChannelMarksStyleCross
  • kChannelMarksStyleStar
  • kChannelMarksStyleRectangle
  • kChannelMarksStyleX
  • kChannelMarksStyleDiamond
  • kChannelMarksStyleTriangle.

Light modes group, display mode = surface, 64 x 64 channels, with marks (red circles).

Function: TSpectrum2Painter::SetChanGrid(Int_t enable,Int_t color)

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:

  • kChannelGridNotDrawn
  • kChannelGridDrawn.

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.

References:

[1] Morhac M., Kliman J., Matouoek 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.

Script:

Example to draw source spectrum (class TSpectrum2Painter). To execute this example, do:

root > .x VisA.C
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");
}
#define f(i)
Definition: RSha256.hxx:104
The Canvas class.
Definition: TCanvas.h:31
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:48
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:248
Definition: graph.py:1

Reimplemented from TObject.

Definition at line 1582 of file TSpectrum2Painter.cxx.

◆ PaintSpectrum()

void TSpectrum2Painter::PaintSpectrum ( TH2 h2,
Option_t option = "",
Int_t  bs = 1600 
)
static

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 insensitive (one can use "a" or "A"). Operators parameters are separated by ",". The operators can be put is any order in the option. Operators must be separated by " ". No " " characters should be put in an operator. This help page describes all the available operators.

The way "h2" will be painted is controlled 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 summarises 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 cumulated 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 neighbouring 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 neighbouring 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 spectrumpainter.C

Definition at line 7673 of file TSpectrum2Painter.cxx.

◆ SetAngles()

void TSpectrum2Painter::SetAngles ( Int_t  alpha,
Int_t  beta,
Int_t  view 
)

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

Definition at line 7116 of file TSpectrum2Painter.cxx.

◆ SetBezier()

void TSpectrum2Painter::SetBezier ( Int_t  bezier)

Sets on/off Bezier smoothing:

  • bezier - determines Bezier interpolation (applies only for simple display modes group for grid, x_lines, y_lines display modes)

Definition at line 7204 of file TSpectrum2Painter.cxx.

◆ SetChanGrid()

void TSpectrum2Painter::SetChanGrid ( Int_t  enable,
Int_t  color 
)

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.

Definition at line 7270 of file TSpectrum2Painter.cxx.

◆ SetChanMarks()

void TSpectrum2Painter::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:

  • 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)

Definition at line 7243 of file TSpectrum2Painter.cxx.

◆ SetColorAlgorithm()

void TSpectrum2Painter::SetColorAlgorithm ( Int_t  colorAlgorithm)

Sets shading color algorithm:

  • olorAlgorithm - applies only for rainbowed display modes (rgb smooth algorithm, rgb modulo color component, cmy smooth algorithm,
  • cmy modulo color component, cie smooth algorithm,
  • cie modulo color component, yiq smooth algorithm,
  • yiq modulo color component, hsv smooth algorithm,
  • hsv modulo color component, it does not apply for simple display modes algorithm group

Definition at line 7149 of file TSpectrum2Painter.cxx.

◆ SetColorIncrements()

void TSpectrum2Painter::SetColorIncrements ( Double_t  r,
Double_t  g,
Double_t  b 
)

Sets color increments between two color levels for r, g, b components:

  • r, g, b - color increments between two color levels

Definition at line 7161 of file TSpectrum2Painter.cxx.

◆ SetContourWidth()

void TSpectrum2Painter::SetContourWidth ( Int_t  width)

Sets width between horizontal slices:

  • width - width between contours, applies only for contours display mode

Definition at line 7217 of file TSpectrum2Painter.cxx.

◆ SetDisplayMode()

void TSpectrum2Painter::SetDisplayMode ( Int_t  modeGroup,
Int_t  displayMode 
)

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

Definition at line 7070 of file TSpectrum2Painter.cxx.

◆ SetLightHeightWeight()

void TSpectrum2Painter::SetLightHeightWeight ( Double_t  weight)

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

Definition at line 7227 of file TSpectrum2Painter.cxx.

◆ SetLightPosition()

void TSpectrum2Painter::SetLightPosition ( Int_t  x,
Int_t  y,
Int_t  z 
)

Sets position of fictive light source in 3D space:

  • x, y, z

Definition at line 7175 of file TSpectrum2Painter.cxx.

◆ SetNodes()

void TSpectrum2Painter::SetNodes ( Int_t  nodesx,
Int_t  nodesy 
)

Sets nodes in both directions:

  • nodesx, nodesy, only the bins at the nodes points are displayed

Definition at line 7101 of file TSpectrum2Painter.cxx.

◆ SetPenAttr()

void TSpectrum2Painter::SetPenAttr ( Int_t  color,
Int_t  style,
Int_t  width 
)

Sets pen attributes:

  • color - color of spectrum
  • style - style of pen (solid, dash, dot, dash-dot)
  • width - width of pen in pixels

Definition at line 7087 of file TSpectrum2Painter.cxx.

◆ SetShading()

void TSpectrum2Painter::SetShading ( Int_t  shading,
Int_t  shadow 
)

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

Definition at line 7190 of file TSpectrum2Painter.cxx.

◆ SetZScale()

void TSpectrum2Painter::SetZScale ( Int_t  scale)

Sets z-axis scale:

  • scale - linear, sqrt or log

Definition at line 7131 of file TSpectrum2Painter.cxx.

◆ ShadowColorCalculation()

Double_t TSpectrum2Painter::ShadowColorCalculation ( Double_t  xtaz,
Double_t  ytaz,
Double_t  ztaz,
Double_t  shad_noise 
)
protected

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.

Definition at line 386 of file TSpectrum2Painter.cxx.

◆ Slice()

void TSpectrum2Painter::Slice ( Double_t  xr,
Double_t  yr,
Double_t  xs,
Double_t  ys,
TLine line 
)
protected

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.

Definition at line 1083 of file TSpectrum2Painter.cxx.

◆ Transform()

void TSpectrum2Painter::Transform ( Int_t  it,
Int_t  jt,
Int_t  zmt 
)
protected

Reads out the value from histogram and calculates screen coordinates.

Parameters:

  • it - node in x- direction
  • jt - node in y- direction
  • zmt - control variable

Definition at line 197 of file TSpectrum2Painter.cxx.

Member Data Documentation

◆ fAlpha

Int_t TSpectrum2Painter::fAlpha
protected

Definition at line 141 of file TSpectrum2Painter.h.

◆ fBeta

Int_t TSpectrum2Painter::fBeta
protected

Definition at line 142 of file TSpectrum2Painter.h.

◆ fBezier

Int_t TSpectrum2Painter::fBezier
protected

Definition at line 155 of file TSpectrum2Painter.h.

◆ fBx1

Int_t TSpectrum2Painter::fBx1
protected

Definition at line 128 of file TSpectrum2Painter.h.

◆ fBx2

Int_t TSpectrum2Painter::fBx2
protected

Definition at line 129 of file TSpectrum2Painter.h.

◆ fBy1

Int_t TSpectrum2Painter::fBy1
protected

Definition at line 130 of file TSpectrum2Painter.h.

◆ fBy2

Int_t TSpectrum2Painter::fBy2
protected

Definition at line 131 of file TSpectrum2Painter.h.

◆ fBzX

Int_t TSpectrum2Painter::fBzX[4]
protected

Definition at line 188 of file TSpectrum2Painter.h.

◆ fBzY

Int_t TSpectrum2Painter::fBzY[4]
protected

Definition at line 189 of file TSpectrum2Painter.h.

◆ fChanlineColor

Int_t TSpectrum2Painter::fChanlineColor
protected

Definition at line 162 of file TSpectrum2Painter.h.

◆ fChanlineEnDis

Int_t TSpectrum2Painter::fChanlineEnDis
protected

Definition at line 161 of file TSpectrum2Painter.h.

◆ fChanmarkColor

Int_t TSpectrum2Painter::fChanmarkColor
protected

Definition at line 160 of file TSpectrum2Painter.h.

◆ fChanmarkEnDis

Int_t TSpectrum2Painter::fChanmarkEnDis
protected

Definition at line 156 of file TSpectrum2Painter.h.

◆ fChanmarkHeight

Int_t TSpectrum2Painter::fChanmarkHeight
protected

Definition at line 159 of file TSpectrum2Painter.h.

◆ fChanmarkStyle

Int_t TSpectrum2Painter::fChanmarkStyle
protected

Definition at line 157 of file TSpectrum2Painter.h.

◆ fChanmarkWidth

Int_t TSpectrum2Painter::fChanmarkWidth
protected

Definition at line 158 of file TSpectrum2Painter.h.

◆ fColorAlg

Int_t TSpectrum2Painter::fColorAlg
protected

Definition at line 148 of file TSpectrum2Painter.h.

◆ fContWidth

Int_t TSpectrum2Painter::fContWidth
protected

Definition at line 140 of file TSpectrum2Painter.h.

◆ fDisplayMode

Int_t TSpectrum2Painter::fDisplayMode
protected

Definition at line 136 of file TSpectrum2Painter.h.

◆ fDxspline

Double_t TSpectrum2Painter::fDxspline
protected

Definition at line 181 of file TSpectrum2Painter.h.

◆ fDyspline

Double_t TSpectrum2Painter::fDyspline
protected

Definition at line 181 of file TSpectrum2Painter.h.

◆ fEnvelope

Short_t* TSpectrum2Painter::fEnvelope
protected

Definition at line 183 of file TSpectrum2Painter.h.

◆ fEnvelopeContour

Short_t* TSpectrum2Painter::fEnvelopeContour
protected

Definition at line 184 of file TSpectrum2Painter.h.

◆ fGbezx

Double_t TSpectrum2Painter::fGbezx
protected

Definition at line 181 of file TSpectrum2Painter.h.

◆ fGbezy

Double_t TSpectrum2Painter::fGbezy
protected

Definition at line 181 of file TSpectrum2Painter.h.

◆ fH2

TH2* TSpectrum2Painter::fH2
protected

Definition at line 121 of file TSpectrum2Painter.h.

◆ fKx

Double_t TSpectrum2Painter::fKx
protected

Definition at line 165 of file TSpectrum2Painter.h.

◆ fKy

Double_t TSpectrum2Painter::fKy
protected

Definition at line 166 of file TSpectrum2Painter.h.

◆ fLevels

Int_t TSpectrum2Painter::fLevels
protected

Definition at line 144 of file TSpectrum2Painter.h.

◆ fLHweight

Double_t TSpectrum2Painter::fLHweight
protected

Definition at line 149 of file TSpectrum2Painter.h.

◆ fLine

Int_t TSpectrum2Painter::fLine
protected

Definition at line 182 of file TSpectrum2Painter.h.

◆ fMaximumXScreenResolution

Int_t TSpectrum2Painter::fMaximumXScreenResolution
protected

Definition at line 186 of file TSpectrum2Painter.h.

◆ fModeGroup

Int_t TSpectrum2Painter::fModeGroup
protected

Definition at line 135 of file TSpectrum2Painter.h.

◆ fMxx

Double_t TSpectrum2Painter::fMxx
protected

Definition at line 167 of file TSpectrum2Painter.h.

◆ fMxy

Double_t TSpectrum2Painter::fMxy
protected

Definition at line 168 of file TSpectrum2Painter.h.

◆ fMyx

Double_t TSpectrum2Painter::fMyx
protected

Definition at line 169 of file TSpectrum2Painter.h.

◆ fMyy

Double_t TSpectrum2Painter::fMyy
protected

Definition at line 170 of file TSpectrum2Painter.h.

◆ fNewColor

TColor* TSpectrum2Painter::fNewColor
protected

Definition at line 185 of file TSpectrum2Painter.h.

◆ fNewColorIndex

Int_t TSpectrum2Painter::fNewColorIndex
protected

buffers' size

Definition at line 187 of file TSpectrum2Painter.h.

◆ fNodesx

Int_t TSpectrum2Painter::fNodesx
protected

Definition at line 138 of file TSpectrum2Painter.h.

◆ fNodesy

Int_t TSpectrum2Painter::fNodesy
protected

Definition at line 139 of file TSpectrum2Painter.h.

◆ fNuSli

Double_t TSpectrum2Painter::fNuSli
protected

Definition at line 178 of file TSpectrum2Painter.h.

◆ fPenColor

Int_t TSpectrum2Painter::fPenColor
protected

Definition at line 132 of file TSpectrum2Painter.h.

◆ fPenDash

Int_t TSpectrum2Painter::fPenDash
protected

Definition at line 133 of file TSpectrum2Painter.h.

◆ fPenWidth

Int_t TSpectrum2Painter::fPenWidth
protected

Definition at line 134 of file TSpectrum2Painter.h.

◆ fRainbow1Step

Double_t TSpectrum2Painter::fRainbow1Step
protected

Definition at line 145 of file TSpectrum2Painter.h.

◆ fRainbow2Step

Double_t TSpectrum2Painter::fRainbow2Step
protected

Definition at line 146 of file TSpectrum2Painter.h.

◆ fRainbow3Step

Double_t TSpectrum2Painter::fRainbow3Step
protected

Definition at line 147 of file TSpectrum2Painter.h.

◆ fShading

Int_t TSpectrum2Painter::fShading
protected

Definition at line 154 of file TSpectrum2Painter.h.

◆ fShadow

Int_t TSpectrum2Painter::fShadow
protected

Definition at line 153 of file TSpectrum2Painter.h.

◆ fTxx

Double_t TSpectrum2Painter::fTxx
protected

Definition at line 171 of file TSpectrum2Painter.h.

◆ fTxy

Double_t TSpectrum2Painter::fTxy
protected

Definition at line 172 of file TSpectrum2Painter.h.

◆ fTyx

Double_t TSpectrum2Painter::fTyx
protected

Definition at line 173 of file TSpectrum2Painter.h.

◆ fTyy

Double_t TSpectrum2Painter::fTyy
protected

Definition at line 174 of file TSpectrum2Painter.h.

◆ fTyz

Double_t TSpectrum2Painter::fTyz
protected

Definition at line 175 of file TSpectrum2Painter.h.

◆ fViewAngle

Int_t TSpectrum2Painter::fViewAngle
protected

Definition at line 143 of file TSpectrum2Painter.h.

◆ fVx

Double_t TSpectrum2Painter::fVx
protected

Definition at line 176 of file TSpectrum2Painter.h.

◆ fVy

Double_t TSpectrum2Painter::fVy
protected

Definition at line 177 of file TSpectrum2Painter.h.

◆ fXe

Int_t TSpectrum2Painter::fXe
protected

Definition at line 182 of file TSpectrum2Painter.h.

◆ fXlight

Int_t TSpectrum2Painter::fXlight
protected

Definition at line 150 of file TSpectrum2Painter.h.

◆ fXmax

Int_t TSpectrum2Painter::fXmax
protected

Definition at line 123 of file TSpectrum2Painter.h.

◆ fXmin

Int_t TSpectrum2Painter::fXmin
protected

Definition at line 122 of file TSpectrum2Painter.h.

◆ fXs

Int_t TSpectrum2Painter::fXs
protected

Definition at line 182 of file TSpectrum2Painter.h.

◆ fXt

Int_t TSpectrum2Painter::fXt
protected

Definition at line 182 of file TSpectrum2Painter.h.

◆ fYe

Int_t TSpectrum2Painter::fYe
protected

Definition at line 182 of file TSpectrum2Painter.h.

◆ fYlight

Int_t TSpectrum2Painter::fYlight
protected

Definition at line 151 of file TSpectrum2Painter.h.

◆ fYmax

Int_t TSpectrum2Painter::fYmax
protected

Definition at line 125 of file TSpectrum2Painter.h.

◆ fYmin

Int_t TSpectrum2Painter::fYmin
protected

Definition at line 124 of file TSpectrum2Painter.h.

◆ fYs

Int_t TSpectrum2Painter::fYs
protected

Definition at line 182 of file TSpectrum2Painter.h.

◆ fYt

Int_t TSpectrum2Painter::fYt
protected

Definition at line 182 of file TSpectrum2Painter.h.

◆ fZ

Double_t TSpectrum2Painter::fZ
protected

Definition at line 181 of file TSpectrum2Painter.h.

◆ fZeq

Double_t TSpectrum2Painter::fZeq
protected

Definition at line 181 of file TSpectrum2Painter.h.

◆ fZlight

Int_t TSpectrum2Painter::fZlight
protected

Definition at line 152 of file TSpectrum2Painter.h.

◆ fZmax

Double_t TSpectrum2Painter::fZmax
protected

Definition at line 127 of file TSpectrum2Painter.h.

◆ fZmin

Double_t TSpectrum2Painter::fZmin
protected

Definition at line 126 of file TSpectrum2Painter.h.

◆ fZPresetValue

Double_t TSpectrum2Painter::fZPresetValue
protected

Definition at line 181 of file TSpectrum2Painter.h.

◆ fZscale

Int_t TSpectrum2Painter::fZscale
protected

Definition at line 137 of file TSpectrum2Painter.h.

Libraries for TSpectrum2Painter:
[legend]

The documentation for this class was generated from the following files: