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