]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSresponseSDD.h
modifications to satisfy the coding conventions
[u/mrichter/AliRoot.git] / ITS / AliITSresponseSDD.h
index 3692860900431f253b174cd1f78397d16ddee5e6..71b7b73558e092a348096cac246ad81d8b4cfb8c 100644 (file)
 #ifndef ALIITSRESPONSESDD_H
 #define ALIITSRESPONSESDD_H
+/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
 
-#include "TArrayF.h"
-#include <TString.h>
-#include <iostream.h>
-#include "AliITSresponse.h"
+#include <TObject.h>
+#include <AliLog.h>
 
-// response for SDD
+/* $Id$ */
+
+/////////////////////////////////////////////////////////////
+//  Base settings for the ITS response classes.            //  
+//  The data member of this class are static and set once  //
+//  for all the modules.                                   //    
+///////////////////////////////////////////////////////////// 
+
+class AliITSresponseSDD : public TObject {
+  public:
 
-class AliITSresponseSDD : public AliITSresponse {
- public:
-    //
-    // Configuration methods
-    //
-  
     AliITSresponseSDD();
-    AliITSresponseSDD(const char *dataType);
-    virtual ~AliITSresponseSDD();
+    virtual ~AliITSresponseSDD(){};
 
-    void SetElectronics(Int_t p1=1) {
-       // Electronics: Pascal (1) or OLA (2)
-       fElectronics=p1;
+    virtual void SetSideATimeZero(Float_t tzero){
+      SetLayer3ATimeZero(tzero);
+      SetLayer4ATimeZero(tzero);
+    }
+    virtual void SetSideCTimeZero(Float_t tzero){
+      SetLayer3CTimeZero(tzero);
+      SetLayer4CTimeZero(tzero);
+    }
+    virtual void SetLayer3ATimeZero(Float_t tzero){
+      for(Int_t iLad=1; iLad<=kNLaddersLay3; iLad++) SetHalfLadderATimeZero(3,iLad,tzero);      
+    }
+    virtual void SetLayer3CTimeZero(Float_t tzero){
+      for(Int_t iLad=1; iLad<=kNLaddersLay3; iLad++) SetHalfLadderCTimeZero(3,iLad,tzero);
+    }
+    virtual void SetLayer4ATimeZero(Float_t tzero){
+      for(Int_t iLad=1; iLad<=kNLaddersLay4; iLad++) SetHalfLadderATimeZero(4,iLad,tzero);      
+    }
+    virtual void SetLayer4CTimeZero(Float_t tzero){
+      for(Int_t iLad=1; iLad<=kNLaddersLay4; iLad++) SetHalfLadderCTimeZero(4,iLad,tzero);
+    }
+    virtual void SetHalfLadderATimeZero(Int_t lay, Int_t lad, Float_t tzero);
+    virtual void SetHalfLadderCTimeZero(Int_t lay, Int_t lad, Float_t tzero);
+    virtual void SetModuleTimeZero(Int_t modIndex, Float_t tzero){
+      if(modIndex<kNSPDmods || modIndex>kNSPDmods+kNSDDmods) AliError(Form("SDD module number %d out of range",modIndex));
+      fTimeZero[modIndex-kNSPDmods]=tzero;
     }
-  
-  Int_t Electronics() {
-    // Electronics: 1 = Pascal; 2 = OLA
-    return fElectronics;
-  }
-  
-  void    SetMaxAdc(Float_t p1=1024.) {
-    // Adc-count saturation value
-    fMaxAdc=p1;
-  }
-  Float_t MaxAdc()  {
-    // Get maximum Adc-count value
-    return fMaxAdc;
-  }                       
-  
-  void    SetChargeLoss(Float_t p1=0.0) {
-    // Set Linear Charge Loss Steepness  // 0.01 for 20%
-    fChargeLoss=p1;
-  }
-  Float_t ChargeLoss()  {
-    // Get Charge Loss Coefficient
-    return fChargeLoss;
-  }                       
-  
-  void    SetDynamicRange(Float_t p1=132.) {
-    // Set Dynamic Range
-    fDynamicRange=p1;
-  }
-  Float_t DynamicRange()  {
-    // Get Dynamic Range
-    return fDynamicRange;
-  }                       
-  
-  void    SetDiffCoeff(Float_t p1=3.23,Float_t p2=30.) {
-    // Diffusion coefficients
-    fDiffCoeff=p1;
-    fDiffCoeff1=p2;
-  }
-  void DiffCoeff(Float_t&diff,Float_t&diff1) {
-    // Get diffusion coefficients
-    diff = fDiffCoeff;
-    diff1 = fDiffCoeff1;
-  } 
-  
-  void    SetDriftSpeed(Float_t p1=7.3) {
-    // Drift velocity
-    fDriftSpeed=p1;
-  }
-  Float_t DriftSpeed() {
-    // drift speed
-    return fDriftSpeed;
-  } 
-  
-  void    SetTemperature(Float_t p1=23.) {
-    // Temperature
-    fTemperature=p1;
-  }
-  Float_t Temperature() {
-    // Get temperature
-    return fTemperature;
-  } 
-  
-  void    SetDataType(const char *data="simulated") {
-    // Type of data - real or simulated
-    fDataType=data;
-  }
-  const char  *DataType() const {
-    // Get data type
-    return fDataType.Data();
-  } 
-  
-  void SetParamOptions(const char *opt1="same",const char *opt2="same"){
-    // Parameters: "same" or read from "file" 
-    fParam1=opt1; fParam2=opt2;
-  }
-  void   ParamOptions(char *opt1,char *opt2) {
-    // options
-    strcpy(opt1,fParam1.Data()); strcpy(opt2,fParam2.Data());
-  }
-  
-  void  SetNoiseParam(Float_t n=0., Float_t b=20.){
-    // Noise and baseline  // 8.3 for ALICE with beam test measurements
-    fNoise=n; fBaseline=b;
-  }   
-  void  SetNoiseAfterElectronics(Float_t n=0.){
-    // Noise after electronics (ADC units) // 1.6 for ALICE from beam test measurements
-    fNoiseAfterEl=n;
-  }   
-  void  GetNoiseParam(Float_t &n, Float_t &b) {
-    // get noise param
-    n=fNoise; b=fBaseline;
-  }  
-  Float_t  GetNoiseAfterElectronics(){
-    // Noise after electronics (ADC units)
-    return fNoiseAfterEl;
-  }   
-
-  void  SetDo10to8(Bool_t bitcomp=kTRUE) {
-    // set the option for 10 to 8 bit compression
-    fBitComp = bitcomp;
-  }
 
-  Bool_t Do10to8() {
-    // get 10 to 8 compression option
-    return fBitComp;
-  }   
-  
-  void    SetZeroSupp (const char *opt="1D") {
-    // Zero-suppression option - could be 1D, 2D or non-ZS 
-    fOption=opt;
-  }
-  const char *ZeroSuppOption() const {
-    // Get zero-suppression option
-    return fOption.Data();
-  }
-  void  SetMinVal(Int_t mv=4) {
-    // Min value used in 2D - could be used as a threshold setting
-    fMinVal = mv;
-  }
-  Int_t  MinVal() {
-    // min val
-    return fMinVal;
-  }
-  
-  void   SetFilenames(const char *f1="",const char *f2="",const char *f3="") {
-    // Set filenames - input, output, parameters ....
-    fFileName1=f1; fFileName2=f2; fFileName3=f3;
-  }
-  void   Filenames(char *input,char *baseline,char *param) {
-    // Filenames
-   strcpy(input,fFileName1.Data());  strcpy(baseline,fFileName2.Data());  
-   strcpy(param,fFileName3.Data());
-  }     
-  
-  
-  void  SetOutputOption(Bool_t write=kFALSE) {
-    // set output option
-    fWrite = write;
-  }
-  Bool_t OutputOption()  {
-    // output option
-    return fWrite;
-  }
-  // 
-  // Compression parameters
-  void  SetCompressParam(Int_t cp[8]); 
-  void  GiveCompressParam(Int_t *x);
-  
-  //  
-  // Detector type response methods
-  void    SetNSigmaIntegration(Float_t p1=3.) {
-    // Set number of sigmas over which cluster disintegration is performed
-    fNsigmas=p1;
-  }
-  Float_t NSigmaIntegration() {
-    // Get number of sigmas over which cluster disintegration is performed
-    return fNsigmas;
-  }
-  void SetNLookUp(Int_t p1=121) {
-    // 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++) {
-      Float_t x = -fNsigmas + (2.*i*fNsigmas)/(fNcomps-1);
-      (*fGaus)[i] = exp(-((x*x)/2));
- //     cout << "fGaus[" << i << "]: " << fGaus->At(i) << endl;
+    virtual void SetTimeOffset(Float_t to){fTimeOffset = to;}
+    virtual Float_t GetTimeOffset()const {return fTimeOffset;}
+    virtual Float_t GetTimeZero(Int_t modIndex){
+      if(modIndex<kNSPDmods || modIndex>kNSPDmods+kNSDDmods){
+       AliError(Form("SDD module number %d out of range",modIndex));
+       return 0.;
+      }
+      return fTimeZero[modIndex-kNSPDmods];
     }
-  }
-    // Get number of intervals in which the gaussian lookup table is divided
-  Int_t GausNLookUp() {return fNcomps;}
-  
-  Float_t IntPH(Float_t eloss) {
-    // Pulse height from scored quantity (eloss)
-    return 0.;
-  }
-  Float_t IntXZ(AliITSsegmentation *) {
-    // Charge disintegration 
-    return 0.;
-  }
-  Float_t GausLookUp(Int_t i) {
-    if(i<0 || i>=fNcomps) return 0.;
-    return fGaus->At(i);
-  }
-  void SetDeadChannels(Int_t nmodules=0, Int_t nchips=0, Int_t nchannels=0);
-  void    PrintGains();
-  void    Print();
+    static Float_t DefaultTimeOffset() {return fgkTimeOffsetDefault;}
 
+    virtual void SetADC2keV(Float_t conv){fADC2keV=conv;}
+    virtual Float_t GetADC2keV()const {return fADC2keV;}
+    static Float_t DefaulttADC2keV() {return fgkADC2keVDefault;}
 
-private:
+    static Float_t GetCarlosRXClockPeriod() {return fgkCarlosRXClockPeriod;}
 
-  AliITSresponseSDD(const AliITSresponseSDD &source); // copy constructor
-  AliITSresponseSDD& operator=(const AliITSresponseSDD &source); // ass. op.
-    
-protected:
-  
-  static const Int_t fModules = 520;     // Total number of SDD modules
-  static const Int_t fChips = 4;        // Number of chips/module
-  static const Int_t fChannels = 64;    // Number of channels/chip
-  Float_t   fGain[fModules][fChips][fChannels];   // Array for channel gains
+ protected:
 
-  Int_t     fCPar[8];        // Hardware compression parameters
-  Float_t   fNoise;          // Noise
-  Float_t   fBaseline;       // Baseline
-  Float_t   fNoiseAfterEl;   // Noise after electronics
-  Float_t   fDynamicRange;   // Set Dynamic Range 
-  Float_t   fChargeLoss;     // Set Linear Coefficient for Charge Loss 
-  Float_t   fTemperature;    // Temperature 
-  Float_t   fDriftSpeed;     // Drift velocity
-  Int_t     fElectronics;    // Electronics
-  
-  Float_t    fMaxAdc;        // Adc saturation value
-  Float_t    fDiffCoeff;     // Diffusion Coefficient (scaling the time)
-  Float_t    fDiffCoeff1;    // Diffusion Coefficient (constant term)
-  Float_t    fNsigmas;       // Number of sigmas over which charge disintegration 
-                             // is performed 
-  TArrayF   *fGaus;          // Gaussian lookup table for signal generation
-  Int_t      fNcomps;        // Number of samplings along the gaussian
-  
-  Int_t      fMinVal;        // Min value used in 2D zero-suppression algo
-  
-  Bool_t     fWrite;         // Write option for the compression algorithms
-  Bool_t     fBitComp;       // 10 to 8 bit compression option
+    enum {kNSPDmods = 240};
+    enum {kNSDDmods = 260};
+    enum {kNLaddersLay3 = 14};
+    enum {kNLaddersLay4 = 22};
 
-  TString    fOption;        // Zero-suppresion option (1D, 2D or none)
-  TString    fParam1;        // Read baselines from file option
-  TString    fParam2;        // Read compression algo thresholds from file 
-  
-  TString         fDataType;         // data type - real or simulated
-  TString         fFileName1;        // input keys : run, module #
-  TString         fFileName2;        // baseline & noise val or output coded                                                 // signal or monitored bgr.
-  TString         fFileName3;        // param values or output coded signal 
-  
-  ClassDef(AliITSresponseSDD,2) // SDD response
-};
-#endif
 
+    static const Float_t fgkTimeOffsetDefault; // default for fTimeOffset
+    static const Float_t fgkADC2keVDefault; // default for fADC2keV
+    static const Float_t fgkCarlosRXClockPeriod;  // clock period for CarlosRX
+
+    Float_t  fTimeOffset;          // Time offset due to electronic delays 
+                                   // --> obsolete, kept for backw. comp. 
+    Float_t  fTimeZero[kNSDDmods]; // Time Zero for each module
+    Float_t  fADC2keV;             // Conversion factor from ADC to keV
+
+ private:
+
+   AliITSresponseSDD(const AliITSresponseSDD &ob); // copy constructor
+   AliITSresponseSDD& operator=(const AliITSresponseSDD & /* source */); // ass. op.
+
+    ClassDef(AliITSresponseSDD,16) 
+    
+    };
+#endif