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 * gTRDclusterCorrection=0;
30 AliTRDclusterCorrection::AliTRDclusterCorrection()
33 //default constructor for correction
35 for (Int_t iplane=0;iplane<6;iplane++)
36 for (Int_t itime=0;itime<30;itime++)
37 for(Int_t iangle=0;iangle<20;iangle++){
38 fCorrections[iplane][itime][iangle][0]=0;
39 fCorrections[iplane][itime][iangle][1]=0;
45 void AliTRDclusterCorrection::SetCorrection(Int_t plane,Int_t timebin, Float_t angle,
46 Float_t value, Float_t sigma)
48 Int_t iangle = int( (angle-fOffsetAngle+1.)*10.+0.5);
50 if (iangle>=20) return;
51 fCorrections[plane][timebin][iangle][0] = value;
52 fCorrections[plane][timebin][iangle][1] = sigma;
55 Float_t AliTRDclusterCorrection::GetCorrection(Int_t plane, Int_t timebin, Float_t angle)
57 Int_t iangle = int( (angle-fOffsetAngle+1.)*10.+0.5);
58 if (iangle<0) return 0.;
59 if (iangle>=20) return 0.;
60 return fCorrections[plane][timebin][iangle][0];
63 Float_t AliTRDclusterCorrection::GetSigma(Int_t plane, Int_t timebin, Float_t angle)
65 Int_t iangle = int( (angle-fOffsetAngle+1.)*10.+0.5);
66 if (iangle<0) return 1.;
67 if (iangle>=20) return 1.;
68 return fCorrections[plane][timebin][iangle][1];
72 AliTRDclusterCorrection * AliTRDclusterCorrection::GetCorrection()
74 if (gTRDclusterCorrection!=0) return gTRDclusterCorrection;
76 TFile * f = new TFile("$ALICE_ROOT/TRD/TRDcorrection.root");
79 gTRDclusterCorrection = new AliTRDclusterCorrection();
80 return gTRDclusterCorrection;
82 gTRDclusterCorrection = (AliTRDclusterCorrection*)f->Get("TRDcorrection");
83 if (gTRDclusterCorrection==0) gTRDclusterCorrection = new AliTRDclusterCorrection();
84 return gTRDclusterCorrection;