AliPhysics  d84cbc0 (d84cbc0)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliForwardMultDists.h
Go to the documentation of this file.
1 #ifndef ALIFORWARDMULTDIST_H
2 #define ALIFORWARDMULTDIST_H
3 
13 #include "AliBaseAODTask.h"
14 #include <TList.h>
15 #include <TString.h>
16 class TH1;
17 class TH2;
18 class AliAODForwardMult;
19 
26 {
27 public:
28  enum {
31  };
35  enum {
37  kAnalysis = 1,
39  kMC = 2,
41  kTrigger = 3,
43  kVertex = 4,
46  };
50  struct BinSpec
51  {
59  BinSpec(Double_t etaMin, Double_t etaMax, Double_t nchLow);
77  void Push(UShort_t n, Double_t d);
83  const TAxis& Axis() const;
84  Double_t fEtaMin; // Least pseudo-rapidity
85  Double_t fEtaMax; // Largest pseudo-rapidity
86  Double_t fLow; // Low cut
87  TArrayI fN; // Number of bins
88  TArrayD fD; // Bin widths
89  mutable TAxis fAxis; // Our axis
90  };
91 
101  AliForwardMultDists(const char* name);
105  virtual ~AliForwardMultDists() {}
115  Bool_t Book();
121  Bool_t PreData();
127  Bool_t PreEvent() { fIsSelected = false; return true; }
135  Bool_t Event(AliAODEvent& aod);
142  Bool_t Finalize();
143  /* @} */
153  void AddBin(const BinSpec& spec);
161  void AddBin(Double_t etaLow, Double_t etaMax, const TAxis& nAxis);
171  void AddBin(Double_t etaLow, Double_t etaMax, UShort_t nMax, UShort_t nDiv);
172  /* @} */
178  void SetUsePhiAcc(Bool_t use) { fUsePhiAcc = use; }
184  void Print(Option_t* option="") const;
191  struct EtaBin : public TObject
192  {
196  EtaBin();
204  EtaBin(Double_t minEta, Double_t maxEta, const TAxis& mAxis);
210  EtaBin(const EtaBin& o);
218  EtaBin& operator=(const EtaBin& o);
222  virtual ~EtaBin() {}
226  const char* GetName() const { return fName.Data(); }
230  Bool_t IsSymmetric() const;
234  Bool_t IsNegative() const;
238  Bool_t IsPositive() const;
245  const char* ParentName() const;
255  TList* FindParent(TList* l, Bool_t create=true) const;
265  static TH1* CreateH1(const char* name, const char* title,
266  const TAxis& xAxis);
277  static TH2* CreateH2(const char* name, const char* title,
278  const TAxis& xAxis, const TAxis& yAxis);
286  void SetupForData(TList* list, const TH2& hist, Bool_t useMC);
297  void Process(const TH1& sumForward, const TH1& sumCentral,
298  const TH2& forward, const TH2& central,
299  Bool_t accepted, const TH1* mc);
307  void Terminate(TList* in, TList* out);
308 
309  TString fName; // Name of this bin
310  TAxis fMAxis; // Axis used for measured Nch
311  TAxis fTAxis; // Axis used for true Nch
312  Double_t fMinEta; // Least @f$\eta@f$ to consider
313  Double_t fMaxEta; // Largest @f$\eta@f$ to consider
314  Int_t fMinBin; // Least @f$\eta@f$ bin to consider
315  Int_t fMaxBin; // Largest @f$\eta@f$ bin to consider
316  TH1* fSum; // Distribution
317  TH2* fCorr; // Correlation between forward and central
318  TH2* fResponse; // Response matrix (for MC)
319  TH1* fTruth; // `true' distribution
320  TH1* fTruthAccepted; // `true' distribution for accepted events
321  TH1* fCoverage; // How much was covered
322 
323  ClassDef(EtaBin,2);
324  };
325 protected:
337  static void ProjectX(const TH2& input, TH1& cache, Bool_t usePhiAcc=true);
345  static void ProjectX(const TH2* input, TH1* cache);
368 
369  TList fBins; // List of bins
370  TList* fSymmetric; // Bins symmetric around 0
371  TList* fNegative; // Bins on negative side only
372  TList* fPositive; // Bins on the positive side only
373  TH1* fMCVertex; // Histogram of MC IpZ
374  TH2* fDiag; // Diagnostics
375  TH1* fForwardCache; // Projection cache
376  TH1* fCentralCache; // Projection cache
377  TH1* fMCCache; // Projection cache
378  Bool_t fUsePhiAcc; // If true, scale by phi acceptance
379  Bool_t fIsSelected; // IF the even was selected
380 
382 };
383 
384 #endif
385 // Local Variables:
386 // mode: C++
387 // End:
388 
389 
static TH2 * CreateH2(const char *name, const char *title, const TAxis &xAxis, const TAxis &yAxis)
const char * ParentName() const
double Double_t
Definition: External.C:58
const char * title
Definition: MakeQAPdf.C:26
AliForwardMultDists & operator=(const AliForwardMultDists &o)
TList * list
void AddBin(const BinSpec &spec)
void SetupForData(TList *list, const TH2 &hist, Bool_t useMC)
TList * FindParent(TList *l, Bool_t create=true) const
static void ProjectX(const TH2 &input, TH1 &cache, Bool_t usePhiAcc=true)
int Int_t
Definition: External.C:63
static TH1 * CreateH1(const char *name, const char *title, const TAxis &xAxis)
void Push(UShort_t n, Double_t d)
BinSpec(Double_t etaMin, Double_t etaMax, Double_t nchLow)
void Terminate(TList *in, TList *out)
void Print(Option_t *option="") const
EtaBin & operator=(const EtaBin &o)
const char * fwd
const char * GetName() const
Definition: External.C:220
void SetUsePhiAcc(Bool_t use)
unsigned short UShort_t
Definition: External.C:28
const char Option_t
Definition: External.C:48
ClassDef(AliForwardMultDists, 1)
bool Bool_t
Definition: External.C:53
Bool_t CheckEvent(const AliAODForwardMult &fwd)
Definition: External.C:196
Bool_t Event(AliAODEvent &aod)
void Process(const TH1 &sumForward, const TH1 &sumCentral, const TH2 &forward, const TH2 &central, Bool_t accepted, const TH1 *mc)