Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / ITS / AliITSSumTP.h
CommitLineData
8f359d7b 1#ifndef ALIITSSUMTP_H
2#define ALIITSSUMTP_H
3
4///////////////////////////////////////////////////////////////////
5// //
6// Class for ITS trackpoints summary + some aux. info ) //
7// Author: Ruben Shahoian //
8// //
9///////////////////////////////////////////////////////////////////
10
11/* $Id$ */
12
13class AliTrackPointArray;
14#include <TObjArray.h>
15#include "AliESDVertex.h"
16
17class AliITSSumTP : public TObject
18{
19 public:
45f87898 20 enum {kCrvTPC,kCrvTPCErr,kCrvGlo,kCrvGloErr,kNVarPerTrack};
21 enum {kTPCInX,kTPCInY,kTPCInZ,kTPCSpare};
8f359d7b 22 //
45f87898 23 AliITSSumTP() : fTracks(0),fVertex(),fNVars(0),fCrvVars(0),fTPCVars(0) {fTracks.SetOwner(kTRUE);}
8f359d7b 24 AliITSSumTP(const AliITSSumTP& src);
25 virtual ~AliITSSumTP() {Reset();}
26 AliITSSumTP &operator=(const AliITSSumTP& src);
6fe97dd9 27 virtual void Print(Option_t* opt="") const;
8f359d7b 28 //
29 AliESDVertex& GetVertex() const {return (AliESDVertex&)fVertex;}
30 AliTrackPointArray* GetTrack(Int_t i) const {return (AliTrackPointArray*)fTracks[i];}
31 TObjArray& GetTracks() const {return (TObjArray&) fTracks;}
32 Int_t GetNTracks() const {return fNVars/kNVarPerTrack;}
33 Double_t GetCrvTPC(Int_t i) const {return fCrvVars[i*kNVarPerTrack+kCrvTPC];}
34 Double_t GetCrvTPCErr(Int_t i) const {return fCrvVars[i*kNVarPerTrack+kCrvTPCErr];}
35 Double_t GetCrvGlo(Int_t i) const {return fCrvVars[i*kNVarPerTrack+kCrvGlo];}
36 Double_t GetCrvGloErr(Int_t i) const {return fCrvVars[i*kNVarPerTrack+kCrvGloErr];}
a4b1ccc5 37 void GetTPCInnerXYZ(int i, double* xyz) const;
38 void SetTPCInnerXYZ(int i, const double* xyz);
8f359d7b 39 //
40 void Reset();
41 void BookNTracks(Int_t n);
42 void SetCrvTPC(Int_t i, Double_t v) {fCrvVars[i*kNVarPerTrack+kCrvTPC] = v;}
43 void SetCrvTPCErr(Int_t i, Double_t v) {fCrvVars[i*kNVarPerTrack+kCrvTPCErr] = v;}
44 void SetCrvGlo(Int_t i, Double_t v) {fCrvVars[i*kNVarPerTrack+kCrvGlo] = v;}
45 void SetCrvGloErr(Int_t i, Double_t v) {fCrvVars[i*kNVarPerTrack+kCrvGloErr] = v;}
46 void AddTrack(AliTrackPointArray* trc) {fTracks.AddLast((TObject*)trc);}
47 void SetVertex(const AliESDVertex* vtx) {fVertex = *vtx;}
48 //
49 protected:
50 //
51 TObjArray fTracks; // TrackPoints
52 AliESDVertex fVertex; // ESD Vertex
53 Int_t fNVars; // Ntracks*kNVarPerTrack
54 Double32_t* fCrvVars; //[fNVars];
45f87898 55 Double32_t* fTPCVars; //[fNVars];
8f359d7b 56
45f87898 57
58 ClassDef(AliITSSumTP,2)
8f359d7b 59};
60
a4b1ccc5 61
62//---------------------------------------------------------------
63inline void AliITSSumTP::GetTPCInnerXYZ(int i, double* xyz) const
64{
65 // get tpc inner coordinates
45f87898 66 if (!fTPCVars) {xyz[0]=xyz[1]=xyz[2]=0; return;} // for BWD compatibility
67 xyz[0] = fTPCVars[i*kNVarPerTrack+kTPCInX];
68 xyz[1] = fTPCVars[i*kNVarPerTrack+kTPCInY];
69 xyz[2] = fTPCVars[i*kNVarPerTrack+kTPCInZ];
a4b1ccc5 70}
71
72//---------------------------------------------------------------
73inline void AliITSSumTP::SetTPCInnerXYZ(int i, const double* xyz)
74{
75 // Set tpc inner coordinates
45f87898 76 if (!fTPCVars) return; // for BWD compatibility
77 fTPCVars[i*kNVarPerTrack+kTPCInX] = xyz[0];
78 fTPCVars[i*kNVarPerTrack+kTPCInY] = xyz[1];
79 fTPCVars[i*kNVarPerTrack+kTPCInZ] = xyz[2];
a4b1ccc5 80}
81
82
8f359d7b 83#endif
84