]>
Commit | Line | Data |
---|---|---|
1d9af2d5 | 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 | /* $Id$ */ | |
17 | ||
18 | #include <Riostream.h> | |
19 | #include <TMath.h> | |
20 | #include <AliITSlayerUpgrade.h> | |
21 | #include <AliITStrackerMI.h> | |
22 | ||
23 | AliITSlayerUpgrade::AliITSlayerUpgrade(): | |
24 | fPhiOffset(0.), | |
25 | fZOffset(0.), | |
26 | fNsel(0), | |
27 | fN(0) | |
28 | { //-------------------------------------------------------------------- | |
29 | //default AliITSlayerUpgrade constructor | |
30 | //-------------------------------------------------------------------- | |
4edc3c8c | 31 | for (Int_t i=0; i<AliITSRecoParam::kMaxClusterPerLayer; i++) { |
2204e928 | 32 | fIndex[i] = -1; |
33 | fClusters[i]= 0x0; | |
34 | } | |
1d9af2d5 | 35 | } |
36 | //___________________________________________________________________________ | |
37 | AliITSlayerUpgrade::AliITSlayerUpgrade(Double_t p,Double_t z): | |
38 | fPhiOffset(p), | |
39 | fZOffset(z), | |
40 | fNsel(0), | |
41 | fN(0) | |
42 | { | |
43 | //-------------------------------------------------------------------- | |
44 | //main AliITSlayerUpgrade constructor | |
45 | //-------------------------------------------------------------------- | |
46 | ||
4edc3c8c | 47 | for (Int_t i=0; i<AliITSRecoParam::kMaxClusterPerLayer; i++) { |
2204e928 | 48 | fIndex[i] = -1; |
49 | fClusters[i]= 0x0; | |
50 | } | |
1d9af2d5 | 51 | |
52 | } | |
53 | ||
54 | AliITSlayerUpgrade::~AliITSlayerUpgrade() { | |
55 | //-------------------------------------------------------------------- | |
56 | // AliITSlayerUpgrade destructor | |
57 | //-------------------------------------------------------------------- | |
1d9af2d5 | 58 | ResetClusters(); |
59 | ||
60 | } | |
61 | void AliITSlayerUpgrade::ResetClusters() { | |
62 | //-------------------------------------------------------------------- | |
63 | // This function removes loaded clusters | |
64 | //-------------------------------------------------------------------- | |
1d9af2d5 | 65 | |
2204e928 | 66 | for (Int_t i=0; i<fN; i++) { |
67 | fIndex[i]=-1; | |
68 | if(fClusters[i]) { | |
69 | delete fClusters[i]; | |
70 | } | |
71 | } | |
1d9af2d5 | 72 | fN=0; |
2204e928 | 73 | return; |
1d9af2d5 | 74 | } |
75 | ||
76 | ||
77 | Int_t AliITSlayerUpgrade::InsertCluster(AliITSRecPoint *c) { | |
78 | //-------------------------------------------------------------------- | |
79 | // This function inserts a cluster to this layer in increasing | |
80 | // order of the cluster's fZ | |
81 | //-------------------------------------------------------------------- | |
2204e928 | 82 | fClusters[fN]=c; |
1d9af2d5 | 83 | fN++; |
84 | return 0; | |
85 | } | |
86 | ||
87 | //----------------------------------------------------------------------- | |
88 | const AliITSRecPoint *AliITSlayerUpgrade::GetNextCluster(Int_t &ci){ | |
89 | //-------------------------------------------------------------------- | |
90 | // This function returns clusters within the "window" | |
91 | //-------------------------------------------------------------------- | |
92 | AliITSRecPoint *c=0; | |
93 | ci=-1; | |
94 | if (fNsel) { | |
95 | fNsel--; | |
96 | ci=fIndex[fNsel]; | |
97 | c=fClusters[ci]; | |
98 | } | |
99 | return c; | |
100 | } | |
1d9af2d5 | 101 |