1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //-------------------------------------------------------
17 // Implementation of the TPC cluster debug information
19 // Origin: Marian Ivanov Marian.Ivanov@cern.ch
21 // Additional cluster information to monitor clustering performance
22 // and to extract a features of detector response
23 // Information attached to the default cluster
26 //-------------------------------------------------------
30 #include "AliTPCclusterInfo.h"
33 ClassImp(AliTPCclusterInfo)
36 AliTPCclusterInfo::AliTPCclusterInfo():
43 // default constructor
45 for (Int_t i=0; i<25;i++){
50 AliTPCclusterInfo::AliTPCclusterInfo(const AliTPCclusterInfo & info):
53 fNTimeBins(info.fNTimeBins),
60 // AliInfo("Copy constructor\n");
61 for (Int_t i=0; i<25;i++){
62 fMatrix[i] = info.fMatrix[i];
65 fGraph = new Float_t[fNBins];
66 for (Int_t i=0;i<fNBins; i++){
67 fGraph[i] = info.fGraph[i];
73 AliTPCclusterInfo::AliTPCclusterInfo(Bool_t extend):
80 // allocate dummy graph - neccessary for IO part to use automatic branching
82 for (Int_t i=0; i<25;i++){
87 fGraph = new Float_t[1];
92 AliTPCclusterInfo::AliTPCclusterInfo(Float_t *matrix, Int_t nbins, Float_t* graph):
99 // constructor of the info
101 for (Int_t i=0;i<25;i++){
102 fMatrix[i]=matrix[i];
106 Int_t center = 5+5+2;
107 for (Int_t i=-2; i<=2;i++) if (matrix[center+i]>0) fNTimeBins++;
108 for (Int_t i=-2; i<=2;i++) if (matrix[center+i*5]>0) fNPads++;
112 fGraph = new Float_t[fNBins];
113 for (Int_t i=0;i<fNBins; i++){
114 fGraph[i] = graph[i];
119 AliTPCclusterInfo& AliTPCclusterInfo::operator=(const AliTPCclusterInfo& info){
121 // assignment operator
123 if (this == &info) return (*this);
124 for (Int_t i=0; i<25;i++){
125 fMatrix[i] = info.fMatrix[i];
128 if (fGraph) delete []fGraph;
129 fGraph = new Float_t[fNBins];
130 for (Int_t i=0;i<fNBins; i++){
131 fGraph[i] = info.fGraph[i];
138 UChar_t AliTPCclusterInfo::GetNPads(Float_t threshold) const {
142 Int_t center = 5+5+2;
143 for (Int_t i=-2; i<=2;i++) if (fMatrix[center+i*5]>threshold) nPads++;
147 UChar_t AliTPCclusterInfo::GetNTimeBins(Float_t threshold) const {
152 Int_t center = 5+5+2;
153 for (Int_t i=-2; i<=2;i++) if (fMatrix[center+i]>threshold) nTimeBins++;
160 AliTPCclusterInfo::~AliTPCclusterInfo(){
164 if (fGraph) delete [] fGraph;