]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFCalSector.cxx
Coverity fixes
[u/mrichter/AliRoot.git] / TOF / AliTOFCalSector.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
5bab6312 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:58:16 arcelli
28updates to handle new V5 geometry & some re-arrangements
29
d4ad0d6b 30Revision 1.2 2006/02/13 16:53:00 decaro
31just Fixing Log info
32
5bab6312 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
5bab6312 37*/
6dc9348d 38
39///////////////////////////////////////////////////////////////////////////////
40// //
41// class for TOF calibration : Sectors //
42// //
43///////////////////////////////////////////////////////////////////////////////
44
6dc9348d 45#include "TBrowser.h"
0e46b9ae 46#include "TROOT.h"
47
d4ad0d6b 48#include "AliLog.h"
0e46b9ae 49
6dc9348d 50#include "AliTOFCalPlateA.h"
51#include "AliTOFCalPlateB.h"
52#include "AliTOFCalPlateC.h"
53#include "AliTOFCalSector.h"
54#include "AliTOFChannel.h"
0e46b9ae 55#include "AliTOFGeometryV5.h"
6dc9348d 56
5480a4f2 57//extern TROOT *gROOT;
6dc9348d 58
59ClassImp(AliTOFCalSector)
60
61//________________________________________________________________
62
655e379f 63AliTOFCalSector::AliTOFCalSector():
64 fNPlate(0),
65 fNStripA(0),
66 fNStripB(0),
67 fNStripC(0),
68 fNpadZ(0),
69 fNpadX(0),
70 fGeom(0x0),
71 fCh(0x0)
72{
340693af 73 //main ctor
6dc9348d 74 gROOT->GetListOfBrowsables()->Add(this);
75
76}
77//________________________________________________________________
78
79AliTOFCalSector::AliTOFCalSector(AliTOFChannel *ch):
655e379f 80 fNPlate(0),
81 fNStripA(0),
82 fNStripB(0),
83 fNStripC(0),
84 fNpadZ(0),
85 fNpadX(0),
86 fGeom(0x0),
6dc9348d 87 fCh(ch)
88{
340693af 89 //ctor with channel
d4ad0d6b 90 gROOT->GetListOfBrowsables()->Add(this);
91}
92//________________________________________________________________
93
655e379f 94AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom):
95 fNPlate(0),
96 fNStripA(0),
97 fNStripB(0),
98 fNStripC(0),
99 fNpadZ(0),
100 fNpadX(0),
101 fGeom(geom),
102 fCh(0x0)
103{
340693af 104 //ctor with geom
d4ad0d6b 105 fNPlate = fGeom->NPlates();
106 fNStripA = fGeom->NStripA();
107 fNStripB = fGeom->NStripB();
108 fNStripC = fGeom->NStripC();
109 fNpadZ = fGeom->NpadZ();
110 fNpadX = fGeom->NpadX();
111 gROOT->GetListOfBrowsables()->Add(this);
112
113}
114//________________________________________________________________
115
116AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom,AliTOFChannel *ch):
655e379f 117 fNPlate(0),
118 fNStripA(0),
119 fNStripB(0),
120 fNStripC(0),
121 fNpadZ(0),
122 fNpadX(0),
123 fGeom(geom),
d4ad0d6b 124 fCh(ch)
125{
340693af 126 // ctor with channel and geom
d4ad0d6b 127 fNPlate = fGeom->NPlates();
128 fNStripA = fGeom->NStripA();
129 fNStripB = fGeom->NStripB();
130 fNStripC = fGeom->NStripC();
131 fNpadZ = fGeom->NpadZ();
132 fNpadX = fGeom->NpadX();
133 gROOT->GetListOfBrowsables()->Add(this);
6dc9348d 134}
135//________________________________________________________________
136
137AliTOFCalSector::AliTOFCalSector(const AliTOFCalSector& sec):
655e379f 138 TObject(sec),
139 fNPlate(0),
140 fNStripA(0),
141 fNStripB(0),
142 fNStripC(0),
143 fNpadZ(0),
144 fNpadX(0),
145 fGeom(0x0),
146 fCh(0x0)
6dc9348d 147 {
340693af 148 //copy ctor
6dc9348d 149 fCh = sec.fCh;
6dc9348d 150 fNPlate = sec.fNPlate;
151 fNStripA = sec.fNStripA;
152 fNStripB = sec.fNStripB;
153 fNStripC = sec.fNStripC;
154 fNpadZ = sec.fNpadZ;
155 fNpadX = sec.fNpadX;
156 gROOT->GetListOfBrowsables()->Add(this);
157 }
7aeeaf38 158//________________________________________________________________
159
160AliTOFCalSector& AliTOFCalSector::operator=(const AliTOFCalSector& sec)
161 {
162 //assignment operator
163 this->fCh = sec.fCh;
164 this->fNPlate = sec.fNPlate;
165 this->fNStripA = sec.fNStripA;
166 this->fNStripB = sec.fNStripB;
167 this->fNStripC = sec.fNStripC;
168 this->fNpadZ = sec.fNpadZ;
169 this->fNpadX = sec.fNpadX;
170 gROOT->GetListOfBrowsables()->Add(this);
171 return *this;
172
173 }
6dc9348d 174//________________________________________________________________
175
176AliTOFCalSector::~AliTOFCalSector()
177{
340693af 178 //dtor
d4ad0d6b 179 gROOT->GetListOfBrowsables()->Remove(this);
6dc9348d 180 delete[] fCh;
181}
182
183//________________________________________________________________
184
185void AliTOFCalSector::Browse(TBrowser *b){
340693af 186 //add cal obj to list of browsables
d4ad0d6b 187 if(fGeom==0x0){
188 AliTOFGeometry *geom= new AliTOFGeometryV5();
189 AliInfo("V5 TOF Geometry is taken as the default");
190 fNPlate = geom->NPlates();
191 fNStripA = geom->NStripA();
192 fNStripB = geom->NStripB();
193 fNStripC = geom->NStripC();
194 fNpadZ = geom->NpadZ();
195 fNpadX = geom->NpadX();
196 delete geom;
197 }
6dc9348d 198 b->Add(new AliTOFCalPlateC(fCh), "Plate0");
199 b->Add(new AliTOFCalPlateB(&fCh[fNStripC*96]),"Plate1");
200 b->Add(new AliTOFCalPlateA(&fCh[(fNStripC+fNStripB)*fNpadZ*fNpadX]),"Plate2");
201 b->Add(new AliTOFCalPlateB(&fCh[(fNStripC+2*fNStripB)*fNpadZ*fNpadX]),"Plate3");
202 b->Add(new AliTOFCalPlateC(&fCh[2*(fNStripC+fNStripB)*fNpadZ*fNpadX]),"Plate4");
203}
204