changes needed for the alignemnt of the new SPD modules (Ruben)
[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) :
17 TObject(src), fTracks(src.fTracks.GetEntriesFast()), fVertex(src.GetVertex()),
18 fNVars(src.fNVars), fCrvVars(0)
19{
20 // copy c-tor
21 fCrvVars = new Double32_t[fNVars];
22 TObjArray& arrSrc = src.GetTracks();
23 for (int i=fNVars;i--;) fCrvVars[i] = src.fCrvVars[i];
24 for (int i=arrSrc.GetEntriesFast();i--;) fTracks.AddAtAndExpand(arrSrc.UncheckedAt(i),i);
25}
26
27//__________________________________________
28AliITSSumTP& AliITSSumTP::operator=(const AliITSSumTP& src)
29{
30 // assignment op-r
31 if (this == &src) return *this;
32 Reset();
33 TObject::operator=(src);
34 fVertex = src.GetVertex();
35 fNVars = src.fNVars;
36 fCrvVars = new Double32_t[fNVars];
37 TObjArray& arrSrc = src.GetTracks();
38 for (int i=fNVars;i--;) fCrvVars[i] = src.fCrvVars[i];
39 for (int i=arrSrc.GetEntriesFast();i--;) fTracks.AddAtAndExpand(arrSrc.UncheckedAt(i),i);
40 return *this;
41}
42
43//__________________________________________
44void AliITSSumTP::BookNTracks(Int_t n)
45{
46 // book space for tracks info
47 delete[] fCrvVars;
48 fNVars = n*kNVarPerTrack;
49 fCrvVars = fNVars>0 ? new Double32_t[fNVars] : 0;
50 for (int i=fNVars;i--;) fCrvVars[i]=0;
51}
52
53//__________________________________________
54void AliITSSumTP::Reset()
55{
56 // reset object
57 fTracks.Delete();
58 delete[] fCrvVars;
59 fCrvVars = 0;
60 fNVars = 0;
61 SetUniqueID(0);
62}