fix compilation
[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];
22 TObjArray& arrSrc = src.GetTracks();
45f87898 23 for (int i=fNVars;i--;) {
24 fCrvVars[i] = src.fCrvVars[i];
25 fTPCVars[i] = src.fTPCVars[i];
26 }
8f359d7b 27 for (int i=arrSrc.GetEntriesFast();i--;) fTracks.AddAtAndExpand(arrSrc.UncheckedAt(i),i);
28}
29
30//__________________________________________
31AliITSSumTP& AliITSSumTP::operator=(const AliITSSumTP& src)
32{
33 // assignment op-r
34 if (this == &src) return *this;
35 Reset();
36 TObject::operator=(src);
37 fVertex = src.GetVertex();
38 fNVars = src.fNVars;
39 fCrvVars = new Double32_t[fNVars];
40 TObjArray& arrSrc = src.GetTracks();
45f87898 41 for (int i=fNVars;i--;) {
42 fCrvVars[i] = src.fCrvVars[i];
43 fTPCVars[i] = src.fTPCVars[i];
44 }
8f359d7b 45 for (int i=arrSrc.GetEntriesFast();i--;) fTracks.AddAtAndExpand(arrSrc.UncheckedAt(i),i);
46 return *this;
47}
48
49//__________________________________________
50void AliITSSumTP::BookNTracks(Int_t n)
51{
52 // book space for tracks info
6fe97dd9 53 delete[] fCrvVars; fCrvVars = 0;
8f359d7b 54 fNVars = n*kNVarPerTrack;
6fe97dd9 55 if (fNVars>0) {
56 fCrvVars = new Double32_t[fNVars];
45f87898 57 fTPCVars = new Double32_t[fNVars];
58 for (int i=fNVars;i--;) fCrvVars[i]=fTPCVars[i] = 0;
6fe97dd9 59 }
8f359d7b 60}
61
62//__________________________________________
63void AliITSSumTP::Reset()
64{
65 // reset object
66 fTracks.Delete();
67 delete[] fCrvVars;
45f87898 68 delete[] fTPCVars;
69 fCrvVars = fTPCVars = 0;
8f359d7b 70 fNVars = 0;
71 SetUniqueID(0);
72}
6fe97dd9 73
74//__________________________________________
75void AliITSSumTP::Print(Option_t *) const
76{
77 // reset object
78 printf("Vertex: "); fVertex.Print();
79 int ntr = GetNTracks();
80 printf("Number of tracks: %d\n",ntr);
45f87898 81 double xyz[3]={0,0,0};
6fe97dd9 82 for (int itr=0;itr<ntr;itr++) {
83 AliTrackPointArray* tr = GetTrack(itr);
45f87898 84 GetTPCInnerXYZ(itr,xyz);
85 printf("#%2d : %d hits CrvGlo: %+.2e/%+.2e CrvTPC: %+.2e/%+.2e TPC_XYZ: %+8.3f %+8.3f %+9.3f\n",itr,tr->GetNPoints(),
86 GetCrvGlo(itr),GetCrvGloErr(itr), GetCrvTPC(itr),GetCrvTPCErr(itr),
87 xyz[0],xyz[1],xyz[2]);
6fe97dd9 88 }
89 //
90}
91