AliPhysics  8bb951a (8bb951a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #include <TArrayD.h>
7 #include <TNamed.h>
8 #include <Riosfwd.h>
9 
10 class TObjArray;
11 
19 namespace EMCalTriggerPtAnalysis {
20 
30 class AliEMCalTriggerBinningDimension : public TNamed{
31 public:
32 
37  TNamed(),
38  fBinning()
39  {}
40 
46  TNamed(name, ""),
47  fBinning()
48  {}
49 
56  AliEMCalTriggerBinningDimension(const char *name, int nbins, const double *binning):
57  TNamed(name, ""),
58  fBinning(nbins+1, binning)
59  {}
60 
66  AliEMCalTriggerBinningDimension(const char *name, const TArrayD &binning):
67  TNamed(name, ""),
68  fBinning(binning.GetSize(), binning.GetArray())
69  {}
70 
75 
81  void Set(int nbins, const double *binning) { fBinning.Set(nbins+1, binning); }
82 
87  void Set(const TArrayD &binning) { fBinning = binning; }
88 
93  const double *GetBinLimits() const { return fBinning.GetArray(); }
94 
99  const TArrayD &GetBinning() const { return fBinning; }
100 
105  void InitializeArray(TArrayD out) const { out = fBinning; }
106 
111  int GetNumberOfBins() const { return fBinning.GetSize() - 1; }
112  virtual void Print(Option_t *option="") const;
113  void PrintStream(std::ostream &stream) const;
114 
115  friend std::ostream &operator<<(std::ostream &stream, const AliEMCalTriggerBinningDimension &dim);
116 
117 private:
118  TArrayD fBinning;
119 
121  ClassDef(AliEMCalTriggerBinningDimension, 1);
123 };
124 
135 class AliEMCalTriggerBinningComponent: public TObject {
136 public:
141 
142  AliEMCalTriggerBinningDimension *GetBinning(const char *name) const;
143  void SetBinning(const char *dimname, int nbins, const double *binning);
144  void SetBinning(const char *dimname, const TArrayD &binning);
145  void SetLinearBinning(const char *dirname, int nbins, double min, double max);
146 
147 private:
148  TObjArray *fDimensions;
149 
151  ClassDef(AliEMCalTriggerBinningComponent, 1);
153 };
154 
155 std::ostream &operator<<(std::ostream& stream, const AliEMCalTriggerBinningDimension &dim);
156 
157 } /* namespace EMCalTriggerPtAnalysis */
158 
159 #endif /* ALIEMCALTRIGGERBINNINGCOMPONENT_H */
AliEMCalTriggerBinningDimension(const char *name, int nbins, const double *binning)
std::ostream & operator<<(std::ostream &stream, const AliEMCalTriggerBinningDimension &dim)
void SetBinning(const char *dimname, int nbins, const double *binning)
AliEMCalTriggerBinningDimension * GetBinning(const char *name) const
Global binning definition for the high- charged particle analysis.
AliEMCalTriggerBinningComponent & operator=(const AliEMCalTriggerBinningComponent &ref)
friend std::ostream & operator<<(std::ostream &stream, const AliEMCalTriggerBinningDimension &dim)
const Int_t nbins
AliEMCalTriggerBinningDimension(const char *name, const TArrayD &binning)
void SetLinearBinning(const char *dirname, int nbins, double min, double max)