]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Module dependent SDD Time Zero in AliITSresponseSDD, needed for proper reconstruction...
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Nov 2008 09:54:39 +0000 (09:54 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Nov 2008 09:54:39 +0000 (09:54 +0000)
ITS/AliITSClusterFinderV2SDD.cxx
ITS/AliITSresponseSDD.cxx
ITS/AliITSresponseSDD.h
ITS/Calib/RespSDD/Run0_999999999_v0_s0.root
ITS/StoreRespSDD.C

index a15622ef3f79f288d387148c8ba1ea44796f632f..d3553909c6baacc713be113ff0053d8af7680295 100644 (file)
@@ -227,7 +227,7 @@ FindClustersSDD(AliBin* bins[2], Int_t nMaxBin, Int_t nzBins,
        if(s==1) zAnode += GetSeg()->NpzHalf();  // right side has anodes from 256. to 511.
        Float_t zdet = GetSeg()->GetLocalZFromAnode(zAnode);
        Float_t driftTimeUncorr = GetSeg()->GetDriftTimeFromTb(timebin)+jitter*rsdd->GetCarlosRXClockPeriod();
-       Float_t driftTime=driftTimeUncorr-rsdd->GetTimeOffset();
+       Float_t driftTime=driftTimeUncorr-rsdd->GetTimeZero(fModule);
        Float_t driftPathMicron = cal->GetDriftPath(driftTime,zAnode);
        const Double_t kMicronTocm = 1.0e-4; 
        Float_t xdet=(driftPathMicron-GetSeg()->Dx())*kMicronTocm; // xdet is negative
index 914c9afb61c3bc1ba25e31d77164dc1e15368898..883b5e37572637c1f86996c1279810e85d194c55 100644 (file)
@@ -27,6 +27,7 @@
 #include <TMath.h>
 
 #include "AliITSresponseSDD.h"
+#include <AliITSgeomTGeo.h>
 
 const Float_t AliITSresponseSDD::fgkTimeOffsetDefault = 54.30;
 const Float_t AliITSresponseSDD::fgkADC2keVDefault = 5.243;
@@ -39,6 +40,61 @@ TObject(),
 fTimeOffset(fgkTimeOffsetDefault),
 fADC2keV(fgkADC2keVDefault){
   // default constructor
+  for(Int_t i=0; i<kNSDDmods;i++){
+    fTimeZero[i]=fgkTimeOffsetDefault;
+  }  
+}
+//_________________________________________________________________________
+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::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);
+  }
 }
-
-
index e4df365e258ca1ebf6ca67f9400bdf8e4d3b851b..71b7b73558e092a348096cac246ad81d8b4cfb8c 100644 (file)
@@ -6,6 +6,7 @@
  
 
 #include <TObject.h>
+#include <AliLog.h>
 
 /* $Id$ */
 
@@ -21,9 +22,42 @@ class AliITSresponseSDD : public TObject {
     AliITSresponseSDD();
     virtual ~AliITSresponseSDD(){};
 
+    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;
+    }
 
     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];
+    }
     static Float_t DefaultTimeOffset() {return fgkTimeOffsetDefault;}
 
     virtual void SetADC2keV(Float_t conv){fADC2keV=conv;}
@@ -35,19 +69,27 @@ class AliITSresponseSDD : public TObject {
 
  protected:
 
+    enum {kNSPDmods = 240};
+    enum {kNSDDmods = 260};
+    enum {kNLaddersLay3 = 14};
+    enum {kNLaddersLay4 = 22};
+
+
     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 
-    Float_t  fADC2keV;        // Conversion factor from ADC to keV
+    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,15
+    ClassDef(AliITSresponseSDD,16
     
     };
 #endif
index f94a3f6677fc15740aa61c457058626ce8e1727a..bd71133761ac73f8675055e55f8cea8b26d9ce64 100644 (file)
Binary files a/ITS/Calib/RespSDD/Run0_999999999_v0_s0.root and b/ITS/Calib/RespSDD/Run0_999999999_v0_s0.root differ
index 01504df350e1fc969e451ba80cb4d7c7923bcf00..b2b782fa3d5244faa02579651610bf8d2c5ab9e6 100644 (file)
@@ -29,6 +29,11 @@ void StoreRespSDD(Int_t firstRun=0, Int_t lastRun=999999999 ){
 
   AliCDBId idRespSDD("ITS/Calib/RespSDD",firstRun, lastRun);
   AliITSresponseSDD* rd = new AliITSresponseSDD();
-  rd->SetTimeOffset(54.3);
+  rd->SetSideATimeZero(54.3);
+  rd->SetSideCTimeZero(54.3);
+//   rd->SetLayer3ATimeZero(235);
+//   rd->SetLayer3CTimeZero(287);
+//   rd->SetLayer4ATimeZero(202);
+//   rd->SetLayer4CTimeZero(230);
   AliCDBManager::Instance()->GetDefaultStorage()->Put(rd, idRespSDD, md);  
 }