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