]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSresponseSDD.cxx
For Pythia with tune don't switch off MI in ConfigHeavyFlavor
[u/mrichter/AliRoot.git] / ITS / AliITSresponseSDD.cxx
index f827d57807435f765babce75bcd1942f066b53ee..9dfe302767831843a03f8842dfd9446a303bd358 100644 (file)
 #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 = "1D";
-const Float_t AliITSresponseSDD::fgkDriftSpeedDefault = 7.3;
-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.),
-fDriftSpeed(fgkDriftSpeedDefault),
-fElectronics(0),
-fMaxAdc(fgkMaxAdcDefault),
-fNsigmas(fgkNsigmasDefault),
-fGaus(),
-fNcomps(0),
-fBitComp(kFALSE),
-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);
-  SetDo10to8();
-  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)
 }
-
-
-//______________________________________________________________________
-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);
+  }
 }
-
-
-//______________________________________________________________________
-Int_t AliITSresponseSDD::Convert8to10(Int_t signal) const {
-  // Undo the lossive 10 to 8 bit compression.
-  // code from Davide C. and Albert W.
-
-  if(Do10to8()){  // kTRUE if the compression is active
-    if (signal < 0 || signal > 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::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;
   }
-  else {  
-    return signal;
+  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::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));
   }
 }