///////////////////////////////////////////////////////////////////////////////
-#include "AliMonitorHisto.h"
#include <TProfile.h>
#include <TH2.h>
#include <TVirtualPad.h>
+#include "AliLog.h"
+
+#include "AliMonitorHisto.h"
+
ClassImp(AliMonitorHisto)
TH1::AddDirectory(addStatus);
}
+//_____________________________________________________________________________
+AliMonitorHisto& AliMonitorHisto::operator =(const AliMonitorHisto& histo)
+{
+// assignment operator
+
+ AliMonitorPlot::operator =(histo);
+
+ Bool_t addStatus = TH1::AddDirectoryStatus();
+ TH1::AddDirectory(kFALSE);
+ fHisto = NULL;
+ if (histo.fHisto) fHisto = (TH1*) histo.fHisto->Clone();
+ fNHistos = histo.fNHistos;
+ TObjLink* link = histo.fHistoList.FirstLink();
+ for (Int_t i = 0; i < fNHistos; i++) {
+ fHistoList.Add(link->GetObject()->Clone());
+ link = link->Next();
+ }
+ fHistoRun = NULL;
+ if (histo.fHistoRun) fHistoRun = (TH1*) histo.fHistoRun->Clone();
+ fHistoDraw = NULL;
+ fHistoRef = NULL;
+ if (histo.fHistoRef) fHistoRef = (TH1*) histo.fHistoRef->Clone();
+ fHistoCompare = NULL;
+ fNorm = histo.fNorm;
+ TH1::AddDirectory(addStatus);
+
+ return *this;
+}
+
//_____________________________________________________________________________
AliMonitorHisto::AliMonitorHisto(TH1* histo, ENorm norm) :
AliMonitorPlot(histo->GetName(), histo->GetTitle())
// create a monitor histogram from the given histogram
if (histo->GetDimension() > 2) {
- Fatal("AliMonitorHisto", "3 dimensional histograms are not supported");
+ AliFatal("3 dimensional histograms are not supported");
}
histo->SetDirectory(NULL);
} else if (fHisto->InheritsFrom(TProfile::Class())) {
((TProfile*)fHisto)->Fill(x, y, w);
} else {
- Error("Fill", "trying to fill x and y of a 1 dimensinal histogram");
+ AliError("trying to fill x and y of a 1 dimensinal histogram");
return;
}
}
if (!fHistoRef) return kTRUE;
if (fgThreshold <= 0) return kTRUE;
if (!fHistoDraw) {
- Info("Compare", "no data histogram available for comparison\ncall DrawEvent, DrawSum or DrawRaw before calling Compare");
+ AliWarning("no data histogram available for comparison\ncall DrawEvent, DrawSum or DrawRaw before calling Compare");
return kTRUE;
}
if (fHistoCompare) delete fHistoCompare;
// get the normalized monitor histogram for the "number"th last event
if (fNHistos == 0) {
- Info("GetEvent", "there are no histograms for single events available");
+ AliWarning("there are no histograms for single events available");
return kFALSE;
}
if (number > fNHistos) {
- Error("GetEvent", "requested event number (%d) exceeds range of available events (%d)\n",
- number, fNHistos);
+ AliError(Form("requested event number (%d) exceeds range of available events (%d)",
+ number, fNHistos));
return kFALSE;
}
if (number <= 0) return kFALSE;
// "number" events
if (fNHistos == 0) {
- Info("GetSum", "there are no histograms for single events available");
+ AliWarning("there are no histograms for single events available");
return kFALSE;
}
if (number > fNHistos) {
- Info("GetSum", "requested number of events (%d) exceeds range of available events (%d)\nusing last %d event(s)",
- number, fNHistos, fNHistos);
+ AliError(Form("requested number of events (%d) exceeds range of available events (%d)\nusing last %d event(s)",
+ number, fNHistos, fNHistos));
number = fNHistos;
}
if (number <= 0) return kFALSE;