]>
Commit | Line | Data |
---|---|---|
6dc9348d | 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 | ||
762446e0 | 16 | /* |
17 | $Log$ | |
0e46b9ae | 18 | Revision 1.5 2006/04/16 22:29:05 hristov |
19 | Coding conventions (Annalisa) | |
20 | ||
7aeeaf38 | 21 | Revision 1.4 2006/04/05 08:35:38 hristov |
22 | Coding conventions (S.Arcelli, C.Zampolli) | |
23 | ||
340693af | 24 | Revision 1.3 2006/03/28 14:56:48 arcelli |
25 | updates to handle new V5 geometry & some re-arrangements | |
26 | ||
d4ad0d6b | 27 | Revision 1.2 2006/02/13 17:22:26 arcelli |
28 | just Fixing Log info | |
29 | ||
762446e0 | 30 | Revision 1.1 2006/02/13 16:10:48 arcelli |
31 | Add classes for TOF Calibration (C.Zampolli) | |
32 | ||
6dc9348d | 33 | author: Chiara Zampolli, zampolli@bo.infn.it |
762446e0 | 34 | */ |
6dc9348d | 35 | |
36 | /////////////////////////////////////////////////////////////////////////////// | |
37 | // // | |
38 | // class for TOF calibration : array of AliTOFChannels // | |
39 | // // | |
40 | /////////////////////////////////////////////////////////////////////////////// | |
41 | ||
6dc9348d | 42 | #include "TBrowser.h" |
0e46b9ae | 43 | #include "TROOT.h" |
44 | ||
d4ad0d6b | 45 | #include "AliLog.h" |
0e46b9ae | 46 | |
6dc9348d | 47 | #include "AliTOFCalSector.h" |
48 | #include "AliTOFCal.h" | |
0e46b9ae | 49 | #include "AliTOFGeometryV5.h" |
6dc9348d | 50 | |
51 | extern TROOT *gROOT; | |
52 | ||
53 | ClassImp(AliTOFCal) | |
54 | ||
55 | //________________________________________________________________ | |
56 | ||
57 | AliTOFCal::AliTOFCal():TObject(){ | |
340693af | 58 | //main ctor |
d4ad0d6b | 59 | fGeom = 0x0; |
60 | fNSector = 0; | |
61 | fNPlate = 0; | |
62 | fNStripA = 0; | |
63 | fNStripB = 0; | |
64 | fNStripC = 0; | |
65 | fNpadZ = 0; | |
66 | fNpadX = 0; | |
6dc9348d | 67 | fnpad = 0; |
68 | fPads = 0x0; | |
69 | gROOT->GetListOfBrowsables()->Add(this); | |
d4ad0d6b | 70 | } |
71 | //________________________________________________________________ | |
72 | ||
73 | AliTOFCal::AliTOFCal(AliTOFGeometry *geom):TObject(){ | |
340693af | 74 | //ctor with geom |
d4ad0d6b | 75 | fGeom = geom; |
76 | fNSector = fGeom->NSectors(); | |
77 | fNPlate = fGeom->NPlates(); | |
78 | fNStripA = fGeom->NStripA(); | |
79 | fNStripB = fGeom->NStripB(); | |
80 | fNStripC = fGeom->NStripC(); | |
81 | fNpadZ = fGeom->NpadZ(); | |
82 | fNpadX = fGeom->NpadX(); | |
83 | fnpad = fNSector*(2*(fNStripC+fNStripB)+fNStripA)*fNpadZ*fNpadX; | |
84 | fPads = 0x0; | |
85 | gROOT->GetListOfBrowsables()->Add(this); | |
6dc9348d | 86 | } |
87 | //________________________________________________________________ | |
88 | ||
89 | AliTOFCal::AliTOFCal(const AliTOFCal& cal): | |
90 | TObject(cal) | |
91 | { | |
340693af | 92 | //copy ctor |
6dc9348d | 93 | fNSector = cal.fNSector; |
94 | fNPlate = cal.fNPlate; | |
95 | fNStripA = cal.fNStripA; | |
96 | fNStripB = cal.fNStripB; | |
97 | fNStripC = cal.fNStripC; | |
98 | fNpadZ = cal.fNpadZ; | |
99 | fNpadX = cal.fNpadX; | |
100 | fnpad = cal.fnpad; | |
101 | for (Int_t i = 0; i<fnpad; i++){ | |
102 | fPads[i]=cal.fPads[i]; | |
103 | } | |
104 | gROOT->GetListOfBrowsables()->Add(this); | |
105 | } | |
106 | //____________________________________________________________________________ | |
7aeeaf38 | 107 | AliTOFCal& AliTOFCal::operator=(const AliTOFCal& cal) |
108 | { | |
109 | //assignment operator | |
110 | this->fNSector = cal.fNSector; | |
111 | this->fNPlate = cal.fNPlate; | |
112 | this->fNStripA = cal.fNStripA; | |
113 | this->fNStripB = cal.fNStripB; | |
114 | this->fNStripC = cal.fNStripC; | |
115 | this->fNpadZ = cal.fNpadZ; | |
116 | this->fNpadX = cal.fNpadX; | |
117 | this->fnpad = cal.fnpad; | |
118 | for (Int_t i = 0; i<fnpad; i++){ | |
119 | this->fPads[i]=cal.fPads[i]; | |
120 | } | |
121 | return *this; | |
122 | ||
123 | } | |
124 | //____________________________________________________________________________ | |
6dc9348d | 125 | AliTOFCal::~AliTOFCal() |
126 | { | |
340693af | 127 | //dtor |
d4ad0d6b | 128 | gROOT->GetListOfBrowsables()->Remove(this); |
6dc9348d | 129 | delete [] fPads; |
130 | } | |
131 | //________________________________________________________________ | |
132 | ||
133 | void AliTOFCal::Browse(TBrowser *b) | |
134 | { | |
340693af | 135 | //add cal obj to list of browsables |
6dc9348d | 136 | char name[10]; |
137 | for(Int_t i=0; i<fNSector; ++i) { | |
138 | snprintf(name,sizeof(name),"Sector %2.2d",i); | |
139 | b->Add(new AliTOFCalSector(&fPads[i*fnpad/fNSector]),name); | |
140 | } | |
141 | } | |
142 | //________________________________________________________________ | |
143 | ||
144 | void AliTOFCal::CreateArray(){ | |
340693af | 145 | //create cal channel array |
d4ad0d6b | 146 | if(fGeom==0x0){ |
147 | AliInfo("V5 TOF Geometry is taken as a default"); | |
148 | AliTOFGeometry *geom= new AliTOFGeometryV5(); | |
149 | fNSector = geom->NSectors(); | |
150 | fNPlate = geom->NPlates(); | |
151 | fNStripA = geom->NStripA(); | |
152 | fNStripB = geom->NStripB(); | |
153 | fNStripC = geom->NStripC(); | |
154 | fNpadZ = geom->NpadZ(); | |
155 | fNpadX = geom->NpadX(); | |
156 | fnpad = fNSector*(2*(fNStripC+fNStripB)+fNStripA)*fNpadZ*fNpadX; | |
157 | delete geom; | |
158 | } | |
6dc9348d | 159 | fPads= new AliTOFChannel[fnpad]; |
160 | } |