Commit a6a3ac64 authored by Jérémie Dudouet's avatar Jérémie Dudouet
Browse files

correct a bug in cleaning peak search

parent 8d7510fa
......@@ -90,7 +90,7 @@ void CXArrow::SetText(TH1 *hist, TString text, TString tooltip)
hist->GetYaxis()->SetRangeUser(gPad->GetUymin(),Y+MaxGlob/50.);
}
void CXArrow::ClearPad(TVirtualPad *pad)
void CXArrow::ClearPad(TVirtualPad *pad, bool refresh)
{
if(pad==nullptr) pad = gPad;
......@@ -98,8 +98,10 @@ void CXArrow::ClearPad(TVirtualPad *pad)
pad->GetListOfPrimitives()->Remove(fBox);
pad->GetListOfPrimitives()->Remove(this);
if(refresh) {
pad->Modified();
pad->Update();
}
}
......
......@@ -43,7 +43,7 @@ public:
void SetText(TH1 *hist, TString text, TString tooltip);
void ClearPad(TVirtualPad *pad = nullptr);
void ClearPad(TVirtualPad *pad = nullptr, bool refresh = true);
virtual void Paint(Option_t *option = "");
......
......@@ -212,6 +212,7 @@ void CXHist1DPlayer::SetMainWindow(CXMainWindow *w)
void CXHist1DPlayer::PeakSearchClear()
{
TVirtualPad *pad = fMainWindow->GetSelectedPad();
gPad = pad;
if(pad==nullptr) {
cout<<"No selected pad, ignored"<<endl;
......@@ -221,7 +222,7 @@ void CXHist1DPlayer::PeakSearchClear()
for(int i=0 ; i<pad->GetListOfPrimitives()->GetEntries() ; i++) {
TObject *o = pad->GetListOfPrimitives()->At(i);
if(o->InheritsFrom(CXArrow::Class())) {
((CXArrow*)o)->ClearPad();
((CXArrow*)o)->ClearPad(pad,false);
i--;
}
}
......
......@@ -71,6 +71,9 @@ CXLevelSchemePlayer::CXLevelSchemePlayer(const char* name, const char *title) :
fListOfBoxes = new TList;
fListOfBoxes->SetOwner();
fListOfCXArrows = new TList;
fListOfCXArrows->SetOwner();
}
CXLevelSchemePlayer::~CXLevelSchemePlayer()
......@@ -80,8 +83,8 @@ CXLevelSchemePlayer::~CXLevelSchemePlayer()
void CXLevelSchemePlayer::ConnectCanvas()
{
TList *l = fMainWindow->GetCanvas()->GetListOfSignals();
if(l==nullptr || l->FindObject("ProcessedEventLevelScheme(int,int,int,TObject*)") == nullptr)
// TList *l = fMainWindow->GetCanvas()->GetListOfSignals();
// if(l==nullptr || l->FindObject("ProcessedEventLevelScheme(int,int,int,TObject*)") == nullptr)
fMainWindow->GetCanvas()->Connect("ProcessedEvent(Int_t, Int_t, Int_t, TObject*)","CXLevelSchemePlayer", this, "ProcessedEventLevelScheme(Int_t, Int_t, Int_t, TObject*)");
}
......@@ -116,22 +119,6 @@ void CXLevelSchemePlayer::DrawArrows(TString ListOfNuclei,TH1 *h)
}
}
// if(fListOfArrows != nullptr)
// delete fListOfArrows;
// if(fListOfLatex != nullptr)
// delete fListOfLatex;
// if(fListOfBoxes != nullptr)
// delete fListOfBoxes;
// fListOfArrows = new TList;
// fListOfArrows->SetOwner();
// fListOfLatex = new TList;
// fListOfLatex->SetOwner();
// fListOfBoxes = new TList;
// fListOfBoxes->SetOwner();
fCurrentHist = h;
fCurrentHist->GetYaxis()->UnZoom();
......
......@@ -56,6 +56,7 @@ private:
TList *fListOfArrows = nullptr;
TList *fListOfLatex = nullptr;
TList *fListOfBoxes = nullptr;
TList *fListOfCXArrows = nullptr;
TList *fListOfDatabase = nullptr;
......
......@@ -20,6 +20,13 @@ private:
Float_t fLifeTime;
TString fJPi;
TString fJDecay;
Float_t MassExc;
Float_t Abund;
Float_t Branching;
NucData *fdata;
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment