AliPhysics  6fe3466 (6fe3466)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliFMDHistCollector.h
Go to the documentation of this file.
1 //
2 // This class collects the event histograms into single histograms,
3 // one for each ring in each vertex bin.
4 //
5 #ifndef ALIFMDHISTCOLLECTOR_H
6 #define ALIFMDHISTCOLLECTOR_H
7 
17 #include <TNamed.h>
18 #include <TList.h>
19 #include <TArrayI.h>
20 #include "AliForwardUtil.h"
21 class AliESDFMD;
22 class TH2;
23 class TH2D;
24 class TH1D;
25 class TObjArray;
26 
44 {
45 public:
51  enum MergeMethod {
97 
98  };
113  };
117  enum FMDRingBits {
118  kFMD1I=0x01,
120  kFMD2I=0x02,
121  kFMD2O=0x04,
123  kFMD3I=0x08,
124  kFMD3O=0x10,
126  };
136  AliFMDHistCollector(const char* title);
143 
147  virtual ~AliFMDHistCollector();
162  virtual void SetupForData(const TAxis& vtxAxis,
163  const TAxis& etaAxis);
177  virtual Bool_t Collect(const AliForwardUtil::Histos& hists,
178  AliForwardUtil::Histos& sums,
179  UShort_t vtxBin,
180  TH2D& out,
181  Double_t cent=-1.0,
182  Bool_t eta2phi=false,
183  Bool_t add=true);
189  virtual void CreateOutputObjects(TList* dir);
209  void SetNCutBins(UInt_t n=2) { fNCutBins = n; }
217  void SetCorrectionCut(Float_t cut=0.5) { fCorrectionCut = cut; }
224  void SetFMDRingsToSkip(UShort_t mask) { fSkipFMDRings = mask; }
230  void SetMakeBGHitMaps(Bool_t use) { fBgAndHitMaps = use; }
242  void SetDebug(Int_t dbg=1) { fDebug = dbg; }
248  void Print(Option_t* option="") const;
249 protected:
257  static void GetDetRing(Int_t idx, UShort_t& d, Char_t& r);
266  static Int_t GetIdx(UShort_t d, Char_t r);
289  static Bool_t CheckSkip(UShort_t d, Char_t r, UShort_t skips);
302  const TH2D* bg, Int_t ie, Int_t ip);
303 
315  static void MergeBins(MergeMethod m,
316  Double_t c, Double_t e,
317  Double_t oc, Double_t oe,
318  Double_t& rc, Double_t& re);
319 
320  //==================================================================
324  struct VtxBin : public TObject
325  {
334  VtxBin(Int_t index=0, Double_t minIpZ=999, Double_t maxIpZ=-999,
335  Int_t nCut=0);
341  VtxBin(const VtxBin& o);
349  VtxBin& operator=(const VtxBin& o);
355  const Char_t* GetName() const;
368  void SetupForData(TH2* coverage,
369  UShort_t skip,
370  FiducialMethod fiducial,
371  Double_t cut,
372  TList* l,
373  const TAxis& etaAxis,
374  Bool_t doHitMap,
375  Bool_t storeSecMap);
393  Bool_t Collect(const AliForwardUtil::Histos& hists,
394  AliForwardUtil::Histos& sums,
395  TH2D& out,
396  TH2D* sumRings,
397  TH1D* skipped,
398  Double_t cent,
399  MergeMethod m,
400  UShort_t skips,
401  TList* byCent,
402  Bool_t eta2phi,
403  Bool_t add);
415  Int_t GetOverlap(UShort_t d, Char_t r, Int_t bin) const;
425  Int_t& first, Int_t& last) const {
426  GetFirstAndLast(GetIdx(d,r), first, last);
427  }
435  void GetFirstAndLast(Int_t idx,Int_t& first, Int_t& last) const;
443  Int_t GetFirst(Int_t idx) const;
451  Int_t GetLast(Int_t idx) const;
460  Int_t GetFirst(UShort_t d, Char_t r) const { return GetFirst(GetIdx(d,r));}
469  Int_t GetLast(UShort_t d, Char_t r) const { return GetLast(GetIdx(d,r));}
470 
471  Int_t fIndex; // Vertex bin index
472  Double_t fLow; // Low @f$ ip_z @f$
473  Double_t fHigh; // High @f$ ip_z @f$
474  AliForwardUtil::Histos* fHitMap; // Hit map (optional)
475  TArrayI fFirstBin; // Per-ring first bin
476  TArrayI fLastBin; // Per-ring last bin
477  Int_t fNCutBins; // Number of bins to cut
478 
479  // ClassDef(VtxBin,1); // Vertex bin in histogram collector
480  };
488  VtxBin* GetVtxBin(Int_t ivtx);
496  const VtxBin* GetVtxBin(Int_t ivtx) const;
497 
498  Int_t fNCutBins; // Number of additional bins to cut away
499  Float_t fCorrectionCut; // Cut-off on secondary corrections
500  Int_t fDebug; // Debug level
501  TList* fList; // Output list
502  TH2D* fSumRings; // Sum per ring (on y-axis)
503  TH2D* fCoverage; // Sum per ring (on y-axis)
504  TH1D* fSkipped; // Skipped rings
505  MergeMethod fMergeMethod; // Merge methiod for overlapping bins
506  FiducialMethod fFiducialMethod; // Fidicual method
507  UShort_t fSkipFMDRings; // FMD rings to ignore
508  Bool_t fBgAndHitMaps; // Make hit/bg maps or not
510  TList* fByCent; // By centrality sums
511  Bool_t fDoByCent; // Whether to do by centrality sum
512  ClassDef(AliFMDHistCollector,6); // Calculate Nch density
513 };
514 
515 
516 #endif
517 // Local Variables:
518 // mode: C++
519 // End:
520 
VtxBin & operator=(const VtxBin &o)
double Double_t
Definition: External.C:58
const char * title
Definition: MakeQAPdf.C:26
Int_t GetLast(UShort_t d, Char_t r) const
Int_t GetLast(Int_t idx) const
AliForwardUtil::Histos * fHitMap
char Char_t
Definition: External.C:18
void SetupForData(TH2 *coverage, UShort_t skip, FiducialMethod fiducial, Double_t cut, TList *l, const TAxis &etaAxis, Bool_t doHitMap, Bool_t storeSecMap)
TList * fByCent
Per-vertex list.
Int_t GetFirst(UShort_t d, Char_t r) const
TCanvas * c
Definition: TestFitELoss.C:172
void SetNCutBins(UInt_t n=2)
MergeMethod GetMergeMethod() const
Int_t GetFirst(Int_t idx) const
ClassDef(AliFMDHistCollector, 6)
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
Int_t GetOverlap(UShort_t d, Char_t r, Int_t bin) const
float Float_t
Definition: External.C:68
Various utilities used in PWGLF/FORWARD.
const Char_t * GetName() const
virtual void CreateOutputObjects(TList *dir)
virtual Bool_t Collect(const AliForwardUtil::Histos &hists, AliForwardUtil::Histos &sums, UShort_t vtxBin, TH2D &out, Double_t cent=-1.0, Bool_t eta2phi=false, Bool_t add=true)
void SetFMDRingsToSkip(UShort_t mask)
void SetFiducialMethod(FiducialMethod m)
Bool_t Collect(const AliForwardUtil::Histos &hists, AliForwardUtil::Histos &sums, TH2D &out, TH2D *sumRings, TH1D *skipped, Double_t cent, MergeMethod m, UShort_t skips, TList *byCent, Bool_t eta2phi, Bool_t add)
void GetFirstAndLast(UShort_t d, UShort_t r, Int_t &first, Int_t &last) const
Definition: External.C:228
Definition: External.C:212
void Print(Option_t *option="") const
static void MergeBins(MergeMethod m, Double_t c, Double_t e, Double_t oc, Double_t oe, Double_t &rc, Double_t &re)
AliFMDHistCollector & operator=(const AliFMDHistCollector &)
void SetDebug(Int_t dbg=1)
VtxBin(Int_t index=0, Double_t minIpZ=999, Double_t maxIpZ=-999, Int_t nCut=0)
static void GetDetRing(Int_t idx, UShort_t &d, Char_t &r)
VtxBin * GetVtxBin(Int_t ivtx)
Definition: External.C:220
void SetMakeBGHitMaps(Bool_t use)
void SetMakeCentralitySums(Bool_t use)
static Int_t GetIdx(UShort_t d, Char_t r)
static Bool_t CheckCorrection(FiducialMethod m, Double_t cut, const TH2D *bg, Int_t ie, Int_t ip)
unsigned short UShort_t
Definition: External.C:28
const char Option_t
Definition: External.C:48
void SetMergeMethod(MergeMethod m)
void SetCorrectionCut(Float_t cut=0.5)
bool Bool_t
Definition: External.C:53
virtual void SetupForData(const TAxis &vtxAxis, const TAxis &etaAxis)
static Bool_t CheckSkip(UShort_t d, Char_t r, UShort_t skips)
FiducialMethod fFiducialMethod