]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSCalibrationSPD.cxx
Coding conventions
[u/mrichter/AliRoot.git] / ITS / AliITSCalibrationSPD.cxx
index eb0afb8979f3b0d4cb399df1ce614621ccb81350..9d4d869c00429b3c9b49dd61ea94c30a1b8183e5 100644 (file)
@@ -13,6 +13,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+#include "AliITSCalibrationSPD.h"
 ///////////////////////////////////////////////////////////////////////////
 //  Calibration class for set:ITS                   
 //  Specific subdetector implementation for         
 //
 //  Modified by D. Elia, G.E. Bruno, H. Tydesjo
 //  March-April 2006
+//  Last mod:  H. Tydesjo  Oct 2007
+//  September   2007: CouplingRowDefault = 0.055 (was 0.047)
 //
 ///////////////////////////////////////////////////////////////////////////
-
-#include "AliITSCalibrationSPD.h"
-
 const Double_t AliITSCalibrationSPD::fgkThreshDefault = 3000.;
 const Double_t AliITSCalibrationSPD::fgkSigmaDefault = 250.;
 const Double_t AliITSCalibrationSPD::fgkCouplColDefault = 0.;
-const Double_t AliITSCalibrationSPD::fgkCouplRowDefault = 0.047;
+const Double_t AliITSCalibrationSPD::fgkCouplRowDefault = 0.055;
 const Double_t AliITSCalibrationSPD::fgkBiasVoltageDefault = 18.182;
 
 ClassImp(AliITSCalibrationSPD) 
+
 //______________________________________________________________________
 AliITSCalibrationSPD::AliITSCalibrationSPD():
 AliITSCalibration(),
@@ -42,8 +43,8 @@ fSigma(fgkSigmaDefault),
 fCouplCol(fgkCouplColDefault),
 fCouplRow(fgkCouplRowDefault),
 fBiasVoltage(fgkBiasVoltageDefault),
-nrDead(0),
-nrNoisy(0){
+fNrBad(0),
+fBadChannels(0){
   // constructor
 
    SetThresholds(fgkThreshDefault,fgkSigmaDefault);
@@ -52,88 +53,43 @@ nrNoisy(0){
    SetNoiseParam(0.,0.);
    SetDataType("simulated");
 }
-//_________________________________________________________________________
-
-
-void AliITSCalibrationSPD::AddDead(UInt_t col, UInt_t row) {
-  fDeadChannels.Set(nrDead*2+2);
-  fDeadChannels.AddAt(col,nrDead*2);
-  fDeadChannels.AddAt(row,nrDead*2+1);
-  nrDead++;
-}
-Int_t AliITSCalibrationSPD::GetDeadColAt(UInt_t index) {
-  if (index<nrDead) {
-    return fDeadChannels.At(index*2);
-  }
-  return -1;
-}
-Int_t AliITSCalibrationSPD::GetDeadRowAt(UInt_t index) {
-  if (index<nrDead) {
-    return fDeadChannels.At(index*2+1);
-  }
-  return -1;
-}
-Bool_t AliITSCalibrationSPD::IsPixelDead(Int_t col, Int_t row) const {
-  for (UInt_t i=0; i<nrDead; i++) { 
-    if (fDeadChannels.At(i*2)==col && fDeadChannels.At(i*2+1)==row) {
-      return true;
-    }
-  }
-  return false;
-}
-
-// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-//___________________________________________________________________________
-// THIS METHOD SHOULD BE DELETED AS SOON AS POSSIBLE!!!!!!!!!!!!!!!!!!!!!!!!!
-// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-Bool_t AliITSCalibrationSPD::IsPixelDead(Int_t mod,Int_t ix,Int_t iz) const {
- // Returns kTRUE if pixel is dead
-  // Inputs:
-  //    Int_t mod      module number
-  //    Int_t ix       x pixel number
-  //    Int_t iz       z pixel number
-  // Outputs:
-  //    none.
-  // Return:
-  //    kFALSE if pixel is alive, or kTRUE if pixel is dead.
-
-  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  Double_t fDeadPixels = 0.01; // fix to keep AliITSsimulationSPDdubna alive!!!
-  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-  Bool_t  dead = kFALSE;
-  Int_t   seed;
-  static TRandom ran; // don't use gRandom. This must not be a true randome
-  // sequence. These sequence must be random one and then fully repetable.
-
-  seed = mod*256*256+iz*256+ix;
-  ran.SetSeed(seed);
-  if(ran.Rndm(0)<fDeadPixels) dead = kTRUE;
-  return dead;
-}
 //____________________________________________________________________________
-
-void AliITSCalibrationSPD::AddNoisy(UInt_t col, UInt_t row) {
-  fDeadChannels.Set(nrNoisy*2+2);
-  fNoisyChannels.AddAt(col,nrNoisy*2);
-  fNoisyChannels.AddAt(row,nrNoisy*2+1);
-  nrNoisy++;
+void AliITSCalibrationSPD::AddBad(UInt_t col, UInt_t row) {
+  //
+  // add bad pixel 
+  //
+  fBadChannels.Set(fNrBad*2+2);
+  fBadChannels.AddAt(col,fNrBad*2);
+  fBadChannels.AddAt(row,fNrBad*2+1);
+  fNrBad++;
 }
-Int_t AliITSCalibrationSPD::GetNoisyColAt(UInt_t index) {
-  if (index<nrNoisy) {
-    return fNoisyChannels.At(index*2);
+//____________________________________________________________________________
+Int_t AliITSCalibrationSPD::GetBadColAt(UInt_t index) {
+  //
+  // Get column of index-th bad pixel
+  //
+  if (index<fNrBad) {
+    return fBadChannels.At(index*2);
   }
   return -1;
 }
-Int_t AliITSCalibrationSPD::GetNoisyRowAt(UInt_t index) {
-  if (index<nrNoisy) {
-    return fNoisyChannels.At(index*2+1);
+//____________________________________________________________________________
+Int_t AliITSCalibrationSPD::GetBadRowAt(UInt_t index) {
+  //
+  // Get row of index-th bad pixel
+  //
+  if (index<fNrBad) {
+    return fBadChannels.At(index*2+1);
   }
   return -1;
 }
-Bool_t AliITSCalibrationSPD::IsPixelNoisy(Int_t col, Int_t row) const {
-  for (UInt_t i=0; i<nrNoisy; i++) { 
-    if (fNoisyChannels.At(i*2)==col && fNoisyChannels.At(i*2+1)==row) {
+//____________________________________________________________________________
+Bool_t AliITSCalibrationSPD::IsPixelBad(Int_t col, Int_t row) const {
+  //
+  // Check if pixel (col,row) is bad
+  //
+  for (UInt_t i=0; i<fNrBad; i++) { 
+    if (fBadChannels.At(i*2)==col && fBadChannels.At(i*2+1)==row) {
       return true;
     }
   }