32 static bool doRestore =
false;
33 auto select =
dynamic_cast<TGraph *
>(
gPad->GetSelected());
35 int event =
gPad->GetEvent();
39 }
else if (event == 11 || doRestore) {
40 if (!select || doRestore) {
43 for (
int i = 1; i <= _h->GetNbinsX(); i++) {
44 std::string parName = _h->GetXaxis()->GetBinLabel(i);
51 gPad->GetMother()->GetMother()->cd();
58 TString _name = select->GetName();
62 _name = _name(0, _name.
Index(
";"));
64 auto _h =
static_cast<TH1 *
>(
gPad->GetPrimitive(
"nominal")->
FindObject(
"scales"));
67 for (
int i = 1; i <= _h->GetNbinsX(); i++) {
68 if (_name == _h->GetXaxis()->GetBinLabel(i)) {
69 auto _gr =
static_cast<TGraph *
>(
gPad->GetPrimitive(
"nominal"));
70 if (_varyName ==
"") {
74 while (newPoint && newPoint->
GetN() > 0) {
84 newPoint->
SetPointX(0, _gr->GetPointX(i - 1));
89 newPoint->
Draw(
"z0p");
90 select->SetPoint(0, _gr->GetPointX(i - 1), _gr->GetPointY(i - 1));
93 select->SetPointX(0, _gr->GetPointX(i - 1));
97 ->
SetPoint(0, i - 1, _gr->GetPointY(i - 1));
103 auto _node =
dynamic_cast<xRooNode *
>(
gPad->GetPrimitive(
"node"));
106 RooArgSet _pars(_node->pars().argList());
107 std::unique_ptr<RooArgSet> snap(_pars.
snapshot());
110 for (
int i = 1; i <= _h->GetNbinsX(); i++) {
111 std::string parName = _h->GetXaxis()->GetBinLabel(i);
116 g &&
g->GetN() > 0) {
118 g->GetPointY(0) * _h->GetBinError(i) + _h->GetBinContent(i);
124 _h->GetBinContent(i));
131 gStyle->SetLineColor(select->GetMarkerColor());
133 gPad->GetMother()->GetMother()->cd(1);
136 static_cast<TAttLine &
>(*gStyle) = bak;
137 static_cast<TAttFill &
>(*gStyle) = bak2;
139 _tmpPad->GetCanvas()->cd();
140 gPad->GetCanvas()->Paint();
141 gPad->GetCanvas()->Update();
153 auto _pull_pad =
gPad->GetPad(1);
154 auto _hidden_pad =
gPad->GetPad(2);
156 if (!_pull_pad || strcmp(_pull_pad->GetName(),
"pulls") != 0)
163 int px =
gPad->GetEventX();
169 gPad->SetUniqueID(px);
170 float upx =
gPad->AbsPixeltoX(px);
171 float x =
gPad->PadtoX(upx);
175 for (
auto g : *_hidden_pad->GetListOfPrimitives()) {
188 if (
auto line =
dynamic_cast<TGraph *
>(
gPad->GetListOfPrimitives()->FindObject(
"markerLine"));
line) {
189 line->SetPointX(0, _x);
190 line->SetPointX(1, _x);
193 line->SetLineStyle(2);
194 line->SetName(
"markerLine");
196 line->SetPoint(0, _x, -100);
197 line->SetPoint(1, _x, 100);
202 for (
auto o : *_pull_pad->GetListOfPrimitives()) {
203 if (!o->InheritsFrom(
"TGraph"))
205 if (_hidden_pad->GetListOfPrimitives()->FindObject(o) ||
TString(o->GetName()).
EndsWith(
"_pull")) {
207 _pull_pad->GetListOfPrimitives()->Remove(o);
213 foundGraph->
Draw(
"pz0 same");
215 _pull_pad->Modified();
226 if (!
g->IsHighlight()) {
233 auto selPad =
dynamic_cast<TVirtualPad *
>(frPad->GetPrimitive(
"selected"));
234 if (_pad && selPad) {
235 auto prim = selPad->GetListOfPrimitives();
236 prim->Remove(prim->At(0));
int Int_t
Signed integer 4 bytes (int).
void Interactive_PLLPlot(TVirtualPad *pad, TObject *obj, Int_t x, Int_t y)
static void Interactive_Pull()
static void Interactive_PLLPlot()
xRooNode(const char *type, const char *name, const char *title="")
bool setRealValue(const char *name, double newVal=0.0, bool verbose=false)
Set value of a RooAbsRealLValue stored in set with given name to newVal No error messages are printed...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual void SetPointEYhigh(Int_t i, Double_t eyh)
virtual void SetPointEYlow(Int_t i, Double_t eyl)
virtual void SetPointX(Int_t i, Double_t x)
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual TH1F * GetHistogram() const
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
virtual Double_t GetPointY(Int_t i) const
TH1 is the base class of all histogram classes in ROOT.
virtual const char * GetName() const
Returns name of object.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
TObject()
TObject constructor.
@ kCanDelete
if object in a list can be deleted
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Double_t Atof() const
Return floating-point value contained in string.
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
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual TVirtualPad * GetMother() const =0
virtual TVirtualPad * GetPad(Int_t subpadnumber) const =0
virtual Int_t GetNumber() const =0
#define BEGIN_XROOFIT_NAMESPACE
#define END_XROOFIT_NAMESPACE