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