]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSCorrMap2DSDD.cxx
Standard cuts for (di-)muon analysis (Diego)
[u/mrichter/AliRoot.git] / ITS / AliITSCorrMap2DSDD.cxx
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
16 /* $Id$ */\r
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
27 #include "AliITSCorrMapSDD.h"\r
28 #include "AliITSCorrMap2DSDD.h"\r
29 #include "AliLog.h"\r
30 \r
31 ClassImp(AliITSCorrMap2DSDD)\r
32 //______________________________________________________________________\r
33 AliITSCorrMap2DSDD::AliITSCorrMap2DSDD():\r
34 AliITSCorrMapSDD()\r
35 {\r
36   // default constructor\r
37   ResetMap();\r
38 }\r
39 //______________________________________________________________________\r
40 AliITSCorrMap2DSDD::AliITSCorrMap2DSDD(Char_t *mapname):\r
41 AliITSCorrMapSDD(mapname)\r
42 {\r
43   // standard constructor\r
44   ResetMap();\r
45 }\r
46 //______________________________________________________________________\r
47 AliITSCorrMap2DSDD::AliITSCorrMap2DSDD(Char_t *mapname, Int_t nbinsan, Int_t nbinsdr):\r
48 AliITSCorrMapSDD(mapname)\r
49 {\r
50   // standard constructor\r
51   ResetMap();\r
52   SetNBinsAnode(nbinsan);\r
53   SetNBinsDrift(nbinsdr);\r
54 }\r
55 //______________________________________________________________________\r
56 void AliITSCorrMap2DSDD::ResetMap(){\r
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
60       fCorrMap[iAn][iDr]=0;\r
61     }\r
62   }\r
63 }\r
64 \r
65 //______________________________________________________________________\r
66 void AliITSCorrMap2DSDD::Set2DMap(TH2F* hmap){\r
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