X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSresponseSDD.cxx;h=b56e192259748cee1f171ab51ff07f5bdf850800;hb=311ee5f3738a1911db7325221e218dd28b1ce64d;hp=3dffc378cf55039975d9db20c8a27b05004f2926;hpb=aacedc3e54091806a9c6d356fd7f582df59fd73f;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSresponseSDD.cxx b/ITS/AliITSresponseSDD.cxx index 3dffc378cf5..b56e1922597 100644 --- a/ITS/AliITSresponseSDD.cxx +++ b/ITS/AliITSresponseSDD.cxx @@ -15,356 +15,154 @@ /* $Id$ */ -#include -#include - -#include "AliITSresponseSDD.h" - -////////////////////////////////////////////////// -// Response class for set:ITS // -// Specific subdetector implementation // -// for silicon drift detectors // +////////////////////////////////////////////////////// +// Base response class forITS // +// It is used to set static data members // +// connected to parameters equal for all // +// the modules // // // // // ////////////////////////////////////////////////////// -const Int_t AliITSresponseSDD::fgkModules; -const Int_t AliITSresponseSDD::fgkChips; -const Int_t AliITSresponseSDD::fgkChannels; -const Int_t AliITSresponseSDD::fgkMaxAdcDefault = 1024; -const Double_t AliITSresponseSDD::fgkDynamicRangeDefault = 132.; -const Double_t AliITSresponseSDD::fgkfChargeLossDefault = 0; -const Double_t AliITSresponseSDD::fgkDiffCoeffDefault = 3.23; -const Double_t AliITSresponseSDD::fgkDiffCoeff1Default = 30.; -const Double_t AliITSresponseSDD::fgkTemperatureDefault = 296.; -const TString AliITSresponseSDD::fgkParam1Default = "same"; -const TString AliITSresponseSDD::fgkParam2Default = "same"; -const Double_t AliITSresponseSDD::fgkNoiseDefault = 10.; -const Double_t AliITSresponseSDD::fgkBaselineDefault = 20.; -const TString AliITSresponseSDD::fgkOptionDefault = "1D"; -const Double_t AliITSresponseSDD::fgkMinValDefault = 4; -const Double_t AliITSresponseSDD::fgkDriftSpeedDefault = 7.3; -const Double_t AliITSresponseSDD::fgkNsigmasDefault = 3.; -const Int_t AliITSresponseSDD::fgkNcompsDefault = 121; -//______________________________________________________________________ -ClassImp(AliITSresponseSDD) - - AliITSresponseSDD::AliITSresponseSDD(){ - // default constructor - fGaus = 0; - SetDeadChannels(); - SetMaxAdc(fgkMaxAdcDefault); - SetDiffCoeff(fgkDiffCoeffDefault,fgkDiffCoeff1Default); - SetDriftSpeed(fgkDriftSpeedDefault); - SetNSigmaIntegration(fgkNsigmasDefault); - SetNLookUp(fgkNcompsDefault); - // SetClock(); - SetNoiseParam(fgkNoiseDefault,fgkBaselineDefault); - SetNoiseAfterElectronics(); - SetJitterError(); - SetElectronics(); - SetDynamicRange(fgkDynamicRangeDefault); - SetChargeLoss(fgkfChargeLossDefault); - SetThresholds(fgkMinValDefault,0.); - SetParamOptions(fgkParam1Default.Data(),fgkParam2Default.Data()); - SetTemperature(fgkTemperatureDefault); - SetZeroSupp(fgkOptionDefault); - SetDataType(); - SetFilenames(); - SetOutputOption(); - SetDo10to8(); - // set the default zero suppression parameters - fCPar[0]=(Int_t) fBaseline; - fCPar[1]=(Int_t) fBaseline; - fCPar[2]=(Int_t)(2.*fNoiseAfterEl + 0.5); - fCPar[3]=(Int_t)(2.*fNoiseAfterEl + 0.5); - fCPar[4]=0; - fCPar[5]=0; - fCPar[6]=0; - fCPar[7]=0; -} -//______________________________________________________________________ -AliITSresponseSDD::AliITSresponseSDD(const char *dataType){ - // constructor - fGaus = 0; - SetDeadChannels(); - SetMaxAdc(fgkMaxAdcDefault); - SetDiffCoeff(fgkDiffCoeffDefault,fgkDiffCoeff1Default); - SetDriftSpeed(fgkDriftSpeedDefault); - SetNSigmaIntegration(fgkNsigmasDefault); - SetNLookUp(fgkNcompsDefault); - // SetClock(); - SetNoiseParam(fgkNoiseDefault,fgkBaselineDefault); - SetNoiseAfterElectronics(); - SetJitterError(); - SetElectronics(); - SetDynamicRange(fgkDynamicRangeDefault); - SetChargeLoss(fgkfChargeLossDefault); - SetThresholds(fgkMinValDefault,0.); - SetParamOptions(fgkParam1Default.Data(),fgkParam2Default.Data()); - SetTemperature(fgkTemperatureDefault); - SetZeroSupp(fgkOptionDefault); - SetDataType(dataType); - SetFilenames(); - SetOutputOption(); - SetDo10to8(); - // set the default zero suppression parameters - fCPar[0]=(Int_t) fBaseline; - fCPar[1]=(Int_t) fBaseline; - fCPar[2]=(Int_t)(2.*fNoiseAfterEl + 0.5); - fCPar[3]=(Int_t)(2.*fNoiseAfterEl + 0.5); - fCPar[4]=0; - fCPar[5]=0; - fCPar[6]=0; - fCPar[7]=0; -} -//______________________________________________________________________ -AliITSresponseSDD::AliITSresponseSDD(const AliITSresponseSDD &ob) : AliITSresponse(ob) { - // Copy constructor - // Copies are not allowed. The method is protected to avoid misuse. - Error("AliITSresponseSDD","Copy constructor not allowed\n"); -} +#include -//______________________________________________________________________ -AliITSresponseSDD& AliITSresponseSDD::operator=(const AliITSresponseSDD& /* ob */){ - // Assignment operator - // Assignment is not allowed. The method is protected to avoid misuse. - Error("= operator","Assignment operator not allowed\n"); - return *this; -} +#include "AliITSresponseSDD.h" +#include -//______________________________________________________________________ -AliITSresponseSDD::~AliITSresponseSDD() { +const Float_t AliITSresponseSDD::fgkTimeOffsetDefault = 54.30; +const Float_t AliITSresponseSDD::fgkADC2keVDefault = 3.34; +const Float_t AliITSresponseSDD::fgkChargevsTimeDefault = 0.00355; +const Float_t AliITSresponseSDD::fgkADCvsDrTimeDefault = 0.0101; +const Float_t AliITSresponseSDD::fgkCarlosRXClockPeriod = 25.; +ClassImp(AliITSresponseSDD) - if(fGaus) delete fGaus; +//_________________________________________________________________________ +AliITSresponseSDD::AliITSresponseSDD(): +TObject(), + fTimeOffset(fgkTimeOffsetDefault), + fADC2keV(fgkADC2keVDefault), + fChargevsTime(fgkChargevsTimeDefault) +{ + // default constructor + for(Int_t i=0; i 255) { - Warning("Convert8to10","out of range signal=%d",signal); - return 0; - } // end if signal <0 || signal >255 - - if (signal < 128) return signal; - if (signal < 192) { - if (TMath::Odd(signal)) return (128+((signal-128)<<1)); - else return (128+((signal-128)<<1)+1); - } // end if signal < 192 - if (signal < 224) { - if (TMath::Odd(signal)) return (256+((signal-192)<<3)+3); - else return (256+((signal-192)<<3)+4); - } // end if signal < 224 - if (TMath::Odd(signal)) return (512+((signal-224)<<4)+7); - return (512+((signal-224)<<4)+8); +//_________________________________________________________________________ +void AliITSresponseSDD::SetHalfLadderATimeZero(Int_t lay, Int_t lad, Float_t tzero){ + // Sets time Zero for all modules of a ladder on side A (Z>0) + Int_t minMod,maxMod; + if(lay==3){ + minMod=1; + maxMod=3; + if(lad>kNLaddersLay3){ + AliError(Form("Ladder number %d out of range",lad)); + return; + } + }else if(lay==4){ + minMod=1; + maxMod=4; + if(lad>kNLaddersLay4){ + AliError(Form("Ladder number %d out of range",lad)); + return; + } + }else{ + AliError(Form("Layer number %d out of range",lay)); + return; } - else { - return signal; + for(Int_t iMod=minMod; iMod<=maxMod; iMod++){ + Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod); + SetModuleTimeZero(modIndex,tzero); } } - -//______________________________________________________________________ -void AliITSresponseSDD::SetCompressParam(Int_t cp[8]){ - // set compression param - - Int_t i; - for (i=0; i<8; i++) { - fCPar[i]=cp[i]; - //printf("\n CompressPar %d %d \n",i,fCPar[i]); - } // end for i -} -//______________________________________________________________________ -void AliITSresponseSDD::GiveCompressParam(Int_t cp[8]) const { - // give compression param - - Int_t i; - for (i=0; i<8; i++) { - cp[i]=fCPar[i]; - } // end for i -} -//______________________________________________________________________ -void AliITSresponseSDD::SetNLookUp(Int_t p1){ - // Set number of sigmas over which cluster disintegration is performed - fNcomps=p1; - fGaus = new TArrayF(fNcomps+1); - for(Int_t i=0; i<=fNcomps; i++) { - Double_t x = -fNsigmas + (2.*i*fNsigmas)/(fNcomps-1); - (*fGaus)[i] = exp(-((x*x)/2)); - // cout << "fGaus[" << i << "]: " << fGaus->At(i) << endl; - } -} -//______________________________________________________________________ -void AliITSresponseSDD::SetDeadChannels(Int_t nmod, 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; +//_________________________________________________________________________ +void AliITSresponseSDD::SetHalfLadderCTimeZero(Int_t lay, Int_t lad, Float_t tzero){ + // Sets time Zero for all modules of a ladder on side C (Z<0) + Int_t minMod,maxMod; + if(lay==3){ + minMod=4; + maxMod=6; + if(lad>kNLaddersLay3){ + AliError(Form("Ladder number %d out of range",lad)); + return; } - Int_t nmax = (fgkModules-nmod)*fgkChips; - if( nchip < 0 || nchip > nmax ) - { - cout << "Wrong number of dead chips: " << nchip << endl; - return; + }else if(lay==4){ + minMod=5; + maxMod=8; + if(lad>kNLaddersLay4){ + AliError(Form("Ladder number %d out of range",lad)); + return; } - nmax = ((fgkModules - nmod)*fgkChips - nchip)*fgkChannels; - if( nchan < 0 || nchan > nmax ) - { - cout << "Wrong number of dead channels: " << nchan << endl; - return; + }else{ + AliError(Form("Layer number %d out of range",lay)); + return; + } + for(Int_t iMod=minMod; iMod<=maxMod; iMod++){ + Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod); + SetModuleTimeZero(modIndex,tzero); + } +} +//_________________________________________________________________________ +void AliITSresponseSDD::PrintChargeCalibrationParams() const{ + // Dump charge calibration parameters + + printf("ADC vs. drift time corr=%f\n",GetChargevsTime()); + printf("-------------------------------------\n"); + printf("Layer 3\n"); + for(Int_t ilad=1; ilad<=14; ilad++){ + for(Int_t idet=1; idet<=6;idet++){ + Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(3,ilad,idet); + Float_t tz=GetADCtokeV(modIndex); + printf("%7.2f ",tz); } - - TRandom *gran = new TRandom(); - - // cout << "modules" << endl; - Int_t * mod = new Int_t [nmod]; - Int_t i; //loop variable - for( i=0; iUniform()); - cout << i+1 << ": Dead module nr: " << mod[i] << endl; - for(Int_t n=0; nUniform() + 1.); - if( module <=0 || module > fgkModules ) - cout << "Wrong module: " << module << endl; - Int_t flagMod = 0; - for( Int_t k=0; kUniform() + 1.); - if( chi <=0 || chi > fgkChips ) cout << "Wrong chip: " << chi << endl; - i++; - chip[i-1] = chi; - chipMod[i-1] = module; - for( Int_t m=0; mUniform() + 1.); - if( module <=0 || module > fgkModules ) - cout << "Wrong module: " << module << endl; - Int_t flagMod = 0; - for( k=0; kUniform() + 1.); - if( chipp <=0 || chipp > fgkChips ) cout << "Wrong chip: "<< chipp<Uniform() + 1.); - if( channel[i-1] <=0 || channel[i-1] > fgkChannels ) - cout << "Wrong channel: " << channel[i-1] << endl; - channelChip[i-1] = chipp; - channelMod[i-1] = module; - fGain[module-1][chipp-1][channel[i-1]-1] = 0.; - cout << i << ": Dead channel nr. " << channel[i-1] << " in chip nr. " - << channelChip[i-1] << " in module nr: " << channelMod[i-1] - << endl; + printf("\n"); + } + printf("\n"); + printf("Layer 4\n"); + for(Int_t ilad=1; ilad<=22; ilad++){ + for(Int_t idet=1; idet<=8;idet++){ + Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(4,ilad,idet); + Float_t tz=GetTimeZero(modIndex); + printf("%7.2f ",tz); } - - delete [] mod; - delete [] chip; - delete [] chipMod; - delete [] channel; - delete [] channelMod; - delete [] channelChip; -} -//______________________________________________________________________ -void AliITSresponseSDD::PrintGains(){ - // - - if( GetDeadModules() == 0 && - 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