23 const Int_t kNMAXPOINTS = 2010;
25 class TCandle :
public TAttLine,
public TAttFill,
public TAttMarker {
28 enum CandleOption:
long {
39 kPointsOutliers = 100000,
41 kPointsAllScat = 300000,
43 kHistoRight = 2000000,
44 kHistoViolin = 3000000,
45 kHistoZeroIndicator = 10000000,
46 kHorizontal = 100000000
57 Double_t fPosCandleAxis;
58 Double_t fCandleWidth;
67 Double_t fWhiskerDown;
69 Double_t * fDatapoints;
70 Long64_t fNDatapoints;
72 Double_t fDrawPointsX[kNMAXPOINTS];
73 Double_t fDrawPointsY[kNMAXPOINTS];
74 Long64_t fNDrawPoints;
76 Double_t fHistoPointsX[kNMAXPOINTS];
77 Double_t fHistoPointsY[kNMAXPOINTS];
89 static Double_t fWhiskerRange;
90 static Double_t fBoxRange;
92 static Bool_t fScaledCandle;
93 static Bool_t fScaledViolin;
97 int GetCandleOption(
const int pos) {
return (fOption/(
long)TMath::Power(10,pos))%10;}
99 void PaintBox(Int_t nPoints, Double_t *x, Double_t *y, Bool_t swapXY);
100 void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Bool_t swapXY);
105 TCandle(
const char *opt);
106 TCandle(
const Double_t candlePos,
const Double_t candleWidth, Long64_t n, Double_t * points);
107 TCandle(
const Double_t candlePos,
const Double_t candleWidth, TH1D *proj);
108 TCandle(
const TCandle &candle);
111 Double_t GetMean()
const {
return fMean;}
112 Double_t GetMedian()
const {
return fMedian;}
113 Double_t GetQ1()
const {
return fBoxUp;}
114 Double_t GetQ2()
const {
return fMedian;}
115 Double_t GetQ3()
const {
return fBoxDown;}
116 Bool_t IsHorizontal() {
return (IsOption(kHorizontal)); }
117 Bool_t IsVertical() {
return (!IsOption(kHorizontal)); }
118 Bool_t IsCandleScaled();
119 Bool_t IsViolinScaled();
121 void SetOption(CandleOption opt) { fOption = opt; }
122 void SetLog(
int x,
int y,
int z) { fLogX = x; fLogY = y; fLogZ = z;}
123 void SetAxisPosition(
const Double_t candlePos) { fPosCandleAxis = candlePos; }
125 void SetCandleWidth(
const Double_t width) { fCandleWidth = width; }
126 void SetHistoWidth(
const Double_t width) { fHistoWidth = width; }
127 void SetHistogram(TH1D *proj) { fProj = proj; fIsCalculated =
false;}
129 virtual void Paint(Option_t *option=
"");
130 void ConvertToPadCoords(Double_t minAxis, Double_t maxAxis, Double_t axisMinCoord, Double_t axisMaxCoord);
132 virtual void SetMean(Double_t mean) { fMean = mean; }
133 virtual void SetMedian(Double_t median) { fMedian = median; }
134 virtual void SetQ1(Double_t q1) { fBoxUp = q1; }
135 virtual void SetQ2(Double_t q2) { fMedian = q2; }
136 virtual void SetQ3(Double_t q3) { fBoxDown = q3; }
138 int ParseOption(
char *optin);
139 const char * GetDrawOption() {
return fOptionStr; }
140 long GetOption() {
return fOption; }
141 bool IsOption(CandleOption opt);
142 static void SetWhiskerRange(
const Double_t wRange);
143 static void SetBoxRange(
const Double_t bRange);
144 static void SetScaledCandle(
const Bool_t cScale =
true);
145 static void SetScaledViolin(
const Bool_t vScale =
true);