AliPhysics  32b88a8 (32b88a8)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliBasedNdetaTask.h
Go to the documentation of this file.
1 //
2 // Task to analyse the AOD for for dN/deta in the base regions
3 //
4 #ifndef ALIBASEDNDETATASK_H
5 #define ALIBASEDNDETATASK_H
6 
16 #include "AliBaseAODTask.h"
17 #include <AliAnalysisUtils.h>
18 class TAxis;
19 class TList;
20 class TH2D;
21 class TH2F;
22 class TH1D;
23 class TH1I;
24 class TF1;
25 class AliAODEvent;
26 class AliAODForwardMult;
27 class TObjArray;
28 
49 {
50 public:
54  enum {
56  kNone = 0,
63  kEventLevel = 0x1,
67  kDummy = 0x2,
71  kBackground = 0x4,
83  kZeroBin = 0x10,
88  };
92  enum EPileupMask {
100  kPileupSPD = 0x1,
104  kPileupTrk = 0x2,
108  kPileupBC = 0x4,
112  kPileupFull = 0x8,
120  kPileupUtil = 0x20,
124  kPileupBins = 0x40,
125  };
126 
129  kCentDefault, // What ever stored in AOD
130  kCentV0M, // VZERO multiplcity
131  kCentV0A, // VZERO-A
132  kCentV0A123, // VZERO-A
133  kCentV0C, // VZERO-C
134  kCentFMD, // FMD
135  kCentTrk, // Tracks
136  kCentTkl, // Tracklets
137  kCentCL0, // Clusters in SPD-0
138  kCentCL1, // Clusters in SPD-1
139  kCentCND, // Candle - tracks+tracklets
140  kCentZNA, // ZDC neutrons A-side
141  kCentZNC, // ZDC neutrons C-side
142  kCentZPA, // ZDC protons A-side
143  kCentZPC, // ZDC protons C-side
144  kCentNPA, // ?
145  kCentV0MvsFMD, // V0M vs FMD
146  kCentTklvsV0M, // Tracks vs V0M
147  kCentZEMvsZDC, // ZDC veto vs neutrons
148  kMult, // Reference multiplicity in @f$|\eta|<0.8@f$
149  kMultV0A, // HMTF V0A
150  kMultV0M, // HMTF V0M
151  kMultV0C, // HMTF V0C
152  kCentTrue = 0x100,
153  kCentEq = 0x200
154  };
165  AliBasedNdetaTask(const char* name);
170  virtual ~AliBasedNdetaTask();
171 
181  virtual void SetDebugLevel(Int_t level);
187  void SetCorrEmpty(Bool_t use) { fCorrEmpty = use; }
213  void SetSatelliteVertices(Bool_t satVtx) { fSatelliteVertices = satVtx; }
234  Bool_t SetCentralityMethod(const TString& method);
240  AliAnalysisUtils& GetAnalysisUtils() { return fAnaUtil; }
248  static const Char_t* NormalizationSchemeString(UShort_t scheme);
256  static UShort_t ParseNormalizationScheme(const Char_t* what);
262  void SetNormalizationScheme(UShort_t scheme);
268  void SetNormalizationScheme(const char* what);
274  void SetMCFinalCorrFilename(const char* filename) {
275  fFinalMCCorrFile.Clear();
276  fFinalMCCorrFile.Append(filename);
277  }
284  void Print(Option_t* option="R") const;
295  virtual Bool_t Book();
302  virtual Bool_t PreEvent() {
303  fCacheCent = -10; fCacheQual = 0xFFFF; return true; }
309  virtual Bool_t Event(AliAODEvent& aod);
317  virtual Bool_t Finalize();
318  /* @} */
319 
337  static TH1D* ProjectX(const TH2D* h,
338  const char* name,
339  Int_t firstbin,
340  Int_t lastbin,
341  bool useROOT=false,
342  bool corr=true,
343  bool error=true);
350  static void ScaleToCoverage(TH2D* copy, const TH1D* norm);
357  static void ScaleToCoverage(TH1D* copy, const TH1D* norm);
367  static void SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker,
368  const char* title,
369  const char* ytitle=0);
375  enum {
376  kSolid = 0x000,
377  kHollow = 0x001,
378  kCircle = 0x002,
379  kSquare = 0x004,
380  kUpTriangle = 0x006,
381  kDownTriangle = 0x008,
382  kDiamond = 0x00a,
383  kCross = 0x00c,
384  kStar = 0x00e
385  };
393  static Int_t GetMarkerStyle(UShort_t bits);
401  static UShort_t GetMarkerBits(Int_t style);
409  static Int_t FlipHollowStyle(Int_t style);
442  void SetIpzReweight(TF1* f) { fIpzReweight = f; }
443 protected:
455  // Forward declaration
456  class CentralityBin;
466  virtual Bool_t CheckEvent(const AliAODForwardMult& forward);
471  virtual void InitializeCentBins();
480  virtual TH2D* GetHistogram(const AliAODEvent& aod, Bool_t mc=false) = 0;
486  virtual Int_t GetColor() const { return kBlack; }
492  virtual Int_t GetMarker() const { return GetMarkerStyle(kCircle); }
500  virtual void CheckEventData(Double_t vtx,
501  TH2* data,
502  TH2* mcData);
510  void AddCentralityBin(UShort_t at, Float_t low, Float_t high);
520  virtual CentralityBin* MakeCentralityBin(const char* name, Float_t low,
521  Float_t high) const;
522 
523  // function which applies empirical correction to the AOD object
533  static TH1* Asymmetry(TH1* h);
542  static Int_t GetCentMethodID(const TString& meth);
550  static const char* GetCentMethod(UShort_t id);
562  AliAODForwardMult* forward,
563  Int_t& qual);
572  AliAODForwardMult* forward);
573  //==================================================================
579  struct Sum : public TNamed
580  {
581  TH2D* fSum; // Sum of non-zero events
582  TH2D* fSum0; // Sum of zero events
583  TH1I* fEvents; // Distribution of events
584  Int_t fDebug; // Debug level
588  Sum() : fSum(0), fSum0(0), fEvents(0), fDebug(0) {}
595  Sum(const char* name, const char* postfix)
596  : TNamed(name,postfix),
597  fSum(0),
598  fSum0(0),
599  fEvents(0),
600  fDebug(0)
601  {}
607  Sum(const Sum& o)
608  : TNamed(o),
609  fSum(o.fSum),
610  fSum0(o.fSum0),
611  fEvents(o.fEvents),
612  fDebug(o.fDebug)
613  {}
621  Sum& operator=(const Sum& o)
622  {
623  if (&o == this) return *this;
624  SetName(o.GetName()); fSum = o.fSum; fSum0 = o.fSum0; fEvents=o.fEvents;
625  return *this;
626  }
630  ~Sum() {}
638  void Init(TList* list, const TH2D* data, Int_t col);
646  void Add(const TH2D* data, Bool_t isZero, Double_t weight);
656  static TString GetHistName(const char* name, Int_t what=0,
657  const char* post=0);
665  TString GetHistName(Int_t what=0) const;
679  TH2D* CalcSum(TList* o, Double_t& ntotal,
680  Double_t zeroEff, Double_t otherEff=1, Int_t marker=20,
681  Bool_t rootXproj=false, Bool_t corrEmpty=true) const;
682 
688  virtual void Print(Option_t* option="") const;
689  // ClassDef(Sum,2); // Summed histograms
690  };
691 
692  //==================================================================
700  class CentralityBin : public TNamed
701  {
702  public:
706  CentralityBin();
714  CentralityBin(const char* name, Float_t low, Float_t high);
720  CentralityBin(const CentralityBin& other);
724  virtual ~CentralityBin();
732  CentralityBin& operator=(const CentralityBin& other);
738  Bool_t IsAllBin() const { return fLow == 0 && fHigh == 0; }
744  const char* GetListName() const;
751  virtual void CreateOutputObjects(TList* dir, Int_t mask);
767  virtual Bool_t ProcessEvent(const AliAODForwardMult* forward,
768  UInt_t triggerMask,
769  Bool_t isZero,
770  Double_t vzMin,
771  Double_t vzMax,
772  const TH2D* data,
773  const TH2D* mc,
774  UInt_t filter,
775  Double_t weight);
834  virtual Double_t Normalization(const TH1I& t,
835  UShort_t scheme,
836  Double_t trgEff,
837  Double_t& ntotal,
838  TString* text) const;
852  virtual void MakeResult(const TH2D* sum,
853  const char* postfix,
854  bool rootProj,
855  bool corrEmpty,
856  Double_t scaler,
857  Int_t marker,
858  Int_t color,
859  TList* mclist,
860  TList* truthlist);
877  virtual void End(TList* sums,
878  TList* results,
879  UShort_t scheme,
880  Double_t trigEff,
881  Double_t trigEff0,
882  Bool_t rootProj,
883  Bool_t corrEmpty,
884  Int_t triggerMask,
885  Int_t marker,
886  Int_t color,
887  TList* mclist,
888  TList* truthlist);
900  const Sum* GetSum(Bool_t mc=false) const { return mc ? fSumMC : fSum; }
908  Sum* GetSum(Bool_t mc=false) { return mc ? fSumMC : fSum; }
914  const TH1I* GetTriggers() const { return fTriggers; }
920  TH1I* GetTriggers() { return fTriggers; }
926  const TH1I* GetStatus() const { return fStatus; }
932  TH1I* GetStatus() { return fStatus; }
942  Int_t GetColor(Int_t fallback=kRed+2) const;
948  TList* GetResults() const { return fOutput; }
957  const char* GetResultName(const char* postfix="") const;
966  TH1* GetResult(const char* postfix="",
967  Bool_t verbose=true) const;
973  void SetDebugLevel(Int_t lvl);
979  void SetSatelliteVertices(Bool_t satVtx) { fSatelliteVertices = satVtx; }
987  virtual void Print(Option_t* option="") const;
988  protected:
997  virtual Bool_t ReadSum(TList* list, bool mc=false);
1004  virtual void CreateSums(const TH2D* data, const TH2D* mc);
1016  virtual Bool_t CheckEvent(const AliAODForwardMult* forward,
1017  Int_t triggerMask,
1018  Double_t vzMin,
1019  Double_t vzMax,
1020  Int_t filter);
1021  TList* fSums; // Output list
1022  TList* fOutput; // Output list
1023  Sum* fSum; // Sum histogram
1024  Sum* fSumMC; // MC sum histogram
1025  TH1I* fTriggers; // Trigger histogram
1026  TH1I* fStatus; // Trigger histogram
1027  Float_t fLow; // Lower limit (inclusive)
1028  Float_t fHigh; // Upper limit (exclusive)
1029  Bool_t fDoFinalMCCorrection; //Do final MC correction
1030  Bool_t fSatelliteVertices; // Satellite vertex flag
1031  Int_t fDebug; // Debug level
1032 
1033  // ClassDef(CentralityBin,5); // A centrality bin
1034  };
1035  Bool_t fCorrEmpty; // Correct for empty bins
1036  Bool_t fUseROOTProj; // Whether to use ROOT's ProjectionX
1037  Double_t fTriggerEff; // Trigger efficiency for selected trigger(s)
1038  Double_t fTriggerEff0; // Bin-0 Trigger efficiency for sel trigger(s)
1039  TObjArray* fListOfCentralities; // Centrality bins
1040  UShort_t fNormalizationScheme; // Normalization scheme
1041  TString fFinalMCCorrFile; //Filename for final MC corr
1042  Bool_t fSatelliteVertices; // satellite vertex flag
1043  TH2D* fEmpiricalCorrection; // Empirical correction
1044  TH2D* fMeanVsC; //mean signal per event vs cent
1045  TH1D* fSeenCent; // The seen centrality
1046  TH1D* fTakenCent; // The taken centrality
1047  TString fCentMethod; // Centrality estimator
1048  AliAnalysisUtils fAnaUtil; // Analysis utility
1049  Bool_t fUseUtilPileup; // Check for SPD outliers
1050  TF1* fIpzReweight; // Re-weighing function
1051  Double_t fCacheCent; // Stored centrality
1052  Int_t fCacheQual; // Stored centrality quality flag
1053  ClassDef(AliBasedNdetaTask,19); // Determine charged particle density
1054 };
1055 
1056 #endif
1057 //
1058 // Local Variables:
1059 // mode: C++
1060 // End:
1061 //
Int_t color[]
Sum(const char *name, const char *postfix)
virtual Bool_t PreEvent()
const char * GetResultName(const char *postfix="") const
const char * filename
Definition: TestFCM.C:1
AliAnalysisUtils & GetAnalysisUtils()
void Print(Option_t *option="R") const
double Double_t
Definition: External.C:58
static void ScaleToCoverage(TH2D *copy, const TH1D *norm)
Definition: External.C:236
const char * title
Definition: MakeQAPdf.C:26
static UShort_t ParseNormalizationScheme(const Char_t *what)
Double_t GetCentrality(AliAODEvent &event, AliAODForwardMult *forward, Int_t &qual)
virtual Bool_t Event(AliAODEvent &aod)
char Char_t
Definition: External.C:18
TList * list
virtual void InitializeCentBins()
static TH1 * Asymmetry(TH1 *h)
TH2D * CalcSum(TList *o, Double_t &ntotal, Double_t zeroEff, Double_t otherEff=1, Int_t marker=20, Bool_t rootXproj=false, Bool_t corrEmpty=true) const
virtual void MakeResult(const TH2D *sum, const char *postfix, bool rootProj, bool corrEmpty, Double_t scaler, Int_t marker, Int_t color, TList *mclist, TList *truthlist)
virtual void CheckEventData(Double_t vtx, TH2 *data, TH2 *mcData)
virtual void SetDebugLevel(Int_t level)
virtual void Print(Option_t *option="") const
void SetUseUtilPileup(Bool_t use)
static Int_t GetMarkerStyle(UShort_t bits)
static Int_t FlipHollowStyle(Int_t style)
virtual Bool_t Finalize()
AliAnalysisUtils fAnaUtil
void SetTriggerEff0(Double_t e)
int Int_t
Definition: External.C:63
void SetNormalizationScheme(UShort_t scheme)
void Init(TList *list, const TH2D *data, Int_t col)
Definition: External.C:204
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
virtual Bool_t CheckEvent(const AliAODForwardMult *forward, Int_t triggerMask, Double_t vzMin, Double_t vzMax, Int_t filter)
void SetTriggerEff(Double_t e)
ClassDef(AliBasedNdetaTask, 19)
Definition: External.C:228
Definition: External.C:212
virtual Int_t GetColor() const
virtual void CreateSums(const TH2D *data, const TH2D *mc)
virtual Bool_t ProcessEvent(const AliAODForwardMult *forward, UInt_t triggerMask, Bool_t isZero, Double_t vzMin, Double_t vzMax, const TH2D *data, const TH2D *mc, UInt_t filter, Double_t weight)
TObjArray * fListOfCentralities
virtual Bool_t Book()
CentralityBin & operator=(const CentralityBin &other)
Sum & operator=(const Sum &o)
static Int_t GetCentMethodID(const TString &meth)
static const char * GetCentMethod(UShort_t id)
virtual CentralityBin * MakeCentralityBin(const char *name, Float_t low, Float_t high) const
void SetSatelliteVertices(Bool_t satVtx)
void SetSatelliteVertices(Bool_t satVtx)
virtual TH2D * GetHistogram(const AliAODEvent &aod, Bool_t mc=false)=0
virtual Bool_t ReadSum(TList *list, bool mc=false)
void AddCentralityBin(UShort_t at, Float_t low, Float_t high)
Bool_t ApplyEmpiricalCorrection(const AliAODForwardMult *aod, TH2D *data)
AliBasedNdetaTask & operator=(const AliBasedNdetaTask &)
TH1 * GetResult(const char *postfix="", Bool_t verbose=true) const
void SetCorrEmpty(Bool_t use)
Definition: External.C:220
static TH1D * ProjectX(const TH2D *h, const char *name, Int_t firstbin, Int_t lastbin, bool useROOT=false, bool corr=true, bool error=true)
void Add(const TH2D *data, Bool_t isZero, Double_t weight)
virtual void End(TList *sums, TList *results, UShort_t scheme, Double_t trigEff, Double_t trigEff0, Bool_t rootProj, Bool_t corrEmpty, Int_t triggerMask, Int_t marker, Int_t color, TList *mclist, TList *truthlist)
const Sum * GetSum(Bool_t mc=false) const
unsigned short UShort_t
Definition: External.C:28
virtual Bool_t CheckEvent(const AliAODForwardMult &forward)
const char Option_t
Definition: External.C:48
static TString GetHistName(const char *name, Int_t what=0, const char *post=0)
void SetIpzReweight(TF1 *f)
virtual void CreateOutputObjects(TList *dir, Int_t mask)
virtual Int_t GetMarker() const
bool Bool_t
Definition: External.C:53
void SetUseROOTProjectX(Bool_t use)
virtual void Print(Option_t *option="") const
AliBasedNdetaTask(const AliBasedNdetaTask &)
Int_t GetColor(Int_t fallback=kRed+2) const
Definition: External.C:196
static UShort_t GetMarkerBits(Int_t style)
void SetGlobalEmpiricalcorrection(TH2D *h)
void SetMCFinalCorrFilename(const char *filename)
Bool_t SetCentralityMethod(const TString &method)
static const Char_t * NormalizationSchemeString(UShort_t scheme)
virtual Double_t Normalization(const TH1I &t, UShort_t scheme, Double_t trgEff, Double_t &ntotal, TString *text) const
static void SetHistogramAttributes(TH1D *h, Int_t colour, Int_t marker, const char *title, const char *ytitle=0)