]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFCalSector.cxx
Coding convention corrections
[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$
0e46b9ae 18Revision 1.5 2006/04/16 22:29:05 hristov
19Coding conventions (Annalisa)
20
7aeeaf38 21Revision 1.4 2006/04/05 08:35:38 hristov
22Coding conventions (S.Arcelli, C.Zampolli)
23
340693af 24Revision 1.3 2006/03/28 14:58:16 arcelli
25updates to handle new V5 geometry & some re-arrangements
26
d4ad0d6b 27Revision 1.2 2006/02/13 16:53:00 decaro
28just Fixing Log info
29
5bab6312 30Revision 1.1 2006/02/13 16:10:48 arcelli
31Add classes for TOF Calibration (C.Zampolli)
32
6dc9348d 33author: Chiara Zampolli, zampolli@bo.infn.it
5bab6312 34*/
6dc9348d 35
36///////////////////////////////////////////////////////////////////////////////
37// //
38// class for TOF calibration : Sectors //
39// //
40///////////////////////////////////////////////////////////////////////////////
41
6dc9348d 42#include "TBrowser.h"
0e46b9ae 43#include "TROOT.h"
44
d4ad0d6b 45#include "AliLog.h"
0e46b9ae 46
6dc9348d 47#include "AliTOFCalPlateA.h"
48#include "AliTOFCalPlateB.h"
49#include "AliTOFCalPlateC.h"
50#include "AliTOFCalSector.h"
51#include "AliTOFChannel.h"
0e46b9ae 52#include "AliTOFGeometryV5.h"
6dc9348d 53
54extern TROOT *gROOT;
55
56ClassImp(AliTOFCalSector)
57
58//________________________________________________________________
59
60AliTOFCalSector::AliTOFCalSector(){
340693af 61 //main ctor
6dc9348d 62 fCh = 0;
d4ad0d6b 63 fGeom=0x0;
64 fNPlate=0;
65 fNStripA=0;
66 fNStripB=0;
67 fNStripC=0;
68 fNpadZ=0;
69 fNpadX=0;
6dc9348d 70 gROOT->GetListOfBrowsables()->Add(this);
71
72}
73//________________________________________________________________
74
75AliTOFCalSector::AliTOFCalSector(AliTOFChannel *ch):
76 fCh(ch)
77{
340693af 78 //ctor with channel
d4ad0d6b 79 fGeom=0x0;
80 fNPlate=0;
81 fNStripA=0;
82 fNStripB=0;
83 fNStripC=0;
84 fNpadZ=0;
85 fNpadX=0;
86 gROOT->GetListOfBrowsables()->Add(this);
87}
88//________________________________________________________________
89
90AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom){
340693af 91 //ctor with geom
d4ad0d6b 92 fCh = 0;
93 fGeom= geom;
94 fNPlate = fGeom->NPlates();
95 fNStripA = fGeom->NStripA();
96 fNStripB = fGeom->NStripB();
97 fNStripC = fGeom->NStripC();
98 fNpadZ = fGeom->NpadZ();
99 fNpadX = fGeom->NpadX();
100 gROOT->GetListOfBrowsables()->Add(this);
101
102}
103//________________________________________________________________
104
105AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom,AliTOFChannel *ch):
106 fCh(ch)
107{
340693af 108 // ctor with channel and geom
d4ad0d6b 109 fGeom= geom;
110 fNPlate = fGeom->NPlates();
111 fNStripA = fGeom->NStripA();
112 fNStripB = fGeom->NStripB();
113 fNStripC = fGeom->NStripC();
114 fNpadZ = fGeom->NpadZ();
115 fNpadX = fGeom->NpadX();
116 gROOT->GetListOfBrowsables()->Add(this);
6dc9348d 117}
118//________________________________________________________________
119
120AliTOFCalSector::AliTOFCalSector(const AliTOFCalSector& sec):
121 TObject(sec)
122 {
340693af 123 //copy ctor
6dc9348d 124 fCh = sec.fCh;
6dc9348d 125 fNPlate = sec.fNPlate;
126 fNStripA = sec.fNStripA;
127 fNStripB = sec.fNStripB;
128 fNStripC = sec.fNStripC;
129 fNpadZ = sec.fNpadZ;
130 fNpadX = sec.fNpadX;
131 gROOT->GetListOfBrowsables()->Add(this);
132 }
7aeeaf38 133//________________________________________________________________
134
135AliTOFCalSector& AliTOFCalSector::operator=(const AliTOFCalSector& sec)
136 {
137 //assignment operator
138 this->fCh = sec.fCh;
139 this->fNPlate = sec.fNPlate;
140 this->fNStripA = sec.fNStripA;
141 this->fNStripB = sec.fNStripB;
142 this->fNStripC = sec.fNStripC;
143 this->fNpadZ = sec.fNpadZ;
144 this->fNpadX = sec.fNpadX;
145 gROOT->GetListOfBrowsables()->Add(this);
146 return *this;
147
148 }
6dc9348d 149//________________________________________________________________
150
151AliTOFCalSector::~AliTOFCalSector()
152{
340693af 153 //dtor
d4ad0d6b 154 gROOT->GetListOfBrowsables()->Remove(this);
6dc9348d 155 delete[] fCh;
156}
157
158//________________________________________________________________
159
160void AliTOFCalSector::Browse(TBrowser *b){
340693af 161 //add cal obj to list of browsables
d4ad0d6b 162 if(fGeom==0x0){
163 AliTOFGeometry *geom= new AliTOFGeometryV5();
164 AliInfo("V5 TOF Geometry is taken as the default");
165 fNPlate = geom->NPlates();
166 fNStripA = geom->NStripA();
167 fNStripB = geom->NStripB();
168 fNStripC = geom->NStripC();
169 fNpadZ = geom->NpadZ();
170 fNpadX = geom->NpadX();
171 delete geom;
172 }
6dc9348d 173 b->Add(new AliTOFCalPlateC(fCh), "Plate0");
174 b->Add(new AliTOFCalPlateB(&fCh[fNStripC*96]),"Plate1");
175 b->Add(new AliTOFCalPlateA(&fCh[(fNStripC+fNStripB)*fNpadZ*fNpadX]),"Plate2");
176 b->Add(new AliTOFCalPlateB(&fCh[(fNStripC+2*fNStripB)*fNpadZ*fNpadX]),"Plate3");
177 b->Add(new AliTOFCalPlateC(&fCh[2*(fNStripC+fNStripB)*fNpadZ*fNpadX]),"Plate4");
178}
179