99 l = strstr(opt,
"CANDLE");
103 char direction =
' ';
106 if (l[6] >=
'A' && l[6] <=
'Z') direction = l[6];
107 if (l[6] >=
'1' && l[6] <=
'9') preset = l[6];
108 if (l[7] >=
'A' && l[7] <=
'Z' && preset !=
' ') direction = l[7];
109 if (l[7] >=
'1' && l[7] <=
'9' && direction !=
' ') preset = l[7];
111 if (direction ==
'X' || direction ==
'V') { }
126 if (preset !=
' ' && direction !=
' ')
128 else if (preset !=
' ' || direction !=
' ')
133 Bool_t useIndivOption =
false;
136 char *brOpen = strstr(opt,
"(");
137 char *brClose = strstr(opt,
")");
138 char indivOption[32];
139 if (brOpen && brClose) {
140 useIndivOption =
true;
141 strncpy(indivOption, brOpen, brClose-brOpen +1);
142 sscanf(indivOption,
"(%d)", (
int*) &
fOption);
143 strncpy(brOpen,
" ",brClose-brOpen+1);
148 if (!useIndivOption && !
fOption ) {
165 prob[0]=1
E-15; prob[1]=0.25; prob[2]=0.5; prob[3]=0.75; prob[4]=1-1
E-15;
167 quantiles[0]=0.; quantiles[1]=0.; quantiles[2] = 0.; quantiles[3] = 0.; quantiles[4] = 0.;
173 if (quantiles[0] >= quantiles[4])
return;
174 if (quantiles[1] >= quantiles[3])
return;
234 dimRight, dimRight-
fCandleWidth/3., dimRight, dimRight, dimLeft};
239 Double_t x[] = {dimLeft, dimLeft, dimRight, dimRight, dimLeft};
246 dimRight, dimRight-
fCandleWidth/3., dimRight, dimRight, dimLeft};
251 Double_t x[] = {dimLeft, dimLeft, dimRight, dimRight, dimLeft};
279 Double_t myMedianX[1], myMedianY[1];
290 if (myMedianX[0] > 0) myMedianX[0] =
TMath::Log10(myMedianX[0]);
else isValid =
false;
293 if (myMedianY[0] > 0) myMedianY[0] =
TMath::Log10(myMedianY[0]);
else isValid =
false;
299 if (isValid)
gPad->PaintPolyMarker(1,myMedianX,myMedianY);
318 if (myMeanX[0] > 0) myMeanX[0] =
TMath::Log10(myMeanX[0]);
else isValid =
false;
321 if (myMeanY[0] > 0) myMeanY[0] =
TMath::Log10(myMeanY[0]);
else isValid =
false;
327 if (isValid)
gPad->PaintPolyMarker(1,myMeanX,myMeanY);
353 const int maxOutliers =
kNMAX;
363 if (scaledBinContent >0 && scaledBinContent < 1) scaledBinContent = 1;
364 for (
int j=0; j < (int)scaledBinContent; j++) {
365 if (nOutliers >= maxOutliers)
break;
371 if ((
int)scaledBinContent == 1)
379 keepCurrently = outliersX[nOutliers];
380 outliersX[nOutliers] = outliersY[nOutliers];
381 outliersY[nOutliers] = keepCurrently;
385 if (outliersX[nOutliers] > 0) outliersX[nOutliers] =
TMath::Log10(outliersX[nOutliers]);
else continue;
388 if (outliersY[nOutliers] > 0) outliersY[nOutliers] =
TMath::Log10(outliersY[nOutliers]);
else continue;
393 if (nOutliers > maxOutliers) {
394 Error (
"PaintCandlePlot",
"Not possible to draw all outliers.");
405 gPad->PaintPolyMarker(nOutliers,outliersX, outliersY);
415 for (pos = 0; pos < 7; pos++) {
416 if (myOpt > opt)
break;
422 return ((thisOpt * myOpt) == opt);
433 for (
int i=0; i<nPoints; i++) {
439 for (
int i=0; i<nPoints; i++) {
445 if (fill)
gPad->PaintFillArea(nPoints, x, y);
447 gPad->PaintPolyLine(nPoints, x, y);
449 if (fill)
gPad->PaintFillArea(nPoints, y, x);
450 gPad->PaintPolyLine(nPoints, y, x);
470 gPad->PaintLine(x1, y1, x2, y2);
472 gPad->PaintLine(y1, x1, y2, x2);
479 void TCandle::Streamer(
TBuffer &R__b)
virtual Style_t GetLineStyle() const
Return the line style.
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
TCandle()
TCandle default constructor.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
Double_t fMedian
Position of the median.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Double_t fWhiskerUp
Position of the upper whisker end.
bool IsOption(CandleOption opt)
Return true is this option is activated in fOption.
Random number generator class based on the maximally quidistributed combined Tausworthe generator by ...
Double_t fNDatapoints
Number of Datapoints within this candle.
virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum=0)
Compute Quantiles for this histogram Quantile x_q of a probability distribution Function F is defined...
Buffer base class used for serializing objects.
int ParseOption(char *optin)
Parsing of the option-string.
virtual Int_t GetNbinsX() const
Double_t * fDatapoints
position of all Datapoints within this candle
virtual void Modify()
Change current line attributes if necessary.
virtual Double_t GetEntries() const
Return the current number of entries.
void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Bool_t swapXY)
Paint a line for candle.
Double_t fMean
Position of the mean.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
static const double x2[5]
Fill Area Attributes class.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return bin lower edge for 1D histogram.
Double_t fCandleWidth
The candle width.
virtual void Modify()
Change current fill area attributes if necessary.
Double_t Log10(Double_t x)
void Error(const char *location, const char *msgfmt,...)
Double_t fBoxDown
Position of the lower box end.
virtual void Modify()
Change current marker attributes if necessary.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Double_t fBoxUp
Position of the upper box end.
virtual Double_t GetMean(Int_t axis=1) const
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
The candle plot painter class.
void Calculate()
Calculates all values needed by the candle definition depending on the candle options.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
tomato 1-D histogram with a double per channel (see TH1 documentation)}
virtual void Paint(Option_t *option="")
Paint one candle with its current attributes.
void PaintBox(Int_t nPoints, Double_t *x, Double_t *y, Bool_t swapXY, Bool_t fill)
Paint a box for candle.
bool fDismiss
True if the candle cannot be painted.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Double_t Rndm()
TausWorth generator from L'Ecuyer, uses as seed 3x32bits integers Use a mask of 0xffffffffUL to make ...
static const double x1[5]
CandleOption fOption
Setting the style of the candle.
int GetCandleOption(const int pos)
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Double_t fWhiskerDown
Position of the lower whisker end.
Double_t fPosCandleAxis
x-pos for a vertical candle
virtual ~TCandle()
TCandle default destructor.
bool fIsRaw
0: for TH1 projection, 1: using raw data
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0