AliPhysics  48852ec (48852ec)
 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 
17 #include "AliBaseAODTask.h"
18 #include <TList.h>
19 #include <TString.h>
20 class TH1;
21 class TH2;
22 class AliAODForwardMult;
23 
32 {
33 public:
34  enum {
37  };
41  enum {
43  kAnalysis = 1,
45  kMC = 2,
47  kTrigger = 3,
49  kVertex = 4,
52  };
56  struct BinSpec
57  {
65  BinSpec(Double_t etaMin, Double_t etaMax, Double_t nchLow);
83  void Push(UShort_t n, Double_t d);
89  const TAxis& Axis() const;
90  Double_t fEtaMin; // Least pseudo-rapidity
91  Double_t fEtaMax; // Largest pseudo-rapidity
92  Double_t fLow; // Low cut
93  TArrayI fN; // Number of bins
94  TArrayD fD; // Bin widths
95  mutable TAxis fAxis; // Our axis
96  };
97 
107  AliForwardMultDists(const char* name);
111  virtual ~AliForwardMultDists() {}
121  Bool_t Book();
127  Bool_t PreData();
133  Bool_t PreEvent() { fIsSelected = false; return true; }
141  Bool_t Event(AliAODEvent& aod);
148  Bool_t Finalize();
149  /* @} */
159  void AddBin(const BinSpec& spec);
167  void AddBin(Double_t etaLow, Double_t etaMax, const TAxis& nAxis);
177  void AddBin(Double_t etaLow, Double_t etaMax, UShort_t nMax, UShort_t nDiv);
178  /* @} */
184  void SetUsePhiAcc(Bool_t use) { fUsePhiAcc = use; }
190  void Print(Option_t* option="") const;
197  struct EtaBin : public TObject
198  {
202  EtaBin();
210  EtaBin(Double_t minEta, Double_t maxEta, const TAxis& mAxis);
216  EtaBin(const EtaBin& o);
224  EtaBin& operator=(const EtaBin& o);
228  virtual ~EtaBin() {}
232  const char* GetName() const { return fName.Data(); }
236  Bool_t IsSymmetric() const;
240  Bool_t IsNegative() const;
244  Bool_t IsPositive() const;
251  const char* ParentName() const;
261  TList* FindParent(TList* l, Bool_t create=true) const;
271  static TH1* CreateH1(const char* name, const char* title,
272  const TAxis& xAxis);
283  static TH2* CreateH2(const char* name, const char* title,
284  const TAxis& xAxis, const TAxis& yAxis);
292  void SetupForData(TList* list, const TH2& hist, Bool_t useMC);
303  void Process(const TH1& sumForward, const TH1& sumCentral,
304  const TH2& forward, const TH2& central,
305  Bool_t accepted, const TH1* mc);
313  void Terminate(TList* in, TList* out);
314 
315  TString fName; // Name of this bin
316  TAxis fMAxis; // Axis used for measured Nch
317  TAxis fTAxis; // Axis used for true Nch
318  Double_t fMinEta; // Least @f$\eta@f$ to consider
319  Double_t fMaxEta; // Largest @f$\eta@f$ to consider
320  Int_t fMinBin; // Least @f$\eta@f$ bin to consider
321  Int_t fMaxBin; // Largest @f$\eta@f$ bin to consider
322  TH1* fSum; // Distribution
323  TH2* fCorr; // Correlation between forward and central
324  TH2* fResponse; // Response matrix (for MC)
325  TH1* fTruth; // `true' distribution
326  TH1* fTruthAccepted; // `true' distribution for accepted events
327  TH1* fCoverage; // How much was covered
328 
329  ClassDef(EtaBin,2);
330  };
331 protected:
343  static void ProjectX(const TH2& input, TH1& cache, Bool_t usePhiAcc=true);
351  static void ProjectX(const TH2* input, TH1* cache);
374 
375  TList fBins; // List of bins
376  TList* fSymmetric; // Bins symmetric around 0
377  TList* fNegative; // Bins on negative side only
378  TList* fPositive; // Bins on the positive side only
379  TH1* fMCVertex; // Histogram of MC IpZ
380  TH2* fDiag; // Diagnostics
381  TH1* fForwardCache; // Projection cache
382  TH1* fCentralCache; // Projection cache
383  TH1* fMCCache; // Projection cache
384  Bool_t fUsePhiAcc; // If true, scale by phi acceptance
385  Bool_t fIsSelected; // IF the even was selected
386 
388 };
389 
390 #endif
391 // Local Variables:
392 // mode: C++
393 // End:
394 
395 
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:27
AliForwardMultDists & operator=(const AliForwardMultDists &o)
TList * list
TDirectory file where lists per trigger are stored in train ouput.
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)