1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // TPC calibration class for parameters which saved per pad //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliTPCCalPad.h"
25 #include "AliTPCCalROC.h"
26 #include <TObjArray.h>
31 ClassImp(AliTPCCalPad)
33 //_____________________________________________________________________________
34 AliTPCCalPad::AliTPCCalPad():TNamed()
37 // AliTPCCalPad default constructor
40 for (Int_t isec = 0; isec < kNsec; isec++) {
46 //_____________________________________________________________________________
47 AliTPCCalPad::AliTPCCalPad(const Text_t *name, const Text_t *title)
51 // AliTPCCalPad constructor
53 for (Int_t isec = 0; isec < kNsec; isec++) {
54 fROC[isec] = new AliTPCCalROC(isec);
59 //_____________________________________________________________________________
60 AliTPCCalPad::AliTPCCalPad(const AliTPCCalPad &c):TNamed(c)
63 // AliTPCCalPad copy constructor
66 ((AliTPCCalPad &) c).Copy(*this);
70 //_____________________________________________________________________________
71 AliTPCCalPad::AliTPCCalPad(TObjArray * array):TNamed()
74 // AliTPCCalPad default constructor
77 for (Int_t isec = 0; isec < kNsec; isec++) {
78 fROC[isec] = (AliTPCCalROC *)array->At(isec);
84 ///_____________________________________________________________________________
85 AliTPCCalPad::~AliTPCCalPad()
88 // AliTPCCalPad destructor
91 for (Int_t isec = 0; isec < kNsec; isec++) {
100 //_____________________________________________________________________________
101 AliTPCCalPad &AliTPCCalPad::operator=(const AliTPCCalPad &c)
104 // Assignment operator
107 if (this != &c) ((AliTPCCalPad &) c).Copy(*this);
112 //_____________________________________________________________________________
113 void AliTPCCalPad::Copy(TObject &c) const
119 for (Int_t isec = 0; isec < kNsec; isec++) {
121 fROC[isec]->Copy(*((AliTPCCalPad &) c).fROC[isec]);
127 TGraph * AliTPCCalPad::MakeGraph(Int_t type, Float_t ratio){
133 for (Int_t i=0;i<72;i++) if (fROC[i]) npoints++;
134 TGraph * graph = new TGraph(npoints);
136 for (Int_t isec=0;isec<72;isec++){
137 if (!fROC[isec]) continue;
138 if (type==0) graph->SetPoint(npoints,isec,fROC[isec]->GetMean());
139 if (type==1) graph->SetPoint(npoints,isec,fROC[isec]->GetMedian());
140 if (type==2) graph->SetPoint(npoints,isec,fROC[isec]->GetLTM(0,ratio));
144 graph->GetXaxis()->SetTitle("Sector");
146 graph->GetYaxis()->SetTitle("Mean");
147 graph->SetMarkerStyle(22);
150 graph->GetYaxis()->SetTitle("Median");
151 graph->SetMarkerStyle(22);
154 graph->GetYaxis()->SetTitle(Form("Mean%f",ratio));
155 graph->SetMarkerStyle(24);
161 TH2F *AliTPCCalPad::MakeHisto2D(Int_t side){
164 // side - specify the side A = 0 C = 1
165 // type - used types of determination of boundaries in z
166 Float_t kEpsilon = 0.000000000001;
167 TH2F * his = new TH2F(GetName(), GetName(), 250,-250,250,250,-250,250);
168 AliTPCROC * roc = AliTPCROC::Instance();
169 for (Int_t isec=0; isec<72; isec++){
170 if (side==0 && isec%36>=18) continue;
171 if (side>0 && isec%36<18) continue;
173 AliTPCCalROC * calRoc = fROC[isec];
174 for (UInt_t irow=0; irow<calRoc->GetNrows(); irow++)
175 for (UInt_t ipad=0; ipad<calRoc->GetNPads(irow); ipad++)
176 if (TMath::Abs(calRoc->GetValue(irow,ipad))>kEpsilon){
178 roc->GetPositionGlobal(isec,irow,ipad,xyz);
179 Int_t binx = 1+TMath::Nint((xyz[0]+250.)*0.5);
180 Int_t biny = 1+TMath::Nint((xyz[1]+250.)*0.5);
181 Float_t value = calRoc->GetValue(irow,ipad);
182 his->SetBinContent(binx,biny,value);
186 his->SetXTitle("x (cm)");
187 his->SetYTitle("y (cm)");