]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Possibility of switching on/off the correction maps (F.Prino)
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Feb 2008 19:10:53 +0000 (19:10 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Feb 2008 19:10:53 +0000 (19:10 +0000)
ITS/AliITSCalibrationSDD.cxx
ITS/AliITSCalibrationSDD.h
ITS/AliITSClusterFinderSDD.cxx
ITS/AliITSClusterFinderSDD.h
ITS/AliITSClusterFinderV2SDD.cxx
ITS/AliITSClusterFinderV2SDD.h
ITS/AliITSMapSDD.cxx
ITS/AliITSMapSDD.h
ITS/AliITSPreprocessorSSD.cxx
ITS/AliITSsegmentationSDD.h
ITS/Calib/CalibSDD/Run0_9999999_v0_s0.root

index 42c8c74bcff4cc3459292f8d8b4f3b4507ed111b..d7ae5a0aad01faa966730845fcda1c7197fd653a 100644 (file)
@@ -43,6 +43,8 @@ fDeadChannels(0),
 fMinVal(fgkMinValDefault),
 fIsDead(kFALSE),
 fBadChannels(),
+fUseACorrMap(0),
+fUseTCorrMap(0),
 fMapAW0(0),
 fMapAW1(0),
 fMapTW0(0),
@@ -66,6 +68,7 @@ fDrSpeed1(0)
   }
   SetThresholds(fgkMinValDefault,0.);
   SetTemperature(fgkTemperatureDefault);
+  SetUseCorrectionMaps(kTRUE,kTRUE);
   SetDataType();
  }
 //______________________________________________________________________
@@ -76,6 +79,8 @@ fDeadChannels(0),
 fMinVal(fgkMinValDefault),
 fIsDead(kFALSE),
 fBadChannels(),
+fUseACorrMap(0),
+fUseTCorrMap(0),
 fMapAW0(0),
 fMapAW1(0),
 fMapTW0(0),
@@ -98,8 +103,10 @@ fDrSpeed1(0)
     }
   }
 
+
   SetThresholds(fgkMinValDefault,0.);
   SetTemperature(fgkTemperatureDefault);
+  SetUseCorrectionMaps(kTRUE,kTRUE);
   SetDataType(dataType);
  }
 //_____________________________________________________________________
@@ -149,6 +156,22 @@ Float_t AliITSCalibrationSDD::GetChannelGain(Int_t anode) const{
   Int_t iChan=GetChipChannel(anode);
   return fGain[iWing][iChip][iChan];
 }
+//______________________________________________________________________
+void AliITSCalibrationSDD::GetCorrections(Float_t z, Float_t x, Float_t &devz, Float_t &devx, AliITSsegmentationSDD* seg){
+  //correction of coordinates using the maps stored in the DB
+  Int_t nSide=seg->GetSideFromLocalX(x);
+  devz=0;
+  if(fUseACorrMap){
+    if(nSide==0) devz=fMapAW0->GetCorrection(z,x,seg);
+    else devz=fMapAW1->GetCorrection(z,x,seg);
+  }
+  devx=0;
+  if(fUseTCorrMap){
+    if(nSide==0) devx=fMapTW0->GetCorrection(z,x,seg);
+    else devx=fMapTW1->GetCorrection(z,x,seg);
+  }
+  return;
+}
 /*
 //______________________________________________________________________
 void AliITSCalibrationSDD::SetDeadChannels(Int_t nchip, Int_t nchan){
index 0f4da6cb91cf93fe925922c9c6c0b3f2c8b91403..1123ba9d47b77a8c2470665861397ca9cfd0e731 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "AliITSCalibration.h"
 #include "AliITSresponseSDD.h"
+#include "AliITSsegmentationSDD.h"
 #include "TArrayI.h"
 
 class AliITSMapSDD;
@@ -97,10 +98,14 @@ class AliITSCalibrationSDD : public AliITSCalibration {
     
     virtual void SetBadChannel(Int_t i,Int_t anode);
     Int_t GetBadChannel(Int_t i) const {return fBadChannels[i];}
-    Bool_t IsBadChannel(Int_t anode){
+    Bool_t IsBadChannel(Int_t anode) const{
       if(GetChannelGain(anode)==0) return kTRUE;
       else return kFALSE;
     }
+    void SetUseCorrectionMaps(Bool_t useAnodeMap, Bool_t useDriftMap){
+      fUseACorrMap=useAnodeMap;
+      fUseTCorrMap=useDriftMap;
+    }
     Float_t GetMapACell(Int_t i,Int_t j) const {
       if(i<256) return fMapAW0->GetCellContent(i,j);
       else return fMapAW1->GetCellContent(i-256,j);
@@ -117,7 +122,6 @@ class AliITSCalibrationSDD : public AliITSCalibration {
       if(wing==0) fMapTW0=mapT;
       else fMapTW1=mapT;
     } 
-    static Int_t GetMapTimeNBin() {return fgkMapTimeNBin;} 
     
     virtual void SetDriftSpeed(Int_t wing, AliITSDriftSpeedArraySDD* arr){
       if(wing==0) fDrSpeed0=arr;
@@ -154,6 +158,7 @@ class AliITSCalibrationSDD : public AliITSCalibration {
     virtual void  SetJitterError(Double_t jitter=20) {((AliITSresponseSDD*)fResponse)->SetJitterError(jitter);}
     virtual Float_t GetJitterError() const {return ((AliITSresponseSDD*)fResponse)->JitterError();}
     virtual Float_t GetDriftPath(Float_t time, Float_t xAnode) const {return time*GetDriftSpeedAtAnode(xAnode);}
+    void GetCorrections(Float_t z, Float_t x, Float_t &devz, Float_t &devx, AliITSsegmentationSDD* seg);
     virtual Float_t GetThresholdAnode(Int_t anode,Int_t nsigma=3) const {
       return nsigma*fNoiseAfterEl[anode];}
 
@@ -170,7 +175,7 @@ class AliITSCalibrationSDD : public AliITSCalibration {
     static const Float_t fgkBaselineDefault; // default for fBaseline
     static const Float_t fgkMinValDefault; // default for fMinVal
     static const Float_t fgkGainDefault; //default for gain
-    static const Int_t fgkMapTimeNBin = 72; //map granularity along drift direction
+
     Int_t fDeadChips;                     // Number of dead chips
     Int_t fDeadChannels;                  // Number of dead channels
     Float_t fGain[fgkWings][fgkChips][fgkChannels];//Array for channel gains
@@ -183,6 +188,9 @@ class AliITSCalibrationSDD : public AliITSCalibration {
     TArrayI  fBadChannels; //Array with bad anodes number (0-512) 
 
     
+    Bool_t fUseACorrMap;    // flag for the use of correction maps (anode)
+    Bool_t fUseTCorrMap;    // flag for the use of correction maps (drift)
+
     AliITSMapSDD* fMapAW0;     //! map of residuals on anode coord. wing 0
     AliITSMapSDD* fMapAW1;     //! map of residuals on anode coord. wing 1
     AliITSMapSDD* fMapTW0;     //! map of residuals on time coord. wing 0
@@ -195,7 +203,7 @@ class AliITSCalibrationSDD : public AliITSCalibration {
     AliITSCalibrationSDD& operator=(const AliITSCalibrationSDD & /* source */); // ass. op.
 
 
-    ClassDef(AliITSCalibrationSDD,8) // SDD response 
+    ClassDef(AliITSCalibrationSDD,9) // SDD response 
     
     };
 #endif
index 5895ac976f4d7e88d4e2cd567502b5e6ca4379e7..6f24cf540df756dbabfa8126442b4ba2f3cd2d1e 100644 (file)
@@ -836,11 +836,14 @@ void AliITSClusterFinderSDD::ResolveClusters(){
                 }
                 clusterI.SetPeakPos( peakpos ); 
                Float_t dp = cal->GetDriftPath(newiTimef,newAnodef);
-               Double_t driftPath = fSddLength - (Double_t)dp;
-                Double_t sign = ( wing == 1 ) ? -1. : 1.;
-               Double_t xcoord = driftPath*sign * 0.0001;
-               Double_t zcoord = anodePath * 0.0001;
-               CorrectPosition(zcoord,xcoord);
+               Float_t driftPath = fSddLength - (Double_t)dp;
+                Float_t sign = ( wing == 1 ) ? -1. : 1.;
+               Float_t xcoord = driftPath*sign * 0.0001;
+               Float_t zcoord = anodePath * 0.0001;
+               Float_t corrx=0, corrz=0;
+               cal->GetCorrections(zcoord,xcoord,corrz,corrx,GetSeg());
+               xcoord+=corrx;
+               zcoord+=corrz;
                 clusterI.SetX( xcoord );        
                 clusterI.SetZ( zcoord );
                 clusterI.SetAnode( newAnodef );
@@ -1034,27 +1037,4 @@ void AliITSClusterFinderSDD::PrintStatus() const{
     cout << "**************************************************" << endl;
 }
 
-//_________________________________________________________________________
-void AliITSClusterFinderSDD::CorrectPosition(Double_t &z, Double_t&y){
-  //correction of coordinates using the maps stored in the DB
-
-  AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
-  static const Int_t nbint = cal->GetMapTimeNBin();
-  static const Int_t nbina = cal->Chips()*cal->Channels();
-  Float_t stepa = (GetSeg()->Dpz(0))/10000.; //anode pitch in cm
-  Float_t stept = (GetSeg()->Dx()/cal->GetMapTimeNBin()/2.)/10.;
-
-  Int_t bint = TMath::Abs((Int_t)(y/stept));
-  if(y>=0) bint+=(Int_t)(nbint/2.);
-  if(bint>nbint) AliError("Wrong bin number!");
 
-  Int_t bina = TMath::Abs((Int_t)(z/stepa));
-  if(z>=0) bina+=(Int_t)(nbina/2.);
-  if(bina>nbina) AliError("Wrong bin number!");
-
-  Double_t devz = (Double_t)cal->GetMapACell(bina,bint)/10000.;
-  Double_t devx = (Double_t)cal->GetMapTCell(bina,bint)/10000.;
-  z+=devz;
-  y+=devx;
-
-}
index 2bab4cd3194ce777f79d13d065d74fff394d8130..8a4e20e5d50b58d7a2914e04304b293e6e61d9e6 100644 (file)
@@ -78,7 +78,7 @@ class AliITSClusterFinderSDD : public AliITSClusterFinder{
     void  PeakFunc( Int_t xdim, Int_t zdim, Double_t *par, Double_t *spe,
                     Double_t *Integral=0 );
     void  PrintStatus() const;
-    void CorrectPosition(Double_t &z, Double_t&y);
+
   private:
     virtual AliITSCalibrationSDD* GetResp(Int_t mod)const{
         return (AliITSCalibrationSDD*) fDetTypeRec->GetCalibrationModel(mod);}//Return Response
index 4c1c9cef893fe351d614dc4dd9c17df34b337374..e2cb3092d2014dd51683cec27ca89eab67e33329 100644 (file)
@@ -205,8 +205,11 @@ FindClustersSDD(AliBin* bins[2], Int_t nMaxBin, Int_t nzBins,
        const Double_t kMicronTocm = 1.0e-4; 
        Float_t xdet=(driftPathMicron-GetSeg()->Dx())*kMicronTocm; // xdet is negative
        if (s==0) xdet=-xdet; // left side has positive local x
-        
-       CorrectPosition(zdet,xdet);
+       
+       Float_t corrx=0, corrz=0;
+       cal->GetCorrections(zdet,xdet,corrz,corrx,GetSeg());
+       zdet+=corrz;
+       xdet+=corrx;
 
        Double_t loc[3]={xdet,0.,zdet},trk[3]={0.,0.,0.};
        mT2L->MasterToLocal(loc,trk);
@@ -336,28 +339,4 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
 }
 
 
-//_________________________________________________________________________
-void AliITSClusterFinderV2SDD::CorrectPosition(Float_t &z, Float_t&y){
-
-  //correction of coordinates using the maps stored in the DB
-
-  AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
-  static const Int_t knbina = cal->Wings()*cal->Chips()*cal->Channels();
-  Int_t bina =(Int_t) GetSeg()->GetAnodeFromLocal(y,z);
-  if(bina>knbina) AliError("Wrong bin number along anodes!");
-
-  static const Int_t knbint = cal->GetMapTimeNBin();
-  const Double_t kMicronTocm = 1.0e-4; 
-  Float_t stept = GetSeg()->Dx()*kMicronTocm/cal->GetMapTimeNBin();  
-  Int_t bint = TMath::Abs((Int_t)(y/stept));
-  if(bint==knbint) bint-=1;
-  if(bint>=knbint) AliError("Wrong bin number along drift direction!");
 
-
-  Float_t devz = cal->GetMapACell(bina,bint)*kMicronTocm;
-  Float_t devx = cal->GetMapTCell(bina,bint)*kMicronTocm;
-  z+=devz;
-  y+=devx;
-
-
-}
index 143b9aab3c4bda9fd1eeb853f659ea490ae8d629..5b9e15ce8bec2889d89792f91901d5a050cfbd43 100644 (file)
@@ -34,7 +34,6 @@ public:
                       TClonesArray *dig, TClonesArray *clusters=0x0);
 
   void FindClustersSDD(AliITSRawStream* input,TClonesArray** clusters);
-  void CorrectPosition(Float_t &z, Float_t&y);
   virtual AliITSCalibrationSDD* GetResp(Int_t mod)const{
     return (AliITSCalibrationSDD*) fDetTypeRec->GetCalibrationModel(mod);}
   virtual AliITSsegmentationSDD* GetSeg()const{
index 6e19e6c2bb840eeca8721876b2a12a02c99594d7..cef0d2bc8bea2e27770151f423a59f4f64e1f686 100644 (file)
@@ -59,6 +59,21 @@ void AliITSMapSDD::SetMap(TH2F* hmap){
   }
 }
 //______________________________________________________________________
+Float_t AliITSMapSDD::GetCorrection(Float_t z, Float_t x, AliITSsegmentationSDD *seg){
+  // returns correction in cm starting from local coordinates on the module
+  const Double_t kMicronTocm = 1.0e-4; 
+  Int_t nAnodes=seg->Npz();
+  Int_t nAnodesHybrid=seg->NpzHalf();
+  Int_t bina =(Int_t) seg->GetAnodeFromLocal(x,z);
+  if(bina>nAnodes)  AliError("Wrong anode anumber!");
+  if(bina>=nAnodesHybrid) bina-=nAnodesHybrid;
+  Float_t stept = seg->Dx()*kMicronTocm/(Float_t)fgkNDrifPts;
+  Int_t bint = TMath::Abs((Int_t)(x/stept));
+  if(bint==fgkNDrifPts) bint-=1;
+  if(bint>=fgkNDrifPts) AliError("Wrong bin number along drift direction!");
+  return kMicronTocm*GetCellContent(bina,bint);
+}
+//______________________________________________________________________
 TH2F* AliITSMapSDD::GetMapHisto() const{
   // Returns a TH2F histogram with map of residuals
   Char_t hname[50];
index 8f06eb176f07af8fa3b7a84a5d8aee288e5c4f79..adb6a246df3238456562f8fa498cc627835668ce 100644 (file)
@@ -13,6 +13,7 @@
 //                                                               //
 ///////////////////////////////////////////////////////////////////
 
+#include "AliITSsegmentationSDD.h"
 #include<TNamed.h>
 #include "AliLog.h"
 class TH1F;
@@ -26,20 +27,24 @@ class AliITSMapSDD : public TNamed {
   virtual ~AliITSMapSDD(){};
 
   void SetMap(TH2F* hmap);
-  void SetCellContent(Int_t iAn, Int_t iTb, Float_t devMicron){
-    if(iAn<0 || iAn>=fgkNAnodPts || iTb<0 || iTb >= fgkNDrifPts){
+  Bool_t CheckBounds(Int_t iAn, Int_t iTb) const {
+    if(iAn<0 || iAn>=fgkNAnodPts || iTb<0 || iTb >= fgkNDrifPts){ 
       AliWarning(Form("Cell out of bounds, anode=%d time-bin=%d",iAn,iTb));
-      return;
+      return kFALSE;
     }
-    fMap[iAn][iTb]=devMicron;
+    return kTRUE;
+  }
+  void SetCellContent(Int_t iAn, Int_t iTb, Float_t devMicron){
+    if(CheckBounds(iAn,iTb)) fMap[iAn][iTb]=devMicron;
   }
+
   Float_t GetCellContent(Int_t iAn, Int_t iTb) const {
-    if(iAn<0 || iAn>=fgkNAnodPts || iTb<0 || iTb >= fgkNDrifPts){
-      AliWarning(Form("Cell out of bounds, anode=%d timebin=%d",iAn,iTb));
-      return 0.;
-    }
-    else return fMap[iAn][iTb];
+    if(CheckBounds(iAn,iTb)) return fMap[iAn][iTb];
+    else return 0.;
   }
+  Float_t GetCorrection(Float_t z, Float_t x, AliITSsegmentationSDD *seg);
+  static Int_t GetNBinsAnode() {return fgkNAnodPts;}
+  static Int_t GetNBinsDrift() {return fgkNDrifPts;}
 
   TH2F* GetMapHisto() const;
   TH1F* GetResidualDistr(Float_t dmin=-300., Float_t dmax=300.) const;
index db4d19d1323010970a75d0b4adac2b7e208dee57..9438c6a5b0e2f897a3dad11c34ab5c21292e4212 100644 (file)
@@ -50,10 +50,10 @@ UInt_t AliITSPreprocessorSSD::Process(TMap* /*dcsAliasMap*/)
   TObjArray badch_array(fgkNumberOfSSD); 
   TObjArray ped_array(fgkNumberOfSSD); 
   //Float_t noise=0, gain=0;
-
+  
   TString runType = GetRunType();
- if(runType == "ELECTRONICS_CALIBRATION_RUN") {
-
 if(runType == "ELECTRONICS_CALIBRATION_RUN") {
+    
   }
   else if(runType == "PEDESTAL") {
 
index 44089d6d55a93a9ca88bc9bd301d26b003ca7d39..57bb617aa7280cb9bc711ffab9701366ffb219db 100644 (file)
@@ -53,6 +53,10 @@ public AliITSsegmentation {
     virtual void    DetToLocal(Int_t ix,Int_t iz,Float_t &x,Float_t &z) const;
     //
     virtual Float_t GetAnodeFromLocal(Float_t x,Float_t z) const;
+    virtual Int_t   GetSideFromLocalX(Float_t xloc) const {
+      if(xloc>0) return 0;   // left side (channel 0) positive xloc
+      else return 1;         // right side (channel 1) negative xloc
+    }
     virtual Float_t GetLocalZFromAnode(Int_t nAnode) const;
     virtual Float_t GetLocalZFromAnode(Float_t zAnode) const;
     virtual Float_t GetDriftTimeFromTb(Int_t tb) const {
@@ -109,8 +113,8 @@ public AliITSsegmentation {
     static const Float_t fgkClockDefault; //Default value for the clock freq.
     static const Int_t fgkHalfNanodesDefault; //Default value for fNanodes/2
     static const Int_t fgkNsamplesDefault; //Default value for fNsamples
-    static const Float_t fgkCm2Micron;
-    static const Float_t fgkMicron2Cm;
+    static const Float_t fgkCm2Micron;  // conversion from cm to micron
+    static const Float_t fgkMicron2Cm;  // conversion from micron to cm
     ClassDef(AliITSsegmentationSDD,5) // SDD segmentation
 };
 
index e6770981c342e7b169b8bc74d3f4b22928d0e692..71938e6e82bb8f59da2f24c241aede211b006d20 100644 (file)
Binary files a/ITS/Calib/CalibSDD/Run0_9999999_v0_s0.root and b/ITS/Calib/CalibSDD/Run0_9999999_v0_s0.root differ