AliPhysics  9c66e61 (9c66e61)
AliForwardFlowTaskQC.h
Go to the documentation of this file.
1 //
2 // Calculate the flow in the forward regions using the Q cumulants method
3 //
4 #ifndef ALIFORWARDFLOWTASKQC_H
5 #define ALIFORWARDFLOWTASKQC_H
6 
14 #include "AliAnalysisTaskSE.h"
15 #include "TString.h"
16 #include <TH2D.h>
17 class AliAODForwardMult;
18 class TH1I;
19 class TH1D;
20 class TH2I;
21 class TH2F;
22 class TH2D;
23 class TH3D;
24 class TAxis;
25 class AliAnalysisFilter;
26 class AliESDEvent;
47 {
48 public:
58  AliForwardFlowTaskQC(const char* name);
62  virtual ~AliForwardFlowTaskQC() {}
70  virtual void UserCreateOutputObjects();
74  virtual void Init() {}
80  virtual void UserExec(Option_t *option);
86  virtual void Terminate(Option_t *option);
87  /* @} */
105  void SetVertexAxis(TAxis* axis) { fVtxAxis = axis; }
111  void SetCentralityAxis(TAxis* axis) { fCentAxis = axis; }
118  void SetCentralityAxis(const char* bins);
125  void SetDetectorCuts(Double_t fmdCut, Double_t spdCut) { fFMDCut = fmdCut; fSPDCut = spdCut; }
132  void SetFlowFlags(UShort_t flags);
141  static const Char_t* GetQCType(UShort_t flags, Bool_t prependUS = kTRUE);
147  void SetEtaGapValue(Double_t eg) { fEtaGap = eg; }
148  void SetTrackCuts(AliAnalysisFilter* trCuts) { fTrackCuts = trCuts; }
152  enum EFlowFlags {
153  kStdQC = 0x0001, // Standard QC{2} and QC{4} calculations
154  kEtaGap = 0x0002, // QC{2} w/ an eta-gap
155  k3Cor = 0x0004, // 3 correlator method for QC{2} w/ an eta-gap
156  kSymEta = 0x0008, // Symmetrize ref flow in std. QC{2} and QC{4} around eta = 0
157  kSatVtx = 0x0010, // Do satellite vertex input (currently not implemented)
158  kNUAcorr = 0x0020, // Apply full NUA correction
159  kFMD = 0x0040, // Use FMD for forward flow
160  kVZERO = 0x0080, // Use VZERO for forward flow
161  kSPD = 0x0100, // SPD object flag
162  kMC = 0x0200, // MC object flag
163  kTracks = 0x1000, // Use tracks for reference flow
164  kTPC = 0x3000, // Use TPC tracks
165  kHybrid = 0x5000 // Use hybrid tracks
166  };
171  struct CumuHistos : public TObject
172  {
173  public:
174  /*
175  * Constructor
176  */
193  : TObject(o),
194  fMaxMoment(o.fMaxMoment), // Max moment to compute
195  fRefHists(o.fRefHists), // List with ref hists
196  fDiffHists(o.fDiffHists), // List with diff hists
197  fNUA(o.fNUA)
198  {}
207  {
208  if (&o == this) return *this;
209  TObject::operator=(o);
211  fRefHists = o.fRefHists;
213  fNUA = o.fNUA;
214  return *this;
215  }
230  TH1* Get(Char_t t, Int_t n, UInt_t nua = 0) const;
237  void ConnectList(TString name, TList* l);
243  void Add(TH1* h) const;
254  enum {
255  kNoNUA = 0, // No NUA applied
256  kNUAOld, // NUA correction from same moment applied
257  kNUA // Full cross-moment NUA correction applied
258  };
259  protected:
268  Int_t GetPos(Int_t n, UInt_t nua) const;
269 
270  Int_t fMaxMoment; // Max flow moment contained
271  TList* fRefHists; // List of reference hists
272  TList* fDiffHists; // List of diff hists
273  UInt_t fNUA; // NUA tracker
274 
275  // ClassDef(CumuHistos, 1);
276  }; // End of struct
277 
278 protected:
282  enum {
283  kFillRef = 0x1, // Fill only ref flow
284  kFillDiff = 0x2, // Fill only diff flow
285  kFillBoth = 0x3, // Fill both
286  kReset = 0x4, // Reset hists (used with one of the above)
287  };
291  enum {
292  kNoEvent = 1, // No event found
293  kNoForward, // No forward object found
294  kNoCentral, // No central object found
295  kNoTrigger, // No (wrong) trigger
296  kNoCent, // No centrality
297  kInvCent, // Centrality outside range
298  kNoVtx, // No vertex
299  kInvVtx, // Vertex outside range
300  kOK // Event OK!
301  };
302  // ----------------- Being nested class ---------------------
307  class VertexBin : public TNamed
308  {
309  public:
310  /*
311  * Constructor
312  */
313  VertexBin();
325  VertexBin(Int_t vLow, Int_t vHigh,
326  UShort_t moment, TString type,
327  UShort_t flags,
328  Double_t cut = -1, Double_t etaGap = -1.);
336  VertexBin(const VertexBin& o){;}
344  VertexBin& operator=(const VertexBin& v);
357  void AddOutput(TList* list, TAxis* centAxis);
368  Bool_t FillHists(TH2D& dNdetadphi, Double_t cent, UShort_t mode);
380  Bool_t FillTracks(TObjArray* trList, AliESDEvent* esd,
381  AliAnalysisFilter* trFilter, UShort_t mode);
388  void CumulantsAccumulate(Double_t cent);
395  void CumulantsAccumulate3Cor(Double_t cent);
405  void GetLimits(Int_t bin, Int_t& aLow, Int_t& aHigh, Int_t& bLow, Int_t& bHigh) const;
413  void CumulantsTerminate(TList* inlist, TList* outlist);
414  /*
415  * Enumeration for cumulant histograms
416  */
417  enum { kW2Two = 1, // <w2*two>
418  kW2, // <w2>
419  kW4Four, // <w4*four>
420  kW4, // <w4>
421  kCosphi1phi2, // <cos(phi1+phi2)>
422  kSinphi1phi2, // <sin(phi1+phi2)>
423  kCosphi1phi2phi3m, // <cos(phi1-phi2-phi3)>
424  kSinphi1phi2phi3m, // <sin(phi1-phi2-phi3)>
425  k3pWeight, // M(M-1)(M-1) or (mp*M-2mq)(M-1)
426  kCosphi1phi2phi3p, // <cos(phi1+phi2-phi3)>
427  kSinphi1phi2phi3p // <sin(phi1+phi2-phi3)>
428  };
429  protected:
439  void CalculateReferenceFlow(CumuHistos& cumu2h, CumuHistos& cumu4h, TH2I* quality, TH1D* chist, TH2D* dNdetaRef) const;
448  void CalculateDifferentialFlow(CumuHistos& cumu2h, CumuHistos& cumu4h, TH2I* quality, TH2D* dNdetaDiff) const;
458  void Calculate3CorFlow(CumuHistos& cumu2h, TH2I* quality, TH1D* chist, TH2D* dNdetaRef, TH2D* dNdetaDiff) const;
465  void SolveCoupledFlowEquations(CumuHistos& cumu, Char_t type) const;
477  Double_t CalculateNUAMatrixElement(Int_t n, Int_t m, Char_t type, Int_t binA, Int_t cBin) const;
485  void AddVertexBins(CumuHistos& cumu, TList* list, UInt_t nNUA) const;
493  Int_t GetBinNumberCos(Int_t n = 0) const;
501  Int_t GetBinNumberSin(Int_t n = 0) const;
507  void SetupNUALabels(TAxis* a) const;
515  TH2I* MakeQualityHist(const Char_t* name) const;
526  TH2D* MakeOutputHist(Int_t qc, Int_t n, const Char_t* ctype, UInt_t nua) const;
527 
528  UShort_t fMaxMoment; // Max flow moment
529  Int_t fVzMin; // z-vertex min must be in whole [cm]
530  Int_t fVzMax; // z-vertex max must be in whole [cm]
531  TString fType; // Data type
532  UShort_t fFlags; // Flow flags, e.g., eta-gap or sat. vtx
533  Double_t fSigmaCut; // Detector specific cut for outlier events
534  Double_t fEtaGap; // Eta gap value
535  Double_t fEtaLims[6]; // Limits for binning in 3Cor method
536  TH2D* fCumuRef; // Histogram for reference flow
537  TH2D* fCumuDiff; // Histogram for differential flow
538  CumuHistos fCumuHists; // Array of histograms for cumulants calculations
539  TH3D* fCumuNUARef; // histogram for NUA terms
540  TH3D* fCumuNUADiff; // histogram for NUA terms
541  TH2F* fdNdedpRefAcc; // Diagnostics histogram for acc. maps
542  TH2F* fdNdedpDiffAcc; // Diagnostics histogram for acc. maps
543  TH2F* fOutliers; // Sigma <M> histogram
544  UShort_t fDebug; // Debug flag
545 
546  // ClassDef(VertexBin, 4); // object for eta dependent cumulants ananlysis
547  };
548  // ---------- End of nested class -------------
564  virtual void InitVertexBins();
568  virtual void InitHists();
574  virtual Bool_t Analyze();
578  virtual void Finalize();
587  void FillVtxBinList(const TList& list, TH2D& h1, Int_t vtx, UShort_t flags = 0x0) const;
597  void FillVtxBinListEtaGap(const TList& list, TH2D& href, TH2D& hdiff, Int_t vtx, UShort_t flags = 0x0) const;
607  void FillVtxBinList3Cor(const TList& list, TH2D& hcent, TH2D& hfwd, Int_t vtx, UShort_t flags = 0x0);
616  TH2D& CombineHists(TH2D& hcent, TH2D& hfwd);
622  Bool_t FillTracks(VertexBin* bin, UShort_t mode) const;
628  void EndVtxBinList(const TList& list) const;
635  void MakeCentralityHists(TList* list) const;
645  virtual Bool_t CheckEvent(const AliAODForwardMult* aodfm);
655  virtual Bool_t CheckTrigger(const AliAODForwardMult* aodfm) const;
665  virtual Bool_t GetCentrality(const AliAODForwardMult* aodfm);
675  virtual Bool_t GetVertex(const AliAODForwardMult* aodfm);
681  AliVVZERO* GetVZERO() const;
687  void FillVZEROHist(AliVVZERO* vzero);
691  void PrintFlowSetup() const;
692 
693  TAxis* fVtxAxis; // Axis to control vertex binning
694  TAxis* fCentAxis; // Axis to control centrality/multiplicity binning
695  Double_t fFMDCut; // FMD sigma cut for outlier events
696  Double_t fSPDCut; // SPD sigma cut for outlier events
697  UShort_t fFlowFlags; // Flow flags, e.g., eta-gap, sat. vtx.
698  Double_t fEtaGap; // Eta gap value
699  TList fBinsForward; // List with forward VertexBin objects
700  TList fBinsCentral; // List with central VertexBin objects
701  TList* fSumList; // Sum list
702  TList* fOutputList; // Output list
703  AliAODEvent* fAOD; // AOD event
704  AliAnalysisFilter* fTrackCuts; // ESD track cuts
705  Int_t fMaxMoment; // Calculate v_{n} flag
706  Float_t fVtx; // Z vertex bin
707  Double_t fCent; // Centrality
708  TH2D fHistdNdedpV0; // VZERO d^2N/detadphi histogram
709  TH2D fHistdNdedp3Cor;// 3 correlator d^2N/detadphi histogram
710  TH2D* fHistFMDSPDCorr;// Diagnostics hist for multiplicity correlations between FMD and SPD
711  TH1D* fHistCent; // Diagnostics hist for centrality
712  TH1D* fHistVertexSel; // Diagnostics hist for selected vertices
713  TH1I* fHistEventSel; // Diagnostics hist for event selection
714 
715  ClassDef(AliForwardFlowTaskQC, 5); // Analysis task for flow analysis
716 };
717 
718 #endif
719 // Local Variables:
720 // mode: C++
721 // End:
virtual void UserExec(Option_t *option)
double Double_t
Definition: External.C:58
void SetTrackCuts(AliAnalysisFilter *trCuts)
AliVVZERO * GetVZERO() const
void EndVtxBinList(const TList &list) const
Definition: External.C:236
Bool_t FillTracks(VertexBin *bin, UShort_t mode) const
char Char_t
Definition: External.C:18
void SetDetectorCuts(Double_t fmdCut, Double_t spdCut)
virtual Bool_t GetVertex(const AliAODForwardMult *aodfm)
TH1 * Get(Char_t t, Int_t n, UInt_t nua=0) const
virtual void Terminate(Option_t *option)
void FillVtxBinList3Cor(const TList &list, TH2D &hcent, TH2D &hfwd, Int_t vtx, UShort_t flags=0x0)
void SetMaxFlowMoment(Short_t n)
int Int_t
Definition: External.C:63
Definition: External.C:204
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
void ConnectList(TString name, TList *l)
Definition: External.C:252
void FillVtxBinList(const TList &list, TH2D &h1, Int_t vtx, UShort_t flags=0x0) const
Definition: External.C:228
Definition: External.C:212
AliAnalysisFilter * fTrackCuts
TH2D & CombineHists(TH2D &hcent, TH2D &hfwd)
Int_t GetPos(Int_t n, UInt_t nua) const
Int_t mode
Definition: anaM.C:41
virtual Bool_t GetCentrality(const AliAODForwardMult *aodfm)
short Short_t
Definition: External.C:23
virtual Bool_t CheckEvent(const AliAODForwardMult *aodfm)
virtual Bool_t CheckTrigger(const AliAODForwardMult *aodfm) const
void SetEtaGapValue(Double_t eg)
void SetFlowFlags(UShort_t flags)
void MakeCentralityHists(TList *list) const
unsigned short UShort_t
Definition: External.C:28
const char Option_t
Definition: External.C:48
virtual void UserCreateOutputObjects()
static const Char_t * GetQCType(UShort_t flags, Bool_t prependUS=kTRUE)
bool Bool_t
Definition: External.C:53
void SetCentralityAxis(TAxis *axis)
void SetVertexAxis(TAxis *axis)
void FillVZEROHist(AliVVZERO *vzero)
Definition: External.C:196
CumuHistos & operator=(const CumuHistos &o)
void FillVtxBinListEtaGap(const TList &list, TH2D &href, TH2D &hdiff, Int_t vtx, UShort_t flags=0x0) const