]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/RESONANCES/AliRsnMiniAnalysisTask.h
Added new class for D0 daughter cuts (Massimo)
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnMiniAnalysisTask.h
1 #ifndef ALIRSNMINIANALYSISTASK_H
2 #define ALIRSNMINIANALYSISTASK_H
3
4 //
5 // Analysis task for 'mini' sub-package
6 // Contains all definitions needed for running an analysis:
7 // -- global event cut
8 // -- a list of track cuts (any number)
9 // -- definitions of output histograms
10 // -- values to be computed.
11 //
12
13 #include <TString.h>
14 #include <TClonesArray.h>
15
16 #include "AliAnalysisTaskSE.h"
17
18 #include "AliRsnEvent.h"
19 #include "AliRsnMiniValue.h"
20 #include "AliRsnMiniOutput.h"
21
22 class TList;
23
24 class AliTriggerAnalysis;
25 class AliRsnMiniEvent;
26 class AliRsnCutSet;
27
28 class AliRsnMiniAnalysisTask : public AliAnalysisTaskSE {
29
30 public:
31
32    AliRsnMiniAnalysisTask();
33    AliRsnMiniAnalysisTask(const char *name, Bool_t isMC = kFALSE);
34    AliRsnMiniAnalysisTask(const AliRsnMiniAnalysisTask &copy);
35    AliRsnMiniAnalysisTask &operator=(const AliRsnMiniAnalysisTask &copy);
36    virtual ~AliRsnMiniAnalysisTask();
37
38    void                UseMC(Bool_t yn = kTRUE)           {fUseMC = yn;}
39    void                UseESDTriggerMask(UInt_t trgMask)     {fTriggerMask = trgMask;}
40    void                UseCentrality(const char *type)    {fUseCentrality = kTRUE; fCentralityType = type; fCentralityType.ToUpper();}
41    void                SetUseCentralityPatch(Bool_t isAOD049) {fUseAOD049CentralityPatch = isAOD049;}
42    void                UseMultiplicity(const char *type)  {fUseCentrality = kFALSE; fCentralityType = type; fCentralityType.ToUpper();}
43    void                UseContinuousMix()                 {fContinuousMix = kTRUE;}
44    void                UseBinnedMix()                     {fContinuousMix = kFALSE;}
45    void                SetNMix(Int_t nmix)                {fNMix = nmix;}
46    void                SetMaxDiffMult (Double_t val)      {fMaxDiffMult  = val;}
47    void                SetMaxDiffVz   (Double_t val)      {fMaxDiffVz    = val;}
48    void                SetMaxDiffAngle(Double_t val)      {fMaxDiffAngle = val;}
49    void                SetEventCuts(AliRsnCutSet *cuts)   {fEventCuts    = cuts;}
50    void                SetMixPrintRefresh(Int_t n)        {fMixPrintRefresh = n;}
51    Int_t               AddTrackCuts(AliRsnCutSet *cuts);
52    TClonesArray       *Outputs()                          {return &fHistograms;}
53    TClonesArray       *Values()                           {return &fValues;}
54    void                SetEventQAHist(TString type,TH2F *histo);
55    void                UseBigOutput(Bool_t b=kTRUE) { fBigOutput = b; }
56
57    virtual void        UserCreateOutputObjects();
58    virtual void        UserExec(Option_t *);
59    virtual void        Terminate(Option_t *);
60    virtual void        FinishTaskOutput();
61
62    Int_t               ValueID(AliRsnMiniValue::EType type, Bool_t useMC = kFALSE);
63    Int_t               CreateValue(AliRsnMiniValue::EType type, Bool_t useMC = kFALSE);
64    AliRsnMiniOutput   *CreateOutput(const char *name, AliRsnMiniOutput::EOutputType type, AliRsnMiniOutput::EComputation src);
65    AliRsnMiniOutput   *CreateOutput(const char *name, const char *outType, const char *compType);
66
67 private:
68
69    Char_t   CheckCurrentEvent();
70    void     FillMiniEvent(Char_t evType);
71    Double_t ComputeAngle();
72    Double_t ComputeCentrality(Bool_t isESD);
73    Double_t ComputeMultiplicity(Bool_t isESD,TString type);
74    Double_t ApplyCentralityPatchAOD049();
75    void     FillTrueMotherESD(AliRsnMiniEvent *event);
76    void     FillTrueMotherAOD(AliRsnMiniEvent *event);
77    void     StoreTrueMother(AliRsnMiniPair *pair, AliRsnMiniEvent *event);
78    Bool_t   EventsMatch(AliRsnMiniEvent *event1, AliRsnMiniEvent *event2);
79
80    Bool_t               fUseMC;           //  use or not MC info
81    Int_t                fEvNum;           //! absolute event counter
82    UInt_t               fTriggerMask;   //trigger mask
83    Bool_t               fUseCentrality;   //  if true, use centrality for event, otherwise use multiplicity
84    TString              fCentralityType;  //  definition used to choose what centrality or multiplicity to use
85    Bool_t               fUseAOD049CentralityPatch; //flag to enable AOD049 centrality patch
86
87    Bool_t               fContinuousMix;   //  mixing --> technique chosen (continuous or binned)
88    Int_t                fNMix;            //  mixing --> required number of mixes
89    Double_t             fMaxDiffMult;     //  mixing --> max difference in multiplicity
90    Double_t             fMaxDiffVz;       //  mixing --> max difference in Vz of prim vert
91    Double_t             fMaxDiffAngle;    //  mixing --> max difference in reaction plane angle
92
93    TList               *fOutput;          //  output list
94    TClonesArray         fHistograms;      //  list of histogram definitions
95    TClonesArray         fValues;          //  list of values to be computed
96    TH1F                *fHEventStat;      //  histogram of event statistics
97    TH1F                *fHAEventsVsMulti; //  histogram of event statistics
98    TH2F                *fHAEventVz;       //  histogram of vertex-z vs. multiplicity/centrality
99    TH2F                *fHAEventMultiCent;//  histogram of multiplicity vs. centrality
100    TH2F                *fHAEventPlane;    //  histogram of event plane vs. multiplicity/centrality
101
102    AliRsnCutSet        *fEventCuts;       //  cuts on events
103    TObjArray            fTrackCuts;       //  list of single track cuts
104    AliRsnEvent          fRsnEvent;        //! interface object to the event
105    TTree               *fEvBuffer;        //! mini-event buffer
106    AliTriggerAnalysis  *fTriggerAna;      //! trigger analysis
107    AliESDtrackCuts     *fESDtrackCuts;    //! quality cut for ESD tracks
108    AliRsnMiniEvent     *fMiniEvent;       //! mini-event cursor
109    Bool_t               fBigOutput;       // flag if open file for output list
110    Int_t                fMixPrintRefresh; // how often info in mixing part is printed
111
112    ClassDef(AliRsnMiniAnalysisTask, 6);   // AliRsnMiniAnalysisTask
113 };
114
115
116 #endif