/************************************************************************** * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id$ */ #include #include #include "AliITSCalibrationSDD.h" #include "AliLog.h" ////////////////////////////////////////////////////// // Calibration class for set:ITS // // Specific subdetector implementation // // for silicon drift detectors // // // // // ////////////////////////////////////////////////////// const Float_t AliITSCalibrationSDD::fgkTemperatureDefault = 296.; const Float_t AliITSCalibrationSDD::fgkNoiseDefault = 10.; const Float_t AliITSCalibrationSDD::fgkGainDefault = 1.; const Float_t AliITSCalibrationSDD::fgkBaselineDefault = 20.; const Float_t AliITSCalibrationSDD::fgkMinValDefault = 4; //______________________________________________________________________ ClassImp(AliITSCalibrationSDD) AliITSCalibrationSDD::AliITSCalibrationSDD(): AliITSCalibration(), fDeadChips(0), fDeadChannels(0), fMinVal(fgkMinValDefault), fIsDead(kFALSE), fBadChannels(), fUseACorrMap(0), fUseTCorrMap(0), fMapAW0(0), fMapAW1(0), fMapTW0(0), fMapTW1(0), fDrSpeed0(0), fDrSpeed1(0) { // default constructor SetDeadChannels(); for(Int_t ian=0;ianfgkChannels*fgkChips*fgkWings-1)AliError("Wrong anode number"); Int_t wing=0; Int_t chip,channel; chip=anode/fgkChannels; channel=anode-(chip*fgkChannels); if(anode>=fgkChips*fgkChannels) wing=1; if(wing==1)chip-=fgkChips; fBadChannels[i]=anode; fGain[wing][chip][channel]=0; } //______________________________________________________________________ Float_t AliITSCalibrationSDD::GetChannelGain(Int_t anode) const{ // returns gain for givenanode Int_t iWing=GetWing(anode); Int_t iChip=GetChip(anode); 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){ // Set fGain to zero to simulate a random distribution of // dead modules, dead chips and single dead channels for( Int_t m=0; m fgkModules ) // { // cout << "Wrong number of dead modules: " << nmod << endl; // return; // } Int_t nmax = fgkWings*fgkChips; if( nchip < 0 || nchip > nmax ) { cout << "Wrong number of dead chips: " << nchip << endl; return; } nmax = (fgkWings*fgkChips - nchip)*fgkChannels; if( nchan < 0 || nchan > nmax ) { cout << "Wrong number of dead channels: " << nchan << endl; return; } TRandom *gran = new TRandom(); // cout << "chips" << endl; Int_t * chip = new Int_t[nchip]; Int_t i = 0; while( i < nchip ) { Int_t wing = (Int_t) (fgkWings*gran->Uniform() + 1.); if( wing <=0 || wing > fgkWings ) Error("SetDeadChannels","Wrong wing"); Int_t chi = (Int_t) (fgkChips*gran->Uniform() + 1.); if( chi <=0 || chi > fgkChips ) Error("SetDeadChannels","Wrong chip:%d\n",chi); i++; chip[i-1] = chi; for( Int_t m=0; mUniform() + 1.); if( wing <=0 || wing > fgkWings ) Error("SetDeadChannels","Wrong wing:%d\n",wing); Int_t chipp = (Int_t) (fgkChips*gran->Uniform() + 1.); if( chipp <=0 || chipp > fgkChips ) Error("SetDeadChannels","Wrong chip:%d",chipp); Int_t flagChip = 0; for( k=0; kUniform() + 1.); if( channel[i-1] <=0 || channel[i-1] > fgkChannels ) Error("SetDeadChannels","Wrong channel:%d\n",channel[i-1]); channelChip[i-1] = chipp; fGain[wing-1][chipp-1][channel[i-1]-1] = 0.; } delete [] chip; delete [] channel; delete [] channelChip; } */ //______________________________________________________________________ void AliITSCalibrationSDD::PrintGains() const{ // if( GetDeadChips() == 0 && GetDeadChannels() == 0 ) return; // Print Electronics Gains cout << "**************************************************" << endl; cout << " Print Electronics Gains " << endl; cout << "**************************************************" << endl; // Print SDD electronic gains for(Int_t t=0; t