]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSClusterFinder.cxx
remove fNdigits data member, it could have wrong value if fDigits is updated. Make...
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinder.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 #include "AliITSClusterFinder.h"
17 #include "AliRun.h"
18 #include "AliITS.h"
19
20 //----------------------------------------------------------
21
22 //----------------------------------------------------------
23
24 ClassImp(AliITSClusterFinder)
25
26 AliITSClusterFinder::AliITSClusterFinder
27 (AliITSsegmentation *seg, AliITSresponse *response, TClonesArray *digits)   
28 {
29   // cluster finder
30     fSegmentation=seg;
31     fResponse=response;
32     fMap = 0;
33     
34     fDigits=digits;
35     fNdigits = fDigits->GetEntriesFast();
36
37     fNRawClusters=0;
38
39     SetNperMax();
40     SetClusterSize();
41     SetDeclusterFlag();
42
43     fNPeaks=-1;
44 }
45
46 //----------------------------------------------------------
47 AliITSClusterFinder::AliITSClusterFinder()
48 {
49   // constructor
50     fResponse=0;
51     fSegmentation = 0;
52     
53     fDigits=0;
54     fNdigits = 0;
55
56     fNRawClusters=0;
57     fMap = 0;
58
59
60     SetNperMax();
61     SetClusterSize();
62     SetDeclusterFlag();
63
64     fNPeaks=-1;
65 }
66  
67 //__________________________________________________________________________
68 AliITSClusterFinder::AliITSClusterFinder(const AliITSClusterFinder &source){
69   //     Copy Constructor 
70   if(&source == this) return;
71   this->fDigits = source.fDigits;
72   this->fNdigits = source.fNdigits;
73   this->fResponse = source.fResponse;
74   this->fSegmentation = source.fSegmentation;
75   this->fNRawClusters = source.fNRawClusters;
76   this->fMap = source.fMap;
77   this->fNperMax = source.fNperMax;
78   this->fDeclusterFlag = source.fDeclusterFlag;
79   this->fClusterSize = source.fClusterSize;
80   this->fNPeaks = source.fNPeaks;
81   return;
82 }
83
84 //_________________________________________________________________________
85 AliITSClusterFinder& 
86   AliITSClusterFinder::operator=(const AliITSClusterFinder &source) {
87   //    Assignment operator
88   if(&source == this) return *this;
89   this->fDigits = source.fDigits;
90   this->fNdigits = source.fNdigits;
91   this->fResponse = source.fResponse;
92   this->fSegmentation = source.fSegmentation;
93   this->fNRawClusters = source.fNRawClusters;
94   this->fMap = source.fMap;
95   this->fNperMax = source.fNperMax;
96   this->fDeclusterFlag = source.fDeclusterFlag;
97   this->fClusterSize = source.fClusterSize;
98   this->fNPeaks = source.fNPeaks;
99   return *this;
100 }
101
102 //----------------------------------------------------------
103 void AliITSClusterFinder::AddCluster(Int_t branch, AliITSRawCluster *c)
104 {
105   //
106   // Add a raw cluster copy to the list
107   //
108     AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
109     iTS->AddCluster(branch,c); 
110     fNRawClusters++;
111
112 }
113
114
115 //----------------------------------------------------------
116 void AliITSClusterFinder::AddCluster(Int_t branch, AliITSRawCluster *c, AliITSRecPoint &rp)
117 {
118   //
119   // Add a raw cluster copy to the list
120   //
121     AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
122     iTS->AddCluster(branch,c); 
123     fNRawClusters++;
124     iTS->AddRecPoint(rp); 
125 }
126
127
128
129
130