cuts on Q out, side, long added
[u/mrichter/AliRoot.git] / PMD / AliPMDRecPoint.cxx
CommitLineData
4fa198c6 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17$Log$
18*/
19
20//_________________________________________________________________________
21// Class for PMD reconstructed space points
22// usually coming from the clusterisation algorithms
23// run on the digits
24//
25//////////////////////////////////////////////////////////////////////////////
26
27// --- ROOT system ---
28
29#include "TObjArray.h"
30
31// --- Standard library ---
32
33// --- AliRoot header files ---
34
35#include "AliPMDRecPoint.h"
36#include "AliGeometry.h"
37#include "AliDigitNew.h"
38
39ClassImp(AliPMDRecPoint)
40
41
42//____________________________________________________________________________
43//____________________________________________________________________________
44void AliPMDRecPoint::AddDigit(AliDigitNew & digit)
45{
46 // adds a digit to the digits list
47 // and accumulates the total amplitude and the multiplicity
48
49
50 if ( fMulDigit >= fMaxDigit ) { // increase the size of the list
51 int * tempo = new ( int[fMaxDigit*=2] ) ;
52
53 Int_t index ;
54
55 for ( index = 0 ; index < fMulDigit ; index++ )
56 tempo[index] = fDigitsList[index] ;
57
58 delete fDigitsList ;
59 fDigitsList = tempo ;
60 }
61
62 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
63 fMulDigit++ ;
64 fAmp += digit.GetAmp() ;
65}
66
67//____________________________________________________________________________
68void AliPMDRecPoint::Copy(AliPMDRecPoint& recp) const
69{
70 //
71 // Copy *this onto pts
72 //
73 // Copy all first
74 if(this != &recp) {
75 ((TObject*) this)->Copy((TObject&)recp);
76 recp.fAmp = fAmp;
77 recp.fGeom = fGeom;
78 recp.fIndexInList = fIndexInList;
79 recp.fLocPos = fLocPos;
80 recp.fLocPosM = new TMatrix(*fLocPosM);
81 recp.fMaxDigit = fMaxDigit;
82 recp.fMulDigit = fMulDigit;
83 recp.fMaxTrack = fMaxTrack;
84 recp.fMulTrack = fMulTrack;
85
86 // Duplicate pointed objects
87 recp.fDigitsList = new Int_t[fMulDigit];
88 memcpy(recp.fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
89 recp.fTracksList = new Int_t[fMulTrack];
90 memcpy(recp.fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
91 }
92}
93
94//____________________________________________________________________________
95void AliPMDRecPoint::GetCovarianceMatrix(TMatrix & mat)
96{
97 // returns the covariant matrix for the local position
98
99 mat = *fLocPosM ;
100
101}
102
103//____________________________________________________________________________
104void AliPMDRecPoint::GetLocalPosition(TVector3 & pos) const
105{
106 // returns the position of the cluster in the local reference system of the sub-detector
107
108 pos = fLocPos;
109
110
111}
112
113//____________________________________________________________________________
114AliPMDRecPoint & AliPMDRecPoint::operator= (const AliPMDRecPoint &recp)
115{
116 recp.Copy(*this);
117 return (*this);
118}
119
120
121//____________________________________________________________________________
122void AliPMDRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) const
123{
124 // returns the position of the cluster in the global reference system of ALICE
125 // and the uncertainty on this position
126
127
128 fGeom->GetGlobal(this, gpos, gmat) ;
129
130}
131
132
133
134
135
136
137
138
139