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 *
8 /// @file AliDxHFECorrelation.h
9 /// @author Sedat Altinpinar, Hege Erdal, Matthias Richter
11 /// @brief Worker class for D0-HF electron correlation
14 #ifndef ALIDXHFECORRELATION_H
15 #define ALIDXHFECORRELATION_H
23 class AliHFCorrelator;
27 class AliAnalysisCuts;
29 class AliDxHFECorrelation : public TNamed {
31 /// default constructor
32 AliDxHFECorrelation(const char* name=NULL);
34 virtual ~AliDxHFECorrelation();
36 // event control histogram
38 kEventsAll = 0, // all events
39 kEventsSel, // selected events
40 kEventsD0 , // events with D0s
41 kEventsD0e, // events with correlated D0s
46 int Init(const char* arguments="");
48 // parse argument string
49 int ParseArguments(const char* arguments);
51 /// fill histograms from particles
52 int Fill(const TObjArray* candidatesD0, const TObjArray* candidatesElectron, const AliVEvent* pEvent);
54 /// histogram event properties
55 virtual int HistogramEventProperties(int bin);
56 virtual THnSparse* DefineTHnSparse();
57 virtual int FillParticleProperties(AliVParticle* tr, AliVParticle* as, Double_t* data, int dimension) const;
59 /// create control THnSparse
60 THnSparse* CreateControlTHnSparse(const char* name,
65 const char** binLabels) const;
67 /// overloaded from TObject: cleanup
68 virtual void Clear(Option_t * option ="");
69 /// overloaded from TObject: print info
70 virtual void Print(Option_t *option="") const;
71 /// overloaded from TObject: draw histograms
72 virtual void Draw(Option_t *option="");
73 /// overloaded from TObject: find object by name
74 virtual TObject* FindObject(const char *name) const;
75 /// overloaded from TObject: find object by pointer
76 virtual TObject* FindObject(const TObject *obj) const;
77 /// overloaded from TObject: save to file
78 virtual void SaveAs(const char *filename="",Option_t *option="") const; // *MENU*
80 virtual void SetCuts(AliAnalysisCuts* cuts) {fCuts=cuts;}
81 virtual void SetUseMC(Bool_t useMC){fUseMC=useMC;}
82 //void SetUseEventMixing(Bool_t useMixing) {fUseEventMixing=useMixing;}
83 //void SetSystem(Bool_t system){fSystem=system;}
84 //void SetPhiRange(Double_t min, Double_t max){fMinPhi=min; fMaxPhi=max;}
85 // TODO: SetEventType only needed for MC. How to avoid this?
86 virtual void SetEventType(int type){fEventType=type;}
88 Bool_t GetUseMC() const {return fUseMC;}
89 const TList* GetControlObjects() const {return fControlObjects;}
90 Double_t GetMinPhi() const {return fMinPhi;}
91 Double_t GetMaxPhi() const {return fMaxPhi;}
92 Double_t GetDeltaPhi() const {return fDeltaPhi;}
93 Double_t GetDeltaEta() const {return fDeltaEta;}
94 inline int GetDimTHnSparse() const {return fDimThn;}
96 void EventMixingChecks(const AliVEvent* pEvent);
98 AliDxHFECorrelation& operator+=(const AliDxHFECorrelation& other);
100 // Probably not needed anymore, since code was changed to THnSparse
101 // but keep here in case we need it later
106 khElectronpT, // TH1F
107 khElectronPhi, // TH1F
108 khElectronEta, // TH1F
113 /// add control object to list, the base class becomes owner of the object
114 int AddControlObject(TObject* pObj);
116 /// set the dimension of THn and allocate filling array
117 void InitTHnSparseArray(int dimension) {
119 if (fCorrArray) delete[] fCorrArray; fCorrArray=NULL;
120 if (dimension>0) fCorrArray=new Double_t[dimension];
123 inline Double_t* ParticleProperties() const {return fCorrArray;}
127 AliDxHFECorrelation(const AliDxHFECorrelation& other);
128 /// assignment operator
129 AliDxHFECorrelation& operator=(const AliDxHFECorrelation& other);
131 // 2012-09-18: when running on Grid the histograms were empty. We encountered
132 // messages "cannot create object of class TH1" when writing the analysis manager
133 // to file for Grid analysis.
134 // This class had a TH1 member marked to be saved, the object though was part of
135 // a list, also a member of the class. Root has a problem with the schema info
137 // Solved by marking fhEventControlCorr as transient, the cause, though, is not
140 TObjArray* fHistograms; // the histograms - for the moment not in use.
141 TList* fControlObjects; // list of control objects
142 THnSparse* fCorrProperties; // the Correlation properties of selected particles
143 TH1* fhEventControlCorr; //! event control histogram (saved via control object list)
144 AliAnalysisCuts *fCuts; //! Cuts
145 Bool_t fUseMC; // use MC info
146 AliHFCorrelator *fCorrelator; //! object for correlations
147 Bool_t fUseEventMixing; // Run Event Mixing analysis
148 Short_t fSystem; // Which system pp/PbPb
149 Double_t fMinPhi; // Holds min phi
150 Double_t fMaxPhi; // Holds maxa phi
151 Double_t fDeltaPhi; // Delta Phi
152 Double_t fDeltaEta; // Delta Eta
153 int fDimThn; // Holds dim of THnSparse
154 Double_t* fCorrArray; //! filling array for THnSparse
155 Int_t fEventType; // Event type. Only needed for MC (fix)
158 static const char* fgkEventControlBinNames[];
160 ClassDef(AliDxHFECorrelation, 4)