]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSCorrMapSDD.h
Fixes for coding convention violations
[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 class TH1F;
19 class TH2F;
20
21 class AliITSCorrMapSDD : public TNamed {
22
23  public:
24   // maps produced from residuals stores Xtrue-Xmeasured in drift lenght.
25   // Since the map computes xtrue-xmeas in drift coordinate
26   // and the difference is added to measured local coordinate, we have
27   // Left:  Xmeas_loc_corr = Xmeas_loc + (Xtrue-Xmeas)_loc = Xmeas_loc - (Xtrue-Xmeas)_drift
28   // Right: Xmeas_loc_corr = Xmeas_loc + (Xtrue-Xmeas)_loc = Xmeas_loc + (Xtrue-Xmeas)_drift
29   // hence, for the left side the sign of the correction need to inverted
30   enum {kLeftInvBit = BIT(14)};   
31   AliITSCorrMapSDD();
32   AliITSCorrMapSDD(Char_t *mapname);
33   virtual ~AliITSCorrMapSDD(){};
34   //
35   void   SetInversionBit(Bool_t v=kTRUE)           {SetBit(kLeftInvBit,v);}
36   Bool_t GetInversionBit()               const     {return TestBit(kLeftInvBit);}
37   //
38   Int_t GetNBinsAnode() const {return fNAnodePts;}
39   Int_t GetNBinsDrift() const {return fNDriftPts;}
40   void SetNBinsAnode(Int_t nbins) {
41     if(nbins<=kMaxNAnodePts) fNAnodePts=nbins;
42     else AliError(Form("Max. number of anode bins = %d",kMaxNAnodePts));
43   }
44   void SetNBinsDrift(Int_t nbins) {
45     if(nbins<=kMaxNDriftPts) fNDriftPts=nbins;
46     else AliError(Form("Max. number of drift bins = %d",kMaxNDriftPts));
47   }
48
49   Bool_t CheckAnodeBounds(Int_t iAn) const {
50     if(iAn<0 || iAn>=fNAnodePts)return kFALSE;
51     else return kTRUE;
52   }
53   Bool_t CheckDriftBounds(Int_t iTb) const {
54     if(iTb<0 || iTb >= fNDriftPts)return kFALSE;
55     else return kTRUE;
56   }
57
58   virtual void Set1DMap(TH1F* /*hmap*/){
59     AliError("Not implemented");
60   }
61   virtual void Set2DMap(TH2F* /*hmap*/){
62     AliError("Not implemented");
63   }
64
65   virtual void ResetMap(){
66     AliError("Not implemented");
67   }
68   virtual void SetCellContent(Int_t /*iAn*/, Int_t /*iTb*/, Float_t /*devMicron*/){
69     AliError("Not implemented");
70   }
71   virtual Float_t GetCellContent(Int_t /*iAn*/, Int_t /*iTb*/) const {
72     AliError("Not implemented");
73     return -99999.;
74   }
75
76   void    ComputeGridPoints(Float_t z, Float_t x, AliITSsegmentationSDD *seg, Bool_t isReco=kTRUE);
77   Float_t GetCorrection(Float_t z, Float_t x, AliITSsegmentationSDD *seg);
78   Float_t GetShiftForSimulation(Float_t z, Float_t x, AliITSsegmentationSDD *seg);
79   TH2F* GetMapHisto() const;
80   TH1F* GetMapProfile() const;
81   TH1F* GetResidualDistr(Float_t dmin=-300., Float_t dmax=300.) const;
82
83
84  protected:
85
86   enum {kMaxNAnodePts=256};// max number of map points along anodes
87   enum {kMaxNDriftPts=291};// max number of map points along drift
88
89   static const Int_t fgkNAnodePtsDefault; // default value for fNAnodePts
90   static const Int_t fgkNDriftPtsDefault; // default value for fNDriftPts
91   Int_t fNAnodePts; // number of map points along anodes
92   Int_t fNDriftPts; // number of map points along anodes
93
94   Float_t fXt1;   // true coordinate in lower grid point
95   Float_t fXt2;   // true coordinate in upper grid point
96   Float_t fXm1;   // measured coordinate in lower grid point
97   Float_t fXm2;   // measured coordinate in upper grid point
98   Float_t fDrLen; // drift length
99
100   ClassDef(AliITSCorrMapSDD,2);
101 };
102 #endif
103