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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // TRD clusterCorrection //
19 // marian.ivanov@cern.ch //
21 ///////////////////////////////////////////////////////////////////////////////
23 #include "AliTRDclusterCorrection.h"
26 ClassImp(AliTRDclusterCorrection)
28 AliTRDclusterCorrection * gAliTRDclusterCorrection=0;
30 //_____________________________________________________________________________
31 AliTRDclusterCorrection::AliTRDclusterCorrection()
34 //default constructor for correction
37 for (Int_t iplane=0;iplane<6;iplane++) {
38 for (Int_t itime=0;itime<30;itime++) {
39 for(Int_t iangle=0;iangle<20;iangle++){
40 fCorrections[iplane][itime][iangle][0]=0;
41 fCorrections[iplane][itime][iangle][1]=0;
50 //_____________________________________________________________________________
51 void AliTRDclusterCorrection::SetCorrection(Int_t plane,Int_t timebin, Float_t angle,
52 Float_t value, Float_t sigma)
55 // Set the correction factors
58 Int_t iangle = int( (angle-fOffsetAngle+1.)*10.+0.5);
60 if (iangle>=20) return;
61 fCorrections[plane][timebin][iangle][0] = value;
62 fCorrections[plane][timebin][iangle][1] = sigma;
66 //_____________________________________________________________________________
67 Float_t AliTRDclusterCorrection::GetCorrection(Int_t plane, Int_t timebin, Float_t angle) const
70 // Get the correction factors
73 Int_t iangle = int( (angle-fOffsetAngle+1.)*10.+0.5);
74 if (iangle<0) return 0.;
75 if (iangle>=20) return 0.;
76 return fCorrections[plane][timebin][iangle][0];
80 //_____________________________________________________________________________
81 Float_t AliTRDclusterCorrection::GetSigma(Int_t plane, Int_t timebin, Float_t angle) const
87 Int_t iangle = int( (angle-fOffsetAngle+1.)*10.+0.5);
88 if (iangle<0) return 1.;
89 if (iangle>=20) return 1.;
90 return fCorrections[plane][timebin][iangle][1];
94 //_____________________________________________________________________________
95 AliTRDclusterCorrection * AliTRDclusterCorrection::GetCorrection()
98 // Return an instance of AliTRDclusterCorrection
101 if (gAliTRDclusterCorrection!=0) return gAliTRDclusterCorrection;
103 TFile * f = new TFile("$ALICE_ROOT/TRD/TRDcorrection.root");
106 gAliTRDclusterCorrection = new AliTRDclusterCorrection();
107 return gAliTRDclusterCorrection;
109 gAliTRDclusterCorrection = (AliTRDclusterCorrection*) f->Get("TRDcorrection");
110 if (gAliTRDclusterCorrection==0)
111 gAliTRDclusterCorrection = new AliTRDclusterCorrection();
113 return gAliTRDclusterCorrection;