X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSresponseSDD.cxx;h=1ab76ba4d93f60471e0f5fc3aa957dbfb62c7f96;hb=7fa8b2daa003d7dff58465900db63064e8150bd5;hp=6a93e8d5d5608f515f6c4880c6140998bf3a8aef;hpb=50d05d7ba51c5b07abb37e62f46ca30e6a27b561;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSresponseSDD.cxx b/ITS/AliITSresponseSDD.cxx index 6a93e8d5d56..1ab76ba4d93 100644 --- a/ITS/AliITSresponseSDD.cxx +++ b/ITS/AliITSresponseSDD.cxx @@ -13,277 +13,91 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -#include -#include - -#include "AliITSresponseSDD.h" +/* $Id$ */ +////////////////////////////////////////////////////// +// Base response class forITS // +// It is used to set static data members // +// connected to parameters equal for all // +// the modules // +// // +// // +////////////////////////////////////////////////////// -//___________________________________________ -ClassImp(AliITSresponseSDD) +#include -AliITSresponseSDD::AliITSresponseSDD() -{ +#include "AliITSresponseSDD.h" +#include + +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::fgkCarlosRXClockPeriod = 25.; +ClassImp(AliITSresponseSDD) + +//_________________________________________________________________________ +AliITSresponseSDD::AliITSresponseSDD(): +TObject(), +fTimeOffset(fgkTimeOffsetDefault), +fADC2keV(fgkADC2keVDefault), +fChargevsTime(fgkChargevsTimeDefault){ // default constructor - fGaus = 0; - SetDeadChannels(); - SetMaxAdc(); - SetDiffCoeff(); - SetDriftSpeed(); - SetNSigmaIntegration(); - SetNLookUp(); - // SetClock(); - SetNoiseParam(); - SetNoiseAfterElectronics(); - SetElectronics(); - SetDynamicRange(); - SetChargeLoss(); - SetMinVal(); - SetParamOptions(); - SetTemperature(); - SetZeroSupp(); - SetDataType(); - SetFilenames(); - SetOutputOption(); - SetDo10to8(); - // set the default zero suppression parameters - fCPar[0]=0; - fCPar[1]=0; - fCPar[2]=(Int_t)(fBaseline + 2.*fNoiseAfterEl + 0.2); - fCPar[3]=(Int_t)(fBaseline + 2.*fNoiseAfterEl + 0.2); - fCPar[4]=0; - fCPar[5]=0; - fCPar[6]=0; - fCPar[7]=0; -} - -AliITSresponseSDD::AliITSresponseSDD(const char *dataType) -{ - // constructor - fGaus = 0; - SetDeadChannels(); - SetMaxAdc(); - SetDiffCoeff(); - SetDriftSpeed(); - SetNSigmaIntegration(); - SetNLookUp(); - // SetClock(); - SetNoiseParam(); - SetNoiseAfterElectronics(); - SetElectronics(); - SetDynamicRange(); - SetChargeLoss(); - SetMinVal(); - SetParamOptions(); - SetTemperature(); - SetZeroSupp(); - SetDataType(dataType); - SetFilenames(); - SetOutputOption(); - SetDo10to8(); - // set the default zero suppression parameters - fCPar[0]=0; - fCPar[1]=0; - fCPar[2]=(Int_t)(fBaseline + 2.*fNoiseAfterEl + 0.2); - fCPar[3]=(Int_t)(fBaseline + 2.*fNoiseAfterEl + 0.2); - fCPar[4]=0; - fCPar[5]=0; - fCPar[6]=0; - fCPar[7]=0; + for(Int_t i=0; i0) + Int_t minMod,maxMod; + if(lay==3){ + minMod=1; + maxMod=3; + if(lad>kNLaddersLay3){ + AliError(Form("Ladder number %d out of range",lad)); + return; } -} - -void AliITSresponseSDD::GiveCompressParam(Int_t cp[8]) -{ - // give compression param - - Int_t i; - for (i=0; i<8; i++) { - cp[i]=fCPar[i]; + }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; + } + for(Int_t iMod=minMod; iMod<=maxMod; iMod++){ + Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod); + SetModuleTimeZero(modIndex,tzero); + } } - -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 fModules ) - { - cout << "Wrong number of dead modules: " << nmod << endl; - return; - } - Int_t nmax = (fModules-nmod)*fChips; - if( nchip < 0 || nchip > nmax ) - { - cout << "Wrong number of dead chips: " << nchip << 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; } - nmax = ((fModules - nmod)*fChips - nchip)*fChannels; - if( nchan < 0 || nchan > nmax ) - { - cout << "Wrong number of dead channels: " << nchan << endl; - return; + }else if(lay==4){ + minMod=5; + maxMod=8; + if(lad>kNLaddersLay4){ + AliError(Form("Ladder number %d out of range",lad)); + return; } - - 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 > fModules ) - cout << "Wrong module: " << module << endl; - Int_t flag_mod = 0; - for( Int_t k=0; kUniform() + 1.); - if( chi <=0 || chi > fChips ) cout << "Wrong chip: " << chi << endl; - i++; - chip[i-1] = chi; - chip_mod[i-1] = module; - for( Int_t m=0; mUniform() + 1.); - if( module <=0 || module > fModules ) - cout << "Wrong module: " << module << endl; - Int_t flag_mod = 0; - for( k=0; kUniform() + 1.); - if( chipp <=0 || chipp > fChips ) cout << "Wrong chip: " << chipp << endl; - Int_t flag_chip = 0; - for( k=0; kUniform() + 1.); - if( channel[i-1] <=0 || channel[i-1] > fChannels ) - cout << "Wrong channel: " << channel[i-1] << endl; - channel_chip[i-1] = chipp; - channel_mod[i-1] = module; - fGain[module-1][chipp-1][channel[i-1]-1] = 0.; - cout << i << ": Dead channel nr. " << channel[i-1] << " in chip nr. " << channel_chip[i-1] << " in module nr: " << channel_mod[i-1] << endl; - } - - delete [] mod; - delete [] chip; - delete [] chip_mod; - delete [] channel; - delete [] channel_mod; - delete [] channel_chip; -} - -void AliITSresponseSDD::PrintGains() -{ - // Print Electronics Gains - cout << "**************************************************" << endl; - cout << " Print Electronics Gains " << endl; - cout << "**************************************************" << endl; - -// FILE *f = fopen( "gains.txt", "w" ); -// fprintf( f, " Module Chip Channel Gain\n" ); - - // Print SDD electronic gains - for(Int_t t=0; t