139 l = strstr(opt,
"CANDLE");
143 char direction =
' ';
146 if (l[6] >=
'A' && l[6] <=
'Z') direction = l[6];
147 if (l[6] >=
'1' && l[6] <=
'9') preset = l[6];
148 if (l[7] >=
'A' && l[7] <=
'Z' && preset !=
' ') direction = l[7];
149 if (l[7] >=
'1' && l[7] <=
'9' && direction !=
' ') preset = l[7];
151 if (direction ==
'X' || direction ==
'V') { }
155 else if (preset ==
'2')
157 else if (preset ==
'3')
159 else if (preset ==
'4')
161 else if (preset ==
'5')
163 else if (preset ==
'6')
165 else if (preset !=
' ')
168 if (preset !=
' ' && direction !=
' ')
170 else if (preset !=
' ' || direction !=
' ')
175 Bool_t useIndivOption =
false;
178 char *brOpen = strstr(opt,
"(");
179 char *brClose = strstr(opt,
")");
180 char indivOption[32];
181 if (brOpen && brClose) {
182 useIndivOption =
true;
184 strlcpy(indivOption, brOpen, brClose-brOpen+2);
185 sscanf(indivOption,
"(%d)", (
int*) &
fOption);
187 strncpy(brOpen,
" ",brClose-brOpen+1);
192 if (!useIndivOption && !
fOption ) {
197 l = strstr(opt,
"VIOLIN");
201 char direction =
' ';
204 if (l[6] >=
'A' && l[6] <=
'Z') direction = l[6];
205 if (l[6] >=
'1' && l[6] <=
'9') preset = l[6];
206 if (l[7] >=
'A' && l[7] <=
'Z' && preset !=
' ') direction = l[7];
207 if (l[7] >=
'1' && l[7] <=
'9' && direction !=
' ') preset = l[7];
209 if (direction ==
'X' || direction ==
'V') { }
213 else if (preset ==
'2')
215 else if (preset !=
' ')
218 if (preset !=
' ' && direction !=
' ')
220 else if (preset !=
' ' || direction !=
' ')
225 Bool_t useIndivOption =
false;
228 char *brOpen = strstr(opt,
"(");
229 char *brClose = strstr(opt,
")");
230 char indivOption[32];
231 if (brOpen && brClose) {
232 useIndivOption =
true;
234 strlcpy(indivOption, brOpen, brClose-brOpen +2);
235 sscanf(indivOption,
"(%d)", (
int*) &
fOption);
237 strncpy(brOpen,
" ",brClose-brOpen+1);
242 if (!useIndivOption && !
fOption ) {
271 prob[0]=1
E-15; prob[1]=0.25; prob[2]=0.5; prob[3]=0.75; prob[4]=1-1
E-15;
273 quantiles[0]=0.; quantiles[1]=0.; quantiles[2] = 0.; quantiles[3] = 0.; quantiles[4] = 0.;
290 if (quantiles[0] >= quantiles[4] ||
291 quantiles[1] >= quantiles[3]) {
324 if (myData < fWhiskerDown && myData >= fBoxDown - 1.5*iqr)
fWhiskerDown = myData;
362 if (scaledBinContent >0 && scaledBinContent < 1) scaledBinContent = 1;
363 for (
int j=0; j < (int)scaledBinContent; j++) {
370 if ((
int)scaledBinContent == 1)
393 Error (
"PaintCandlePlot",
"Not possible to draw all outliers.");
400 myScale = nOutliers/(maxOutliers/2.);
408 if (!(i % (
int) myScale == 0 ))
continue;
436 Error (
"PaintCandlePlotRaw",
"Not possible to draw all outliers.");
448 fProj =
new TH1D(
"hpa",
"hpa",100,min,max+0.0001*(max-min));
578 dimRight, dimRight-
fCandleWidth/3., dimRight, dimRight, dimLeft};
583 Double_t x[] = {dimLeft, dimLeft, dimRight, dimRight, dimLeft};
611 Double_t myMedianX[1], myMedianY[1];
622 if (myMedianX[0] > 0) myMedianX[0] =
TMath::Log10(myMedianX[0]);
else isValid =
false;
625 if (myMedianY[0] > 0) myMedianY[0] =
TMath::Log10(myMedianY[0]);
else isValid =
false;
631 if (isValid)
gPad->PaintPolyMarker(1,myMedianX,myMedianY);
650 if (myMeanX[0] > 0) myMeanX[0] =
TMath::Log10(myMeanX[0]);
else isValid =
false;
653 if (myMeanY[0] > 0) myMeanY[0] =
TMath::Log10(myMeanY[0]);
else isValid =
false;
659 if (isValid)
gPad->PaintPolyMarker(1,myMeanX,myMeanY);
701 for (pos = 0; pos < 16; pos++) {
702 if (myOpt > opt)
break;
708 return ((thisOpt * myOpt) == opt);
719 for (
int i=0; i<nPoints; i++) {
725 for (
int i=0; i<nPoints; i++) {
731 gPad->PaintFillArea(nPoints, x, y);
732 gPad->PaintPolyLine(nPoints, x, y);
734 gPad->PaintFillArea(nPoints, y, x);
735 gPad->PaintPolyLine(nPoints, y, x);
755 gPad->PaintLine(x1, y1, x2, y2);
757 gPad->PaintLine(y1, x1, y2, x2);
764 void TCandle::Streamer(
TBuffer &R__b)
793 fMean = axisMinCoord + ((
fMean-
a)/b)*(axisMaxCoord-axisMinCoord);
796 fBoxUp = axisMinCoord + ((
fBoxUp-
a)/b)*(axisMaxCoord-axisMinCoord);
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
TCandle()
TCandle default constructor.
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 WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Double_t fMedian
Position of the median.
If this bit is not set it is vertical.
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 ...
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
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.
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.
int ParseOption(char *optin)
Parsing of the option-string.
Double_t fAxisMin
The Minimum which is visible by the axis (used by zero indicator)
Double_t * fDatapoints
position of all Datapoints within this candle
Double_t fDrawPointsX[kNMAXPOINTS]
x-coord for every outlier, ..
virtual Double_t GetBinLowEdge(Int_t bin) const
Return bin lower edge for 1D histogram.
virtual void Modify()
Change current line attributes if necessary.
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 Style_t GetMarkerStyle() const
Return the marker style.
virtual Style_t GetLineStyle() const
Return the line style.
static const double x2[5]
Fill Area Attributes class.
Double_t fCandleWidth
The candle width.
int fLogX
make the candle appear logx-like
void Quantiles(Int_t n, Int_t nprob, Double_t *x, Double_t *quantiles, Double_t *prob, Bool_t isSorted=kTRUE, Int_t *index=0, Int_t type=7)
Computes sample quantiles, corresponding to the given probabilities Parameters: x -the data sample n ...
virtual void Modify()
Change current fill area attributes if necessary.
void PaintBox(Int_t nPoints, Double_t *x, Double_t *y, Bool_t swapXY)
Paint a box for candle.
Double_t Log10(Double_t x)
Double_t fDrawPointsY[kNMAXPOINTS]
y-coord for every outlier, ..
void Error(const char *location, const char *msgfmt,...)
Double_t fHistoPointsX[kNMAXPOINTS]
x-coord for the polyline of the histo
Double_t fBoxDown
Position of the lower box end.
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...
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void Modify()
Change current marker attributes if necessary.
Double_t fBoxUp
Position of the upper box end.
int fLogY
make the candle appear logy-like
The candle plot painter class.
void Calculate()
Calculates all values needed by the candle definition depending on the candle options.
Double_t fAxisMax
The Maximum which is visible by the axis (used by zero indicator)
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.
virtual Color_t GetLineColor() const
Return the line color.
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 GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
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]
virtual TH1 * RebinX(Int_t ngroup=2, const char *newname="")
CandleOption fOption
Setting the style of the candle.
Double_t fMedianErr
The size of the notch.
Double_t fHistoPointsY[kNMAXPOINTS]
y-coord for the polyline of the histo
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Double_t GetEntries() const
Return the current number of entries.
int GetCandleOption(const int pos)
Long64_t fNDrawPoints
max number of outliers or other point to be shown
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
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
virtual ~TCandle()
TCandle default destructor.
bool fIsRaw
0: for TH1 projection, 1: using raw data
virtual Int_t GetNbinsX() const
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
Long64_t fNDatapoints
Number of Datapoints within this candle.