]>
Commit | Line | Data |
---|---|---|
b2a297fa | 1 | #ifndef ALIDIELECTRON_H |
2 | #define ALIDIELECTRON_H | |
3 | /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | //##################################################### | |
7 | //# # | |
8 | //# Class AliDielectron # | |
9 | //# Main Class for e+e- analysis # | |
10 | //# # | |
11 | //# by WooJin J. Park, GSI / W.J.Park@gsi.de # | |
12 | //# Ionut C. Arsene, GSI / I.C.Arsene@gsi.de # | |
13 | //# Magnus Mager, CERN / Magnus.Mager@cern.ch # | |
14 | //# Jens Wiechula, Uni HD / Jens.Wiechula@cern.ch # | |
15 | //# # | |
16 | //##################################################### | |
17 | ||
18 | ||
19 | #include <TNamed.h> | |
20 | #include <TObjArray.h> | |
21 | ||
22 | #include <AliAnalysisFilter.h> | |
23 | #include <AliKFParticle.h> | |
24 | ||
25 | #include "AliDielectronHistos.h" | |
26 | #include "AliDielectronPair.h" | |
27 | ||
28 | class AliVEvent; | |
29 | class THashList; | |
30 | class AliDielectronCF; | |
31 | ||
32 | //________________________________________________________________ | |
33 | class AliDielectron : public TNamed { | |
34 | ||
35 | public: | |
36 | enum ParticleValues { kPx=0, kPy, kPz, kPt, kP, kXv, kYv, kZv, kOneOverPt, | |
37 | kPhi, kTheta, kE, kM, kEta, kY, kCharge, kNParticleValues }; | |
38 | enum PairValues { kChi2NDF=kNParticleValues, kDecayLength, kR, kOpeningAngle, kMerr, kNPairValues }; | |
39 | ||
40 | AliDielectron(); | |
41 | AliDielectron(const char* name, const char* title); | |
42 | virtual ~AliDielectron(); | |
43 | ||
44 | void Init(); | |
45 | ||
46 | void Process(AliVEvent *ev1, AliVEvent *ev2=0); | |
47 | ||
b2a297fa | 48 | const AliAnalysisFilter& GetEventFilter() const { return fEventFilter; } |
49 | const AliAnalysisFilter& GetTrackFilter() const { return fTrackFilter; } | |
50 | const AliAnalysisFilter& GetPairFilter() const { return fPairFilter; } | |
51 | ||
52 | AliAnalysisFilter& GetEventFilter() { return fEventFilter; } | |
53 | AliAnalysisFilter& GetTrackFilter() { return fTrackFilter; } | |
54 | AliAnalysisFilter& GetPairFilter() { return fPairFilter; } | |
55 | ||
56 | void SetMotherPdg( Int_t pdgMother ) { fPdgMother=pdgMother; } | |
57 | ||
58 | const TObjArray* GetTrackArray(Int_t i) const {return (i>=0&&i<4)?&fTracks[i]:0;} | |
59 | const TObjArray* GetPairArray(Int_t i) const {return (i>=0&&i<10)? | |
60 | static_cast<TObjArray*>(fPairCandidates->UncheckedAt(i)):0;} | |
61 | ||
62 | TObjArray** GetPairArraysPointer() { return &fPairCandidates; } | |
63 | ||
64 | void SetHistogramManager(AliDielectronHistos * const histos) { fHistos=histos; } | |
65 | const THashList * GetHistogramList() const { return fHistos?fHistos->GetHistogramList():0x0; } | |
66 | ||
67 | Bool_t HasCandidates() const { return GetPairArray(1)?GetPairArray(1)->GetEntriesFast()>0:0; } | |
68 | ||
69 | void SetCFManagerPair(AliDielectronCF * const cf) { fCfManagerPair=cf; } | |
70 | AliDielectronCF* GetCFManagerPair() const { return fCfManagerPair; } | |
71 | ||
72 | static const char* TrackClassName(Int_t i) { return (i>=0&&i<4)?fgkTrackClassNames[i]:""; } | |
73 | static const char* PairClassName(Int_t i) { return (i>=0&&i<10)?fgkPairClassNames[i]:""; } | |
74 | ||
75 | private: | |
76 | ||
77 | ||
78 | AliAnalysisFilter fEventFilter; // Event cuts | |
79 | AliAnalysisFilter fTrackFilter; // leg cuts | |
80 | AliAnalysisFilter fPairFilter; // pair cuts | |
81 | ||
82 | Int_t fPdgMother; // pdg code of mother tracks | |
83 | ||
84 | AliDielectronHistos *fHistos; // Histogram manager | |
85 | // Streaming and merging should be handled | |
86 | // by the analysis framework | |
87 | ||
88 | TObjArray fTracks[4]; //! Selected track candidates | |
89 | // 0: Event1, positive particles | |
90 | // 1: Event1, negative particles | |
91 | // 2: Event2, positive particles | |
92 | // 3: Event2, negative particles | |
93 | ||
94 | TObjArray *fPairCandidates; //! Pair candidate arrays | |
95 | //TODO: better way to store it? TClonesArray? | |
96 | ||
97 | AliDielectronCF *fCfManagerPair;//Correction Framework Manager for the Pair | |
98 | ||
99 | void FillTrackArrays(AliVEvent * const ev, Int_t eventNr=0); | |
100 | void FillPairArrays(Int_t arr1, Int_t arr2); | |
101 | ||
102 | Int_t GetPairIndex(Int_t arr1, Int_t arr2) const {return arr1>=arr2?arr1*(arr1+1)/2+arr2:arr2*(arr2+1)/2+arr1;} | |
103 | ||
104 | void InitPairCandidateArrays(); | |
105 | void ClearArrays(); | |
106 | ||
107 | TObjArray* PairArray(Int_t i); | |
108 | ||
109 | static const char* fgkTrackClassNames[4]; //Names for track arrays | |
110 | static const char* fgkPairClassNames[10]; //Names for pair arrays | |
111 | ||
112 | void ProcessMC(); | |
113 | ||
a655b716 | 114 | void FillHistograms(const AliVEvent *ev); |
115 | ||
b2a297fa | 116 | AliDielectron(const AliDielectron &c); |
117 | AliDielectron &operator=(const AliDielectron &c); | |
118 | ||
119 | ClassDef(AliDielectron,1); | |
120 | }; | |
121 | ||
122 | inline void AliDielectron::InitPairCandidateArrays() | |
123 | { | |
124 | // | |
125 | // initialise all pair candidate arrays | |
126 | // | |
127 | fPairCandidates->SetOwner(); | |
128 | for (Int_t i=0;i<10;++i){ | |
129 | TObjArray *arr=new TObjArray; | |
130 | fPairCandidates->AddAt(arr,i); | |
131 | arr->SetOwner(); | |
132 | } | |
133 | } | |
134 | ||
135 | inline TObjArray* AliDielectron::PairArray(Int_t i) | |
136 | { | |
137 | // | |
138 | // for internal use only: unchecked return of track array for fast access | |
139 | // | |
140 | return static_cast<TObjArray*>(fPairCandidates->UncheckedAt(i)); | |
141 | } | |
142 | ||
143 | inline void AliDielectron::ClearArrays() | |
144 | { | |
145 | // | |
146 | // Reset the Arrays | |
147 | // | |
148 | for (Int_t i=0;i<4;++i){ | |
149 | fTracks[i].Clear(); | |
150 | } | |
151 | for (Int_t i=0;i<10;++i){ | |
152 | PairArray(i)->Delete(); | |
153 | } | |
154 | } | |
155 | ||
156 | #endif |