]>
Commit | Line | Data |
---|---|---|
07627591 | 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 | /////////////////////////////////////////////////////////////////////////////// | |
18 | // // | |
19 | // Calibration base class for a single ROC // | |
20 | // Contains one float value per pad // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | #include "AliTPCCalROC.h" | |
25 | #include "TMath.h" | |
26 | ||
27 | ClassImp(AliTPCCalROC) | |
28 | Int_t AliTPCCalROC::fgNSectorsAll =0; | |
29 | Int_t AliTPCCalROC::fgNSectors[2]={0,0}; | |
30 | Int_t AliTPCCalROC::fgNRows[2]={0,0}; | |
31 | Int_t *AliTPCCalROC::fgNPads[2]={0,0}; | |
32 | Int_t *AliTPCCalROC::fgRowPosIndex[2] ={0,0}; | |
33 | Int_t AliTPCCalROC::fgNChannels[2]={0,0}; | |
34 | ||
35 | void AliTPCCalROC::Init(){ | |
36 | // | |
37 | // initialize static variables | |
38 | // | |
39 | if (AliTPCCalROC::fgNSectorsAll>0) return; | |
40 | fgNSectorsAll =72; | |
41 | fgNSectors[0] =36; | |
42 | fgNSectors[1] =36; | |
43 | // | |
44 | fgNRows[0]= 63; | |
45 | fgNRows[1]= 96; | |
46 | // | |
47 | // number of pads in padrow | |
48 | fgNPads[0] = new Int_t[fgNRows[0]]; | |
49 | fgNPads[1] = new Int_t[fgNRows[1]]; | |
50 | // | |
51 | // padrow index in array | |
52 | // | |
53 | fgRowPosIndex[0] = new Int_t[fgNRows[0]]; | |
54 | fgRowPosIndex[1] = new Int_t[fgNRows[1]]; | |
55 | // | |
56 | // inner sectors | |
57 | // | |
58 | Int_t index =0; | |
59 | for (Int_t irow=0; irow<fgNRows[0];irow++){ | |
60 | Int_t npads = (irow==0) ? 68 : 2 *Int_t(Double_t(irow)/3. +33.67); | |
61 | fgNPads[0][irow] = npads; | |
62 | fgRowPosIndex[0][irow] = index; | |
63 | index+=npads; | |
64 | } | |
65 | fgNChannels[0] = index; | |
66 | // | |
67 | index =0; | |
68 | Double_t k1 = 10.*TMath::Tan(10*TMath::DegToRad())/6.; | |
69 | Double_t k2 = 15.*TMath::Tan(10*TMath::DegToRad())/6.; | |
70 | for (Int_t irow=0; irow<fgNRows[1];irow++){ | |
71 | Int_t npads = (irow<64) ? | |
72 | 2*Int_t(k1*Double_t(irow)+37.75): | |
73 | 2*Int_t(k2*Double_t(irow-64)+56.66); | |
74 | fgNPads[1][irow] = npads; | |
75 | fgRowPosIndex[1][irow] = index; | |
76 | index+=npads; | |
77 | } | |
78 | fgNChannels[1] = index; | |
79 | } | |
80 | ||
81 | ||
82 | //_____________________________________________________________________________ | |
83 | AliTPCCalROC::AliTPCCalROC():TObject() | |
84 | { | |
85 | // | |
86 | // Default constructor | |
87 | // | |
88 | fSector = -1; | |
89 | fIndex = 0; | |
90 | fData = 0; | |
91 | } | |
92 | ||
93 | //_____________________________________________________________________________ | |
94 | AliTPCCalROC::AliTPCCalROC(Int_t sector):TObject() | |
95 | { | |
96 | // | |
97 | // Constructor that initializes a given sector | |
98 | // | |
99 | Init(); | |
100 | fSector = sector; | |
101 | fIndex = (sector<fgNSectors[0]) ? 0:1; | |
102 | fData = new Float_t[fgNChannels[fIndex]]; | |
103 | } | |
104 | ||
105 | //_____________________________________________________________________________ | |
106 | AliTPCCalROC::AliTPCCalROC(const AliTPCCalROC &c):TObject(c) | |
107 | { | |
108 | // | |
109 | // AliTPCCalROC copy constructor | |
110 | // | |
111 | fSector = c.fSector; | |
112 | fIndex = c.fIndex; | |
113 | Int_t nchannels = fgNChannels[fIndex]; | |
114 | fData = new Float_t[nchannels]; | |
115 | for (Int_t idata = 0; idata< nchannels; idata++) fData[idata] = c.fData[idata]; | |
116 | } | |
117 | ||
118 | //_____________________________________________________________________________ | |
119 | AliTPCCalROC::~AliTPCCalROC() | |
120 | { | |
121 | // | |
122 | // AliTPCCalROC destructor | |
123 | // | |
124 | ||
125 | if (fData) { | |
126 | delete [] fData; | |
127 | fData = 0; | |
128 | } | |
129 | } | |
130 |