Coverity fixed
[u/mrichter/AliRoot.git] / ITS / AliITSCorrMap1DSDD.cxx
CommitLineData
0ec6d8a9 1/**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
54af1add 16/* $Id$ */
0ec6d8a9 17
18///////////////////////////////////////////////////////////////////
19// //
20// Implementation of the base class for SDD map 2D corrections //
21// Origin: F.Prino, Torino, prino@to.infn.it //
22// //
23///////////////////////////////////////////////////////////////////
24
25#include "TH1F.h"
54af1add 26#include "AliITSCorrMapSDD.h"
27#include "AliITSCorrMap1DSDD.h"
f1b15b8d 28#include "AliLog.h"
0ec6d8a9 29
54af1add 30ClassImp(AliITSCorrMap1DSDD)
0ec6d8a9 31//______________________________________________________________________
54af1add 32AliITSCorrMap1DSDD::AliITSCorrMap1DSDD():
33AliITSCorrMapSDD()
0ec6d8a9 34{
35 // default constructor
36 ResetMap();
37 SetNBinsAnode(1);
38}
39//______________________________________________________________________
54af1add 40AliITSCorrMap1DSDD::AliITSCorrMap1DSDD(Char_t *mapname):
41AliITSCorrMapSDD(mapname)
0ec6d8a9 42{
43 // standard constructor
44 ResetMap();
45 SetNBinsAnode(1);
46}
47//______________________________________________________________________
54af1add 48AliITSCorrMap1DSDD::AliITSCorrMap1DSDD(Char_t *mapname, Int_t nbinsdr):
49AliITSCorrMapSDD(mapname)
0ec6d8a9 50{
51 ResetMap();
52 SetNBinsAnode(1);
53 SetNBinsDrift(nbinsdr);
54}
55//______________________________________________________________________
54af1add 56void AliITSCorrMap1DSDD::ResetMap(){
0ec6d8a9 57 // Sets contents to zero
58 for(Int_t iDr=0;iDr<kMaxNDriftPts; iDr++){
54af1add 59 fCorrMap[iDr]=0;
0ec6d8a9 60 }
61}
62//______________________________________________________________________
54af1add 63void AliITSCorrMap1DSDD::Set1DMap(TH1F* hmap){
0ec6d8a9 64 // Fill map staring from 1D histo of rediduals vs. x
65 if(hmap->GetNbinsX()!=fNDriftPts){
66 AliError(Form("N. of histo bins (%d) not matching N. of map cells (%d)\n",hmap->GetNbinsX(),fNDriftPts));
67 return;
68 }
69 for(Int_t iDr=0;iDr<fNDriftPts; iDr++){
70 SetCellContent(0,iDr,hmap->GetBinContent(iDr+1));
71 }
72}
73