Add classes for TOF Calibration (C.Zampolli)
[u/mrichter/AliRoot.git] / TOF / AliTOFCalStrip.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 /*$Log$
17 author: Chiara Zampolli, zampolli@bo.infn.it
18  */  
19
20 ///////////////////////////////////////////////////////////////////////////////
21 //                                                                           //
22 // class for TOF calibration : strips                                        //
23 //                                                                           //
24 ///////////////////////////////////////////////////////////////////////////////
25
26 #include "TObject.h"
27 #include "TROOT.h"
28 #include "TBrowser.h"
29 #include "TClass.h"
30 #include "AliTOFGeometryV4.h"
31 #include "AliTOFChannel.h"
32 #include "AliTOFCalStrip.h"
33 #include "AliTOFCalPadZ.h"
34
35 ClassImp(AliTOFCalStrip)
36
37 //________________________________________________________________
38
39 AliTOFCalStrip::AliTOFCalStrip(){
40   fCh = 0;
41   fNSector = AliTOFGeometryV4::NSectors();
42   fNPlate = AliTOFGeometryV4::NPlates();
43   fNStripA = AliTOFGeometryV4::NStripA();
44   fNStripB = AliTOFGeometryV4::NStripB();
45   fNStripC = 20;
46   //  fNStripC = AliTOFGeometryV4::NStripC();
47   fNpadZ = AliTOFGeometryV4::NpadZ();
48   fNpadX = AliTOFGeometryV4::NpadX();
49 }
50 //________________________________________________________________
51
52 AliTOFCalStrip::AliTOFCalStrip(AliTOFChannel *ch):
53   fCh(ch)
54 {
55   fNSector = AliTOFGeometryV4::NSectors();
56   fNPlate = AliTOFGeometryV4::NPlates();
57   fNStripA = AliTOFGeometryV4::NStripA();
58   fNStripB = AliTOFGeometryV4::NStripB();
59   fNStripC = 20;
60   //  fNStripC = AliTOFGeometryV4::NStripC();
61   fNpadZ = AliTOFGeometryV4::NpadZ();
62   fNpadX = AliTOFGeometryV4::NpadX();
63
64 }
65 //________________________________________________________________
66
67 AliTOFCalStrip::~AliTOFCalStrip()
68 {
69   delete[] fCh;
70 }
71
72 //________________________________________________________________
73
74 AliTOFCalStrip::AliTOFCalStrip(const AliTOFCalStrip& strip):
75   TObject(strip)
76   {
77     fCh = strip.fCh;
78     fNSector = strip.fNSector;
79     fNPlate = strip.fNPlate;
80     fNStripA = strip.fNStripA;
81     fNStripB = strip.fNStripB;
82     fNStripC = strip.fNStripC;
83     fNpadZ = strip.fNpadZ;
84     fNpadX = strip.fNpadX;
85
86   }
87 //________________________________________________________________
88
89 void AliTOFCalStrip::Browse(TBrowser *b){
90
91   char name[10];
92   for(Int_t i=0; i<fNpadZ; ++i) {
93     snprintf(name,sizeof(name),"PadZ %2.2d",i);
94     b->Add(new AliTOFCalPadZ(&fCh[i*fNpadX]),name);
95   }
96 }