]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/TPCbase/AliTPCclusterInfo.cxx
doxy: TPC/TPCbase converted
[u/mrichter/AliRoot.git] / TPC / TPCbase / AliTPCclusterInfo.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 /// \class AliTPCclusterInfo
17 /// \brief Implementation of the TPC cluster debug information
18 ///
19 ///   Additional cluster information to monitor clustering performance
20 ///   and to extract a features of detector response
21 ///   Information attached to the default cluster
22 ///   ONLY in DEBUG MODE
23 ///
24 /// \author Marian Ivanov   Marian.Ivanov@cern.ch
25
26 #include "AliTPCclusterInfo.h"
27 #include "AliLog.h"
28
29 /// \cond CLASSIMP
30 ClassImp(AliTPCclusterInfo)
31 /// \endcond
32
33
34 AliTPCclusterInfo::AliTPCclusterInfo():
35   fNPads(0),
36   fNTimeBins(0),
37   fNBins(0),
38   fGraph(0)
39 {
40   //
41   // default constructor
42   //
43   for (Int_t i=0; i<25;i++){
44     fMatrix[i] = i;
45   }
46 }
47
48 AliTPCclusterInfo::AliTPCclusterInfo(const  AliTPCclusterInfo & info):
49   TObject(info),
50   fNPads(info.fNPads),
51   fNTimeBins(info.fNTimeBins),
52   fNBins(info.fNBins),
53   fGraph(0)
54 {
55   /// copy constructor
56
57   // AliInfo("Copy constructor\n");
58   for (Int_t i=0; i<25;i++){
59     fMatrix[i] = info.fMatrix[i];
60   }
61   if (info.fGraph) {
62     fGraph = new Float_t[fNBins];
63     for (Int_t i=0;i<fNBins; i++){
64       fGraph[i] = info.fGraph[i];
65     }
66   }
67 }
68
69
70 AliTPCclusterInfo::AliTPCclusterInfo(Bool_t extend):
71   fNPads(0),
72   fNTimeBins(0),
73   fNBins(0),
74   fGraph(0)
75 {
76   /// allocate dummy graph - neccessary for IO part to use automatic branching
77
78   for (Int_t i=0; i<25;i++){
79     fMatrix[i] = i;
80   }
81   if (extend){
82     fNBins = 1;
83     fGraph  = new Float_t[1];
84     fGraph[0]=-1;
85   }
86 }
87
88 AliTPCclusterInfo::AliTPCclusterInfo(Float_t *matrix, Int_t nbins, Float_t* graph):
89   fNPads(0),
90   fNTimeBins(0),
91   fNBins(0),
92   fGraph(0)
93 {
94   /// constructor of the info
95
96   for (Int_t i=0;i<25;i++){
97     fMatrix[i]=matrix[i];
98   }
99   fNPads=0;
100   fNTimeBins=0;
101   Int_t center = 5+5+2;
102   for (Int_t i=-2; i<=2;i++) if (matrix[center+i]>0) fNTimeBins++;
103   for (Int_t i=-2; i<=2;i++) if (matrix[center+i*5]>0) fNPads++;
104   fNBins = nbins;
105   fGraph = 0;
106   if (fNBins>0) {
107     fGraph = new Float_t[fNBins];
108     for (Int_t i=0;i<fNBins; i++){
109       fGraph[i] = graph[i];
110     }
111   }
112 }
113
114 AliTPCclusterInfo& AliTPCclusterInfo::operator=(const AliTPCclusterInfo& info){
115   /// assignment operator
116
117   if (this == &info) return (*this);
118   for (Int_t i=0; i<25;i++){
119     fMatrix[i] = info.fMatrix[i];
120   }
121   if (info.fGraph) {
122     if (fGraph) delete []fGraph;
123     fGraph = new Float_t[fNBins];
124     for (Int_t i=0;i<fNBins; i++){
125       fGraph[i] = info.fGraph[i];
126     }
127   }
128   return *this;
129 }
130
131
132 UChar_t AliTPCclusterInfo::GetNPads(Float_t threshold) const {
133   ///
134
135   Int_t nPads=0;
136   Int_t center = 5+5+2;
137   for (Int_t i=-2; i<=2;i++) if (fMatrix[center+i*5]>threshold) nPads++;
138   return nPads;
139 }
140
141 UChar_t AliTPCclusterInfo::GetNTimeBins(Float_t threshold) const {
142   ///
143
144   Int_t nTimeBins=0;
145   Int_t center = 5+5+2;
146   for (Int_t i=-2; i<=2;i++) if (fMatrix[center+i]>threshold) nTimeBins++;
147   return nTimeBins;
148 }
149
150
151
152
153 AliTPCclusterInfo::~AliTPCclusterInfo(){
154   /// destructor
155
156   if (fGraph)  delete [] fGraph;
157 }
158