]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSsimulationSSD.cxx
Adding field for number of fired chips in SPD layer 1/2 (4 Bytes)
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSSD.cxx
index f15ee050b7590e3c204403798ca558d6e0f96c52..8904fc0a3a43d318502860d92a7c71cb82bee395 100644 (file)
@@ -19,6 +19,8 @@
 #include <stdlib.h>
 #include <Riostream.h>
 #include <TObjArray.h>
+#include <TRandom.h>
+
 #include "AliITSmodule.h"
 #include "AliITSMapA2.h"
 #include "AliITSpList.h"
@@ -29,6 +31,7 @@
 #include "AliITShit.h"
 #include "AliITSdigitSSD.h"
 #include "AliRun.h"
+#include "AliITSgeom.h"
 #include "AliITSsimulationSSD.h"
 #include "AliITSTableSSD.h"
 //#include "AliITSresponseSSD.h"
@@ -123,10 +126,16 @@ AliITSsimulation& AliITSsimulationSSD::operator=(
 }
 //______________________________________________________________________
 AliITSsimulationSSD::AliITSsimulationSSD(const AliITSsimulationSSD &source):
-    AliITSsimulation(source){
+    AliITSsimulation(source),
+fMapA2(source.fMapA2),
+fIonE(source.fIonE),
+fDifConst(),
+fDriftVel(){
   // copy constructor
-
-  *this = source;
+  fDifConst[0] = source.fDifConst[0];
+  fDifConst[1] = source.fDifConst[1];
+  fDriftVel[0] = source.fDriftVel[0];
+  fDriftVel[1] = source.fDriftVel[1];
 }
 //______________________________________________________________________
 AliITSsimulationSSD::~AliITSsimulationSSD() {
@@ -271,8 +280,8 @@ void AliITSsimulationSSD::HitToDigit(Int_t module, Double_t x0, Double_t y0,
     if ( y > (seg->Dy()/2+10)*1.0E-4 ) {
       // check if particle is within the detector
       Warning("HitToDigit",
-             "hit out of detector y0=%e,y=%e,dey=%e,j =%e module=%d",
-             y0,y,dey,j,module);
+             "hit out of detector y0=%e,y=%e,dey=%e,j =%d module=%d,  exceed=%e",
+             y0,y,dey,j,module, y-(seg->Dy()/2+10)*1.0E-4);
       return;
     } // end if
     z = z0 + (j+0.5)*dez;
@@ -332,13 +341,13 @@ void AliITSsimulationSSD::ApplyNoise(AliITSpList *pList,Int_t module){
   for(ix=0;ix<GetNStrips();ix++){      // loop over strips
     
     // noise is gaussian
-    noise  = gRandom->Gaus(0,res->GetNoiseP().At(ix));
+    noise  = (Double_t) gRandom->Gaus(0,res->GetNoiseP().At(ix));
     
     // need to calibrate noise 
     // NOTE. noise from the calibration database comes uncalibrated, 
     // it needs to be calibrated in order to be added
     // to the signal. It will be decalibrated later on together with the noise    
-    noise *= res->GetGainP(ix); 
+    noise *= (Double_t) res->GetGainP(ix); 
     
     // noise comes in ADC channels from the calibration database
     // It needs to be converted back to electronVolts
@@ -352,8 +361,8 @@ void AliITSsimulationSSD::ApplyNoise(AliITSpList *pList,Int_t module){
   
     // Nside
   for(ix=0;ix<GetNStrips();ix++){      // loop over strips
-    noise  = gRandom->Gaus(0,res->GetNoiseN().At(ix));// give noise to signal
-    noise *= res->GetGainN(ix); 
+    noise  = (Double_t) gRandom->Gaus(0,res->GetNoiseN().At(ix));// give noise to signal
+    noise *= (Double_t) res->GetGainN(ix); 
     noise /= res->GetDEvToADC(1.);
     signal = noise + fMapA2->GetSignal(1,ix);//get signal from map
     fMapA2->SetHit(1,ix,signal); // give back signal to map
@@ -583,6 +592,7 @@ void AliITSsimulationSSD::ChargeToSignal(Int_t module,AliITSpList *pList) {
        // if strip is dead -> gain=0
        if( ((k==0)&&(res->GetGainP(ix)==0)) || ((k==1)&&(res->GetGainN(ix)==0))) continue;
        
+       signal = fMapA2->GetSignal(k,ix);
        // signal has to be uncalibrated
        // In real life, gains are supposed to be calculated from calibration runs,
        // stored in the calibration DB and used in the reconstruction
@@ -591,7 +601,7 @@ void AliITSsimulationSSD::ChargeToSignal(Int_t module,AliITSpList *pList) {
        else signal /= res->GetGainN(ix);
 
        // signal is converted in unit of ADC
-       signal = res->GetDEvToADC(fMapA2->GetSignal(k,ix));
+       signal = res->GetDEvToADC(signal);
        if(signal>4096.) signal = 4096.;//if exceeding, accumulate last one
 
        // threshold for zero suppression is set on the basis of the noise