]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFCalSector.cxx
9771fea22e626bb07e7e9cd6a49758864157306b
[u/mrichter/AliRoot.git] / TOF / AliTOFCalSector.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:58:16  arcelli
19 updates to handle new V5 geometry & some re-arrangements
20
21 Revision 1.2  2006/02/13 16:53:00  decaro
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 : Sectors                                       //
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 "AliTOFCalPlateA.h"
43 #include "AliTOFCalPlateB.h"
44 #include "AliTOFCalPlateC.h"
45 #include "AliTOFCalSector.h"
46 #include "AliTOFChannel.h"
47
48 extern TROOT *gROOT;
49
50 ClassImp(AliTOFCalSector)
51
52 //________________________________________________________________
53
54 AliTOFCalSector::AliTOFCalSector(){
55   //main ctor
56   fCh = 0;
57   fGeom=0x0;
58   fNPlate=0;
59   fNStripA=0;
60   fNStripB=0;
61   fNStripC=0;
62   fNpadZ=0;
63   fNpadX=0;
64   gROOT->GetListOfBrowsables()->Add(this);
65
66 }
67 //________________________________________________________________
68
69 AliTOFCalSector::AliTOFCalSector(AliTOFChannel *ch):
70   fCh(ch)
71 {
72   //ctor with channel
73   fGeom=0x0;
74   fNPlate=0;
75   fNStripA=0;
76   fNStripB=0;
77   fNStripC=0;
78   fNpadZ=0;
79   fNpadX=0;
80   gROOT->GetListOfBrowsables()->Add(this);
81 }
82 //________________________________________________________________
83
84 AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom){
85   //ctor with geom
86   fCh = 0;
87   fGeom= geom; 
88   fNPlate  = fGeom->NPlates();
89   fNStripA = fGeom->NStripA();
90   fNStripB = fGeom->NStripB();
91   fNStripC = fGeom->NStripC();
92   fNpadZ = fGeom->NpadZ();
93   fNpadX = fGeom->NpadX();
94   gROOT->GetListOfBrowsables()->Add(this);
95
96 }
97 //________________________________________________________________
98
99 AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom,AliTOFChannel *ch):
100   fCh(ch)
101 {
102   // ctor with channel and geom
103   fGeom= geom; 
104   fNPlate  = fGeom->NPlates();
105   fNStripA = fGeom->NStripA();
106   fNStripB = fGeom->NStripB();
107   fNStripC = fGeom->NStripC();
108   fNpadZ = fGeom->NpadZ();
109   fNpadX = fGeom->NpadX();
110   gROOT->GetListOfBrowsables()->Add(this);
111 }
112 //________________________________________________________________
113
114 AliTOFCalSector::AliTOFCalSector(const AliTOFCalSector& sec):
115   TObject(sec)
116   {
117     //copy ctor
118     fCh = sec.fCh;
119     fNPlate = sec.fNPlate;
120     fNStripA = sec.fNStripA;
121     fNStripB = sec.fNStripB;
122     fNStripC = sec.fNStripC;
123     fNpadZ = sec.fNpadZ;
124     fNpadX = sec.fNpadX;
125     gROOT->GetListOfBrowsables()->Add(this);
126   }
127 //________________________________________________________________
128
129 AliTOFCalSector::~AliTOFCalSector()
130 {
131   //dtor
132   gROOT->GetListOfBrowsables()->Remove(this);
133   delete[] fCh;
134 }
135
136 //________________________________________________________________
137
138 void AliTOFCalSector::Browse(TBrowser *b){
139   //add cal obj to list of browsables
140   if(fGeom==0x0){
141     AliTOFGeometry *geom= new AliTOFGeometryV5(); 
142     AliInfo("V5 TOF Geometry is taken as the default");
143     fNPlate  = geom->NPlates();
144     fNStripA = geom->NStripA();
145     fNStripB = geom->NStripB();
146     fNStripC = geom->NStripC();
147     fNpadZ = geom->NpadZ();
148     fNpadX = geom->NpadX();
149     delete geom;
150   }
151   b->Add(new AliTOFCalPlateC(fCh),        "Plate0");
152   b->Add(new AliTOFCalPlateB(&fCh[fNStripC*96]),"Plate1");
153   b->Add(new AliTOFCalPlateA(&fCh[(fNStripC+fNStripB)*fNpadZ*fNpadX]),"Plate2");
154   b->Add(new AliTOFCalPlateB(&fCh[(fNStripC+2*fNStripB)*fNpadZ*fNpadX]),"Plate3");
155   b->Add(new AliTOFCalPlateC(&fCh[2*(fNStripC+fNStripB)*fNpadZ*fNpadX]),"Plate4");
156 }
157