added a protection
[u/mrichter/AliRoot.git] / STEER / AliAODTracklets.h
CommitLineData
21b22f32 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
17class AliAODTracklets : public TNamed
18{
19 public:
20 AliAODTracklets();
21 AliAODTracklets(const char* name, const char* title);
5c1dc41f 22 AliAODTracklets(const AliAODTracklets& evt);
23 AliAODTracklets& operator=(const AliAODTracklets& evt);
21b22f32 24
25 virtual ~AliAODTracklets();
26
27 void CreateContainer(Int_t nTracks);
28 void DeleteContainer();
29
d59deed5 30 Bool_t SetTracklet(Int_t pos, Double32_t theta, Double32_t phi, Double32_t deltaPhi, Int_t label);
21b22f32 31
32 Int_t GetNumberOfTracklets() const { return fNTracks; }
d59deed5 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;
21b22f32 36 inline Int_t GetLabel(Int_t i) const;
37
38 protected:
f51b5257 39 Int_t fNTracks; // Number of tracklets
d59deed5 40 Double32_t *fTheta; //[fNTracks] array with theta values
41 Double32_t *fPhi; //[fNTracks] array with phi values
42 Double32_t *fDeltaPhi; //[fNTracks] array with delta phi values
f51b5257 43 Int_t *fLabels; //[fNTracks] array with labels of tracklets
21b22f32 44
21b22f32 45
ab0347d8 46 ClassDef(AliAODTracklets, 2);
21b22f32 47};
48
d59deed5 49Double32_t AliAODTracklets::GetTheta(Int_t i) const
21b22f32 50{
51 if (i>=0 && i<fNTracks)
52 {
53 return fTheta[i];
54 }
55 else
56 Error("GetTheta","Invalid track number %d",i); return -9999.;
57}
58
d59deed5 59Double32_t AliAODTracklets::GetPhi(Int_t i) const
21b22f32 60{
61 if (i>=0 && i<fNTracks)
62 {
63 return fPhi[i];
64 }
65 else
66 Error("GetPhi","Invalid track number %d",i); return -9999.;
67}
68
d59deed5 69Double32_t AliAODTracklets::GetDeltaPhi(Int_t i) const
21b22f32 70{
71 if (i>=0 && i<fNTracks)
72 {
73 return fDeltaPhi[i];
74 }
75 else
76 Error("GetDeltaPhi","Invalid track number %d",i); return -9999.;
77}
78
79Int_t AliAODTracklets::GetLabel(Int_t i) const
80{
81 if (i>=0 && i<fNTracks)
82 {
83 return fLabels[i];
84 }
85 else
86 Error("GetLabel","Invalid track number %d",i); return -9999;
87}
88
89#endif