]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSCorrMap2DSDD.cxx
Fix Coverity
[u/mrichter/AliRoot.git] / ITS / AliITSCorrMap2DSDD.cxx
CommitLineData
0ec6d8a9 1/**************************************************************************\r
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *\r
3 * *\r
4 * Author: The ALICE Off-line Project. *\r
5 * Contributors are mentioned in the code where appropriate. *\r
6 * *\r
7 * Permission to use, copy, modify and distribute this software and its *\r
8 * documentation strictly for non-commercial purposes is hereby granted *\r
9 * without fee, provided that the above copyright notice appears in all *\r
10 * copies and that both the copyright notice and this permission notice *\r
11 * appear in the supporting documentation. The authors make no claims *\r
12 * about the suitability of this software for any purpose. It is *\r
13 * provided "as is" without express or implied warranty. *\r
14 **************************************************************************/\r
15\r
54af1add 16/* $Id$ */\r
0ec6d8a9 17\r
18///////////////////////////////////////////////////////////////////\r
19// //\r
20// Implementation of the base class for SDD map 2D corrections //\r
21// Origin: F.Prino, Torino, prino@to.infn.it //\r
22// //\r
23///////////////////////////////////////////////////////////////////\r
24\r
25#include "TH1F.h"\r
26#include "TH2F.h"\r
54af1add 27#include "AliITSCorrMapSDD.h"\r
28#include "AliITSCorrMap2DSDD.h"\r
f1b15b8d 29#include "AliLog.h"\r
0ec6d8a9 30\r
54af1add 31ClassImp(AliITSCorrMap2DSDD)\r
0ec6d8a9 32//______________________________________________________________________\r
54af1add 33AliITSCorrMap2DSDD::AliITSCorrMap2DSDD():\r
34AliITSCorrMapSDD()\r
0ec6d8a9 35{\r
36 // default constructor\r
37 ResetMap();\r
38}\r
39//______________________________________________________________________\r
54af1add 40AliITSCorrMap2DSDD::AliITSCorrMap2DSDD(Char_t *mapname):\r
41AliITSCorrMapSDD(mapname)\r
0ec6d8a9 42{\r
43 // standard constructor\r
44 ResetMap();\r
45}\r
46//______________________________________________________________________\r
54af1add 47AliITSCorrMap2DSDD::AliITSCorrMap2DSDD(Char_t *mapname, Int_t nbinsan, Int_t nbinsdr):\r
48AliITSCorrMapSDD(mapname)\r
0ec6d8a9 49{\r
50 // standard constructor\r
51 ResetMap();\r
52 SetNBinsAnode(nbinsan);\r
53 SetNBinsDrift(nbinsdr);\r
54}\r
55//______________________________________________________________________\r
54af1add 56void AliITSCorrMap2DSDD::ResetMap(){\r
0ec6d8a9 57 // Sets contents to zero\r
58 for(Int_t iAn=0;iAn<kMaxNAnodePts; iAn++){\r
59 for(Int_t iDr=0;iDr<kMaxNDriftPts; iDr++){\r
54af1add 60 fCorrMap[iAn][iDr]=0;\r
0ec6d8a9 61 }\r
62 }\r
63}\r
64\r
65//______________________________________________________________________\r
54af1add 66void AliITSCorrMap2DSDD::Set2DMap(TH2F* hmap){\r
0ec6d8a9 67 // Fill map staring from 2D histo \r
68 // with anodes on x axis and drift dist. on y axis\r
69 if(hmap->GetNbinsX()!=fNAnodePts || hmap->GetNbinsY()!=fNDriftPts){ \r
70 AliError(Form("N. of histo bins (%dX%d) not matching N. of map cells (%dX%d)\n",hmap->GetNbinsX(),hmap->GetNbinsY(),fNAnodePts,fNDriftPts));\r
71 return;\r
72 }\r
73 for(Int_t iAn=0;iAn<fNAnodePts; iAn++){\r
74 for(Int_t iDr=0;iDr<fNDriftPts; iDr++){\r
75 SetCellContent(iAn,iDr,hmap->GetBinContent(iAn+1,iDr+1));\r
76 }\r
77 }\r
78}\r