]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFCalSector.cxx
updates to handle new V5 geometry & some re-arrangements
[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.2  2006/02/13 16:53:00  decaro
19 just Fixing Log info
20
21 Revision 1.1  2006/02/13 16:10:48  arcelli
22 Add classes for TOF Calibration (C.Zampolli)
23
24 author: Chiara Zampolli, zampolli@bo.infn.it
25 */  
26
27 ///////////////////////////////////////////////////////////////////////////////
28 //                                                                           //
29 // class for TOF calibration : Sectors                                       //
30 //                                                                           //
31 ///////////////////////////////////////////////////////////////////////////////
32
33 #include "TObject.h"
34 #include "TROOT.h"
35 #include "TBrowser.h"
36 #include "TClass.h"
37 #include "AliLog.h"
38 #include "AliTOFGeometryV5.h"
39 #include "AliTOFCalPlateA.h"
40 #include "AliTOFCalPlateB.h"
41 #include "AliTOFCalPlateC.h"
42 #include "AliTOFCalSector.h"
43 #include "AliTOFChannel.h"
44
45 extern TROOT *gROOT;
46
47 ClassImp(AliTOFCalSector)
48
49 //________________________________________________________________
50
51 AliTOFCalSector::AliTOFCalSector(){
52   fCh = 0;
53   fGeom=0x0;
54   fNPlate=0;
55   fNStripA=0;
56   fNStripB=0;
57   fNStripC=0;
58   fNpadZ=0;
59   fNpadX=0;
60   gROOT->GetListOfBrowsables()->Add(this);
61
62 }
63 //________________________________________________________________
64
65 AliTOFCalSector::AliTOFCalSector(AliTOFChannel *ch):
66   fCh(ch)
67 {
68   fGeom=0x0;
69   fNPlate=0;
70   fNStripA=0;
71   fNStripB=0;
72   fNStripC=0;
73   fNpadZ=0;
74   fNpadX=0;
75   gROOT->GetListOfBrowsables()->Add(this);
76 }
77 //________________________________________________________________
78
79 AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom){
80   fCh = 0;
81   fGeom= geom; 
82   fNPlate  = fGeom->NPlates();
83   fNStripA = fGeom->NStripA();
84   fNStripB = fGeom->NStripB();
85   fNStripC = fGeom->NStripC();
86   fNpadZ = fGeom->NpadZ();
87   fNpadX = fGeom->NpadX();
88   gROOT->GetListOfBrowsables()->Add(this);
89
90 }
91 //________________________________________________________________
92
93 AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom,AliTOFChannel *ch):
94   fCh(ch)
95 {
96   fGeom= geom; 
97   fNPlate  = fGeom->NPlates();
98   fNStripA = fGeom->NStripA();
99   fNStripB = fGeom->NStripB();
100   fNStripC = fGeom->NStripC();
101   fNpadZ = fGeom->NpadZ();
102   fNpadX = fGeom->NpadX();
103   gROOT->GetListOfBrowsables()->Add(this);
104 }
105 //________________________________________________________________
106
107 AliTOFCalSector::AliTOFCalSector(const AliTOFCalSector& sec):
108   TObject(sec)
109   {
110     fCh = sec.fCh;
111     fNPlate = sec.fNPlate;
112     fNStripA = sec.fNStripA;
113     fNStripB = sec.fNStripB;
114     fNStripC = sec.fNStripC;
115     fNpadZ = sec.fNpadZ;
116     fNpadX = sec.fNpadX;
117     gROOT->GetListOfBrowsables()->Add(this);
118   }
119 //________________________________________________________________
120
121 AliTOFCalSector::~AliTOFCalSector()
122 {
123   gROOT->GetListOfBrowsables()->Remove(this);
124   delete[] fCh;
125 }
126
127 //________________________________________________________________
128
129 void AliTOFCalSector::Browse(TBrowser *b){
130
131   if(fGeom==0x0){
132     AliTOFGeometry *geom= new AliTOFGeometryV5(); 
133     AliInfo("V5 TOF Geometry is taken as the default");
134     fNPlate  = geom->NPlates();
135     fNStripA = geom->NStripA();
136     fNStripB = geom->NStripB();
137     fNStripC = geom->NStripC();
138     fNpadZ = geom->NpadZ();
139     fNpadX = geom->NpadX();
140     delete geom;
141   }
142   b->Add(new AliTOFCalPlateC(fCh),        "Plate0");
143   b->Add(new AliTOFCalPlateB(&fCh[fNStripC*96]),"Plate1");
144   b->Add(new AliTOFCalPlateA(&fCh[(fNStripC+fNStripB)*fNpadZ*fNpadX]),"Plate2");
145   b->Add(new AliTOFCalPlateB(&fCh[(fNStripC+2*fNStripB)*fNpadZ*fNpadX]),"Plate3");
146   b->Add(new AliTOFCalPlateC(&fCh[2*(fNStripC+fNStripB)*fNpadZ*fNpadX]),"Plate4");
147 }
148