125 auto obj =
gROOT->GetListOfSpecials()->FindObject(
name);
127 Warning(
"TCutG",
"Replacing existing %s: %s (Potential memory leak).",
128 obj->IsA()->GetName(),obj->GetName());
131 gROOT->GetListOfSpecials()->Add(
this);
139 if (!ttitle) ttitle = ptitle->
GetLine(0);
141 const char *title = ttitle->
GetTitle();
142 Int_t nch = strlen(title);
143 char *vars =
new char[nch+1];
144 strlcpy(vars,title,nch+1);
145 char *col = strstr(vars,
":");
149 char *brak = strstr(col,
" {");
154 char *brak = strstr(vars,
" {");
171 auto obj =
gROOT->GetListOfSpecials()->FindObject(
name);
173 Warning(
"TCutG",
"Replacing existing %s: %s (Potential memory leak).",
174 obj->IsA()->GetName(),obj->GetName());
177 gROOT->GetListOfSpecials()->Add(
this);
185 if (!ttitle) ttitle = ptitle->
GetLine(0);
187 const char *title = ttitle->
GetTitle();
188 Int_t nch = strlen(title);
189 char *vars =
new char[nch+1];
190 strlcpy(vars,title,nch+1);
191 char *col = strstr(vars,
":");
195 char *brak = strstr(col,
" {");
200 char *brak = strstr(vars,
" {");
217 auto obj =
gROOT->GetListOfSpecials()->FindObject(
name);
219 Warning(
"TCutG",
"Replacing existing %s: %s (Potential memory leak).",
220 obj->IsA()->GetName(),obj->GetName());
223 gROOT->GetListOfSpecials()->Add(
this);
231 if (!ttitle) ttitle = ptitle->
GetLine(0);
233 const char *title = ttitle->
GetTitle();
234 Int_t nch = strlen(title);
235 char *vars =
new char[nch+1];
236 strlcpy(vars,title,nch+1);
237 char *col = strstr(vars,
":");
241 char *brak = strstr(col,
" {");
246 char *brak = strstr(vars,
" {");
262 gROOT->GetListOfSpecials()->Remove(
this);
290 for (
Int_t i=0;i<
n-1;i++) {
309 for (
Int_t i=0;i<
n-1;i++) {
311 cx += (
fX[i]-
fX[i+1])*t;
312 cy += (-
fY[i]+
fY[i+1])*t;
339 TAxis *xaxis =
h->GetXaxis();
340 TAxis *yaxis =
h->GetYaxis();
345 Int_t nbinsx =
h->GetNbinsX();
353 Int_t bin, binx, biny;
354 for (biny=biny1;biny<=biny2;biny++) {
356 for (binx=binx1;binx<=binx2;binx++) {
359 bin = binx +(nbinsx+2)*biny;
361 else integral +=
h->GetBinContent(bin);
375 out,
Class(),
"cutg",
377 out <<
" cutg->SetVarX(\"" <<
GetVarX() <<
"\");\n";
378 out <<
" cutg->SetVarY(\"" <<
GetVarY() <<
"\");\n";
433 gROOT->GetListOfSpecials()->Add(
this);
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
double Stat_t
Statistics type (double).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Class to manage histogram axis.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
Buffer base class used for serializing objects.
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
virtual Double_t IntegralHist(TH2 *h, Option_t *option="") const
Compute the integral of 2-d histogram h for all bins inside the cut if option "width" is specified,...
virtual void Center(Double_t &cx, Double_t &cy) const
Compute the center x,y of this TCutG The algorithm uses Stoke's theorem over the border of the closed...
~TCutG() override
TCutG destructor.
TCutG()
TCutG default constructor.
void Streamer(TBuffer &) override
Stream an object of class TCutG.
const char * GetVarX() const
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
TObject * fObjectY
! pointer to an object corresponding to Y
virtual void SetVarY(const char *vary)
Set Y variable.
virtual Double_t Area() const
Compute the area inside this TCutG The algorithm uses Stoke's theorem over the border of the closed p...
virtual void SetObjectY(TObject *obj)
Set the Y object (and delete the previous one if any).
virtual void SetVarX(const char *varx)
Set X variable.
TCutG & operator=(const TCutG &)
Assignment operator.
virtual void SetObjectX(TObject *obj)
Set the X object (and delete the previous one if any).
TObject * fObjectX
! pointer to an object corresponding to X
const char * GetVarY() const
Int_t fNpoints
Number of points <= fMaxSize.
Double_t * fY
[fNpoints] array of Y points
virtual Int_t IsInside(Double_t x, Double_t y) const
void SetName(const char *name="") override
Set the name of the TNamed.
Double_t * fX
[fNpoints] array of X points
TGraph & operator=(const TGraph &)
Service class for 2-D histogram classes.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
TObject()
TObject constructor.
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
Save array in the output stream "out" as vector.
@ kInvalidObject
if object ctor succeeded but object should not be used
virtual TText * GetLine(Int_t number) const
virtual TText * GetLineWith(const char *text) const
void ToLower()
Change string to lower-case.
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const