+ // adapt the name and title of the histogram in case they are empty
+ AliDielectronHistos::AdaptNameTitle(hist, histClass);
+ hist->SetName(Form("HF_%s",hist->GetName()));
+
+ fRefObj.AddLast(hist);
+ delete binsX;
+ delete binsY;
+}
+
+//_____________________________________________________________________________
+void AliDielectronHF::UserProfile(const char* histClass, UInt_t valTypeP,
+ const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
+ UInt_t valTypeX, UInt_t valTypeY, UInt_t valTypeZ, TString option, UInt_t valTypeW)
+{
+ //
+ // Histogram creation 3D case with arbitraty binning X, Y, Z
+ // the TVectorD is assumed to be surplus after the creation and will be deleted!!!
+ //
+ TH1 *hist=0x0;
+ if(valTypeP==AliDielectronHistos::kNoProfile) {
+ hist=new TH3F("","",
+ binsX->GetNrows()-1,binsX->GetMatrixArray(),
+ binsY->GetNrows()-1,binsY->GetMatrixArray(),
+ binsZ->GetNrows()-1,binsZ->GetMatrixArray());
+ }
+ else {
+ TString opt=""; Double_t pmin=0., pmax=0.;
+ if(!option.IsNull()) {
+ TObjArray *arr=option.Tokenize(";");
+ arr->SetOwner();
+ opt=((TObjString*)arr->At(0))->GetString();
+ if(arr->GetEntriesFast()>1) pmin=(((TObjString*)arr->At(1))->GetString()).Atof();
+ if(arr->GetEntriesFast()>2) pmax=(((TObjString*)arr->At(2))->GetString()).Atof();
+ delete arr;
+ }
+ hist=new TProfile3D("","",
+ binsX->GetNrows()-1,binsX->GetMatrixArray(),
+ binsY->GetNrows()-1,binsY->GetMatrixArray(),
+ binsZ->GetNrows()-1,binsZ->GetMatrixArray());
+ ((TProfile3D*)hist)->BuildOptions(pmin,pmax,opt.Data());
+ }
+
+ // store variales in axes
+ UInt_t valType[4] = {0};
+ valType[0]=valTypeX; valType[1]=valTypeY; valType[2]=valTypeZ; valType[3]=valTypeP;
+ AliDielectronHistos::StoreVariables(hist, valType);
+ hist->SetUniqueID(valTypeW); // store weighting variable
+
+ for(Int_t i=0; i<4; i++) fUsedVars->SetBitNumber(valType[i],kTRUE);
+ fUsedVars->SetBitNumber(valTypeW,kTRUE);
+
+ // adapt the name and title of the histogram in case they are empty
+ AliDielectronHistos::AdaptNameTitle(hist, histClass);
+ hist->SetName(Form("HF_%s",hist->GetName()));
+
+ fRefObj.AddLast(hist);
+ delete binsX;
+ delete binsY;
+ delete binsZ;
+}
+
+//_____________________________________________________________________________
+void AliDielectronHF::UserSparse(const char* histClass, Int_t ndim, TObjArray *limits, UInt_t *vars, UInt_t valTypeW)
+{
+ //
+ // THnSparse creation with non-linear binning
+ //
+
+ THnSparseF *hist=0;
+ Int_t bins[ndim];
+ // get number of bins
+ for(Int_t idim=0 ;idim<ndim; idim++) {
+ TVectorD *vec = (TVectorD*) limits->At(idim);
+ bins[idim]=vec->GetNrows()-1;
+ }
+
+ hist=new THnSparseF("",histClass, ndim, bins, 0x0, 0x0);
+
+ // set binning
+ for(Int_t idim=0 ;idim<ndim; idim++) {
+ TVectorD *vec = (TVectorD*) limits->At(idim);
+ hist->SetBinEdges(idim,vec->GetMatrixArray());
+ }
+
+ // store variales in axes
+ AliDielectronHistos::StoreVariables(hist, vars);
+ hist->SetUniqueID(valTypeW); // store weighting variable
+
+ // store which variables are used
+ for(Int_t i=0; i<20; i++) fUsedVars->SetBitNumber(vars[i],kTRUE);
+ fUsedVars->SetBitNumber(valTypeW,kTRUE);
+
+ // adapt the name and title of the histogram in case they are empty
+ TString name;
+ for(Int_t iv=0; iv < ndim; iv++) name+=Form("%s_",AliDielectronVarManager::GetValueName(vars[iv]));
+ name.Resize(name.Length()-1);
+ hist->SetName(Form("HF_%s",name.Data()));
+
+ fRefObj.AddLast(hist);
+ delete limits;
+