]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSCorrMapSDD.h
bug fix
[u/mrichter/AliRoot.git] / ITS / AliITSCorrMapSDD.h
1 #ifndef ALIITSCORRMAPSDD_H
2 #define ALIITSCORRMAPSDD_H
3 /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ///////////////////////////////////////////////////////////////////
9 //                                                               //
10 // Mother class for SDD maps used to correct for                 //
11 // voltage divider shape and doping fluctuations                 //
12 // Origin: F.Prino, Torino, prino@to.infn.it                     //
13 //                                                               //
14 ///////////////////////////////////////////////////////////////////
15
16 #include "AliITSsegmentationSDD.h"
17 #include<TNamed.h>
18 #include "AliLog.h"
19 class TH1F;
20 class TH2F;
21
22 class AliITSCorrMapSDD : public TNamed {
23
24  public:
25   AliITSCorrMapSDD();
26   AliITSCorrMapSDD(Char_t *mapname);
27   virtual ~AliITSCorrMapSDD(){};
28
29   Int_t GetNBinsAnode() const {return fNAnodePts;}
30   Int_t GetNBinsDrift() const {return fNDriftPts;}
31   void SetNBinsAnode(Int_t nbins) {
32     if(nbins<=kMaxNAnodePts) fNAnodePts=nbins;
33     else AliError(Form("Max. number of anode bins = %d",kMaxNAnodePts));
34   }
35   void SetNBinsDrift(Int_t nbins) {
36     if(nbins<=kMaxNDriftPts) fNDriftPts=nbins;
37     else AliError(Form("Max. number of drift bins = %d",kMaxNDriftPts));
38   }
39
40   Bool_t CheckAnodeBounds(Int_t iAn) const {
41     if(iAn<0 || iAn>=fNAnodePts)return kFALSE;
42     else return kTRUE;
43   }
44   Bool_t CheckDriftBounds(Int_t iTb) const {
45     if(iTb<0 || iTb >= fNDriftPts)return kFALSE;
46     else return kTRUE;
47   }
48
49   virtual void Set1DMap(TH1F* /*hmap*/){
50     AliError("Not implemented");
51   }
52   virtual void Set2DMap(TH2F* /*hmap*/){
53     AliError("Not implemented");
54   }
55
56   virtual void ResetMap(){
57     AliError("Not implemented");
58   }
59   virtual void SetCellContent(Int_t /*iAn*/, Int_t /*iTb*/, Float_t /*devMicron*/){
60     AliError("Not implemented");
61   }
62   virtual Float_t GetCellContent(Int_t /*iAn*/, Int_t /*iTb*/) const {
63     AliError("Not implemented");
64     return -99999.;
65   }
66
67   void    ComputeGridPoints(Float_t z, Float_t x, AliITSsegmentationSDD *seg, Bool_t isReco=kTRUE);
68   Float_t GetCorrection(Float_t z, Float_t x, AliITSsegmentationSDD *seg);
69   Float_t GetShiftForSimulation(Float_t z, Float_t x, AliITSsegmentationSDD *seg);
70   TH2F* GetMapHisto() const;
71   TH1F* GetMapProfile() const;
72   TH1F* GetResidualDistr(Float_t dmin=-300., Float_t dmax=300.) const;
73
74
75  protected:
76
77   enum {kMaxNAnodePts=256};// max number of map points along anodes
78   enum {kMaxNDriftPts=291};// max number of map points along drift
79
80   static const Int_t fgkNAnodePtsDefault; // default value for fNAnodePts
81   static const Int_t fgkNDriftPtsDefault; // default value for fNDriftPts
82   Int_t fNAnodePts; // number of map points along anodes
83   Int_t fNDriftPts; // number of map points along anodes
84
85   Float_t fXt1;   // true coordinate in lower grid point
86   Float_t fXt2;   // true coordinate in upper grid point
87   Float_t fXm1;   // measured coordinate in lower grid point
88   Float_t fXm2;   // measured coordinate in upper grid point
89   Float_t fDrLen; // drift length
90
91   ClassDef(AliITSCorrMapSDD,2);
92 };
93 #endif