update for the NUA
[u/mrichter/AliRoot.git] / ITS / AliITSSumTP.cxx
... / ...
CommitLineData
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) :
17TObject(src), fTracks(src.fTracks.GetEntriesFast()), fVertex(src.GetVertex()),
18 fNVars(src.fNVars), fCrvVars(0),fTPCVars(0)
19{
20 // copy c-tor
21 fCrvVars = new Double32_t[fNVars];
22 fTPCVars = new Double32_t[fNVars];
23 TObjArray& arrSrc = src.GetTracks();
24 for (int i=fNVars;i--;) {
25 fCrvVars[i] = src.fCrvVars[i];
26 fTPCVars[i] = src.fTPCVars[i];
27 }
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];
41 fTPCVars = new Double32_t[fNVars];
42 TObjArray& arrSrc = src.GetTracks();
43 for (int i=fNVars;i--;) {
44 fCrvVars[i] = src.fCrvVars[i];
45 fTPCVars[i] = src.fTPCVars[i];
46 }
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
55 delete[] fCrvVars; fCrvVars = 0;
56 fNVars = n*kNVarPerTrack;
57 if (fNVars>0) {
58 fCrvVars = new Double32_t[fNVars];
59 fTPCVars = new Double32_t[fNVars];
60 for (int i=fNVars;i--;) fCrvVars[i]=fTPCVars[i] = 0;
61 }
62}
63
64//__________________________________________
65void AliITSSumTP::Reset()
66{
67 // reset object
68 fTracks.Delete();
69 delete[] fCrvVars;
70 delete[] fTPCVars;
71 fCrvVars = fTPCVars = 0;
72 fNVars = 0;
73 SetUniqueID(0);
74}
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);
83 double xyz[3]={0,0,0};
84 for (int itr=0;itr<ntr;itr++) {
85 AliTrackPointArray* tr = GetTrack(itr);
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]);
90 }
91 //
92}
93