]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSsimulationSPD.cxx
Changing default for raw data layout
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSPD.cxx
index 35301a979060a709cfb5248bf2913981403e9f5e..4381468afea1ee3d417b96e159ffd3a2ffb84a16 100644 (file)
@@ -30,8 +30,6 @@ $Id$
 #include "AliITSsimulationSPD.h"
 #include "AliLog.h"
 #include "AliRun.h"
-#include "AliCDBEntry.h"
-#include "AliCDBLocal.h"
 
 //#define DEBUG
 
@@ -41,6 +39,7 @@ ClassImp(AliITSsimulationSPD)
 //  Modified by D. Elia, G.E. Bruno, H. Tydesjo 
 //  Fast diffusion code by Bjorn S. Nilsen
 //  March-April 2006
+//  October     2007: GetCalibrationObjects() removed
 //
 //  Version: 0
 //  Written by Boris Batyunya
@@ -120,9 +119,6 @@ void AliITSsimulationSPD::Init(){
         fCoupling=1;
     } // end if
 
-    // Get the calibration objects for each module(ladder)
-    GetCalibrationObjects(0); //RunNr 0 hard coded for now
-
 }
 //______________________________________________________________________
 AliITSsimulationSPD::~AliITSsimulationSPD(){
@@ -142,7 +138,10 @@ AliITSsimulationSPD::~AliITSsimulationSPD(){
 //______________________________________________________________________
 AliITSsimulationSPD::AliITSsimulationSPD(const 
                                                   AliITSsimulationSPD 
-                                                  &s) : AliITSsimulation(s){
+                                                  &s) : AliITSsimulation(s),
+fHis(s.fHis),
+fSPDname(s.fSPDname),
+fCoupling(s.fCoupling){
     //     Copy Constructor
     // Inputs:
     //    AliITSsimulationSPD &s The original class for which
@@ -151,8 +150,6 @@ AliITSsimulationSPD::AliITSsimulationSPD(const
     //    none.
     // Return:
 
-    *this = s;
-    return;
 }
 //______________________________________________________________________
 AliITSsimulationSPD&  AliITSsimulationSPD::operator=(const 
@@ -188,43 +185,6 @@ AliITSsimulation&  AliITSsimulationSPD::operator=(const
 
     return *this;
 }
-
-//______________________________________________________________________
-void AliITSsimulationSPD::GetCalibrationObjects(Int_t RunNr) {
-    //    Gets the calibration objects for each module (ladder) 
-    // Inputs:
-    //    RunNr: hard coded to RunNr=0 for now
-    // Outputs:
-    //    none.
-    // Return:
-    //    none.
-
-  AliCDBManager* man = AliCDBManager::Instance();
-
-  AliCDBEntry *entrySPD=0;
-  entrySPD = man->Get("ITS/Calib/CalibSPD", RunNr);
-
-  if(!entrySPD){
-    AliWarning("Cannot find SPD calibration entry in default storage! Using local storage $ALICE_ROOT");
-    AliCDBStorage *localStor = 
-               AliCDBManager::Instance()->GetStorage("local://$ALICE_ROOT");
-    entrySPD = localStor->Get("ITS/Calib/CalibSPD", RunNr);
-    if(!entrySPD){
-      AliFatal("Cannot find SPD calibration entry!");
-      return;
-    }
-  }
-  
-  TObjArray *respSPD = (TObjArray *)entrySPD->GetObject();
-  if ((! respSPD)) {
-    AliFatal("Cannot get data from SPD database entry!");
-    return;
-  }
-  for (Int_t mod=0; mod<240; mod++) {
-    fCalObj[mod] = (AliITSCalibrationSPD*) respSPD->At(mod);
-  }
-}
-
 //______________________________________________________________________
 void AliITSsimulationSPD::InitSimulationModule(Int_t module, Int_t event){
     //  This function creates maps to build the list of tracks for each
@@ -403,6 +363,9 @@ void AliITSsimulationSPD::HitToSDigit(AliITSmodule *mod){
             sigz=sig*fda;
             SpreadChargeAsym(x,z,ix,iz,el,sigx,sigz,idtrack,h);
         } // end if st>0.0
+
+    } // Loop over all hits h
+
         // Coupling
         switch (fCoupling) {
         default:
@@ -424,7 +387,6 @@ void AliITSsimulationSPD::HitToSDigit(AliITSmodule *mod){
                 } // end for i
             break;
         } // end switch
-    } // Loop over all hits h
     if(GetDebug(2))Info("HitToSDigit","Finished fCoupling=%d",fCoupling);
 }
 //______________________________________________________________________
@@ -485,7 +447,7 @@ void AliITSsimulationSPD::HitToSDigitFast(AliITSmodule *mod){
                 sigz=sig*fda;
                 //SpreadCharge(x,z,ix,iz,el,sig,idtrack,h);
                 SpreadChargeAsym(x,z,ix,iz,el,sigx,sigz,idtrack,h);
-                // cout << "sigx sigz " << sigx << " " << sigz << endl; // dom
+//                cout << "sigx sigz " << sigx << " " << sigz << endl; // dom
             } // end for i // End Integrate over t
         else { // st == 0.0 deposit it at this point
             x   = x0;
@@ -499,6 +461,9 @@ void AliITSsimulationSPD::HitToSDigitFast(AliITSmodule *mod){
             sigz=sig*fda;
             SpreadChargeAsym(x,z,ix,iz,el,sigx,sigz,idtrack,h);
         } // end if st>0.0
+
+    } // Loop over all hits h
+
         // Coupling
         switch (fCoupling) {
         default:
@@ -520,7 +485,6 @@ void AliITSsimulationSPD::HitToSDigitFast(AliITSmodule *mod){
                 } // end for i
             break;
         } // end switch
-    } // Loop over all hits h
     if(GetDebug(2))Info("HitToSDigit","Finished fCoupling=%d",fCoupling);
 }
 //______________________________________________________________________
@@ -689,9 +653,15 @@ void AliITSsimulationSPD::RemoveDeadPixels(AliITSmodule *mod){
     //    none.
 
   Int_t moduleNr = mod->GetIndex();
-  Int_t nrDead = fCalObj[moduleNr]->GetNrDead();
+  AliITSCalibrationSPD* calObj = (AliITSCalibrationSPD*) GetCalibrationModel(moduleNr);
+
+  Int_t nrDead = calObj->GetNrBad();
+//  cout << "Module --> " << moduleNr << endl; // dom
+//  cout << "nr of dead " << nrDead << endl; // dom
   for (Int_t i=0; i<nrDead; i++) {
-    GetMap()->DeleteHit(fCalObj[moduleNr]->GetDeadColAt(i),fCalObj[moduleNr]->GetDeadRowAt(i));
+    GetMap()->DeleteHit(calObj->GetBadColAt(i),calObj->GetBadRowAt(i));
+//    cout << "dead index " << i << endl; // dom
+//    cout << "col row --> " << calObj->GetDeadColAt(i) << " " << calObj->GetDeadRowAt(i) << endl; // dom
   }
 }
 //______________________________________________________________________
@@ -708,7 +678,7 @@ void AliITSsimulationSPD::FrompListToDigits(){
     Int_t j,ix,iz;
     Double_t  electronics;
     Double_t sig;
-    const Int_t    knmaxtrk=AliITSdigitSPD::GetNTracks();
+    const Int_t    knmaxtrk=AliITSdigit::GetNTracks();
     static AliITSdigitSPD dig;
     AliITSCalibrationSPD* res = (AliITSCalibrationSPD*)GetCalibrationModel(fDetType->GetITSgeom()->GetStartSPD());
     if(GetDebug(1)) Info("FrompListToDigits","()");
@@ -928,8 +898,7 @@ void AliITSsimulationSPD::SetCouplingOld(Int_t col, Int_t row,
 
     //  Debugging ...
 //    cout << "Threshold --> " << GetThreshold() << endl;  // dom
-//    cout << "Couplings --> " << couplC << " " << couplR << endl;  //dom
-
+//    cout << "Couplings --> " << couplC << " " << couplR << endl;  // dom
 
     if(GetDebug(3)) Info("SetCouplingOld","(col=%d,row=%d,ntrack=%d,idhit=%d) "
                          "Calling SetCoupling couplC=%e couplR=%e",