1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.5 2006/04/16 22:29:05 hristov
19 Coding conventions (Annalisa)
21 Revision 1.4 2006/04/05 08:35:38 hristov
22 Coding conventions (S.Arcelli, C.Zampolli)
24 Revision 1.3 2006/03/28 14:56:48 arcelli
25 updates to handle new V5 geometry & some re-arrangements
27 Revision 1.2 2006/02/13 17:22:26 arcelli
30 Revision 1.1 2006/02/13 16:10:48 arcelli
31 Add classes for TOF Calibration (C.Zampolli)
33 author: Chiara Zampolli, zampolli@bo.infn.it
36 ///////////////////////////////////////////////////////////////////////////////
38 // class for TOF calibration : array of AliTOFChannels //
40 ///////////////////////////////////////////////////////////////////////////////
47 #include "AliTOFCalSector.h"
48 #include "AliTOFCal.h"
49 #include "AliTOFGeometryV5.h"
55 //________________________________________________________________
57 AliTOFCal::AliTOFCal():TObject(){
69 gROOT->GetListOfBrowsables()->Add(this);
71 //________________________________________________________________
73 AliTOFCal::AliTOFCal(AliTOFGeometry *geom):TObject(){
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;
85 gROOT->GetListOfBrowsables()->Add(this);
87 //________________________________________________________________
89 AliTOFCal::AliTOFCal(const AliTOFCal& cal):
93 fNSector = cal.fNSector;
94 fNPlate = cal.fNPlate;
95 fNStripA = cal.fNStripA;
96 fNStripB = cal.fNStripB;
97 fNStripC = cal.fNStripC;
101 for (Int_t i = 0; i<fnpad; i++){
102 fPads[i]=cal.fPads[i];
104 gROOT->GetListOfBrowsables()->Add(this);
106 //____________________________________________________________________________
107 AliTOFCal& AliTOFCal::operator=(const AliTOFCal& cal)
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];
124 //____________________________________________________________________________
125 AliTOFCal::~AliTOFCal()
128 gROOT->GetListOfBrowsables()->Remove(this);
131 //________________________________________________________________
133 void AliTOFCal::Browse(TBrowser *b)
135 //add cal obj to list of browsables
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);
142 //________________________________________________________________
144 void AliTOFCal::CreateArray(){
145 //create cal channel array
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;
159 fPads= new AliTOFChannel[fnpad];