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