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