]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSsimulationSDD.cxx
new classes for raw data processing (T. Kuhr)
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSDD.cxx
index ec00dc2cb981aa8275bebcea899c5ca2a84078fc..af298d2c291ab9880d5cac7fd2757d979ab28b12 100644 (file)
 /*
   $Id$
   $Log$
+  Revision 1.37  2002/10/14 14:57:07  hristov
+  Merging the VirtualMC branch to the main development branch (HEAD)
+
+  Revision 1.32.4.4  2002/10/14 13:14:08  hristov
+  Updating VirtualMC to v3-09-02
+
+  Revision 1.36  2002/09/11 10:32:41  hristov
+  Use new for arrays with variable size
+
+  Revision 1.35  2002/09/09 17:23:28  nilsen
+  Minor changes in support of changes to AliITSdigitS?D class'.
+
+  Revision 1.34  2002/06/07 16:32:28  nilsen
+  Latest SDD changes to speed up the SDD simulation code.
+
   Revision 1.33  2002/04/24 22:02:31  nilsen
   New SDigits and Digits routines, and related changes,  (including new
   noise values).
 
  */
 
-#include <iostream.h>
+#include <Riostream.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -271,7 +286,7 @@ void AliITSsimulationSDD::Init(AliITSsegmentationSDD *seg,
     } // end if
 
     const char *kopt=fResponse->ZeroSuppOption();
-    if (strstr(fParam,"file") ) {
+    if (strstr(fParam.Data(),"file") ) {
         fD.Set(fNofMaps);
         fT1.Set(fNofMaps);
         if (strstr(kopt,"2D")) {
@@ -807,8 +822,12 @@ void AliITSsimulationSDD::ListOfFiredCells(Int_t *arg,Double_t timeAmplitude,
 //____________________________________________
 void AliITSsimulationSDD::AddDigit( Int_t i, Int_t j, Int_t signal ) {
     // Adds a Digit.
-    Int_t digits[3], tracks[3], hits[3];
-    Float_t phys, charges[3];
+    Int_t size = AliITSdigitSPD::GetNTracks();
+    Int_t digits[3];
+    Int_t * tracks = new Int_t[size];
+    Int_t * hits = new Int_t[size];
+    Float_t phys;
+    Float_t * charges = new Float_t[size];
 
     if( fResponse->Do10to8() ) signal = Convert8to10( signal ); 
     digits[0] = i;
@@ -818,7 +837,7 @@ void AliITSsimulationSDD::AddDigit( Int_t i, Int_t j, Int_t signal ) {
     AliITSpListItem *pItem = fpList->GetpListItem( i, j );
     if( pItem == 0 ) {
         phys = 0.0;
-        for( Int_t l=0; l<3; l++ ) {
+        for( Int_t l=0; l<size; l++ ) {
             tracks[l]  = 0;
             hits[l]    = 0;
             charges[l] = 0.0;
@@ -828,14 +847,21 @@ void AliITSsimulationSDD::AddDigit( Int_t i, Int_t j, Int_t signal ) {
         if( idtrack >= 0 ) phys = pItem->GetSignal();  
         else phys = 0.0;
 
-        for( Int_t l=0; l<3; l++ ) {
+        for( Int_t l=0; l<size; l++ ) if(l<pItem->GetMaxKept()) {
             tracks[l]  = pItem->GetTrack( l );
             hits[l]    = pItem->GetHit( l );
             charges[l] = pItem->GetSignal( l );
-        }
+        }else{
+            tracks[l]  = -3;
+            hits[l]    = -1;
+            charges[l] = 0.0;
+       }// end for if
     }
 
     fITS->AddSimDigit( 1, phys, digits, tracks, hits, charges ); 
+    delete [] tracks;
+    delete [] hits;
+    delete [] charges;
 }
 
 /*
@@ -1314,7 +1340,7 @@ void AliITSsimulationSDD::Init2D(){
     // Albert W.) :
     // Read 2D zero-suppression parameters for SDD
 
-    if (!strstr(fParam,"file")) return;
+    if (!strstr(fParam.Data(),"file")) return;
 
     Int_t na,pos,tempTh;
     Float_t mu,sigma;
@@ -1452,7 +1478,7 @@ void AliITSsimulationSDD::Init1D(){
     // Torino people should give input
     // Read 1D zero-suppression parameters for SDD
 
-    if (!strstr(fParam,"file")) return;
+    if (!strstr(fParam.Data(),"file")) return;
 
     Int_t na,pos,tempTh;
     Float_t mu,sigma;