]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFCalPlateC.cxx
Coding conventions (Annalisa)
[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.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:57:56  arcelli
25 updates to handle new V5 geometry & some re-arrangements
26
27 Revision 1.2  2006/02/13 17:22:26  arcelli
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 : PlateC                                        //
39 //                                                                           //
40 ///////////////////////////////////////////////////////////////////////////////
41
42 #include "TBrowser.h"
43
44 #include "AliLog.h"
45
46 #include "AliTOFCalPlateC.h"
47 #include "AliTOFCalStrip.h"
48 #include "AliTOFChannel.h"
49 #include "AliTOFGeometryV5.h"
50
51 ClassImp(AliTOFCalPlateC)
52
53 //________________________________________________________________
54
55 AliTOFCalPlateC::AliTOFCalPlateC(){
56   //main ctor
57   fCh = 0;
58   fGeom= 0x0; 
59   fNStripC = 0;
60   fNpadZ = 0;
61   fNpadX = 0;
62 }
63 //________________________________________________________________
64
65 AliTOFCalPlateC::AliTOFCalPlateC(AliTOFChannel *ch) : fCh(ch)
66 {
67   //ctor with channel
68   fGeom= 0x0; 
69   fNStripC = 0;
70   fNpadZ = 0;
71   fNpadX = 0;
72 }
73 //________________________________________________________________
74
75 AliTOFCalPlateC::AliTOFCalPlateC(AliTOFGeometry *geom){
76   //ctor with geom
77   fCh = 0;
78   fGeom = geom;  
79   fNStripC = fGeom->NStripC();
80   fNpadZ = fGeom->NpadZ();
81   fNpadX = fGeom->NpadX();
82 }
83 //________________________________________________________________
84
85 AliTOFCalPlateC::AliTOFCalPlateC(AliTOFGeometry *geom, AliTOFChannel *ch): fCh(ch)
86 {
87   //ctor with channel and geom
88   fGeom = geom;  
89   fNStripC = fGeom->NStripC();
90   fNpadZ = fGeom->NpadZ();
91   fNpadX = fGeom->NpadX();
92 }
93
94 //________________________________________________________________
95
96 AliTOFCalPlateC& AliTOFCalPlateC::operator=(const AliTOFCalPlateC& pl)
97   {
98   //assignment operator
99     this->fCh = pl.fCh;
100     this->fNStripC = pl.fNStripC;
101     this->fNpadZ = pl.fNpadZ;
102     this->fNpadX = pl.fNpadX;
103     this->fGeom = pl.fGeom;
104     return *this;
105
106   }
107 //________________________________________________________________
108
109 AliTOFCalPlateC::~AliTOFCalPlateC()
110 {
111   //dtor
112   delete[] fCh;
113 }
114
115 //________________________________________________________________
116
117 AliTOFCalPlateC::AliTOFCalPlateC(const AliTOFCalPlateC& pl):
118   TObject(pl)
119   {
120   //copy ctor 
121     fCh = pl.fCh;
122     fNStripC = pl.fNStripC;
123     fNpadZ = pl.fNpadZ;
124     fNpadX = pl.fNpadX;
125     fGeom = pl.fGeom;
126
127   }
128 //________________________________________________________________
129
130 void AliTOFCalPlateC::Browse(TBrowser *b){
131   //add cal obj to list of browsables
132
133   if(fGeom==0x0){
134     AliTOFGeometry *geom = new AliTOFGeometryV5(); 
135     AliInfo("V5 TOF Geometry is taken as the default");
136     fNStripC = geom->NStripC();
137     fNpadZ = geom->NpadZ();
138     fNpadX = geom->NpadX();
139     delete geom;
140   }
141   char name[10];
142   for(Int_t i=0; i<fNStripC; ++i) {
143     snprintf(name,sizeof(name),"Strip %2.2d",i);
144     b->Add(new AliTOFCalStrip(&fCh[i*fNpadZ*fNpadX]),name);
145   }
146 }