4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 // optimized data container reusing functionality of AliCFContainer / THnsparse
9 // Use AliTHn instead of AliCFContainer and your memory consumption will be drastically reduced
10 // As AliTHn derives from AliCFContainer, you can just replace your current AliCFContainer object by AliTHn
11 // Once you have the merged output, call FillParent() and you can use AliCFContainer as usual
15 #include "AliCFContainer.h"
20 class AliTHn : public AliCFContainer
24 AliTHn(const Char_t* name, const Char_t* title,const Int_t nSelStep, const Int_t nVarIn, const Int_t* nBinIn);
28 virtual void Fill(const Double_t *var, Int_t istep, Double_t weight=1.) ;
29 virtual void FillParent();
30 virtual void FillContainer(AliCFContainer* cont);
32 TArrayF* GetValues(Int_t step) { return fValues[step]; }
33 TArrayF* GetSumw2(Int_t step) { return fSumw2[step]; }
35 void DeleteContainers();
38 AliTHn(const AliTHn &c);
39 AliTHn& operator=(const AliTHn& corr);
40 virtual void Copy(TObject& c) const;
42 virtual Long64_t Merge(TCollection* list);
46 Long64_t GetGlobalBinIndex(const Int_t* binIdx);
48 Long64_t fNBins; // number of total bins
49 Int_t fNVars; // number of variables
50 Int_t fNSteps; // number of selection steps
51 TArrayF **fValues; //[fNSteps] data container
52 TArrayF **fSumw2; //[fNSteps] data container
54 TAxis** axisCache; //! cache axis pointers (about 50% of the time in Fill is spent in GetAxis otherwise)
55 Int_t* fNbinsCache; //! cache Nbins per axis
56 Double_t* fLastVars; //! caching of last used bins (in many loops some vars are the same for a while)
57 Int_t* fLastBins; //! caching of last used bins (in many loops some vars are the same for a while)
59 ClassDef(AliTHn, 4) // THn like container