]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFCalSector.cxx
minor changes to improve serializability
[u/mrichter/AliRoot.git] / TOF / AliTOFCalSector.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 /*
17 $Log$
18 Revision 1.5  2006/04/16 22:29:05  hristov
19 Coding conventions (Annalisa)
20
21 Revision 1.4  2006/04/05 08:35:38  hristov
22 Coding conventions (S.Arcelli, C.Zampolli)
23
24 Revision 1.3  2006/03/28 14:58:16  arcelli
25 updates to handle new V5 geometry & some re-arrangements
26
27 Revision 1.2  2006/02/13 16:53:00  decaro
28 just Fixing Log info
29
30 Revision 1.1  2006/02/13 16:10:48  arcelli
31 Add classes for TOF Calibration (C.Zampolli)
32
33 author: Chiara Zampolli, zampolli@bo.infn.it
34 */  
35
36 ///////////////////////////////////////////////////////////////////////////////
37 //                                                                           //
38 // class for TOF calibration : Sectors                                       //
39 //                                                                           //
40 ///////////////////////////////////////////////////////////////////////////////
41
42 #include "TBrowser.h"
43 #include "TROOT.h"
44
45 #include "AliLog.h"
46
47 #include "AliTOFCalPlateA.h"
48 #include "AliTOFCalPlateB.h"
49 #include "AliTOFCalPlateC.h"
50 #include "AliTOFCalSector.h"
51 #include "AliTOFChannel.h"
52 #include "AliTOFGeometryV5.h"
53
54 extern TROOT *gROOT;
55
56 ClassImp(AliTOFCalSector)
57
58 //________________________________________________________________
59
60 AliTOFCalSector::AliTOFCalSector(){
61   //main ctor
62   fCh = 0;
63   fGeom=0x0;
64   fNPlate=0;
65   fNStripA=0;
66   fNStripB=0;
67   fNStripC=0;
68   fNpadZ=0;
69   fNpadX=0;
70   gROOT->GetListOfBrowsables()->Add(this);
71
72 }
73 //________________________________________________________________
74
75 AliTOFCalSector::AliTOFCalSector(AliTOFChannel *ch):
76   fCh(ch)
77 {
78   //ctor with channel
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
90 AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom){
91   //ctor with geom
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
105 AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom,AliTOFChannel *ch):
106   fCh(ch)
107 {
108   // ctor with channel and geom
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);
117 }
118 //________________________________________________________________
119
120 AliTOFCalSector::AliTOFCalSector(const AliTOFCalSector& sec):
121   TObject(sec)
122   {
123     //copy ctor
124     fCh = sec.fCh;
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   }
133 //________________________________________________________________
134
135 AliTOFCalSector& 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   }
149 //________________________________________________________________
150
151 AliTOFCalSector::~AliTOFCalSector()
152 {
153   //dtor
154   gROOT->GetListOfBrowsables()->Remove(this);
155   delete[] fCh;
156 }
157
158 //________________________________________________________________
159
160 void AliTOFCalSector::Browse(TBrowser *b){
161   //add cal obj to list of browsables
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   }
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