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