]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSMapSDD.h
New AliITSMisAligner class. It replaces MakeITS...MisAlignment.C macros and class...
[u/mrichter/AliRoot.git] / ITS / AliITSMapSDD.h
1 #ifndef ALIITSMAPSDD_H
2 #define ALIITSMAPSDD_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 AliITSMapSDD : public TNamed {
23
24  public:
25   AliITSMapSDD();
26   AliITSMapSDD(Char_t *mapname);
27   virtual ~AliITSMapSDD(){};
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){
42       AliWarning(Form("Cell out of bounds, anode=%d",iAn));
43       return kFALSE;
44     }
45     return kTRUE;
46   }
47   Bool_t CheckDriftBounds(Int_t iTb) const {
48     if(iTb<0 || iTb >= fNDriftPts){ 
49       AliWarning(Form("Cell out of bounds, time-bin=%d",iTb));
50       return kFALSE;
51     }
52     return kTRUE;
53   }
54
55   virtual void Set1DMap(TH1F* /*hmap*/){
56     AliError("Not implemented");
57   }
58   virtual void Set2DMap(TH2F* /*hmap*/){
59     AliError("Not implemented");
60   }
61
62   virtual void ResetMap() = 0;
63   virtual void SetCellContent(Int_t iAn, Int_t iTb, Float_t devMicron) = 0;
64   virtual Float_t GetCellContent(Int_t iAn, Int_t iTb) const = 0;
65
66   Float_t GetCorrection(Float_t z, Float_t x, AliITSsegmentationSDD *seg);
67   TH2F* GetMapHisto() const;
68   TH1F* GetResidualDistr(Float_t dmin=-300., Float_t dmax=300.) const;
69
70
71  protected:
72   enum {kMaxNAnodePts=256};// max number of map points along anodes
73   enum {kMaxNDriftPts=291};// max number of map points along drift
74
75   static const Int_t fgkNAnodePtsDefault; // default value for fNAnodePts
76   static const Int_t fgkNDriftPtsDefault; // default value for fNDriftPts
77
78   Int_t fNAnodePts; // number of map points along anodes
79   Int_t fNDriftPts; // number of map points along anodes
80
81   ClassDef(AliITSMapSDD,3);
82 };
83 #endif