]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFCalPlateC.cxx
- Adding alternate versions of methods for handling regional structures and
[u/mrichter/AliRoot.git] / TOF / AliTOFCalPlateC.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.6  2006/04/20 22:30:49  hristov
19 Coding conventions (Annalisa)
20
21 Revision 1.5  2006/04/16 22:29:05  hristov
22 Coding conventions (Annalisa)
23
24 Revision 1.4  2006/04/05 08:35:38  hristov
25 Coding conventions (S.Arcelli, C.Zampolli)
26
27 Revision 1.3  2006/03/28 14:57:56  arcelli
28 updates to handle new V5 geometry & some re-arrangements
29
30 Revision 1.2  2006/02/13 17:22:26  arcelli
31 just Fixing Log info
32
33 Revision 1.1  2006/02/13 16:10:48  arcelli
34 Add classes for TOF Calibration (C.Zampolli)
35
36 author: Chiara Zampolli, zampolli@bo.infn.it
37 */  
38
39 ///////////////////////////////////////////////////////////////////////////////
40 //                                                                           //
41 // class for TOF calibration : PlateC                                        //
42 //                                                                           //
43 ///////////////////////////////////////////////////////////////////////////////
44
45 #include "TBrowser.h"
46
47 #include "AliLog.h"
48
49 #include "AliTOFCalPlateC.h"
50 #include "AliTOFCalStrip.h"
51 #include "AliTOFChannel.h"
52 #include "AliTOFGeometryV5.h"
53
54 ClassImp(AliTOFCalPlateC)
55
56 //________________________________________________________________
57
58 AliTOFCalPlateC::AliTOFCalPlateC():
59   fNStripC(0),
60   fNpadZ(0),
61   fNpadX(0),
62   fGeom(0x0), 
63   fCh(0x0)
64 {
65   //main ctor
66 }
67 //________________________________________________________________
68
69 AliTOFCalPlateC::AliTOFCalPlateC(AliTOFChannel *ch) : 
70   fNStripC(0),
71   fNpadZ(0),
72   fNpadX(0),
73   fGeom(0x0), 
74   fCh(ch)
75 {
76   //ctor with channel
77 }
78 //________________________________________________________________
79
80 AliTOFCalPlateC::AliTOFCalPlateC(AliTOFGeometry *geom):
81   fNStripC(0),
82   fNpadZ(0),
83   fNpadX(0),
84   fGeom(geom), 
85   fCh(0x0)
86 {
87   //ctor with geom
88   fNStripC = fGeom->NStripC();
89   fNpadZ = fGeom->NpadZ();
90   fNpadX = fGeom->NpadX();
91 }
92 //________________________________________________________________
93
94 AliTOFCalPlateC::AliTOFCalPlateC(AliTOFGeometry *geom, AliTOFChannel *ch): 
95   fNStripC(0),
96   fNpadZ(0),
97   fNpadX(0),
98   fGeom(geom), 
99   fCh(ch)
100 {
101   //ctor with channel and geom
102   fNStripC = fGeom->NStripC();
103   fNpadZ = fGeom->NpadZ();
104   fNpadX = fGeom->NpadX();
105 }
106
107 //________________________________________________________________
108
109 AliTOFCalPlateC& AliTOFCalPlateC::operator=(const AliTOFCalPlateC& pl)
110   {
111   //assignment operator
112     this->fCh = pl.fCh;
113     this->fNStripC = pl.fNStripC;
114     this->fNpadZ = pl.fNpadZ;
115     this->fNpadX = pl.fNpadX;
116     this->fGeom = pl.fGeom;
117     return *this;
118
119   }
120 //________________________________________________________________
121
122 AliTOFCalPlateC::~AliTOFCalPlateC()
123 {
124   //dtor
125   delete[] fCh;
126 }
127
128 //________________________________________________________________
129
130 AliTOFCalPlateC::AliTOFCalPlateC(const AliTOFCalPlateC& pl):
131   TObject(pl),
132   fNStripC(0),
133   fNpadZ(0),
134   fNpadX(0),
135   fGeom(0x0), 
136   fCh(0x0)
137   {
138   //copy ctor 
139     fCh = pl.fCh;
140     fNStripC = pl.fNStripC;
141     fNpadZ = pl.fNpadZ;
142     fNpadX = pl.fNpadX;
143     fGeom = pl.fGeom;
144
145   }
146 //________________________________________________________________
147
148 void AliTOFCalPlateC::Browse(TBrowser *b){
149   //add cal obj to list of browsables
150
151   if(fGeom==0x0){
152     AliTOFGeometry *geom = new AliTOFGeometryV5(); 
153     AliInfo("V5 TOF Geometry is taken as the default");
154     fNStripC = geom->NStripC();
155     fNpadZ = geom->NpadZ();
156     fNpadX = geom->NpadX();
157     delete geom;
158   }
159   char name[10];
160   for(Int_t i=0; i<fNStripC; ++i) {
161     snprintf(name,sizeof(name),"Strip %2.2d",i);
162     b->Add(new AliTOFCalStrip(&fCh[i*fNpadZ*fNpadX]),name);
163   }
164 }