AliPhysics  v5-06-11-01 (156c7f3)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliEMCalTriggerBinningComponent.h
Go to the documentation of this file.
1 #ifndef ALIEMCALTRIGGERBINNINGCOMPONENT_H
2 #define ALIEMCALTRIGGERBINNINGCOMPONENT_H
3 /* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 // Author: Markus Fasel
7 #include <TArrayD.h>
8 #include <TNamed.h>
9 
10 class TObjArray;
11 
19 namespace EMCalTriggerPtAnalysis {
20 
21 class AliEMCalTriggerBinningDimension : public TNamed{
22 public:
24  TNamed(),
25  fBinning()
26  {}
28  TNamed(name, ""),
29  fBinning()
30  {}
31  AliEMCalTriggerBinningDimension(const char *name, int nbins, double *binning):
32  TNamed(name, ""),
33  fBinning(nbins+1, binning)
34  {}
35  AliEMCalTriggerBinningDimension(const char *name, const TArrayD &binning):
36  TNamed(name, ""),
37  fBinning(binning.GetSize(), binning.GetArray())
38  {}
40 
41  void Set(int nbins, double *binning) { fBinning.Set(nbins+1, binning); }
42  void Set(const TArrayD &binning) { fBinning = binning; }
43  const double *GetBinLimits() const { return fBinning.GetArray(); }
44  int GetNumberOfBins() const { return fBinning.GetSize() - 1; }
45  virtual void Print(Option_t *option="") const;
46 
47 private:
48  TArrayD fBinning; // Bin limits
49 
51 };
52 
53 class AliEMCalTriggerBinningComponent: public TObject {
54 public:
59 
60  AliEMCalTriggerBinningDimension *GetBinning(const char *name) const;
61  void SetBinning(const char *dimname, int nbins, double *binning);
62  void SetBinning(const char *dimname, const TArrayD &binning);
63 
64 private:
65  TObjArray *fDimensions; // List of binnings (dimensions)
66 
68 };
69 
70 } /* namespace EMCalTriggerPtAnalysis */
71 
72 #endif /* ALIEMCALTRIGGERBINNINGCOMPONENT_H */
void SetBinning(const char *dimname, int nbins, double *binning)
ClassDef(AliEMCalTriggerBinningComponent, 1)
ClassDef(AliEMCalTriggerBinningDimension, 1)
AliEMCalTriggerBinningComponent & operator=(const AliEMCalTriggerBinningComponent &ref)
AliEMCalTriggerBinningDimension * GetBinning(const char *name) const
AliEMCalTriggerBinningDimension(const char *name, const TArrayD &binning)
AliEMCalTriggerBinningDimension(const char *name, int nbins, double *binning)