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 //
20 // Marian Ivanov (marian.ivanov@cern.ch) //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliTRDclusterCorrection.h"
27 ClassImp(AliTRDclusterCorrection)
29 //_____________________________________________________________________________
30 AliTRDclusterCorrection::AliTRDclusterCorrection()
35 // Default constructor for AliTRDclusterCorrection
38 for (Int_t iplane = 0; iplane < 6; iplane++) {
39 for (Int_t itime = 0; itime < 30; itime++) {
40 for (Int_t iangle = 0; iangle < 20; iangle++) {
41 fCorrections[iplane][itime][iangle][0] = 0.0;
42 fCorrections[iplane][itime][iangle][1] = 0.0;
49 //_____________________________________________________________________________
50 AliTRDclusterCorrection::~AliTRDclusterCorrection()
58 //_____________________________________________________________________________
59 void AliTRDclusterCorrection::SetCorrection(Int_t plane,Int_t timebin, Float_t angle
60 , Float_t value, Float_t sigma)
63 // Set the correction factors
66 Int_t iangle = Int_t((angle - fOffsetAngle + 1.0) * 10.0 + 0.5);
67 if (iangle < 0) return;
68 if (iangle >= 20) return;
69 fCorrections[plane][timebin][iangle][0] = value;
70 fCorrections[plane][timebin][iangle][1] = sigma;
74 //_____________________________________________________________________________
75 Float_t AliTRDclusterCorrection::GetCorrection(Int_t plane, Int_t timebin, Float_t angle) const
78 // Get the correction factors
81 Int_t iangle = Int_t((angle - fOffsetAngle + 1.0) * 10.0 + 0.5);
82 if (iangle < 0) return 0.0;
83 if (iangle >= 20) return 0.0;
85 return fCorrections[plane][timebin][iangle][0];
89 //_____________________________________________________________________________
90 Float_t AliTRDclusterCorrection::GetSigma(Int_t plane, Int_t timebin, Float_t angle) const
96 Int_t iangle = Int_t((angle - fOffsetAngle + 1.0) * 10.0 + 0.5);
97 if (iangle < 0) return 1.0;
98 if (iangle >= 20) return 1.0;
100 return fCorrections[plane][timebin][iangle][1];
104 //_____________________________________________________________________________
105 AliTRDclusterCorrection *AliTRDclusterCorrection::GetCorrection()
108 // Return an instance of AliTRDclusterCorrection and sets the global
109 // pointer gAliTRDclusterCorrection (Is this needed somewhere ????)
112 AliTRDclusterCorrection *clusterCorrection = 0x0;
114 TFile *fileIn = new TFile("$ALICE_ROOT/TRD/TRDcorrection.root");
116 clusterCorrection = new AliTRDclusterCorrection();
117 return clusterCorrection;
120 clusterCorrection = (AliTRDclusterCorrection *)
121 fileIn->Get("TRDcorrection");
122 if (clusterCorrection == 0) {
123 clusterCorrection = new AliTRDclusterCorrection();
126 return clusterCorrection;