]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/AliITSlayerUpgrade.cxx
Added version tailored for pp (AliTrackletTaskMultipp) with additional
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSlayerUpgrade.cxx
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   //--------------------------------------------------------------------
31   for (Int_t i=0; i<AliITSRecoParam::kMaxClusterPerLayer; i++) {
32   fIndex[i] = -1;
33   fClusters[i]= 0x0;
34   }
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
47   for (Int_t i=0; i<AliITSRecoParam::kMaxClusterPerLayer; i++) {
48   fIndex[i] = -1;
49   fClusters[i]= 0x0;
50   }
51
52 }
53
54 AliITSlayerUpgrade::~AliITSlayerUpgrade() {
55   //--------------------------------------------------------------------
56   // AliITSlayerUpgrade destructor
57   //--------------------------------------------------------------------
58 ResetClusters();
59
60 }
61 void AliITSlayerUpgrade::ResetClusters() {
62   //--------------------------------------------------------------------
63   // This function removes loaded clusters
64   //--------------------------------------------------------------------
65
66   for (Int_t i=0; i<fN; i++) {
67   fIndex[i]=-1;
68   if(fClusters[i]) {
69     delete fClusters[i];
70     }
71   }
72   fN=0;
73   return;
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   //--------------------------------------------------------------------
82   fClusters[fN]=c;
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 }
101