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