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