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 ///////////////////////////////////////////////////////////////////
16 #include "AliITSsegmentationSDD.h"
21 class AliITSCorrMapSDD : public TNamed {
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)};
32 AliITSCorrMapSDD(Char_t *mapname);
33 virtual ~AliITSCorrMapSDD(){};
35 void SetInversionBit(Bool_t v=kTRUE) {SetBit(kLeftInvBit,v);}
36 Bool_t GetInversionBit() const {return TestBit(kLeftInvBit);}
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));
44 void SetNBinsDrift(Int_t nbins) {
45 if(nbins<=kMaxNDriftPts) fNDriftPts=nbins;
46 else AliError(Form("Max. number of drift bins = %d",kMaxNDriftPts));
49 Bool_t CheckAnodeBounds(Int_t iAn) const {
50 if(iAn<0 || iAn>=fNAnodePts)return kFALSE;
53 Bool_t CheckDriftBounds(Int_t iTb) const {
54 if(iTb<0 || iTb >= fNDriftPts)return kFALSE;
58 virtual void Set1DMap(TH1F* /*hmap*/){
59 AliError("Not implemented");
61 virtual void Set2DMap(TH2F* /*hmap*/){
62 AliError("Not implemented");
65 virtual void ResetMap(){
66 AliError("Not implemented");
68 virtual void SetCellContent(Int_t /*iAn*/, Int_t /*iTb*/, Float_t /*devMicron*/){
69 AliError("Not implemented");
71 virtual Float_t GetCellContent(Int_t /*iAn*/, Int_t /*iTb*/) const {
72 AliError("Not implemented");
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;
86 enum {kMaxNAnodePts=256};// max number of map points along anodes
87 enum {kMaxNDriftPts=291};// max number of map points along drift
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
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
100 ClassDef(AliITSCorrMapSDD,2);