99 strlcpy(myopt,opt,128);
246 char *
l = strstr(opt,
"CANDLE");
251 char direction =
' ';
254 if (
l[6] >=
'A' &&
l[6] <=
'Z') direction =
l[6];
255 if (
l[6] >=
'1' &&
l[6] <=
'9') preset =
l[6];
256 if (
l[7] >=
'A' &&
l[7] <=
'Z' && preset !=
' ') direction =
l[7];
257 if (
l[7] >=
'1' &&
l[7] <=
'9' && direction !=
' ') preset =
l[7];
259 if (direction ==
'X' || direction ==
'V') { }
263 else if (preset ==
'2')
265 else if (preset ==
'3')
267 else if (preset ==
'4')
269 else if (preset ==
'5')
271 else if (preset ==
'6')
273 else if (preset !=
' ')
276 if (preset !=
' ' && direction !=
' ')
278 else if (preset !=
' ' || direction !=
' ')
283 Bool_t useIndivOption =
false;
285 if (direction ==
' ') direction =
'X';
287 char *brOpen = strstr(opt,
"(");
288 char *brClose = strstr(opt,
")");
289 char indivOption[32];
290 if (brOpen && brClose) {
291 useIndivOption =
true;
293 strlcpy(indivOption, brOpen, brClose-brOpen+2);
294 sscanf(indivOption,
"(%d)", (
int*) &
fOption);
296 memcpy(brOpen,
" ",brClose-brOpen+1);
306 if (!useIndivOption && !
fOption ) {
312 l = strstr(opt,
"VIOLIN");
316 char direction =
' ';
319 if (
l[6] >=
'A' &&
l[6] <=
'Z') direction =
l[6];
320 if (
l[6] >=
'1' &&
l[6] <=
'9') preset =
l[6];
321 if (
l[7] >=
'A' &&
l[7] <=
'Z' && preset !=
' ') direction =
l[7];
322 if (
l[7] >=
'1' &&
l[7] <=
'9' && direction !=
' ') preset =
l[7];
324 if (direction ==
'X' || direction ==
'V') { }
328 else if (preset ==
'2')
330 else if (preset !=
' ')
333 if (preset !=
' ' && direction !=
' ')
335 else if (preset !=
' ' || direction !=
' ')
340 Bool_t useIndivOption =
false;
342 if (direction ==
' ') direction =
'X';
344 char *brOpen = strstr(opt,
"(");
345 char *brClose = strstr(opt,
")");
346 char indivOption[32];
347 if (brOpen && brClose) {
348 useIndivOption =
true;
350 strlcpy(indivOption, brOpen, brClose-brOpen +2);
351 sscanf(indivOption,
"(%d)", (
int*) &
fOption);
353 memcpy(brOpen,
" ",brClose-brOpen+1);
363 if (!useIndivOption && !
fOption ) {
404 prob[0] = 0.5 - wRange/2.;
405 prob[4] = 0.5 + wRange/2.;
412 prob[1] = 0.5 - bRange/2.;
413 prob[3] = 0.5 + bRange/2.;
418 Double_t quantiles[5] = { 0., 0., 0., 0., 0. };
435 if (quantiles[0] >= quantiles[4] ||
436 quantiles[1] >= quantiles[3]) {
502 if (scaledBinContent >0 && scaledBinContent < 1) scaledBinContent = 1;
503 for (
int j=0; j < (
int)scaledBinContent; j++) {
510 if ((
int)scaledBinContent == 1)
533 Error (
"PaintCandlePlot",
"Not possible to draw all outliers.");
540 myScale = nOutliers/(maxOutliers/2.);
548 if (!(i % (
int) myScale == 0 ))
continue;
576 Error (
"PaintCandlePlotRaw",
"Not possible to draw all outliers.");
587 fProj =
new TH1D(
"hpa",
"hpa",100,min,max+0.0001*(max-min));
622 if (myBinValue > 0) myBinValue =
TMath::Log10(myBinValue);
else myBinValue = 0;
723 dimRight, dimRight-
fCandleWidth/3., dimRight, dimRight, dimLeft};
728 Double_t x[] = {dimLeft, dimLeft, dimRight, dimRight, dimLeft};
756 Double_t myMedianX[1], myMedianY[1];
767 if (myMedianX[0] > 0) myMedianX[0] =
TMath::Log10(myMedianX[0]);
else isValid =
false;
770 if (myMedianY[0] > 0) myMedianY[0] =
TMath::Log10(myMedianY[0]);
else isValid =
false;
776 if (isValid)
gPad->PaintPolyMarker(1,myMedianX,myMedianY);
795 if (myMeanX[0] > 0) myMeanX[0] =
TMath::Log10(myMeanX[0]);
else isValid =
false;
798 if (myMeanY[0] > 0) myMeanY[0] =
TMath::Log10(myMeanY[0]);
else isValid =
false;
804 if (isValid)
gPad->PaintPolyMarker(1,myMeanX,myMeanY);
846 for (pos = 0; pos < 16; pos++) {
847 if (myOpt > opt)
break;
853 return (thisOpt * myOpt) == opt;
866 for (
int i=0; i<nPoints; i++) {
872 for (
int i=0; i<nPoints; i++) {
878 gPad->PaintFillArea(nPoints,
x,
y);
879 gPad->PaintPolyLine(nPoints,
x,
y);
881 gPad->PaintFillArea(nPoints,
y,
x);
882 gPad->PaintPolyLine(nPoints,
y,
x);
942 fMean = axisMinCoord + ((
fMean-
a)/
b)*(axisMaxCoord-axisMinCoord);
945 fBoxUp = axisMinCoord + ((
fBoxUp-
a)/
b)*(axisMaxCoord-axisMinCoord);
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Option_t Option_t SetLineColor
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t SetMarkerStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TStyle * gStyle
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void Modify()
Change current fill area attributes if necessary.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void Modify()
Change current line attributes if necessary.
virtual void Modify()
Change current marker attributes if necessary.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
The candle plot painter class.
Double_t fMedian
Position of the median.
@ kHorizontal
If this bit is not set it is vertical.
void Streamer(TBuffer &) override
Stream an object of class TCandle.
static void SetScaledViolin(const Bool_t vScale=true)
Static function to set scaling between violin-withs.
bool fIsRaw
0: for TH1 projection, 1: using raw data
CandleOption fOption
Setting the style of the candle.
TString fOptionStr
String to draw the candle.
Double_t fAxisMax
The Maximum which is visible by the axis (used by zero indicator)
~TCandle() override
TCandle default destructor.
int fLogZ
make the candle appear logz-like
Double_t fPosCandleAxis
x-pos for a vertical candle
int GetCandleOption(const int pos) const
Double_t fMean
Position of the mean.
Double_t fWhiskerDown
Position of the lower whisker end.
Long64_t fNDrawPoints
max number of outliers or other point to be shown
virtual void Paint(Option_t *option="")
Paint one candle with its current attributes.
Double_t fAxisMin
The Minimum which is visible by the axis (used by zero indicator)
void ConvertToPadCoords(Double_t minAxis, Double_t maxAxis, Double_t axisMinCoord, Double_t axisMaxCoord)
The coordinates in the TParallelCoordVar-class are in Pad-Coordinates, so we need to convert them.
Double_t fDrawPointsY[kNMAXPOINTS]
y-coord for every outlier, ..
Long64_t fNDatapoints
Number of Datapoints within this candle.
Bool_t IsViolinScaled() const
Returns true if violin plot should be scaled.
Double_t fHistoPointsY[kNMAXPOINTS]
y-coord for the polyline of the histo
Bool_t IsHorizontal() const
Double_t fHistoPointsX[kNMAXPOINTS]
x-coord for the polyline of the histo
static void SetScaledCandle(const Bool_t cScale=true)
Static function to set scaling between candles-withs.
Double_t * fDatapoints
position of all Datapoints within this candle
int ParseOption(char *optin)
Parsing of the option-string.
bool fDismiss
True if the candle cannot be painted.
Double_t fWhiskerUp
Position of the upper whisker end.
static void SetBoxRange(const Double_t bRange)
Static function to set BoxRange, by setting box-range, one can force the box of the candle-chart to c...
bool IsOption(CandleOption opt) const
Return true is this option is activated in fOption.
int fLogY
make the candle appear logy-like
Double_t fMedianErr
The size of the notch.
void PaintBox(Int_t nPoints, Double_t *x, Double_t *y, Bool_t swapXY)
Paint a box for candle.
Double_t fBoxUp
Position of the upper box end.
int fLogX
make the candle appear logx-like
Double_t fDrawPointsX[kNMAXPOINTS]
x-coord for every outlier, ..
TCandle()
TCandle default constructor.
Double_t fBoxDown
Position of the lower box end.
void Calculate()
Calculates all values needed by the candle definition depending on the candle options.
void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Bool_t swapXY)
Paint a line for candle.
Double_t fHistoWidth
The histo width (the height of the max bin)
Bool_t IsCandleScaled() const
Returns true if candle plot should be scaled.
static void SetWhiskerRange(const Double_t wRange)
Static function to set WhiskerRange, by setting whisker-range, one can force the whiskers to cover th...
Double_t fCandleWidth
The candle width.
1-D histogram with a double per channel (see TH1 documentation)}
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
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.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual Int_t GetNbinsX() const
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual TH1 * RebinX(Int_t ngroup=2, const char *newname="")
virtual Double_t GetBinLowEdge(Int_t bin) const
Return bin lower edge for 1D histogram.
virtual Double_t GetEntries() const
Return the current number of entries.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum=nullptr)
Compute Quantiles for this histogram Quantile x_q of a probability distribution Function F is defined...
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
Random number generator class based on the maximally quidistributed combined Tausworthe generator by ...
Double_t Rndm() override
TausWorth generator from L'Ecuyer, uses as seed 3x32bits integers Use a mask of 0xffffffffUL to make ...
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t GetViolinScaled() const
Bool_t GetCandleScaled() const
Double_t GetCandleWhiskerRange() const
void SetCandleScaled(Bool_t on=kFALSE)
Double_t GetCandleBoxRange() const
void SetViolinScaled(Bool_t on=kTRUE)
void SetCandleWhiskerRange(Double_t wRange=1.0)
By setting whisker-range for candle plot, one can force the whiskers to cover the fraction of the dis...
void SetCandleBoxRange(Double_t bRange=0.5)
By setting box-range for candle plot, one can force the box of the candle-chart to cover that given f...
void Quantiles(Int_t n, Int_t nprob, Double_t *x, Double_t *quantiles, Double_t *prob, Bool_t isSorted=kTRUE, Int_t *index=nullptr, Int_t type=7)
Computes sample quantiles, corresponding to the given probabilities.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.