]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSCorrMapSDD.h
K0s code update (Matt Steinpreis)
[u/mrichter/AliRoot.git] / ITS / AliITSCorrMapSDD.h
CommitLineData
54af1add 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
54af1add 16#include<TNamed.h>
cfe39822 17#include "AliLog.h"
54af1add 18class TH1F;
19class TH2F;
cfe39822 20class AliITSsegmentationSDD;
54af1add 21
22class AliITSCorrMapSDD : public TNamed {
23
24 public:
9b7108c2 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)};
54af1add 32 AliITSCorrMapSDD();
33 AliITSCorrMapSDD(Char_t *mapname);
34 virtual ~AliITSCorrMapSDD(){};
9b7108c2 35 //
36 void SetInversionBit(Bool_t v=kTRUE) {SetBit(kLeftInvBit,v);}
37 Bool_t GetInversionBit() const {return TestBit(kLeftInvBit);}
38 //
54af1add 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));
44 }
45 void SetNBinsDrift(Int_t nbins) {
46 if(nbins<=kMaxNDriftPts) fNDriftPts=nbins;
47 else AliError(Form("Max. number of drift bins = %d",kMaxNDriftPts));
48 }
49
50 Bool_t CheckAnodeBounds(Int_t iAn) const {
374200ee 51 if(iAn<0 || iAn>=fNAnodePts)return kFALSE;
52 else return kTRUE;
54af1add 53 }
54 Bool_t CheckDriftBounds(Int_t iTb) const {
374200ee 55 if(iTb<0 || iTb >= fNDriftPts)return kFALSE;
56 else return kTRUE;
54af1add 57 }
58
59 virtual void Set1DMap(TH1F* /*hmap*/){
60 AliError("Not implemented");
61 }
62 virtual void Set2DMap(TH2F* /*hmap*/){
63 AliError("Not implemented");
64 }
65
66 virtual void ResetMap(){
67 AliError("Not implemented");
68 }
69 virtual void SetCellContent(Int_t /*iAn*/, Int_t /*iTb*/, Float_t /*devMicron*/){
70 AliError("Not implemented");
71 }
72 virtual Float_t GetCellContent(Int_t /*iAn*/, Int_t /*iTb*/) const {
73 AliError("Not implemented");
74 return -99999.;
75 }
76
374200ee 77 void ComputeGridPoints(Float_t z, Float_t x, AliITSsegmentationSDD *seg, Bool_t isReco=kTRUE);
54af1add 78 Float_t GetCorrection(Float_t z, Float_t x, AliITSsegmentationSDD *seg);
374200ee 79 Float_t GetShiftForSimulation(Float_t z, Float_t x, AliITSsegmentationSDD *seg);
54af1add 80 TH2F* GetMapHisto() const;
6c790b32 81 TH1F* GetMapProfile() const;
54af1add 82 TH1F* GetResidualDistr(Float_t dmin=-300., Float_t dmax=300.) const;
83
84
85 protected:
86
87 enum {kMaxNAnodePts=256};// max number of map points along anodes
88 enum {kMaxNDriftPts=291};// max number of map points along drift
89
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
94
374200ee 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
100
101 ClassDef(AliITSCorrMapSDD,2);
54af1add 102};
103#endif
9b7108c2 104