updates to handle new V5 geometry & some re-arrangements
[u/mrichter/AliRoot.git] / TOF / AliTOFCalPadZ.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.2  2006/02/13 17:22:26  arcelli
19 just Fixing Log info
20
21 Revision 1.1  2006/02/13 16:10:48  arcelli
22 Add classes for TOF Calibration (C.Zampolli)
23
24 author: Chiara Zampolli, zampolli@bo.infn.it
25 */  
26
27 ///////////////////////////////////////////////////////////////////////////////
28 //                                                                           //
29 // class for TOF calibration : PadZ                                          //
30 //                                                                           //
31 ///////////////////////////////////////////////////////////////////////////////
32
33 #include "TObject.h"
34 #include "TROOT.h"
35 #include "TBrowser.h"
36 #include "TClass.h"
37 #include "AliLog.h"
38 #include "AliTOFGeometryV5.h"
39 #include "AliTOFChannel.h"
40 #include "AliTOFCalPadZ.h"
41
42 ClassImp(AliTOFCalPadZ)
43
44 //________________________________________________________________
45
46 AliTOFCalPadZ::AliTOFCalPadZ(){
47   fCh = 0;
48   fNpadX=0;
49 }
50 //________________________________________________________________
51
52 AliTOFCalPadZ::AliTOFCalPadZ(AliTOFChannel *ch):
53   fCh(ch)
54 {  
55   fNpadX = 0;
56 }
57 //________________________________________________________________
58
59 AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom){
60   fCh = 0;
61   fGeom = geom;
62   fNpadX = fGeom->NpadX();
63 }
64 //________________________________________________________________
65
66 AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom,AliTOFChannel *ch):
67   fCh(ch)
68 {  
69   fGeom = geom;
70   fNpadX = fGeom->NpadX();
71 }
72 //________________________________________________________________
73
74 AliTOFCalPadZ::~AliTOFCalPadZ()
75   {
76     delete[] fCh;
77   }
78 //________________________________________________________________
79
80 void AliTOFCalPadZ::Browse(TBrowser *b)
81 {
82   if(fGeom==0x0){
83     AliInfo("V5 TOF Geometry is taken as the default");
84     AliTOFGeometry *geom = new AliTOFGeometryV5();
85     fNpadX = geom->NpadX();
86     delete geom;
87   }
88   char name[10];
89   for(Int_t i=0; i<fNpadX; ++i) {
90     snprintf(name,sizeof(name),"PadX %2.2d",i);
91     b->Add(new AliTOFChannel(fCh[i]),name);
92   }
93 }