/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
+ * *
* Author: The ALICE Off-line Project. *
* Contributors are mentioned in the code where appropriate. *
* *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-#include <TString.h>
+/* $Id$ */
-#include "AliITSresponseSDD.h"
+//////////////////////////////////////////////////////
+// Base response class forITS //
+// It is used to set static data members //
+// connected to parameters equal for all //
+// the modules //
+// //
+// //
+//////////////////////////////////////////////////////
+#include <TMath.h>
-//___________________________________________
-ClassImp(AliITSresponseSDD)
+#include "AliITSresponseSDD.h"
+#include <AliITSgeomTGeo.h>
-AliITSresponseSDD::AliITSresponseSDD()
-{
- // constructor
- SetMaxAdc();
- SetDiffCoeff();
- SetDriftSpeed();
- SetNSigmaIntegration();
- SetNLookUp();
- // SetClock();
- SetNoiseParam();
- SetNoiseAfterElectronics();
- SetElectronics();
- SetDynamicRange();
- SetChargeLoss();
- SetMinVal();
- SetParamOptions();
- SetZeroSupp();
- SetDataType();
- SetFilenames();
- SetOutputOption();
- SetDo10to8();
-}
+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)
-//__________________________________________________________________________
-AliITSresponseSDD::AliITSresponseSDD(const AliITSresponseSDD &source){
- // Copy Constructor
- if(&source == this) return;
- Int_t i;
- for(i=0;i<8;i++){this->fCPar[i] = source.fCPar[i];}
- this->fNoise = source.fNoise;
- this->fBaseline = source.fBaseline;
- this->fNoiseAfterEl = source.fNoiseAfterEl;
- this->fDynamicRange = source.fDynamicRange;
- this->fChargeLoss = source.fChargeLoss;
- this->fTemperature = source.fTemperature;
- this->fDriftSpeed = source.fDriftSpeed;
- this->fNsigmas = source.fNsigmas;
- this->fMaxAdc = source.fMaxAdc;
- this->fDiffCoeff = source.fDiffCoeff;
- this->fDiffCoeff1 = source.fDiffCoeff1;
- this->fZeroSuppFlag = source.fZeroSuppFlag;
- this->fMinVal = source.fMinVal;
- this->fWrite = source.fWrite;
- this->fBitComp = source.fBitComp;
- this->fOption = source.fOption;
- this->fParam1 = source.fParam1;
- return;
+//_________________________________________________________________________
+AliITSresponseSDD::AliITSresponseSDD():
+TObject(),
+ fTimeOffset(fgkTimeOffsetDefault),
+ fADC2keV(fgkADC2keVDefault),
+ fChargevsTime(fgkChargevsTimeDefault)
+{
+ // default constructor
+ for(Int_t i=0; i<kNSDDmods;i++){
+ fTimeZero[i]=fgkTimeOffsetDefault;
+ fDeltaVDrift[i] = fDeltaVDrift[i+kNSDDmods] = 0.;
+ fADCtokeV[i]=fgkADC2keVDefault;
+ fADCvsDriftTime[i]=fgkADCvsDrTimeDefault;
+ }
+ 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::operator=(const AliITSresponseSDD &source) {
- // Assignment operator
- if(&source == this) return *this;
- Int_t i;
- for(i=0;i<8;i++){this->fCPar[i] = source.fCPar[i];}
- this->fNoise = source.fNoise;
- this->fBaseline = source.fBaseline;
- this->fNoiseAfterEl = source.fNoiseAfterEl;
- this->fDynamicRange = source.fDynamicRange;
- this->fChargeLoss = source.fChargeLoss;
- this->fTemperature = source.fTemperature;
- this->fDriftSpeed = source.fDriftSpeed;
- this->fNsigmas = source.fNsigmas;
- this->fMaxAdc = source.fMaxAdc;
- this->fDiffCoeff = source.fDiffCoeff;
- this->fDiffCoeff1 = source.fDiffCoeff1;
- this->fZeroSuppFlag = source.fZeroSuppFlag;
- this->fMinVal = source.fMinVal;
- this->fWrite = source.fWrite;
- this->fBitComp = source.fBitComp;
- this->fOption = source.fOption;
- this->fParam1 = source.fParam1;
- return *this;
+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::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]);
-
+//_________________________________________________________________________
+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::GiveCompressParam(Int_t cp[8])
-{
- // give compression param
-
- Int_t i;
- for (i=0; i<8; i++) {
- cp[i]=fCPar[i];
+//_________________________________________________________________________
+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);
}
+ 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::Print()
-{
- // Print SDD response Parameters
-
- cout << "**************************************************" << endl;
- cout << " Silicon Drift Detector Response Parameters " << endl;
- cout << "**************************************************" << endl;
- cout << "Diffusion Coefficients: " << fDiffCoeff << ", " << fDiffCoeff1 << endl;
-
- cout << "Hardware compression parameters: " << endl;
- for(Int_t i=0; i<8; i++) cout << "fCPar[" << i << "] = " << fCPar[i] << endl;
- cout << "Noise before electronics (arbitrary units): " << fNoise << endl;
- cout << "Baseline (ADC units): " << fBaseline << endl;
- cout << "Noise after electronics (ADC units): " << fNoiseAfterEl << endl;
-
- cout << "Dynamic Range: " << fDynamicRange << endl;
- cout << "Charge Loss: " << fChargeLoss << endl;
- cout << "Temperature: " << fTemperature << endl;
- cout << "Drift Speed: " << fDriftSpeed << endl;
- cout << "Electronics (1=PASCAL, 2=OLA): " << fElectronics << endl;
-
- cout << "N. of Sigma for signal integration: " << fNsigmas << endl;
- cout << "N. of bins in lookup table: " << fNcomps << endl;
-
- cout << "Max. ADC Value: " << fMaxAdc << endl;
- cout << "Min. Value: " << fMinVal << endl;
-
- cout << "Zero suppression flag: " << fZeroSuppFlag << endl;
- cout << "**************************************************" << endl;
+//_________________________________________________________________________
+void AliITSresponseSDD::PrintTimeZeroes() const{
+ // Dump time zero values
+
+ 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{
+ // Dump corrections to vdrift
-
-
+ for(Int_t iMod=240; iMod<500; iMod++){
+ printf("Module %d dVleft=%f dVright=%f\n",iMod,GetDeltaVDrift(iMod,0),GetDeltaVDrift(iMod,1));
+ }
+}