]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added some comments, fixed up some coding violations and made some minor
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Aug 2001 21:10:22 +0000 (21:10 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Aug 2001 21:10:22 +0000 (21:10 +0000)
cosmetic changes to DigitizeModule/HitsToDigits.

ITS/AliITSsimulationSSD.cxx
ITS/AliITSsimulationSSD.h

index 074a18e44aa95c03dc4498b31b955f3a241eda57..dee880f3789564bbedae6757e8d0576221176a98 100644 (file)
@@ -1,20 +1,36 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+/* $Id$ */
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <iostream.h>
+#include <iomanip.h>
 #include <TObjArray.h>
 #include <TRandom.h>
 #include <TMath.h>
 
 #include "AliITSmodule.h"
-#include "AliITSMapA2.h"   
+#include "AliITSMapA2.h"
 #include "AliITSsegmentationSSD.h"
 #include "AliITSresponseSSD.h"
-#include "AliITSsimulationSSD.h"
-//#include "AliITSdictSSD.h"
 #include "AliITSdcsSSD.h"
 #include "AliITS.h"
 #include "AliRun.h"
 #include "AliITSgeom.h"
+#include "AliITSsimulationSSD.h"
 
 ClassImp(AliITSsimulationSSD);
 ////////////////////////////////////////////////////////////////////////
@@ -24,40 +40,55 @@ ClassImp(AliITSsimulationSSD);
 //
 // AliITSsimulationSSD is the simulation of SSDs.
 
+//----------------------------------------------------------------------
+AliITSsimulationSSD::AliITSsimulationSSD(){
+    //default Constructor
+
+    fDCS     = 0;
+    fNstrips = GetSegmentation()->Npx();
+    fPitch   = GetSegmentation()->Dpx(0);
+    fDifConst[0] = fDifConst[1] = 0.0;
+    fDriftVel[0] = fDriftVel[1] = 0.0;
+    fMapA2   = 0;
+}
 //----------------------------------------------------------------------
 AliITSsimulationSSD::AliITSsimulationSSD(AliITSsegmentation *seg,
                                          AliITSresponse *resp){
     // Constructor
 
-    fSegmentation = seg;
-    fResponse = resp;
+    fSegmentation    = seg;
+    fResponse        = resp;
     Float_t noise[2] = {0.,0.};
     fResponse->GetNoiseParam(noise[0],noise[1]); // retrieves noise parameters
-    fDCS = new AliITSdcsSSD(seg,resp); 
-
-    fNstrips = fSegmentation->Npx();
-    fPitch = fSegmentation->Dpx(0);
-    fMapA2 = new AliITSMapA2(fSegmentation);
-     
-    fSteps  = 100;   // still hard-wired - set in SetDetParam and get it via  
-                     // fDCS together with the others eventually    
+    fDCS             = new AliITSdcsSSD(seg,resp); 
+
+    fNstrips         = GetSegmentation()->Npx();
+    fPitch           = GetSegmentation()->Dpx(0);
+    SetDriftVelocity(); // use default values in .h file
+    SetIonizeE();       // use default values in .h file
+    SetDiffConst();     // use default values in .h file
+    fMapA2           = new AliITSMapA2(fSegmentation);
 }
 //______________________________________________________________________
-AliITSsimulationSSD& AliITSsimulationSSD::operator=(AliITSsimulationSSD 
-                                                                      &source){
+AliITSsimulationSSD& AliITSsimulationSSD::operator=(
+                                                const AliITSsimulationSSD &s){
     // Operator =
 
-    if(this==&source) return *this;
-
-    this->fDCS     = new AliITSdcsSSD(*(source.fDCS));
-    this->fMapA2   = source.fMapA2;
-    this->fNstrips = source.fNstrips;
-    this->fPitch   = source.fPitch;
-    this->fSteps   = source.fSteps;
+    if(this==&s) return *this;
+
+    this->fDCS         = new AliITSdcsSSD(*(s.fDCS));
+    this->fMapA2       = s.fMapA2;
+    this->fNstrips     = s.fNstrips;
+    this->fPitch       = s.fPitch;
+    this->fIonE        = s.fIonE;
+    this->fDifConst[0] = s.fDifConst[0];
+    this->fDifConst[1] = s.fDifConst[1];
+    this->fDriftVel[0] = s.fDriftVel[0];
+    this->fDriftVel[1] = s.fDriftVel[1];
     return *this;
 }
-//_____________________________________________________________---------
-AliITSsimulationSSD::AliITSsimulationSSD(AliITSsimulationSSD &source){
+//______________________________________________________________________
+AliITSsimulationSSD::AliITSsimulationSSD(const AliITSsimulationSSD &source){
     // copy constructor
 
     *this = source;
@@ -68,7 +99,7 @@ AliITSsimulationSSD::~AliITSsimulationSSD() {
     delete fMapA2;
     delete fDCS;
 }
-//_______________________________________________________________-------
+//______________________________________________________________________
 void AliITSsimulationSSD::DigitiseModule(AliITSmodule *mod,Int_t module,
                                          Int_t dummy) {
     // Digitizes hits for one SSD module 
@@ -77,24 +108,23 @@ void AliITSsimulationSSD::DigitiseModule(AliITSmodule *mod,Int_t module,
     AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
     AliITSgeom *geom = aliITS->GetITSgeom();
     geom->GetModuleId(module,lay, lad, detect);
-    if ( lay == 6 )((AliITSsegmentationSSD*)fSegmentation)->SetLayer(6);
-    if ( lay == 5 )((AliITSsegmentationSSD*)fSegmentation)->SetLayer(5);
+    if ( lay == 6 ) GetSegmentation()->SetLayer(6);
+    if ( lay == 5 ) GetSegmentation()->SetLayer(5);
 
     TObjArray *hits = mod->GetHits();
-    Int_t nhits = hits->GetEntriesFast();
+    Int_t nhits     = hits->GetEntriesFast();
     if (!nhits) return;
-    //cout<<"!! module, nhits ="<<module<<","<<nhits<<endl; 
   
     Double_t x0=0.0, y0=0.0, z0=0.0;
     Double_t x1=0.0, y1=0.0, z1=0.0;
     Double_t de=0.0;
-    Int_t maxNdigits = 2*fNstrips; 
+    Int_t maxNdigits = 2*fNstrips;
     Float_t  **pList = new Float_t* [maxNdigits]; 
     memset(pList,0,sizeof(Float_t*)*maxNdigits);
     Int_t indexRange[4] = {0,0,0,0};
-    static Bool_t first=kTRUE;
-    Int_t lasttrack = -2;
-    Int_t idtrack = -2;
+    static Bool_t first = kTRUE;
+    Int_t lasttrack     = -2;
+    Int_t idtrack       = -2;
     
     for(Int_t i=0; i<nhits; i++) {    
        // LineSegmentL returns 0 if the hit is entering
@@ -127,33 +157,27 @@ void AliITSsimulationSSD::HitToDigit(Int_t module, Double_t x0, Double_t y0,
     // Turns hits in SSD module into one or more digits.
 
     Float_t tang[2] = {0.0,0.0};
-    fSegmentation->Angles(tang[0], tang[1]);// stereo<<  -> tan(stereo)~=stereo
+    GetSegmentation()->Angles(tang[0], tang[1]);//stereo<<->tan(stereo)~=stereo
     Double_t x, y, z;
     Double_t dex=0.0, dey=0.0, dez=0.0;
-    Double_t pairs;
-    Double_t ionE = 3.62E-9;   // ionization energy of Si (GeV)
-    
+    Double_t pairs; // pair generation energy per step.
     Double_t sigma[2] = {0.,0.};// standard deviation of the diffusion gaussian
-
-    Double_t D[2] = {11.,30.}; // diffusion constant {h,e} (cm**2/sec)
     Double_t tdrift[2] = {0.,0.}; // time of drift
-    Double_t vdrift[2] = {0.86E6,2.28E6};  // drift velocity (cm/sec)   
     Double_t w;
     Double_t inf[2], sup[2], par0[2];                 
+
     // Steps in the module are determined "manually" (i.e. No Geant)
     // NumOfSteps divide path between entering and exiting hits in steps 
     Int_t numOfSteps = NumOfSteps(x1, y1, z1, dex, dey, dez);
   
     // Enery loss is equally distributed among steps
-    de = de/numOfSteps;
-    pairs = de/ionE;             // e-h pairs generated
+    de    = de/numOfSteps;
+    pairs = de/GetIonizeE(); // e-h pairs generated
 
     for(Int_t j=0; j<numOfSteps; j++) {     // stepping
-       //    cout<<"step number ="<<j<<endl;
        x = x0 + (j+0.5)*dex;
        y = y0 + (j+0.5)*dey;
-       //if ( y > (seg->Dy()/2 +10)*1.0E-4 ) {
-       if ( y > (fSegmentation->Dy()/2+10)*1.0E-4 ) {
+       if ( y > (GetSegmentation()->Dy()/2+10)*1.0E-4 ) {
            // check if particle is within the detector
            cout<<"AliITSsimulationSSD::HitToDigit: Warning: hit "
                "out of detector y0,y,dey,j ="
@@ -164,8 +188,8 @@ void AliITSsimulationSSD::HitToDigit(Int_t module, Double_t x0, Double_t y0,
 
        // calculate drift time
        // y is the minimum path
-       tdrift[0] = (y+(fSegmentation->Dy()*1.0E-4)/2) / vdrift[0];
-       tdrift[1] = ((fSegmentation->Dy()*1.0E-4)/2-y) / vdrift[1];
+       tdrift[0] = (y+(GetSegmentation()->Dy()*1.0E-4)/2)/GetDriftVelocity(0);
+       tdrift[1] = ((GetSegmentation()->Dy()*1.0E-4)/2-y)/GetDriftVelocity(1);
 
        for(Int_t k=0; k<2; k++) {   // both sides    remember: 0=Pside 1=Nside
 
@@ -173,14 +197,11 @@ void AliITSsimulationSSD::HitToDigit(Int_t module, Double_t x0, Double_t y0,
 
            // w is the coord. perpendicular to the strips
            if(k==0) {
-               //w=(x+(seg->Dx()*1.0E-4)/2)-(z+(seg->Dz()*1.0E-4)/2)*tang[k]; 
-               w = (x+(fSegmentation->Dx()*1.0E-4)/2) -
-                   (z+(fSegmentation->Dz()*1.0E-4)/2)*tang[k]; 
+               w = (x+(GetSegmentation()->Dx()*1.0E-4)/2) -
+                   (z+(GetSegmentation()->Dz()*1.0E-4)/2)*tang[k]; 
            }else{
-               //w =(x+(seg->Dx()*1.0E-4)/2)+(z-(seg->Dz()*1.0E-4)/2)*tang[k];
-               w = (x+(fSegmentation->Dx()*1.0E-4)/2) + 
-                   (z-(fSegmentation->Dz()*1.0E-4)/2)*tang[k]; 
-               //cout<<"k,x,z,w ="<<k<<","<<x<<","<<z<<","<<w<<endl;
+               w = (x+(GetSegmentation()->Dx()*1.0E-4)/2) + 
+                   (z-(GetSegmentation()->Dz()*1.0E-4)/2)*tang[k];
            } // end if
            w = w / (fPitch*1.0E-4); // w is converted in units of pitch
 
@@ -196,10 +217,8 @@ void AliITSsimulationSSD::HitToDigit(Int_t module, Double_t x0, Double_t y0,
            } // end if
 
            // sigma is the standard deviation of the diffusion gaussian
-
            if(tdrift[k]<0) return;
-
-           sigma[k] = TMath::Sqrt(2*D[k]*tdrift[k]);
+           sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
            sigma[k] = sigma[k] /(fPitch*1.0E-4);  //units of Pitch
            if(sigma[k]==0.0) {         
                cout<<"AliITSsimulationSSD::DigitiseModule: Error: sigma=0"
@@ -219,51 +238,43 @@ void AliITSsimulationSSD::HitToDigit(Int_t module, Double_t x0, Double_t y0,
     } // end stepping
     //delete seg;
 }
-//____________________________________________________________________--
+//______________________________________________________________________
 void AliITSsimulationSSD::ApplyNoise() {
     // Apply Noise.
   
-    Float_t signal;
-    Float_t noise[2] = {0.,0.};
-    fResponse->GetNoiseParam(noise[0],noise[1]); // retrieves noise parameters
-
+    Double_t signal;
+    Double_t noise[2] = {0.,0.};
+    Float_t a,b;
+    fResponse->GetNoiseParam(a,b); // retrieves noise parameters
+    noise[0] = (Double_t) a; noise[1] = (Double_t) b;
     for(Int_t k=0;k<2;k++){                    // both sides (0=Pside, 1=Nside)
-       for(Int_t ix=0;ix<fNstrips;ix++){            // loop over strips
-           signal = (Float_t) fMapA2->GetSignal(k,ix);// retrieves signal
-                                                       // from map
-
+       for(Int_t ix=0;ix<fNstrips;ix++){      // loop over strips
+           signal = fMapA2->GetSignal(k,ix); // retrieves signal from map
            signal += gRandom->Gaus(0,noise[k]);// add noise to signal
            if(signal<0.) signal=0.0;           // in case noise is negative...
-
-           fMapA2->SetHit(k,ix,(Double_t)signal); // give back signal to map
+           fMapA2->SetHit(k,ix,signal); // give back signal to map
        } // loop over strip 
     } // loop over k (P or N side)
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::ApplyCoupling() {
     // Apply the effect of electronic coupling between channels
-    Float_t signal, signalLeft=0, signalRight=0;
+    Double_t signalLeft=0, signalRight=0;
 
     for(Int_t ix=0;ix<fNstrips;ix++){
-       if(ix>0.) signalLeft  = (Float_t) fMapA2->GetSignal(0,ix-1)*
-                                                       fDCS->GetCouplingPL();
+       if(ix>0.)signalLeft = fMapA2->GetSignal(0,ix-1)*fDCS->GetCouplingPL();
        else signalLeft = 0.0;
-       if(ix<(fNstrips-1)) signalRight = (Float_t) fMapA2->GetSignal(0,ix+1)*
+       if(ix<(fNstrips-1)) signalRight = fMapA2->GetSignal(0,ix+1)*
                                                         fDCS->GetCouplingPR();
        else signalRight = 0.0;
-       signal = (Float_t) fMapA2->GetSignal(0,ix);
-       signal += signalLeft + signalRight;
-       fMapA2->SetHit(0,ix,(Double_t)signal);
+       fMapA2->AddSignal(0,ix,signalLeft + signalRight);
     
-       if(ix>0.) signalLeft  = (Float_t) fMapA2->GetSignal(1,ix-1)*
-                                                        fDCS->GetCouplingNL();
+       if(ix>0.) signalLeft = fMapA2->GetSignal(1,ix-1)*fDCS->GetCouplingNL();
        else signalLeft = 0.0;
-       if(ix<(fNstrips-1)) signalRight = (Float_t) fMapA2->GetSignal(1,ix+1)*
+       if(ix<(fNstrips-1)) signalRight = fMapA2->GetSignal(1,ix+1)*
                                                          fDCS->GetCouplingNR();
        else signalRight = 0.0;
-       signal = (Float_t) fMapA2->GetSignal(1,ix);
-       signal += signalLeft + signalRight;
-       fMapA2->SetHit(1,ix,(Double_t)signal);
+       fMapA2->AddSignal(1,ix,signalLeft + signalRight);
     } // loop over strips 
 }
 //______________________________________________________________________
@@ -287,7 +298,7 @@ void AliITSsimulationSSD::IntegrateGaussian(Int_t k,Double_t par, Double_t w,
     //         this way we are free to introduce asimmetry
 
     Double_t a=0.0, b=0.0;
-    Double_t signal = 0.0, dXCharge1 = 0.0, dXCharge2 = 0.0;
+    Double_t dXCharge1 = 0.0, dXCharge2 = 0.0;
     // dXCharge1 and 2 are the charge to two neighbouring strips
     // Watch that we only involve at least two strips
     // Numbers greater than 2 of strips in a cluster depend on
@@ -317,21 +328,16 @@ void AliITSsimulationSSD::IntegrateGaussian(Int_t k,Double_t par, Double_t w,
 
        // for the time being, signal is the charge
        // in ChargeToSignal signal is converted in ADC channel
-       signal = fMapA2->GetSignal(k,strip);
-       signal += dXCharge1;
-
-       fMapA2->SetHit(k,strip,(Double_t)signal);
+       fMapA2->AddSignal(k,strip,dXCharge1);
        if(((Int_t) strip) < (fNstrips-1)) {
            // strip doesn't have to be the last (remind: last=fNstrips-1)
            // otherwise part of the charge is lost
-           signal = fMapA2->GetSignal(k,(strip+1));
-           signal += dXCharge2;
-           fMapA2->SetHit(k,(strip+1),(Double_t)signal);
+           fMapA2->AddSignal(k,(strip+1),dXCharge2);
        } // end if
     
        if(dXCharge1 > 1.) {
            if (first) {
-               indexRange[k*2+0]=indexRange[k*2+1]=(Int_t) strip;
+               indexRange[k*2+0] = indexRange[k*2+1]=(Int_t) strip;
                first=kFALSE;
            } // end if first
 
@@ -360,15 +366,11 @@ void AliITSsimulationSSD::IntegrateGaussian(Int_t k,Double_t par, Double_t w,
 
        // for the time being, signal is the charge
        // in ChargeToSignal signal is converted in ADC channel
-       signal = fMapA2->GetSignal(k,strip);
-       signal += dXCharge1;
-       fMapA2->SetHit(k,strip,(Double_t)signal);
+       fMapA2->AddSignal(k,strip,dXCharge1);
        if(((Int_t) strip) > 0) {
            // strip doesn't have to be the first
            // otherwise part of the charge is lost
-           signal = fMapA2->GetSignal(k,(strip-1));
-           signal += dXCharge2;
-           fMapA2->SetHit(k,(strip-1),(Double_t)signal);
+           fMapA2->AddSignal(k,(strip-1),dXCharge2);
        } // end if
     
        if(dXCharge1 > 1.) {
@@ -410,13 +412,12 @@ void AliITSsimulationSSD::GetList(Int_t label,Float_t **pList,
     Int_t ix,globalIndex;
     Float_t signal=0.;
     Float_t highest,middle,lowest;
-  // printf("SPD-GetList: indexRange[0] indexRange[1] indexRange[2] indexRange[3] %d %d %d %d\n",indexRange[0], indexRange[1], indexRange[2], indexRange[3]);
 
     for(Int_t k=0; k<2; k++) {
        for(ix=indexRange[k*2+0];ix<indexRange[k*2+1]+1;ix++){
            if(indexRange[k*2+0]<indexRange[k*2+1]) 
-               signal=fMapA2->GetSignal(k,ix);
-      
+               signal = fMapA2->GetSignal(k,ix);
+
            globalIndex = k*fNstrips+ix; // globalIndex starts from 0!
            if(!pList[globalIndex]){
                // 
@@ -485,7 +486,6 @@ void AliITSsimulationSSD::ChargeToSignal(Float_t **pList) {
        for(Int_t ix=0;ix<fNstrips;ix++){         // loop over strips
 
            signal = (Float_t) fMapA2->GetSignal(k,ix);
-
            gi =k*fNstrips+ix; // global index
            if (signal > threshold) {
                digits[0]=k;
@@ -498,8 +498,6 @@ void AliITSsimulationSSD::ChargeToSignal(Float_t **pList) {
                if(signal>1000.) signal = 1000.0;//if exceeding, accumulate
                                                  // last one
                digits[2]=(Int_t) signal;
-
-               //gi =k*fNstrips+ix; // global index
                for(j1=0;j1<3;j1++){
                    if (pList[gi]) {
                        tracks[j1] = (Int_t)(*(pList[gi]+j1));
@@ -516,11 +514,45 @@ void AliITSsimulationSSD::ChargeToSignal(Float_t **pList) {
                hits[2]=0;
                // finally add digit
                aliITS->AddSimDigit(2,phys,digits,tracks,hits,charges);
-
-               //if(pList[gi]) delete [] pList[gi];
            } // end if signal > threshold
            if(pList[gi]) delete [] pList[gi];
        } // end for ix
     } // end for k
     delete [] pList;
 }
+//______________________________________________________________________
+void AliITSsimulationSSD::Print(ostream *os){
+    //Standard output format for this class
+
+    //AliITSsimulation::Print(os);
+    *os << fNstrips <<","<< fPitch <<","<< fIonE <<",";
+    *os << fDifConst[0] <<","<< fDifConst[1] <<",";
+    *os << fDriftVel[0] <<","<< fDriftVel[1];
+    //*os <<","; fDCS->Print(os);
+    //*os <<","; fMapA2->Print(os);
+}
+//______________________________________________________________________
+void AliITSsimulationSSD::Read(istream *is){
+    // Standard output streaming function.
+
+    //AliITSsimulation::Read(is);
+    *is >> fNstrips >> fPitch >> fIonE;
+    *is >> fDifConst[0] >> fDifConst[1];
+    *is >> fDriftVel[0] >> fDriftVel[1];
+    //fDCS->Read(is);
+    //fMapA2->Read(is);
+}
+//______________________________________________________________________
+ostream &operator<<(ostream &os,AliITSsimulationSSD &source){
+    // Standard output streaming function.
+
+    source.Print(&os);
+    return os;
+}
+//______________________________________________________________________
+istream &operator>>(istream &os,AliITSsimulationSSD &source){
+    // Standard output streaming function.
+
+    source.Read(&os);
+    return os;
+}
index 2d55e8761c47d0461c9e0fe06d7cc48c041f9503..53ea7a71e9b3bed63016c087ccc4bafbb157ced0 100644 (file)
@@ -1,81 +1,88 @@
 #ifndef ALIITSSIMULATIONSSD_H
 #define ALIITSSIMULATIONSSD_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice     */
+/* $Id$ */
 
-#include <TArrayF.h>
-
-#include "AliITSdcsSSD.h"
-//#include "AliITSdictSSD.h"
 #include "AliITSsimulation.h"
-#include "AliITSsegmentationSSD.h"
-
 
+class ostream;
+class istream;
 class AliITSMapA2;
-//class AliITSdictSSD;
 class AliITSdcsSSD;
+class AliITSsegmentationSSD;
 
 class AliITSsimulationSSD: public AliITSsimulation {
 
-public:
-
-  AliITSsimulationSSD() {}
-  AliITSsimulationSSD(AliITSsimulationSSD &source); // copy constructor
-  AliITSsimulationSSD& operator=(AliITSsimulationSSD &source); // operator =
-  AliITSsimulationSSD(AliITSsegmentation *seg, AliITSresponse *resp);
-  virtual ~AliITSsimulationSSD();
-    
-  void DigitiseModule(AliITSmodule *mod, Int_t imod, Int_t dummy);  
-  //void HitToDigit(Double_t x0, Double_t y0, Double_t z0, 
-  void HitToDigit(Int_t module, Double_t x0, Double_t y0, Double_t z0, //b.b. 
-                 Double_t x, Double_t y, Double_t z, Double_t de,
-                 Int_t *indexRange, Bool_t first);            
-  Int_t NumOfSteps(Double_t x, Double_t y, Double_t z,
-                  Double_t  & dex,Double_t & dey,Double_t & dez);
-  void GetList(Int_t track, Float_t **pList, Int_t *IndexRange);
-  void ChargeToSignal(Float_t **pList);
-  
-  //TArrayF* GetSignalP() {return fP;}
-  //TArrayF* GetSignalN() {return fN;}
-  
-  AliITSsegmentationSSD *GetSegmentation() {return (AliITSsegmentationSSD*)fSegmentation;}
+ public:
+    AliITSsimulationSSD(); // Default constructor
+    AliITSsimulationSSD(const AliITSsimulationSSD &source); // copy constructor
+    // operator =
+    AliITSsimulationSSD& operator=(const AliITSsimulationSSD &source);
+    //Standard Constructor
+    AliITSsimulationSSD(AliITSsegmentation *seg,AliITSresponse *resp);
+    //Destructor
+    virtual ~AliITSsimulationSSD();
+    //Digitizes all of the hits in a module
+    void DigitiseModule(AliITSmodule *mod,Int_t imod,Int_t dummy);
+    //Computes the signal from one hit
+    void HitToDigit(Int_t module,Double_t x0,Double_t y0,Double_t z0, 
+                   Double_t x,Double_t y,Double_t z,Double_t de,
+                   Int_t *indexRange,Bool_t first);
+    // returns the number of steps needed to proplerly distribute the charge
+    // in a step
+    Int_t NumOfSteps(Double_t x,Double_t y,Double_t z,
+                    Double_t  &dex,Double_t &dey,Double_t &dez);
+    void GetList(Int_t track,Float_t **pList,Int_t *IndexRange);
+    // sets thresholds and fills digits
+    void ChargeToSignal(Float_t **pList);
+    //returns a pointer to the SSD segmentation.
+    AliITSsegmentationSSD *GetSegmentation() {
+       return (AliITSsegmentationSSD*) fSegmentation;}
+    //Returns the ionization energy for Si in GeV.
+    Double_t GetIonizeE() const {return fIonE;}
+    //Sets the ionization energy for Si in GeV.
+    void SetIonizeE(Double_t e=3.62E-09){fIonE = e;}
+    //Returns the Diffusion constant h in cm**2/sec
+    Double_t GetDiffConst(Int_t i) const {return fDifConst[i];}
+    //Sets the Diffusion constant h in cm**2/sec
+    void SetDiffConst(Double_t h=11.0,Double_t e=30.0)
+       {fDifConst[0] = h;fDifConst[1]=e;}
+    //Returns the Drift velocity for the side i
+    Double_t GetDriftVelocity(Int_t i) const {return fDriftVel[i];}
+    //Sets the Drift velocity for the P and N sides
+    void SetDriftVelocity(Double_t v0=0.86E+06,Double_t v1=2.28E+06)
+       {fDriftVel[0] = v0;fDriftVel[1] = v1;}
+    // Standard ascii class print function
+    void Print(ostream *os);
+    // Standard ascii class read function
+    void Read(istream *is);
 
  protected:
-  
-  void  IntegrateGaussian(Int_t k, Double_t par, Double_t av, Double_t sigma, 
-                         Double_t inf, Double_t sup,
-                         Int_t *indexRange, Bool_t first);
-  void  ApplyNoise();
-  void  ApplyCoupling();
-  //  void  ApplyThreshold();
-  //void  ApplyDAQ();
-  
-  Float_t  F(Float_t av, Float_t x, Float_t s); 
-  //  Float_t  Get2Strip(Int_t flag, Int_t istrip, Float_t x, Float_t z);
-  
-  // Data members 
-  
+    // Diffuses the charge onto neighboring strips.
+    void    IntegrateGaussian(Int_t k,Double_t par,Double_t av,Double_t sigma, 
+                             Double_t inf, Double_t sup,
+                             Int_t *indexRange, Bool_t first);
+    void    ApplyNoise(); // Applies noise to strips randomly
+    void    ApplyCoupling(); // Applies posible signal coupling between strips
+    Float_t F(Float_t av, Float_t x, Float_t s);
+
+    // Data members
  protected:
-  
-  AliITSdcsSSD    *fDCS;
-  Int_t   fNstrips;
-  Float_t fPitch;
-  //TArrayF *fN;         // for signal N side
-  //TArrayF *fP;         // for signal P side
-  //AliITSdictSSD *fTracksP;  //!
-  //AliITSdictSSD *fTracksN;  //! 
-  
-  //______________________________________________________________
-  //  
-  // Parameters for simulation
-  //______________________________________________________________
-  Int_t    fSteps;                //Number of steps 
-  
- private:
+    AliITSdcsSSD *fDCS;   // Class containing detector controle paramters
+    Int_t        fNstrips;//! number of strips, gotten from segmentation
+    Float_t      fPitch;  //! strip pitch spacing gotten from segmentation
 
-  AliITSMapA2  *fMapA2;        // MapA2
-  
-  ClassDef(AliITSsimulationSSD,1)
-    
-    };
+ private:
+    AliITSMapA2 *fMapA2;      //! Map of ionization, used localy only
+    Double_t    fIonE;        // ionization energy of Si in GeV
+    Double_t    fDifConst[2]; // Diffusion constants [h,e] in cm**2/sec
+    Double_t    fDriftVel[2]; // Drift velocities [P,N sides] cm/sec
 
+    ClassDef(AliITSsimulationSSD,2) // SSD signal simulation class
 
+};
+// Input and output functions for standard C++ input/output.
+ostream &operator<<(ostream &os,AliITSsimulationSSD &source);
+istream &operator>>(istream &is,AliITSsimulationSSD &source);
 #endif