AliPhysics  9fe175b (9fe175b)
 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 
12 namespace EMCalTriggerPtAnalysis {
13 
24 class AliEMCalTriggerBinningDimension : public TNamed{
25 public:
26 
31  TNamed(),
32  fBinning()
33  {}
34 
40  TNamed(name, ""),
41  fBinning()
42  {}
43 
50  AliEMCalTriggerBinningDimension(const char *name, int nbins, const double *binning):
51  TNamed(name, ""),
52  fBinning(nbins+1, binning)
53  {}
54 
60  AliEMCalTriggerBinningDimension(const char *name, const TArrayD &binning):
61  TNamed(name, ""),
62  fBinning(binning.GetSize(), binning.GetArray())
63  {}
64 
69 
75  void Set(int nbins, const double *binning) { fBinning.Set(nbins+1, binning); }
76 
81  void Set(const TArrayD &binning) { fBinning = binning; }
82 
87  const double *GetBinLimits() const { return fBinning.GetArray(); }
88 
93  const TArrayD &GetBinning() const { return fBinning; }
94 
99  void InitializeArray(TArrayD out) const { out = fBinning; }
100 
105  int GetNumberOfBins() const { return fBinning.GetSize() - 1; }
106  virtual void Print(Option_t *option="") const;
107  void PrintStream(std::ostream &stream) const;
108 
109  friend std::ostream &operator<<(std::ostream &stream, const AliEMCalTriggerBinningDimension &dim);
110 
111 private:
112  TArrayD fBinning;
113 
115  ClassDef(AliEMCalTriggerBinningDimension, 1);
117 };
118 
130 class AliEMCalTriggerBinningComponent: public TObject {
131 public:
136 
137  AliEMCalTriggerBinningDimension *GetBinning(const char *name) const;
138  void SetBinning(const char *dimname, int nbins, const double *binning);
139  void SetBinning(const char *dimname, const TArrayD &binning);
140  void SetLinearBinning(const char *dirname, int nbins, double min, double max);
141 
142 private:
143  TObjArray *fDimensions;
144 
146  ClassDef(AliEMCalTriggerBinningComponent, 1);
148 };
149 
150 std::ostream &operator<<(std::ostream& stream, const AliEMCalTriggerBinningDimension &dim);
151 
152 } /* namespace EMCalTriggerPtAnalysis */
153 
154 #endif /* ALIEMCALTRIGGERBINNINGCOMPONENT_H */
std::ostream & operator<<(std::ostream &stream, const AliCutValueRange< t > &val)
AliEMCalTriggerBinningDimension(const char *name, int nbins, const double *binning)
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)