]>
Commit | Line | Data |
---|---|---|
72c0a987 | 1 | //-*- Mode: C++ -*- |
2 | // $Id$ | |
3 | ||
4 | //* This file is property of and copyright by the ALICE Project * | |
5 | //* ALICE Experiment at CERN, All rights reserved. * | |
6 | //* See cxx source for full Copyright notice * | |
7 | ||
8 | /// @file AliDxHFECorrelation.h | |
9 | /// @author Sedat Altinpinar, Hege Erdal, Matthias Richter | |
10 | /// @date 2012-04-25 | |
11 | /// @brief Worker class for D0-HF electron correlation | |
12 | /// | |
13 | ||
14 | #ifndef ALIDXHFECORRELATION_H | |
15 | #define ALIDXHFECORRELATION_H | |
16 | ||
17 | #include "TNamed.h" | |
18 | ||
9535cec9 | 19 | class TH1; |
20 | class THnSparse; | |
21 | class TObject; | |
22 | class TList; | |
dfe96b90 | 23 | class AliHFCorrelator; |
24 | class AliVParticle; | |
25 | class TObjArray; | |
26 | class AliVEvent; | |
27 | class AliAnalysisCuts; | |
72c0a987 | 28 | |
29 | class AliDxHFECorrelation : public TNamed { | |
30 | public: | |
31 | /// default constructor | |
32 | AliDxHFECorrelation(const char* name=NULL); | |
33 | /// destructor | |
34 | virtual ~AliDxHFECorrelation(); | |
35 | ||
9535cec9 | 36 | // event control histogram |
37 | enum { | |
38 | kEventsAll = 0, // all events | |
39 | kEventsSel, // selected events | |
2229ac91 | 40 | kEventsTriggered, // events with D0s |
41 | kEventsCorrelated, // events with correlated D0s | |
9535cec9 | 42 | kNEventControlLabels |
43 | }; | |
44 | ||
2229ac91 | 45 | // Enums for setting trigger particle type |
46 | enum { | |
47 | kD=0, | |
48 | kElectron=1 | |
49 | } ; | |
50 | ||
72c0a987 | 51 | // init |
dfe96b90 | 52 | int Init(const char* arguments=""); |
53 | ||
54 | // parse argument string | |
55 | int ParseArguments(const char* arguments); | |
72c0a987 | 56 | |
57 | /// fill histograms from particles | |
dfe96b90 | 58 | int Fill(const TObjArray* candidatesD0, const TObjArray* candidatesElectron, const AliVEvent* pEvent); |
72c0a987 | 59 | |
9535cec9 | 60 | /// histogram event properties |
61 | virtual int HistogramEventProperties(int bin); | |
dfe96b90 | 62 | virtual THnSparse* DefineTHnSparse(); |
63 | virtual int FillParticleProperties(AliVParticle* tr, AliVParticle* as, Double_t* data, int dimension) const; | |
64 | ||
65 | /// create control THnSparse | |
66 | THnSparse* CreateControlTHnSparse(const char* name, | |
67 | int thnSize, | |
68 | int* thnBins, | |
69 | double* thnMin, | |
70 | double* thnMax, | |
71 | const char** binLabels) const; | |
9535cec9 | 72 | |
72c0a987 | 73 | /// overloaded from TObject: cleanup |
74 | virtual void Clear(Option_t * option =""); | |
75 | /// overloaded from TObject: print info | |
76 | virtual void Print(Option_t *option="") const; | |
77 | /// overloaded from TObject: draw histograms | |
78 | virtual void Draw(Option_t *option=""); | |
79 | /// overloaded from TObject: find object by name | |
80 | virtual TObject* FindObject(const char *name) const; | |
81 | /// overloaded from TObject: find object by pointer | |
82 | virtual TObject* FindObject(const TObject *obj) const; | |
83 | /// overloaded from TObject: save to file | |
84 | virtual void SaveAs(const char *filename="",Option_t *option="") const; // *MENU* | |
85 | ||
dfe96b90 | 86 | virtual void SetCuts(AliAnalysisCuts* cuts) {fCuts=cuts;} |
9535cec9 | 87 | virtual void SetUseMC(Bool_t useMC){fUseMC=useMC;} |
dfe96b90 | 88 | //void SetUseEventMixing(Bool_t useMixing) {fUseEventMixing=useMixing;} |
89 | //void SetSystem(Bool_t system){fSystem=system;} | |
90 | //void SetPhiRange(Double_t min, Double_t max){fMinPhi=min; fMaxPhi=max;} | |
91 | // TODO: SetEventType only needed for MC. How to avoid this? | |
92 | virtual void SetEventType(int type){fEventType=type;} | |
9535cec9 | 93 | |
94 | Bool_t GetUseMC() const {return fUseMC;} | |
95 | const TList* GetControlObjects() const {return fControlObjects;} | |
dfe96b90 | 96 | Double_t GetMinPhi() const {return fMinPhi;} |
97 | Double_t GetMaxPhi() const {return fMaxPhi;} | |
98 | Double_t GetDeltaPhi() const {return fDeltaPhi;} | |
99 | Double_t GetDeltaEta() const {return fDeltaEta;} | |
100 | inline int GetDimTHnSparse() const {return fDimThn;} | |
2229ac91 | 101 | Int_t GetTriggerParticleType() const {return fTriggerParticleType;} |
9535cec9 | 102 | |
dfe96b90 | 103 | void EventMixingChecks(const AliVEvent* pEvent); |
9535cec9 | 104 | |
72c0a987 | 105 | AliDxHFECorrelation& operator+=(const AliDxHFECorrelation& other); |
106 | ||
9535cec9 | 107 | // Probably not needed anymore, since code was changed to THnSparse |
108 | // but keep here in case we need it later | |
72c0a987 | 109 | enum { |
110 | khD0pT, // TH1F | |
111 | khD0Phi, // TH1F | |
112 | khD0Eta, // TH1F | |
113 | khElectronpT, // TH1F | |
114 | khElectronPhi, // TH1F | |
115 | khElectronEta, // TH1F | |
72c0a987 | 116 | kNofHistograms |
117 | }; | |
118 | ||
119 | protected: | |
9535cec9 | 120 | /// add control object to list, the base class becomes owner of the object |
121 | int AddControlObject(TObject* pObj); | |
122 | ||
dfe96b90 | 123 | /// set the dimension of THn and allocate filling array |
124 | void InitTHnSparseArray(int dimension) { | |
125 | fDimThn=dimension; | |
126 | if (fCorrArray) delete[] fCorrArray; fCorrArray=NULL; | |
127 | if (dimension>0) fCorrArray=new Double_t[dimension]; | |
128 | } | |
129 | ||
130 | inline Double_t* ParticleProperties() const {return fCorrArray;} | |
131 | ||
72c0a987 | 132 | private: |
133 | /// copy constructor | |
134 | AliDxHFECorrelation(const AliDxHFECorrelation& other); | |
135 | /// assignment operator | |
136 | AliDxHFECorrelation& operator=(const AliDxHFECorrelation& other); | |
137 | ||
e2a398f5 | 138 | // 2012-09-18: when running on Grid the histograms were empty. We encountered |
139 | // messages "cannot create object of class TH1" when writing the analysis manager | |
140 | // to file for Grid analysis. | |
141 | // This class had a TH1 member marked to be saved, the object though was part of | |
142 | // a list, also a member of the class. Root has a problem with the schema info | |
143 | // in that case. | |
144 | // Solved by marking fhEventControlCorr as transient, the cause, though, is not | |
145 | // understood | |
146 | ||
dfe96b90 | 147 | TObjArray* fHistograms; // the histograms - for the moment not in use. |
148 | TList* fControlObjects; // list of control objects | |
149 | THnSparse* fCorrProperties; // the Correlation properties of selected particles | |
150 | TH1* fhEventControlCorr; //! event control histogram (saved via control object list) | |
151 | AliAnalysisCuts *fCuts; //! Cuts | |
152 | Bool_t fUseMC; // use MC info | |
153 | AliHFCorrelator *fCorrelator; //! object for correlations | |
154 | Bool_t fUseEventMixing; // Run Event Mixing analysis | |
155 | Short_t fSystem; // Which system pp/PbPb | |
156 | Double_t fMinPhi; // Holds min phi | |
157 | Double_t fMaxPhi; // Holds maxa phi | |
158 | Double_t fDeltaPhi; // Delta Phi | |
159 | Double_t fDeltaEta; // Delta Eta | |
160 | int fDimThn; // Holds dim of THnSparse | |
161 | Double_t* fCorrArray; //! filling array for THnSparse | |
162 | Int_t fEventType; // Event type. Only needed for MC (fix) | |
2229ac91 | 163 | Int_t fTriggerParticleType; // Which particle to trigger on |
9535cec9 | 164 | |
165 | static const char* fgkEventControlBinNames[]; | |
72c0a987 | 166 | |
2229ac91 | 167 | ClassDef(AliDxHFECorrelation, 5) |
72c0a987 | 168 | }; |
169 | #endif |