some coverity fixes
[u/mrichter/AliRoot.git] / TOF / AliTOFCalPadZ.cxx
CommitLineData
6dc9348d 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
762446e0 16/*
17$Log$
655e379f 18Revision 1.6 2006/04/20 22:30:49 hristov
19Coding conventions (Annalisa)
20
0e46b9ae 21Revision 1.5 2006/04/16 22:29:05 hristov
22Coding conventions (Annalisa)
23
7aeeaf38 24Revision 1.4 2006/04/05 08:35:38 hristov
25Coding conventions (S.Arcelli, C.Zampolli)
26
340693af 27Revision 1.3 2006/03/28 14:57:30 arcelli
28updates to handle new V5 geometry & some re-arrangements
29
d4ad0d6b 30Revision 1.2 2006/02/13 17:22:26 arcelli
31just Fixing Log info
32
762446e0 33Revision 1.1 2006/02/13 16:10:48 arcelli
34Add classes for TOF Calibration (C.Zampolli)
35
6dc9348d 36author: Chiara Zampolli, zampolli@bo.infn.it
762446e0 37*/
6dc9348d 38
39///////////////////////////////////////////////////////////////////////////////
40// //
41// class for TOF calibration : PadZ //
42// //
43///////////////////////////////////////////////////////////////////////////////
44
6dc9348d 45#include "TBrowser.h"
0e46b9ae 46
d4ad0d6b 47#include "AliLog.h"
0e46b9ae 48
6dc9348d 49#include "AliTOFCalPadZ.h"
0e46b9ae 50#include "AliTOFChannel.h"
51#include "AliTOFGeometryV5.h"
6dc9348d 52
53ClassImp(AliTOFCalPadZ)
54
55//________________________________________________________________
56
655e379f 57 AliTOFCalPadZ::AliTOFCalPadZ():
58 fNpadX(0),
59 fGeom(0x0),
60 fCh(0)
61{
62 //fCh = 0;
63 //fNpadX=0;
6dc9348d 64}
65//________________________________________________________________
66
67AliTOFCalPadZ::AliTOFCalPadZ(AliTOFChannel *ch):
655e379f 68 fNpadX(0),
69 fGeom(0x0),
6dc9348d 70 fCh(ch)
71{
655e379f 72 //fNpadX = 0;
d4ad0d6b 73}
74//________________________________________________________________
6dc9348d 75
655e379f 76AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom):
77 fNpadX(0),
78 fGeom(geom),
79 fCh(0)
80{
340693af 81 //ctor with TOF geometry
655e379f 82 //fCh = 0;
83 //fGeom = geom;
d4ad0d6b 84 fNpadX = fGeom->NpadX();
85}
86//________________________________________________________________
87
88AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom,AliTOFChannel *ch):
655e379f 89 fNpadX(0),
90 fGeom(geom),
d4ad0d6b 91 fCh(ch)
92{
340693af 93 //ctor with TOF geometry and cal channel
d4ad0d6b 94 fGeom = geom;
95 fNpadX = fGeom->NpadX();
6dc9348d 96}
7aeeaf38 97
98//________________________________________________________________
655e379f 99AliTOFCalPadZ::AliTOFCalPadZ(const AliTOFCalPadZ &source):
100 TObject(),
101 fNpadX(0),
102 fGeom(0x0),
103 fCh(0)
7aeeaf38 104{
105 // copy constructor
106
107 this->fGeom=source.fGeom;
108
109}
110
111//_____________________________________________________________________________
112AliTOFCalPadZ& AliTOFCalPadZ::operator=(const AliTOFCalPadZ &source)
113{
114 // assignment operator
115
116 this->fGeom=source.fGeom;
117 return *this;
118
119}
120
6dc9348d 121//________________________________________________________________
122
123AliTOFCalPadZ::~AliTOFCalPadZ()
124 {
125 delete[] fCh;
126 }
127//________________________________________________________________
128
129void AliTOFCalPadZ::Browse(TBrowser *b)
130{
340693af 131 //Add cal object to browsable list
d4ad0d6b 132 if(fGeom==0x0){
133 AliInfo("V5 TOF Geometry is taken as the default");
134 AliTOFGeometry *geom = new AliTOFGeometryV5();
135 fNpadX = geom->NpadX();
136 delete geom;
137 }
6dc9348d 138 char name[10];
139 for(Int_t i=0; i<fNpadX; ++i) {
140 snprintf(name,sizeof(name),"PadX %2.2d",i);
141 b->Add(new AliTOFChannel(fCh[i]),name);
142 }
143}