]>
Commit | Line | Data |
---|---|---|
1 | /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * | |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
4 | /* $Id$ */ | |
5 | ||
6 | //------------------------------------------------------------------------- | |
7 | // AOD class to store tracklets | |
8 | // Author: Jan Fiete Grosse-Oetringhaus, CERN | |
9 | // Class created from AliMultiplicity | |
10 | //------------------------------------------------------------------------- | |
11 | ||
12 | #ifndef ALIAODTRACKLETS_H | |
13 | #define ALIAODTRACKLETS_H | |
14 | ||
15 | #include <TNamed.h> | |
16 | ||
17 | class AliAODTracklets : public TNamed | |
18 | { | |
19 | public: | |
20 | AliAODTracklets(); | |
21 | AliAODTracklets(const char* name, const char* title); | |
22 | AliAODTracklets(const AliAODTracklets& evt); | |
23 | AliAODTracklets& operator=(const AliAODTracklets& evt); | |
24 | ||
25 | virtual ~AliAODTracklets(); | |
26 | ||
27 | void CreateContainer(Int_t nTracks); | |
28 | void DeleteContainer(); | |
29 | ||
30 | Bool_t SetTracklet(Int_t pos, Double32_t theta, Double32_t phi, Double32_t deltaPhi, Int_t labelL1, Int_t labelL2); | |
31 | ||
32 | Int_t GetNumberOfTracklets() const { return fNTracks; } | |
33 | inline Double32_t GetTheta(Int_t i) const; | |
34 | inline Double32_t GetPhi(Int_t i) const; | |
35 | inline Double32_t GetDeltaPhi(Int_t i) const; | |
36 | inline Int_t GetLabel(Int_t i, Int_t layer) const; | |
37 | inline void SetLabel(Int_t i, Int_t layer,Int_t label); | |
38 | ||
39 | protected: | |
40 | Int_t fNTracks; // Number of tracklets | |
41 | Double32_t *fTheta; //[fNTracks] array with theta values | |
42 | Double32_t *fPhi; //[fNTracks] array with phi values | |
43 | Double32_t *fDeltaPhi; //[fNTracks] array with delta phi values | |
44 | Int_t *fLabels; //[fNTracks] array with labels of cluster in L1 used for the tracklet | |
45 | Int_t *fLabelsL2; //[fNTracks] array with labels of cluster in L2 used for the tracklet | |
46 | ||
47 | ||
48 | ClassDef(AliAODTracklets, 3); | |
49 | }; | |
50 | ||
51 | Double32_t AliAODTracklets::GetTheta(Int_t i) const | |
52 | { | |
53 | if (i>=0 && i<fNTracks) | |
54 | { | |
55 | return fTheta[i]; | |
56 | } | |
57 | else | |
58 | Error("GetTheta","Invalid track number %d",i); return -9999.; | |
59 | } | |
60 | ||
61 | Double32_t AliAODTracklets::GetPhi(Int_t i) const | |
62 | { | |
63 | if (i>=0 && i<fNTracks) | |
64 | { | |
65 | return fPhi[i]; | |
66 | } | |
67 | else | |
68 | Error("GetPhi","Invalid track number %d",i); return -9999.; | |
69 | } | |
70 | ||
71 | Double32_t AliAODTracklets::GetDeltaPhi(Int_t i) const | |
72 | { | |
73 | if (i>=0 && i<fNTracks) | |
74 | { | |
75 | return fDeltaPhi[i]; | |
76 | } | |
77 | else | |
78 | Error("GetDeltaPhi","Invalid track number %d",i); return -9999.; | |
79 | } | |
80 | ||
81 | Int_t AliAODTracklets::GetLabel(Int_t i, Int_t layer) const | |
82 | { | |
83 | if (i>=0 && i<fNTracks) | |
84 | { | |
85 | return (layer == 0) ? fLabels[i] : fLabelsL2[i]; | |
86 | } | |
87 | else | |
88 | Error("GetLabel","Invalid track number %d",i); return -9999; | |
89 | } | |
90 | ||
91 | ||
92 | void AliAODTracklets::SetLabel(Int_t i, Int_t layer,Int_t label) | |
93 | { | |
94 | if (i>=0 && i<fNTracks) | |
95 | { | |
96 | if(layer == 0) fLabels[i] = label; | |
97 | else fLabelsL2[i] = label; | |
98 | } | |
99 | } | |
100 | ||
101 | ||
102 | #endif |