X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSCalibrationSSD.h;h=78ca7873d00ccc901eb56a9e2a72f9b244121ebc;hb=a65a7e704a90d2ca4e682c82d8a708900dda04ca;hp=37555399d1c733615010789d063b20462766c743;hpb=23197852b55a2f848f715a9f57e1dc811c9d3f50;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSCalibrationSSD.h b/ITS/AliITSCalibrationSSD.h index 37555399d1c..78ca7873d00 100644 --- a/ITS/AliITSCalibrationSSD.h +++ b/ITS/AliITSCalibrationSSD.h @@ -3,17 +3,14 @@ /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ #include "AliITSCalibration.h" -#include "AliITSNoiseSSD.h" -#include "AliITSPedestalSSD.h" -#include "AliITSGainSSD.h" -#include "AliITSBadChannelsSSD.h" -#include "AliITSresponseSSD.h" -#include "TArrayF.h" -#include "TArrayI.h" +#include "AliITSNoiseSSDv2.h" +#include "AliITSPedestalSSDv2.h" +#include "AliITSGainSSDv2.h" +#include "AliITSBadChannelsSSDv2.h" /* $Id$ */ ////////////////////////////////////////////// -// Response class for SSD // +// Calibration class for SSD // // // ////////////////////////////////////////////// class AliITSCalibrationSSD : public AliITSCalibration { @@ -23,39 +20,19 @@ class AliITSCalibrationSSD : public AliITSCalibration { AliITSCalibrationSSD(const char *dataType); virtual ~AliITSCalibrationSSD(); - virtual void SetNoiseParam(Double_t np, Double_t nn) { - // set noise par - fNoiseP=np; fNoiseN=nn; - } + Float_t GetNoiseP(Int_t n) {return fNoise->GetNoiseP(fModule,n); } + Float_t GetNoiseN(Int_t n) {return fNoise->GetNoiseN(fModule,n); } + void SetNoise( AliITSNoiseSSDv2* noise) {fNoise=noise;} - virtual void GetNoiseParam(Double_t &np, Double_t &nn) const { - // get noise par - np=fNoiseP; nn=fNoiseN; - } + Float_t GetPedestalP(Int_t n) {return fPedestal->GetPedestalP(fModule,n); } + Float_t GetPedestalN(Int_t n) {return fPedestal->GetPedestalN(fModule,n); } + void SetPedestal( AliITSPedestalSSDv2* pedestal) {fPedestal=pedestal;} - void AddNoiseP(Int_t c, Float_t n) { fNoise->AddNoiseP(c,n);} - TArrayF GetNoiseP() {return fNoise->GetNoiseP(); } - Float_t GetNoiseP(Int_t n) {return fNoise->GetNoiseP(n); } - void AddNoiseN(Int_t c, Float_t n) { fNoise->AddNoiseN(c,n);} - TArrayF GetNoiseN() {return fNoise->GetNoiseN(); } - Float_t GetNoiseN(Int_t n) {return fNoise->GetNoiseN(n); } - void SetNoise( AliITSNoiseSSD* noise) {fNoise=noise;} - - void AddPedestalP(Int_t c, Float_t n) { fPedestal->AddPedestalP(c,n);} - TArrayF GetPedestalP() {return fPedestal->GetPedestalP(); } - Float_t GetPedestalP(Int_t n) {return fPedestal->GetPedestalP(n); } - void AddPedestalN(Int_t c, Float_t n) { fPedestal->AddPedestalN(c,n);} - TArrayF GetPedestalN() {return fPedestal->GetPedestalN(); } - Float_t GetPedestalN(Int_t n) {return fPedestal->GetPedestalN(n); } - void SetPedestal( AliITSPedestalSSD* pedestal) {fPedestal=pedestal;} - - void AddGainP(Int_t c, Float_t n) { fGain->AddGainP(c,n);} - TArrayF GetGainP() {return fGain->GetGainP(); } - Float_t GetGainP(Int_t n) {return fGain->GetGainP(n); } - void AddGainN(Int_t c, Float_t n) { fGain->AddGainN(c,n);} - TArrayF GetGainN() {return fGain->GetGainN(); } - Float_t GetGainN(Int_t n) {return fGain->GetGainN(n); } - void SetGain( AliITSGainSSD* gain) {fGain=gain;} + Float_t GetGainP(Int_t n) {return fGain->GetGainP(fModule,n); } + Float_t GetGainN(Int_t n) {return fGain->GetGainN(fModule,n); } + void SetGainP(Int_t n, Float_t value) {fGain->AddGainP(fModule,n,value);} + void SetGainN(Int_t n, Float_t value) {fGain->AddGainN(fModule,n,value);} + void SetGain( AliITSGainSSDv2* gain) {fGain=gain;} void SetBad() { fIsBad = kTRUE; @@ -69,33 +46,21 @@ class AliITSCalibrationSSD : public AliITSCalibration { virtual Bool_t IsChipBad(Int_t nChip) const { return fIsChipBad[nChip]; } - Int_t ChipsPerModule() const{return fgkChipsPerModule;} // Number of chips/module - Int_t ChannelsPerChip() const{ return fgkChannelsPerChip;}//Number of channels/chip - - TArrayI GetBadPChannelsList() { return fBadChannels->GetBadPChannelsList(); } const - TArrayI GetBadNChannelsList() { return fBadChannels->GetBadNChannelsList(); } const - void SetBadChannels( AliITSBadChannelsSSD* badchannels) {fBadChannels=badchannels;} - Int_t GetBadPChannel(Int_t n) {return fBadChannels->GetBadPChannel(n); } - Int_t GetBadNChannel(Int_t n) {return fBadChannels->GetBadNChannel(n); } - Bool_t IsPChannelBad(Int_t n) {return fBadChannels->GetBadPChannel(n)&1; } - Bool_t IsNChannelBad(Int_t n) {return fBadChannels->GetBadNChannel(n)&1; } - - void SetNoisePThreshold(Int_t threshold) { fNoisePThreshold = threshold;} - void AddNoisyPChannel(Int_t c, Int_t n) { fNoisyPChannelsList.AddAt(n,c);} - TArrayI GetNoisyPChannelsList() const {return fNoisyPChannelsList; } - void SetNoiseNThreshold(Int_t threshold) { fNoiseNThreshold = threshold;} - void AddNoisyNChannel(Int_t c, Int_t n) { fNoisyNChannelsList.AddAt(n,c);} - TArrayI GetNoisyNChannelsList() const {return fNoisyNChannelsList; } - - void SetNDeadPChannelsList(Int_t n) { fDeadPChannelsList.Set(n); } - void AddDeadPChannel(Int_t c, Int_t n) { fDeadPChannelsList.AddAt(n,c);} - TArrayI GetDeadPChannelsList() const {return fDeadPChannelsList; } - void SetNDeadNChannelsList(Int_t n) { fDeadNChannelsList.Set(n); } - void AddDeadNChannel(Int_t c, Int_t n) { fDeadNChannelsList.AddAt(n,c);} - TArrayI GetDeadNChannelsList() const {return fDeadNChannelsList; } - // - + Int_t ChipsPerModule() const{return fgkChipsPerModule;} // # chips/module + Int_t ChannelsPerChip() const{ return fgkChannelsPerChip;}// #channels/chip + + void SetBadChannels( AliITSBadChannelsSSDv2* badchannels) { + fBadChannels=badchannels;} + Char_t GetBadPChannel(Int_t n) { + return fBadChannels->GetBadChannelP(fModule,n); } + Char_t GetBadNChannel(Int_t n) { + return fBadChannels->GetBadChannelN(fModule,n); } + Bool_t IsPChannelBad(Int_t n) { + return fBadChannels->GetBadChannelP(fModule,n)&1; } + Bool_t IsNChannelBad(Int_t n) { + return fBadChannels->GetBadChannelN(fModule,n)&1; } + // virtual void SetNDetParam(Int_t npar) { // set number of param fNPar=npar; @@ -109,90 +74,53 @@ class AliITSCalibrationSSD : public AliITSCalibration { } virtual void GetDetParam(Double_t *dpar) const; - virtual void SetSigmaSpread(Double_t p1, Double_t p2) { - // Set sigmas of the charge spread function: Pside-Nside - // square of (microns) - fSigmaP=p1; fSigmaN=p2; + virtual void SetSigmaSpread(Double_t, Double_t) { + NotImplemented("SetSigmaSpread");} + + virtual void SigmaSpread(Double_t &, Double_t &) const { + NotImplemented("SetSigmaSpread");} + + void SetModule(Int_t mod){fModule = mod;} + void SetModuleIndex(Int_t modId){ + fModule=modId-500; // temporary patch, 500 is n. of SPD+SDD modules + FillBadChipMap(); } + void SetKeVperADC(Double_t a=86.4/120.){fKeVperADC = a;} + Double_t ADCToKeV(Double_t adc) const {return adc*fKeVperADC;} - virtual void SigmaSpread(Double_t &sP, Double_t &sN) const { - // Get sigmas for the charge spread - sP=fSigmaP; sN=fSigmaN; - } + void SetSSDADCpereV(Double_t a=(120./24888.9)*(85.0/77.0)){fSSDADCpereV = a;} + Double_t GetSSDDEvToADC(Double_t eV) const {return eV*fSSDADCpereV;} + Int_t GetSSDIEvToADC(Double_t eV) const { + return ((Int_t) GetSSDDEvToADC(eV)); } - virtual void SetThresholds(Double_t /* a */, Double_t /* b */) - {NotImplemented("SetThresholds");} - virtual void Thresholds(Double_t & /* a */, Double_t & /* b */) const - {NotImplemented("Thresholds");} - - virtual void SetParamOptions(const char *opt1, const char *opt2) {((AliITSresponseSSD*)fResponse)->SetParamOptions(opt1,opt2);} - virtual void GetParamOptions(char *opt1,char *opt2) const {((AliITSresponseSSD*)fResponse)->ParamOptions(opt1,opt2);} - virtual void SetADCpereV(Double_t a=120./24888.9) {((AliITSresponseSSD*)fResponse)->SetADCpereV(a);} - virtual Double_t GetDEvToADC(Double_t eV) const {return ((AliITSresponseSSD*)fResponse)->DEvToADC(eV);} - virtual Int_t IEvToADC(Double_t eV) const {return ((AliITSresponseSSD*)fResponse)->IEvToADC(eV);} - - virtual void SetKeVperADC(Double_t a=86.4/120.0) {((AliITSresponseSSD*)fResponse)->SetKeVperADC(a);} - virtual Double_t ADCToKeV(Double_t adc) const {return ((AliITSresponseSSD*)fResponse)->ADCToKeV(adc);} - - virtual Double_t GetCouplingPR() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingPR();} - virtual Double_t GetCouplingPL() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingPL();} - virtual Double_t GetCouplingNR() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingNR();} - virtual Double_t GetCouplingNL() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingNL();} - virtual void SetCouplings(Double_t pr, Double_t pl, Double_t nr, Double_t nl) - { ((AliITSresponseSSD*)fResponse)->SetCouplings(pr,pl,nr,nl);} - - virtual Int_t GetZSThreshold() const {return ((AliITSresponseSSD*)fResponse)->GetZSThreshold();} - virtual void SetZSThreshold(Int_t zsth) - { ((AliITSresponseSSD*)fResponse)->SetZSThreshold(zsth);} - -protected: + + protected: static const Int_t fgkChipsPerModule = 12; // Number of chips/module static const Int_t fgkChannelsPerChip = 128; // Number of channels/chip - static const Double_t fgkNoiseNDefault; // default for fNoiseN - static const Double_t fgkNoisePDefault; // default for fNoiseP static const Int_t fgkNParDefault; // default for fNPar - static const Double_t fgkSigmaPDefault; //default for fSigmaP - static const Double_t fgkSigmaNDefault; //default for fSigmaP + Int_t fModule; //! module number (range 0 -> 1697) + Int_t fNPar; // Number of detector param Double_t *fDetPar; //[fNPar] Array of parameters - Double_t fNoiseP; // Noise on Pside - Double_t fNoiseN; // Noise on Nside - Double_t fSigmaP; // Sigma charge spread on Pside - Double_t fSigmaN; // Sigma charge spread on Nside - - AliITSNoiseSSD *fNoise; - AliITSPedestalSSD *fPedestal; - AliITSGainSSD *fGain; - AliITSBadChannelsSSD *fBadChannels; + AliITSNoiseSSDv2 *fNoise; // pointer to noise calib object + AliITSPedestalSSDv2 *fPedestal; // pointer to pedestal calib object + AliITSGainSSDv2 *fGain; // pointer to gain calib object + AliITSBadChannelsSSDv2 *fBadChannels; // pointer to bad channels calib object Bool_t fIsBad; // module is dead or alive ? Bool_t fIsChipBad[fgkChipsPerModule]; // chip is dead or alive ? - TArrayF fGainP; // Gain for P side channels - TArrayF fGainN; // Gain for N side channels - - TArrayF fNoisP; // Noise for P side channels - TArrayF fNoisN; // Noise for N side channels - - TArrayF fPedP; - TArrayF fPedN; - - Float_t fNoisePThreshold; // need to decide if channel is noisy - TArrayI fNoisyPChannelsList; // list of P side noisy channels - Float_t fNoiseNThreshold; // need to decide if channel is noisy - TArrayI fNoisyNChannelsList; // list of N side noisy channels - - TArrayI fDeadNChannelsList; // list of P side dead channels - TArrayI fDeadPChannelsList; // list of N side dead channels + Double_t fSSDADCpereV; // Constant to convert eV to ADC for SSD. + Double_t fKeVperADC; // Constant to convert ADC to keV private: AliITSCalibrationSSD(const AliITSCalibrationSSD &source); // copy constructor AliITSCalibrationSSD& operator=(const AliITSCalibrationSSD &source); // ass. op. - ClassDef(AliITSCalibrationSSD,3) //Response class for SSD -}; + ClassDef(AliITSCalibrationSSD,6) //Response class for SSD + }; #endif