return list;
}
-void AliEMCALHistoUtilities::FillH1(TList *l, Int_t ind, Double_t x, Double_t w)
+void AliEMCALHistoUtilities::FillH1(TList *l, Int_t ind, Double_t x, Double_t w, Double_t error)
{
//fill 1d histogram
static TH1* hid=0;
+ static int bin=0;
if(l == 0) return;
+
if(ind>=0 && ind < l->GetSize()){
hid = (TH1*)l->At(ind);
- hid->Fill(x,w);
+ if(error <= 0.0) { // standard way
+ hid->Fill(x,w);
+ } else{
+ bin = hid->FindBin(x);
+ hid->SetBinContent(bin,w);
+ hid->SetBinError(bin,error);
+ }
}
}
// service routine
static TList *MoveHistsToList(const char* name="ListOfHists", Bool_t putToBrowser=kTRUE);
- static void FillH1(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t w=1.);
+ static void FillH1(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t w=1., Double_t error=0.);
static void FillH2(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t y=-99999., Double_t w=1.);
static int SaveListOfHists(TList *mylist=0, const char* name="test", Bool_t kSingleKey=kFALSE,
const char* opt="RECREATE");