#include <TMath.h>
#include "AliITSresponseSDD.h"
+#include <AliITSgeomTGeo.h>
-const Int_t AliITSresponseSDD::fgkMaxAdcDefault = 1024;
-const Float_t AliITSresponseSDD::fgkDynamicRangeDefault = 132.;
-const Float_t AliITSresponseSDD::fgkfChargeLossDefault = 0;
-const Float_t AliITSresponseSDD::fgkDiffCoeffDefault = 3.23;
-const Float_t AliITSresponseSDD::fgkDiffCoeff1Default = 30.;
-const TString AliITSresponseSDD::fgkParam1Default = "same";
-const TString AliITSresponseSDD::fgkParam2Default = "same";
-const TString AliITSresponseSDD::fgkOptionDefault = "ZS";
-const Float_t AliITSresponseSDD::fgkDriftSpeedDefault = 7.3;
-const Float_t AliITSresponseSDD::fgkTimeOffsetDefault = 53.57;
-const Float_t AliITSresponseSDD::fgkADC2keVDefault = 5.243;
-const Float_t AliITSresponseSDD::fgkNsigmasDefault = 3.;
-const Int_t AliITSresponseSDD::fgkNcompsDefault = 121;
-
+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():
-AliITSresponse(),
-fJitterError(0.),
-fDynamicRange(0.),
-fChargeLoss(0.),
-fTimeOffset(fgkTimeOffsetDefault),
-fADC2keV(fgkADC2keVDefault),
-fElectronics(0),
-fMaxAdc(fgkMaxAdcDefault),
-fNsigmas(fgkNsigmasDefault),
-fGaus(),
-fNcomps(fgkNcompsDefault),
-fOption(),
-fParam1(),
-fParam2() {
+TObject(),
+ fTimeOffset(fgkTimeOffsetDefault),
+ fADC2keV(fgkADC2keVDefault),
+ fChargevsTime(fgkChargevsTimeDefault){
// default constructor
- fGaus = 0;
- SetDiffCoeff(fgkDiffCoeffDefault,fgkDiffCoeff1Default);
- // SetNLookUp(fgkNcompsDefault);
-
- SetJitterError();
- SetElectronics();
- SetDynamicRange(fgkDynamicRangeDefault);
- SetChargeLoss(fgkfChargeLossDefault);
- SetParamOptions(fgkParam1Default.Data(),fgkParam2Default.Data());
- SetZeroSupp(fgkOptionDefault);
- SetOutputOption();
+ for(Int_t i=0; i<kNSDDmods;i++){
+ fTimeZero[i]=fgkTimeOffsetDefault;
+ fDeltaVDrift[i] = fDeltaVDrift[i+kNSDDmods] = 0.;
+ fADCtokeV[i]=fgkADC2keVDefault;
+ }
+ SetVDCorr2Side(kTRUE); // default for new objects will be separate corrections for 2 sides (bwd compatible)
+ // SetVDCorrMult(kTRUE); // default for new objects will have multiplicative correction v'=(1+corr)*v (bwd compatible)
}
-
-
-//______________________________________________________________________
-AliITSresponseSDD::~AliITSresponseSDD() {
-
- if(fGaus) delete fGaus;
+//_________________________________________________________________________
+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;
+ }
+ for(Int_t iMod=minMod; iMod<=maxMod; iMod++){
+ Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod);
+ SetModuleTimeZero(modIndex,tzero);
+ }
}
-
-
-//________________________________________________________________________
-void AliITSresponseSDD::SetNLookUp(Int_t p1){
- // Set number of sigmas over which cluster disintegration is performed
- fNcomps=p1;
- if (fGaus) delete fGaus;
- fGaus = new TArrayF(fNcomps+1);
- for(Int_t i=0; i<=fNcomps; i++) {
- Float_t x = -fNsigmas + (2.*i*fNsigmas)/(fNcomps-1);
- (*fGaus)[i] = exp(-((x*x)/2));
+//_________________________________________________________________________
+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;
+ }
+ }else if(lay==4){
+ minMod=5;
+ maxMod=8;
+ 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::PrintChargeCalibrationParams() const{
+ //
+ 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);
+ }
+ 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=GetADCtokeV(modIndex);
+ printf("%7.2f ",tz);
+ }
+ printf("\n");
+ }
+}
+//_________________________________________________________________________
+void AliITSresponseSDD::PrintTimeZeroes() const{
+ //
+ 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=GetTimeZero(modIndex);
+ printf("%7.2f ",tz);
+ }
+ 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);
+ }
+ printf("\n");
+ }
+
+}
+//_________________________________________________________________________
+void AliITSresponseSDD::PrintVdriftCorerctions() const{
+ //
+ for(Int_t iMod=240; iMod<500; iMod++){
+ printf("Module %d dVleft=%f dVright=%f\n",iMod,GetDeltaVDrift(iMod,0),GetDeltaVDrift(iMod,1));
}
}