update for the NUA
[u/mrichter/AliRoot.git] / ITS / AliITSSumTP.cxx
CommitLineData
8f359d7b 1#include "AliITSSumTP.h"
2#include "AliTrackPointArray.h"
3
4///////////////////////////////////////////////////////////////////
5// //
6// Class for ITS trackpoints summary + some aux. info ) //
7// Author: Ruben Shahoian //
8// //
9///////////////////////////////////////////////////////////////////
10
11/* $Id$ */
12
13ClassImp(AliITSSumTP)
14
15//__________________________________________
16AliITSSumTP::AliITSSumTP(const AliITSSumTP& src) :
45f87898 17TObject(src), fTracks(src.fTracks.GetEntriesFast()), fVertex(src.GetVertex()),
18 fNVars(src.fNVars), fCrvVars(0),fTPCVars(0)
8f359d7b 19{
20 // copy c-tor
21 fCrvVars = new Double32_t[fNVars];
80745d17 22 fTPCVars = new Double32_t[fNVars];
8f359d7b 23 TObjArray& arrSrc = src.GetTracks();
45f87898 24 for (int i=fNVars;i--;) {
25 fCrvVars[i] = src.fCrvVars[i];
26 fTPCVars[i] = src.fTPCVars[i];
27 }
8f359d7b 28 for (int i=arrSrc.GetEntriesFast();i--;) fTracks.AddAtAndExpand(arrSrc.UncheckedAt(i),i);
29}
30
31//__________________________________________
32AliITSSumTP& AliITSSumTP::operator=(const AliITSSumTP& src)
33{
34 // assignment op-r
35 if (this == &src) return *this;
36 Reset();
37 TObject::operator=(src);
38 fVertex = src.GetVertex();
39 fNVars = src.fNVars;
40 fCrvVars = new Double32_t[fNVars];
80745d17 41 fTPCVars = new Double32_t[fNVars];
8f359d7b 42 TObjArray& arrSrc = src.GetTracks();
45f87898 43 for (int i=fNVars;i--;) {
44 fCrvVars[i] = src.fCrvVars[i];
45 fTPCVars[i] = src.fTPCVars[i];
46 }
8f359d7b 47 for (int i=arrSrc.GetEntriesFast();i--;) fTracks.AddAtAndExpand(arrSrc.UncheckedAt(i),i);
48 return *this;
49}
50
51//__________________________________________
52void AliITSSumTP::BookNTracks(Int_t n)
53{
54 // book space for tracks info
6fe97dd9 55 delete[] fCrvVars; fCrvVars = 0;
8f359d7b 56 fNVars = n*kNVarPerTrack;
6fe97dd9 57 if (fNVars>0) {
58 fCrvVars = new Double32_t[fNVars];
45f87898 59 fTPCVars = new Double32_t[fNVars];
60 for (int i=fNVars;i--;) fCrvVars[i]=fTPCVars[i] = 0;
6fe97dd9 61 }
8f359d7b 62}
63
64//__________________________________________
65void AliITSSumTP::Reset()
66{
67 // reset object
68 fTracks.Delete();
69 delete[] fCrvVars;
45f87898 70 delete[] fTPCVars;
71 fCrvVars = fTPCVars = 0;
8f359d7b 72 fNVars = 0;
73 SetUniqueID(0);
74}
6fe97dd9 75
76//__________________________________________
77void AliITSSumTP::Print(Option_t *) const
78{
79 // reset object
80 printf("Vertex: "); fVertex.Print();
81 int ntr = GetNTracks();
82 printf("Number of tracks: %d\n",ntr);
45f87898 83 double xyz[3]={0,0,0};
6fe97dd9 84 for (int itr=0;itr<ntr;itr++) {
85 AliTrackPointArray* tr = GetTrack(itr);
45f87898 86 GetTPCInnerXYZ(itr,xyz);
87 printf("#%2d : %d hits CrvGlo: %+.2e/%+.2e CrvTPC: %+.2e/%+.2e TPC_XYZ: %+8.3f %+8.3f %+9.3f\n",itr,tr->GetNPoints(),
88 GetCrvGlo(itr),GetCrvGloErr(itr), GetCrvTPC(itr),GetCrvTPCErr(itr),
89 xyz[0],xyz[1],xyz[2]);
6fe97dd9 90 }
91 //
92}
93