AliPhysics  c923f52 (c923f52)
 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 TProfile;
26 class AliAODEvent;
27 class AliAODForwardMult;
28 class TObjArray;
29 
50 {
51 public:
55  enum {
57  kNone = 0,
64  kEventLevel = 0x1,
68  kDummy = 0x2,
72  kBackground = 0x4,
84  kZeroBin = 0x10,
89  };
93  enum EPileupMask {
101  kPileupSPD = 0x1,
105  kPileupTrk = 0x2,
109  kPileupBC = 0x4,
113  kPileupFull = 0x8,
121  kPileupUtil = 0x20,
125  kPileupBins = 0x40,
126  };
127 
130  kCentDefault, // What ever stored in AOD
131  kCentV0M, // VZERO multiplcity
132  kCentV0A, // VZERO-A
133  kCentV0A123, // VZERO-A
134  kCentV0C, // VZERO-C
135  kCentFMD, // FMD
136  kCentTrk, // Tracks
137  kCentTkl, // Tracklets
138  kCentCL0, // Clusters in SPD-0
139  kCentCL1, // Clusters in SPD-1
140  kCentCND, // Candle - tracks+tracklets
141  kCentZNA, // ZDC neutrons A-side
142  kCentZNC, // ZDC neutrons C-side
143  kCentZPA, // ZDC protons A-side
144  kCentZPC, // ZDC protons C-side
145  kCentNPA, // ?
146  kCentV0MvsFMD, // V0M vs FMD
147  kCentTklvsV0M, // Tracks vs V0M
148  kCentZEMvsZDC, // ZDC veto vs neutrons
149  kMult, // Reference multiplicity in @f$|\eta|<0.8@f$
150  kMultV0A, // HMTF V0A
151  kMultV0M, // HMTF V0M
152  kMultV0C, // HMTF V0C
153  kCentTrue = 0x100,
154  kCentEq = 0x200
155  };
166  AliBasedNdetaTask(const char* name);
171  virtual ~AliBasedNdetaTask();
172 
182  virtual void SetDebugLevel(Int_t level);
188  void SetCorrEmpty(Bool_t use) { fCorrEmpty = use; }
214  void SetSatelliteVertices(Bool_t satVtx) { fSatelliteVertices = satVtx; }
235  Bool_t SetCentralityMethod(const TString& method);
241  AliAnalysisUtils& GetAnalysisUtils() { return fAnaUtil; }
249  static const Char_t* NormalizationSchemeString(UShort_t scheme);
257  static UShort_t ParseNormalizationScheme(const Char_t* what);
263  void SetNormalizationScheme(UShort_t scheme);
269  void SetNormalizationScheme(const char* what);
275  void SetMCFinalCorrFilename(const char* filename) {
276  fFinalMCCorrFile.Clear();
277  fFinalMCCorrFile.Append(filename);
278  }
285  void Print(Option_t* option="R") const;
296  virtual Bool_t Book();
303  virtual Bool_t PreEvent() {
304  fCacheCent = -10; fCacheQual = 0xFFFF; return true; }
310  virtual Bool_t Event(AliAODEvent& aod);
318  virtual Bool_t Finalize();
319  /* @} */
320 
338  static TH1D* ProjectX(const TH2D* h,
339  const char* name,
340  Int_t firstbin,
341  Int_t lastbin,
342  bool useROOT=false,
343  bool corr=true,
344  bool error=true);
351  static void ScaleToCoverage(TH2D* copy, const TH1D* norm);
358  static void ScaleToCoverage(TH1D* copy, const TH1D* norm);
368  static void SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker,
369  const char* title,
370  const char* ytitle=0);
376  enum {
377  kSolid = 0x000,
378  kHollow = 0x001,
379  kCircle = 0x002,
380  kSquare = 0x004,
381  kUpTriangle = 0x006,
382  kDownTriangle = 0x008,
383  kDiamond = 0x00a,
384  kCross = 0x00c,
385  kStar = 0x00e
386  };
394  static Int_t GetMarkerStyle(UShort_t bits);
402  static UShort_t GetMarkerBits(Int_t style);
410  static Int_t FlipHollowStyle(Int_t style);
443  void SetIpzReweight(TF1* f) { fIpzReweight = f; }
444 protected:
456  // Forward declaration
457  class CentralityBin;
467  virtual Bool_t CheckEvent(const AliAODForwardMult& forward);
472  virtual void InitializeCentBins();
481  virtual TH2D* GetHistogram(const AliAODEvent& aod, Bool_t mc=false) = 0;
487  virtual Int_t GetColor() const { return kBlack; }
493  virtual Int_t GetMarker() const { return GetMarkerStyle(kCircle); }
501  virtual void CheckEventData(Double_t vtx,
502  TH2* data,
503  TH2* mcData);
511  void AddCentralityBin(UShort_t at, Float_t low, Float_t high);
521  virtual CentralityBin* MakeCentralityBin(const char* name, Float_t low,
522  Float_t high) const;
523 
524  // function which applies empirical correction to the AOD object
534  static TH1* Asymmetry(TH1* h);
543  static Int_t GetCentMethodID(const TString& meth);
551  static const char* GetCentMethod(UShort_t id);
563  AliAODForwardMult* forward,
564  Int_t& qual);
573  AliAODForwardMult* forward);
574  //==================================================================
580  struct Sum : public TNamed
581  {
582  TH2D* fSum; // Sum of non-zero events
583  TH2D* fSum0; // Sum of zero events
584  TH1I* fEvents; // Distribution of events
585  Int_t fDebug; // Debug level
589  Sum() : fSum(0), fSum0(0), fEvents(0), fDebug(0) {}
596  Sum(const char* name, const char* postfix)
597  : TNamed(name,postfix),
598  fSum(0),
599  fSum0(0),
600  fEvents(0),
601  fDebug(0)
602  {}
608  Sum(const Sum& o)
609  : TNamed(o),
610  fSum(o.fSum),
611  fSum0(o.fSum0),
612  fEvents(o.fEvents),
613  fDebug(o.fDebug)
614  {}
622  Sum& operator=(const Sum& o)
623  {
624  if (&o == this) return *this;
625  SetName(o.GetName()); fSum = o.fSum; fSum0 = o.fSum0; fEvents=o.fEvents;
626  return *this;
627  }
631  ~Sum() {}
639  void Init(TList* list, const TH2D* data, Int_t col);
647  void Add(const TH2D* data, Bool_t isZero, Double_t weight);
657  static TString GetHistName(const char* name, Int_t what=0,
658  const char* post=0);
666  TString GetHistName(Int_t what=0) const;
680  TH2D* CalcSum(TList* o, Double_t& ntotal,
681  Double_t zeroEff, Double_t otherEff=1, Int_t marker=20,
682  Bool_t rootXproj=false, Bool_t corrEmpty=true) const;
683 
689  virtual void Print(Option_t* option="") const;
690  // ClassDef(Sum,2); // Summed histograms
691  };
692 
693  //==================================================================
701  class CentralityBin : public TNamed
702  {
703  public:
707  CentralityBin();
715  CentralityBin(const char* name, Float_t low, Float_t high);
721  CentralityBin(const CentralityBin& other);
725  virtual ~CentralityBin();
733  CentralityBin& operator=(const CentralityBin& other);
739  Bool_t IsAllBin() const { return fLow == 0 && fHigh == 0; }
745  const char* GetListName() const;
752  virtual void CreateOutputObjects(TList* dir, Int_t mask);
768  virtual Bool_t ProcessEvent(const AliAODForwardMult* forward,
769  UInt_t triggerMask,
770  Bool_t isZero,
771  Double_t vzMin,
772  Double_t vzMax,
773  const TH2D* data,
774  const TH2D* mc,
775  UInt_t filter,
776  Double_t weight);
835  virtual Double_t Normalization(const TH1I& t,
836  UShort_t scheme,
837  Double_t trgEff,
838  Double_t& ntotal,
839  TString* text) const;
853  virtual void MakeResult(const TH2D* sum,
854  const char* postfix,
855  bool rootProj,
856  bool corrEmpty,
857  Double_t scaler,
858  Int_t marker,
859  Int_t color,
860  TList* mclist,
861  TList* truthlist);
878  virtual void End(TList* sums,
879  TList* results,
880  UShort_t scheme,
881  Double_t trigEff,
882  Double_t trigEff0,
883  Bool_t rootProj,
884  Bool_t corrEmpty,
885  Int_t triggerMask,
886  Int_t marker,
887  Int_t color,
888  TList* mclist,
889  TList* truthlist);
901  const Sum* GetSum(Bool_t mc=false) const { return mc ? fSumMC : fSum; }
909  Sum* GetSum(Bool_t mc=false) { return mc ? fSumMC : fSum; }
915  const TH1I* GetTriggers() const { return fTriggers; }
921  TH1I* GetTriggers() { return fTriggers; }
927  const TH1I* GetStatus() const { return fStatus; }
933  TH1I* GetStatus() { return fStatus; }
943  Int_t GetColor(Int_t fallback=kRed+2) const;
944  void SetColor(Color_t colour) { fColor = colour; }
950  TList* GetResults() const { return fOutput; }
959  const char* GetResultName(const char* postfix="") const;
968  TH1* GetResult(const char* postfix="",
969  Bool_t verbose=true) const;
975  void SetDebugLevel(Int_t lvl);
981  void SetSatelliteVertices(Bool_t satVtx) { fSatelliteVertices = satVtx; }
989  virtual void Print(Option_t* option="") const;
990  protected:
999  virtual Bool_t ReadSum(TList* list, bool mc=false);
1006  virtual void CreateSums(const TH2D* data, const TH2D* mc);
1018  virtual Bool_t CheckEvent(const AliAODForwardMult* forward,
1019  Int_t triggerMask,
1020  Double_t vzMin,
1021  Double_t vzMax,
1022  Int_t filter);
1023  TList* fSums; // Output list
1024  TList* fOutput; // Output list
1025  Sum* fSum; // Sum histogram
1026  Sum* fSumMC; // MC sum histogram
1027  TH1I* fTriggers; // Trigger histogram
1028  TH1I* fStatus; // Trigger histogram
1029  Float_t fLow; // Lower limit (inclusive)
1030  Float_t fHigh; // Upper limit (exclusive)
1031  Bool_t fDoFinalMCCorrection; //Do final MC correction
1032  Bool_t fSatelliteVertices; // Satellite vertex flag
1033  Int_t fDebug; // Debug level
1034  Color_t fColor; // Colour used
1035 
1036  // ClassDef(CentralityBin,5); // A centrality bin
1037  };
1038  Bool_t fCorrEmpty; // Correct for empty bins
1039  Bool_t fUseROOTProj; // Whether to use ROOT's ProjectionX
1040  Double_t fTriggerEff; // Trigger efficiency for selected trigger(s)
1041  Double_t fTriggerEff0; // Bin-0 Trigger efficiency for sel trigger(s)
1042  TObjArray* fListOfCentralities; // Centrality bins
1043  UShort_t fNormalizationScheme; // Normalization scheme
1044  TString fFinalMCCorrFile; //Filename for final MC corr
1045  Bool_t fSatelliteVertices; // satellite vertex flag
1046  TH2D* fEmpiricalCorrection; // Empirical correction
1047  TProfile* fMeanVsC; //mean signal per event vs cent
1048  TH1D* fSeenCent; // The seen centrality
1049  TH1D* fTakenCent; // The taken centrality
1050  TString fCentMethod; // Centrality estimator
1051  AliAnalysisUtils fAnaUtil; // Analysis utility
1052  Bool_t fUseUtilPileup; // Check for SPD outliers
1053  TF1* fIpzReweight; // Re-weighing function
1054  Double_t fCacheCent; // Stored centrality
1055  Int_t fCacheQual; // Stored centrality quality flag
1056  ClassDef(AliBasedNdetaTask,19); // Determine charged particle density
1057 };
1058 
1059 #endif
1060 //
1061 // Local Variables:
1062 // mode: C++
1063 // End:
1064 //
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)