28 fHist->Draw(
"colz same");
43 mark->SetMarkerSize(1.5);
44 mark->SetMarkerColor(color);
61 g->SetLineStyle(style);
62 g->SetLineColor(color);
76 if (gPad && !gPad->GetListOfPrimitives()->IsEmpty())
return;
78 const TAxis *
ax =
fHist->GetXaxis();
79 const TAxis *ay =
fHist->GetYaxis();
80 const double Nx = ax->GetNbins();
81 const double Ny = ay->GetNbins();
87 ax->GetTitle(), ay->GetTitle()),
94 axes->SetMinimum(
fHist->GetMinimum());
95 axes->SetMaximum(
fHist->GetMaximum());
98 axes->SetTitle(
fHist->GetTitle());
99 axes->GetXaxis()->SetLabelSize(ax->GetLabelSize());
100 axes->GetYaxis()->SetLabelSize(ay->GetLabelSize());
101 axes->GetXaxis()->SetLabelOffset(ax->GetLabelOffset());
102 axes->GetYaxis()->SetLabelOffset(ay->GetLabelOffset());
103 axes->GetXaxis()->CenterTitle();
104 axes->GetYaxis()->CenterTitle();
106 if(
fLogX) gPad->SetLogx();
107 if(
fLogY) gPad->SetLogy();
117 std::vector<TGraph*>
ret;
123 TVirtualPad* bak = gPad;
125 const bool wasbatch = gROOT->IsBatch();
129 gStyle->SetOptStat(0);
132 surf->SetContour(1, &level);
133 surf->Draw(
"cont list");
138 gROOT->SetBatch(wasbatch);
145 TCollection*
specs = gROOT->GetListOfSpecials();
147 TIter nextSpec(specs);
148 while(TObject* spec = nextSpec()){
149 if(!spec->InheritsFrom(TObjArray::Class()))
continue;
150 TObjArray* conts = (TObjArray*)spec;
152 if(conts->IsEmpty())
continue;
154 if(!conts->At(0)->InheritsFrom(TList::Class()))
continue;
155 TList* cont = (TList*)conts->At(0);
159 while(TObject* obj = nextObj()){
160 if(!obj->InheritsFrom(TGraph::Class()))
continue;
162 ret.push_back((TGraph*)obj->Clone(
UniqueName().c_str()));
179 for (
int x = 0;
x < ret->GetNbinsX() + 2; ++
x)
181 for (
int y = 0;
y < ret->GetNbinsY() + 2; ++
y)
194 fHist->SetTitle(str);
200 TDirectory *oldDir = gDirectory;
208 v.Write(
"minValues");
210 fHist->Write(
"hist");
221 TObjString(
fLogX ?
"yes" :
"no").Write(
"logx");
222 TObjString(
fLogY ?
"yes" :
"no").Write(
"logy");
236 surf.
fHist = (TH2F *) dir->Get(
"hist");
241 for (
int idx = 0;
idx < s.GetNrows(); ++
idx)
245 for (
int idx = 0; idx < m->GetNrows(); ++
idx)
255 TH2*
h =
new TH2F(*s.
fHist);
257 for(
int x = 0;
x < h->GetNbinsX()+2; ++
x)
258 for(
int y = 0;
y < h->GetNbinsY()+2; ++
y)
259 h->SetBinContent(
x,
y, level);
267 const TAxis*
ax =
fHist->GetXaxis();
268 return fLogX ? ax->GetBinCenterLog(bin) : ax->GetBinCenter(bin);
274 const TAxis*
ax =
fHist->GetYaxis();
275 return fLogY ? ax->GetBinCenterLog(bin) : ax->GetBinCenter(bin);
Cuts and Vars for the 2020 FD DiF Study.
double BinCenterX(int bin) const
void CheckMask(const std::string &func) const
void SetTitle(const char *str)
double BinCenterY(int bin) const
std::vector< TGraph * > GetGraphs(TH2 *fc, double minchi=-1)
For expert use, custom painting of contours.
void DrawBestFit(Color_t color, Int_t marker=kFullCircle) const
Draw the best fit point.
void Draw() const
Draw the surface itself.
void DrawContour(TH2 *fc, Style_t style, Color_t color, double minchi=-1)
double func(double x, double y)
void SaveToHelper(TDirectory *dir) const
dir should already be the appropriate sub-directory
std::vector< double > fSeedValues
TH2 * ToTH2(double minchi=-1) const
friend TH2 * Flat(double, const ISurface &)
Helper function for the gaussian approximation surfaces.
std::vector< int > fBinMask
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
static void FillSurfObj(ISurface &surf, TDirectory *dir)
Prevent histograms being added to the current directory.
std::string UniqueName()
Return a different string each time, for creating histograms.