fMinVal(fgkMinValDefault),
fIsDead(kFALSE),
fBadChannels(),
+fUseACorrMap(0),
+fUseTCorrMap(0),
fMapAW0(0),
fMapAW1(0),
fMapTW0(0),
}
SetThresholds(fgkMinValDefault,0.);
SetTemperature(fgkTemperatureDefault);
+ SetUseCorrectionMaps(kTRUE,kTRUE);
SetDataType();
}
//______________________________________________________________________
fMinVal(fgkMinValDefault),
fIsDead(kFALSE),
fBadChannels(),
+fUseACorrMap(0),
+fUseTCorrMap(0),
fMapAW0(0),
fMapAW1(0),
fMapTW0(0),
}
}
+
SetThresholds(fgkMinValDefault,0.);
SetTemperature(fgkTemperatureDefault);
+ SetUseCorrectionMaps(kTRUE,kTRUE);
SetDataType(dataType);
}
//_____________________________________________________________________
Int_t iChan=GetChipChannel(anode);
return fGain[iWing][iChip][iChan];
}
+//______________________________________________________________________
+void AliITSCalibrationSDD::GetCorrections(Float_t z, Float_t x, Float_t &devz, Float_t &devx, AliITSsegmentationSDD* seg){
+ //correction of coordinates using the maps stored in the DB
+ Int_t nSide=seg->GetSideFromLocalX(x);
+ devz=0;
+ if(fUseACorrMap){
+ if(nSide==0) devz=fMapAW0->GetCorrection(z,x,seg);
+ else devz=fMapAW1->GetCorrection(z,x,seg);
+ }
+ devx=0;
+ if(fUseTCorrMap){
+ if(nSide==0) devx=fMapTW0->GetCorrection(z,x,seg);
+ else devx=fMapTW1->GetCorrection(z,x,seg);
+ }
+ return;
+}
/*
//______________________________________________________________________
void AliITSCalibrationSDD::SetDeadChannels(Int_t nchip, Int_t nchan){
#include "AliITSCalibration.h"
#include "AliITSresponseSDD.h"
+#include "AliITSsegmentationSDD.h"
#include "TArrayI.h"
class AliITSMapSDD;
virtual void SetBadChannel(Int_t i,Int_t anode);
Int_t GetBadChannel(Int_t i) const {return fBadChannels[i];}
- Bool_t IsBadChannel(Int_t anode){
+ Bool_t IsBadChannel(Int_t anode) const{
if(GetChannelGain(anode)==0) return kTRUE;
else return kFALSE;
}
+ void SetUseCorrectionMaps(Bool_t useAnodeMap, Bool_t useDriftMap){
+ fUseACorrMap=useAnodeMap;
+ fUseTCorrMap=useDriftMap;
+ }
Float_t GetMapACell(Int_t i,Int_t j) const {
if(i<256) return fMapAW0->GetCellContent(i,j);
else return fMapAW1->GetCellContent(i-256,j);
if(wing==0) fMapTW0=mapT;
else fMapTW1=mapT;
}
- static Int_t GetMapTimeNBin() {return fgkMapTimeNBin;}
virtual void SetDriftSpeed(Int_t wing, AliITSDriftSpeedArraySDD* arr){
if(wing==0) fDrSpeed0=arr;
virtual void SetJitterError(Double_t jitter=20) {((AliITSresponseSDD*)fResponse)->SetJitterError(jitter);}
virtual Float_t GetJitterError() const {return ((AliITSresponseSDD*)fResponse)->JitterError();}
virtual Float_t GetDriftPath(Float_t time, Float_t xAnode) const {return time*GetDriftSpeedAtAnode(xAnode);}
+ void GetCorrections(Float_t z, Float_t x, Float_t &devz, Float_t &devx, AliITSsegmentationSDD* seg);
virtual Float_t GetThresholdAnode(Int_t anode,Int_t nsigma=3) const {
return nsigma*fNoiseAfterEl[anode];}
static const Float_t fgkBaselineDefault; // default for fBaseline
static const Float_t fgkMinValDefault; // default for fMinVal
static const Float_t fgkGainDefault; //default for gain
- static const Int_t fgkMapTimeNBin = 72; //map granularity along drift direction
+
Int_t fDeadChips; // Number of dead chips
Int_t fDeadChannels; // Number of dead channels
Float_t fGain[fgkWings][fgkChips][fgkChannels];//Array for channel gains
TArrayI fBadChannels; //Array with bad anodes number (0-512)
+ Bool_t fUseACorrMap; // flag for the use of correction maps (anode)
+ Bool_t fUseTCorrMap; // flag for the use of correction maps (drift)
+
AliITSMapSDD* fMapAW0; //! map of residuals on anode coord. wing 0
AliITSMapSDD* fMapAW1; //! map of residuals on anode coord. wing 1
AliITSMapSDD* fMapTW0; //! map of residuals on time coord. wing 0
AliITSCalibrationSDD& operator=(const AliITSCalibrationSDD & /* source */); // ass. op.
- ClassDef(AliITSCalibrationSDD,8) // SDD response
+ ClassDef(AliITSCalibrationSDD,9) // SDD response
};
#endif
}
clusterI.SetPeakPos( peakpos );
Float_t dp = cal->GetDriftPath(newiTimef,newAnodef);
- Double_t driftPath = fSddLength - (Double_t)dp;
- Double_t sign = ( wing == 1 ) ? -1. : 1.;
- Double_t xcoord = driftPath*sign * 0.0001;
- Double_t zcoord = anodePath * 0.0001;
- CorrectPosition(zcoord,xcoord);
+ Float_t driftPath = fSddLength - (Double_t)dp;
+ Float_t sign = ( wing == 1 ) ? -1. : 1.;
+ Float_t xcoord = driftPath*sign * 0.0001;
+ Float_t zcoord = anodePath * 0.0001;
+ Float_t corrx=0, corrz=0;
+ cal->GetCorrections(zcoord,xcoord,corrz,corrx,GetSeg());
+ xcoord+=corrx;
+ zcoord+=corrz;
clusterI.SetX( xcoord );
clusterI.SetZ( zcoord );
clusterI.SetAnode( newAnodef );
cout << "**************************************************" << endl;
}
-//_________________________________________________________________________
-void AliITSClusterFinderSDD::CorrectPosition(Double_t &z, Double_t&y){
- //correction of coordinates using the maps stored in the DB
-
- AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
- static const Int_t nbint = cal->GetMapTimeNBin();
- static const Int_t nbina = cal->Chips()*cal->Channels();
- Float_t stepa = (GetSeg()->Dpz(0))/10000.; //anode pitch in cm
- Float_t stept = (GetSeg()->Dx()/cal->GetMapTimeNBin()/2.)/10.;
-
- Int_t bint = TMath::Abs((Int_t)(y/stept));
- if(y>=0) bint+=(Int_t)(nbint/2.);
- if(bint>nbint) AliError("Wrong bin number!");
- Int_t bina = TMath::Abs((Int_t)(z/stepa));
- if(z>=0) bina+=(Int_t)(nbina/2.);
- if(bina>nbina) AliError("Wrong bin number!");
-
- Double_t devz = (Double_t)cal->GetMapACell(bina,bint)/10000.;
- Double_t devx = (Double_t)cal->GetMapTCell(bina,bint)/10000.;
- z+=devz;
- y+=devx;
-
-}
void PeakFunc( Int_t xdim, Int_t zdim, Double_t *par, Double_t *spe,
Double_t *Integral=0 );
void PrintStatus() const;
- void CorrectPosition(Double_t &z, Double_t&y);
+
private:
virtual AliITSCalibrationSDD* GetResp(Int_t mod)const{
return (AliITSCalibrationSDD*) fDetTypeRec->GetCalibrationModel(mod);}//Return Response
const Double_t kMicronTocm = 1.0e-4;
Float_t xdet=(driftPathMicron-GetSeg()->Dx())*kMicronTocm; // xdet is negative
if (s==0) xdet=-xdet; // left side has positive local x
-
- CorrectPosition(zdet,xdet);
+
+ Float_t corrx=0, corrz=0;
+ cal->GetCorrections(zdet,xdet,corrz,corrx,GetSeg());
+ zdet+=corrz;
+ xdet+=corrx;
Double_t loc[3]={xdet,0.,zdet},trk[3]={0.,0.,0.};
mT2L->MasterToLocal(loc,trk);
}
-//_________________________________________________________________________
-void AliITSClusterFinderV2SDD::CorrectPosition(Float_t &z, Float_t&y){
-
- //correction of coordinates using the maps stored in the DB
-
- AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
- static const Int_t knbina = cal->Wings()*cal->Chips()*cal->Channels();
- Int_t bina =(Int_t) GetSeg()->GetAnodeFromLocal(y,z);
- if(bina>knbina) AliError("Wrong bin number along anodes!");
-
- static const Int_t knbint = cal->GetMapTimeNBin();
- const Double_t kMicronTocm = 1.0e-4;
- Float_t stept = GetSeg()->Dx()*kMicronTocm/cal->GetMapTimeNBin();
- Int_t bint = TMath::Abs((Int_t)(y/stept));
- if(bint==knbint) bint-=1;
- if(bint>=knbint) AliError("Wrong bin number along drift direction!");
-
- Float_t devz = cal->GetMapACell(bina,bint)*kMicronTocm;
- Float_t devx = cal->GetMapTCell(bina,bint)*kMicronTocm;
- z+=devz;
- y+=devx;
-
-
-}
TClonesArray *dig, TClonesArray *clusters=0x0);
void FindClustersSDD(AliITSRawStream* input,TClonesArray** clusters);
- void CorrectPosition(Float_t &z, Float_t&y);
virtual AliITSCalibrationSDD* GetResp(Int_t mod)const{
return (AliITSCalibrationSDD*) fDetTypeRec->GetCalibrationModel(mod);}
virtual AliITSsegmentationSDD* GetSeg()const{
}
}
//______________________________________________________________________
+Float_t AliITSMapSDD::GetCorrection(Float_t z, Float_t x, AliITSsegmentationSDD *seg){
+ // returns correction in cm starting from local coordinates on the module
+ const Double_t kMicronTocm = 1.0e-4;
+ Int_t nAnodes=seg->Npz();
+ Int_t nAnodesHybrid=seg->NpzHalf();
+ Int_t bina =(Int_t) seg->GetAnodeFromLocal(x,z);
+ if(bina>nAnodes) AliError("Wrong anode anumber!");
+ if(bina>=nAnodesHybrid) bina-=nAnodesHybrid;
+ Float_t stept = seg->Dx()*kMicronTocm/(Float_t)fgkNDrifPts;
+ Int_t bint = TMath::Abs((Int_t)(x/stept));
+ if(bint==fgkNDrifPts) bint-=1;
+ if(bint>=fgkNDrifPts) AliError("Wrong bin number along drift direction!");
+ return kMicronTocm*GetCellContent(bina,bint);
+}
+//______________________________________________________________________
TH2F* AliITSMapSDD::GetMapHisto() const{
// Returns a TH2F histogram with map of residuals
Char_t hname[50];
// //
///////////////////////////////////////////////////////////////////
+#include "AliITSsegmentationSDD.h"
#include<TNamed.h>
#include "AliLog.h"
class TH1F;
virtual ~AliITSMapSDD(){};
void SetMap(TH2F* hmap);
- void SetCellContent(Int_t iAn, Int_t iTb, Float_t devMicron){
- if(iAn<0 || iAn>=fgkNAnodPts || iTb<0 || iTb >= fgkNDrifPts){
+ Bool_t CheckBounds(Int_t iAn, Int_t iTb) const {
+ if(iAn<0 || iAn>=fgkNAnodPts || iTb<0 || iTb >= fgkNDrifPts){
AliWarning(Form("Cell out of bounds, anode=%d time-bin=%d",iAn,iTb));
- return;
+ return kFALSE;
}
- fMap[iAn][iTb]=devMicron;
+ return kTRUE;
+ }
+ void SetCellContent(Int_t iAn, Int_t iTb, Float_t devMicron){
+ if(CheckBounds(iAn,iTb)) fMap[iAn][iTb]=devMicron;
}
+
Float_t GetCellContent(Int_t iAn, Int_t iTb) const {
- if(iAn<0 || iAn>=fgkNAnodPts || iTb<0 || iTb >= fgkNDrifPts){
- AliWarning(Form("Cell out of bounds, anode=%d timebin=%d",iAn,iTb));
- return 0.;
- }
- else return fMap[iAn][iTb];
+ if(CheckBounds(iAn,iTb)) return fMap[iAn][iTb];
+ else return 0.;
}
+ Float_t GetCorrection(Float_t z, Float_t x, AliITSsegmentationSDD *seg);
+ static Int_t GetNBinsAnode() {return fgkNAnodPts;}
+ static Int_t GetNBinsDrift() {return fgkNDrifPts;}
TH2F* GetMapHisto() const;
TH1F* GetResidualDistr(Float_t dmin=-300., Float_t dmax=300.) const;
TObjArray badch_array(fgkNumberOfSSD);
TObjArray ped_array(fgkNumberOfSSD);
//Float_t noise=0, gain=0;
-
+
TString runType = GetRunType();
- if(runType == "ELECTRONICS_CALIBRATION_RUN") {
-
+ if(runType == "ELECTRONICS_CALIBRATION_RUN") {
+
}
else if(runType == "PEDESTAL") {
virtual void DetToLocal(Int_t ix,Int_t iz,Float_t &x,Float_t &z) const;
//
virtual Float_t GetAnodeFromLocal(Float_t x,Float_t z) const;
+ virtual Int_t GetSideFromLocalX(Float_t xloc) const {
+ if(xloc>0) return 0; // left side (channel 0) positive xloc
+ else return 1; // right side (channel 1) negative xloc
+ }
virtual Float_t GetLocalZFromAnode(Int_t nAnode) const;
virtual Float_t GetLocalZFromAnode(Float_t zAnode) const;
virtual Float_t GetDriftTimeFromTb(Int_t tb) const {
static const Float_t fgkClockDefault; //Default value for the clock freq.
static const Int_t fgkHalfNanodesDefault; //Default value for fNanodes/2
static const Int_t fgkNsamplesDefault; //Default value for fNsamples
- static const Float_t fgkCm2Micron;
- static const Float_t fgkMicron2Cm;
+ static const Float_t fgkCm2Micron; // conversion from cm to micron
+ static const Float_t fgkMicron2Cm; // conversion from micron to cm
ClassDef(AliITSsegmentationSDD,5) // SDD segmentation
};