--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+// AOD class to store tracklets
+// Author: Jan Fiete Grosse-Oetringhaus, CERN
+// Class created from AliMultiplicity
+//-------------------------------------------------------------------------
+
+#include "AliAODTracklets.h"
+
+ClassImp(AliAODTracklets)
+
+AliAODTracklets::AliAODTracklets() : TNamed(), fNTracks(0), fTheta(0), fPhi(0), fDeltaPhi(0), fLabels(0)
+{
+ // default constructor
+}
+
+AliAODTracklets::AliAODTracklets(const char* name, const char* title) : TNamed(name, title), fNTracks(0), fTheta(0), fPhi(0), fDeltaPhi(0), fLabels(0)
+{
+ // TNamed constructor
+}
+
+void AliAODTracklets::CreateContainer(Int_t nTracks)
+{
+ // function that creates container to store tracklets
+
+ DeleteContainer();
+
+ fNTracks = nTracks;
+
+ if (fNTracks <= 0)
+ return;
+
+ fTheta = new Float_t[fNTracks];
+ fPhi = new Float_t[fNTracks];
+ fDeltaPhi = new Float_t[fNTracks];
+ fLabels = new Int_t[fNTracks];
+}
+
+AliAODTracklets::~AliAODTracklets()
+{
+ // destructor
+
+ DeleteContainer();
+}
+
+void AliAODTracklets::DeleteContainer()
+{
+ // deletes allocated memory
+
+ if (fTheta)
+ {
+ delete[] fTheta;
+ fTheta = 0;
+ }
+
+ if (fPhi)
+ {
+ delete[] fPhi;
+ fPhi = 0;
+ }
+
+ if (fDeltaPhi)
+ {
+ delete[] fDeltaPhi;
+ fDeltaPhi = 0;
+ }
+
+ if (fLabels)
+ {
+ delete[] fLabels;
+ fLabels = 0;
+ }
+
+ fNTracks = 0;
+}
+
+Bool_t AliAODTracklets::SetTracklet(Int_t pos, Float_t theta, Float_t phi, Float_t deltaPhi, Int_t label)
+{
+ // Sets a tracklet at the given position
+
+ if (pos < 0 || pos >= fNTracks)
+ return kFALSE;
+
+ fTheta[pos] = theta;
+ fPhi[pos] = phi;
+ fDeltaPhi[pos] = deltaPhi;
+ fLabels[pos] = label;
+
+ return kTRUE;
+}
--- /dev/null
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+// AOD class to store tracklets
+// Author: Jan Fiete Grosse-Oetringhaus, CERN
+// Class created from AliMultiplicity
+//-------------------------------------------------------------------------
+
+#ifndef ALIAODTRACKLETS_H
+#define ALIAODTRACKLETS_H
+
+#include <TNamed.h>
+
+class AliAODTracklets : public TNamed
+{
+ public:
+ AliAODTracklets();
+ AliAODTracklets(const char* name, const char* title);
+
+ virtual ~AliAODTracklets();
+
+ void CreateContainer(Int_t nTracks);
+ void DeleteContainer();
+
+ Bool_t SetTracklet(Int_t pos, Float_t theta, Float_t phi, Float_t deltaPhi, Int_t label);
+
+ Int_t GetNumberOfTracklets() const { return fNTracks; }
+ inline Float_t GetTheta(Int_t i) const;
+ inline Float_t GetPhi(Int_t i) const;
+ inline Float_t GetDeltaPhi(Int_t i) const;
+ inline Int_t GetLabel(Int_t i) const;
+
+ protected:
+ Int_t fNTracks; // Number of tracklets
+ Float_t *fTheta; //[fNTracks] array with theta values
+ Float_t *fPhi; //[fNTracks] array with phi values
+ Float_t *fDeltaPhi; //[fNTracks] array with delta phi values
+ Int_t *fLabels; //[fNTracks] array with labels of tracklets
+
+ private:
+ AliAODTracklets(const AliAODTracklets& evt);
+ AliAODTracklets& operator=(const AliAODTracklets& evt);
+
+ ClassDef(AliAODTracklets, 1);
+};
+
+Float_t AliAODTracklets::GetTheta(Int_t i) const
+{
+ if (i>=0 && i<fNTracks)
+ {
+ return fTheta[i];
+ }
+ else
+ Error("GetTheta","Invalid track number %d",i); return -9999.;
+}
+
+Float_t AliAODTracklets::GetPhi(Int_t i) const
+{
+ if (i>=0 && i<fNTracks)
+ {
+ return fPhi[i];
+ }
+ else
+ Error("GetPhi","Invalid track number %d",i); return -9999.;
+}
+
+Float_t AliAODTracklets::GetDeltaPhi(Int_t i) const
+{
+ if (i>=0 && i<fNTracks)
+ {
+ return fDeltaPhi[i];
+ }
+ else
+ Error("GetDeltaPhi","Invalid track number %d",i); return -9999.;
+}
+
+Int_t AliAODTracklets::GetLabel(Int_t i) const
+{
+ if (i>=0 && i<fNTracks)
+ {
+ return fLabels[i];
+ }
+ else
+ Error("GetLabel","Invalid track number %d",i); return -9999;
+}
+
+#endif