]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Minor changes in support of changes to AliITSdigitS?D class'.
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Sep 2002 17:23:28 +0000 (17:23 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Sep 2002 17:23:28 +0000 (17:23 +0000)
ITS/AliITSClusterFinderSDD.cxx
ITS/AliITSClusterFinderSPD.cxx
ITS/AliITSclusterSSD.cxx
ITS/AliITSclusterSSD.h
ITS/AliITSsimulationSDD.cxx
ITS/AliITSsimulationSPD.cxx
ITS/AliITSsimulationSPDdubna.cxx
ITS/AliITSsimulationSSD.cxx

index 87762cf8250fe931b8713d16e22c08f5157bfe1d..a22a38b2211bfbd0faf36361b792a8d586ba1a20 100644 (file)
 /*
   $Id$
   $Log$
+  Revision 1.25  2002/05/10 22:29:40  nilsen
+  Change my Massimo Masera in the default constructor to bring things into
+  compliance.
+
   Revision 1.24  2002/04/24 22:02:31  nilsen
   New SDigits and Digits routines, and related changes,  (including new
   noise values).
@@ -1217,7 +1221,7 @@ void AliITSClusterFinderSDD::GetRecPoints(){
     const Float_t kconv = 1.0e-4; 
     const Float_t kRMSx = 38.0*kconv; // microns->cm ITS TDR Table 1.3
     const Float_t kRMSz = 28.0*kconv; // microns->cm ITS TDR Table 1.3
-    Int_t i;
+    Int_t i,j;
     Int_t ix, iz, idx=-1;
     AliITSdigitSDD *dig=0;
     Int_t ndigits=fDigits->GetEntriesFast();
@@ -1244,9 +1248,20 @@ void AliITSClusterFinderSDD::GetRecPoints(){
         rnew.SetdEdX(kconvGeV*clusterI->Q());
         rnew.SetSigmaX2(kRMSx*kRMSx);
         rnew.SetSigmaZ2(kRMSz*kRMSz);
-        if(dig) rnew.fTracks[0]=dig->fTracks[0];
-        if(dig) rnew.fTracks[1]=dig->fTracks[1];
-        if(dig) rnew.fTracks[2]=dig->fTracks[2];
+        if(dig){
+           rnew.fTracks[0] = dig->fTracks[0];
+           rnew.fTracks[1] = -3;
+           rnew.fTracks[2] = -3;
+           j=1;
+           while(rnew.fTracks[0]==dig->fTracks[j] &&
+                 j<dig->GetNTracks()) j++;
+           if(j<dig->GetNTracks()){
+               rnew.fTracks[1] = dig->fTracks[j];
+               while(rnew.fTracks[1]==dig->fTracks[j] && 
+                     j<dig->GetNTracks()) j++;
+               if(j<dig->GetNTracks()) rnew.fTracks[2] = dig->fTracks[j];
+           } // end if
+       } // end if
         //printf("SDD: i %d track1 track2 track3 %d %d %d x y %f %f\n",
         //         i,rnew.fTracks[0],rnew.fTracks[1],rnew.fTracks[2],c
         //         lusterI->X(),clusterI->Z());
index 86e43f7f2cfb5418e5ac52192322441db937b427..643eaf36e3b9bd61c74c4c0edd45f359eabb4481 100644 (file)
@@ -101,18 +101,24 @@ void AliITSClusterFinderSPD::FindRawClusters(Int_t module){
     Int_t ndigits = fDigits->GetEntriesFast();  
     if (!ndigits) return;
 
-    AliITSdigit *dig;
-    AliITSdigitSPD *dig1;
-    Int_t ndig;
+    AliITSdigitSPD *dig;
+    Int_t ndig,i;
     for(ndig=0; ndig<ndigits; ndig++) {
-       dig= (AliITSdigit*)fDigits->UncheckedAt(ndig);
+       dig= (AliITSdigitSPD*)fDigits->UncheckedAt(ndig);
        digx[digitcount] = dig->fCoord2+1;  //starts at 1
        digz[digitcount] = dig->fCoord1+1;  //starts at 1
-       dig1= (AliITSdigitSPD*)fDigits->UncheckedAt(ndig);
-       digtr1[digitcount] = dig1->fTracks[0];
-       digtr2[digitcount] = dig1->fTracks[1];
-       digtr3[digitcount] = dig1->fTracks[2];
-       digtr4[digitcount] = dig1->fSignal;
+       digtr1[digitcount] = dig->fTracks[0];
+       digtr2[digitcount] = -3;
+       digtr3[digitcount] = -3;
+       i=1;
+       while(digtr1[digitcount]==dig->fTracks[i] && i<dig->GetNTracks()) i++;
+       if(i<dig->GetNTracks()){
+           digtr2[digitcount] = dig->fTracks[i];
+           while(digtr1[digitcount]==dig->fTracks[i] && 
+                 i<dig->GetNTracks()) i++;
+           if(i<dig->GetNTracks()) digtr3[digitcount] = dig->fTracks[i];
+       } // end if
+       digtr4[digitcount] = dig->fSignal;
        digitcount++;
     } // end for ndig
     ClusterFinder(digitcount,digx,digz,digtr1,digtr2,digtr3,digtr4,
index a5caddfb65b7c868cf379b331aadd8a3f429f34e..3259728a05bfb2550910f11dd4cc141bca1cf61f 100644 (file)
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
 #include <iostream.h>
+#include "TArrayI.h"
+#include "TClonesArray.h"
 #include "AliITSdigit.h"
 #include "AliITSclusterSSD.h"
 
 ClassImp(AliITSclusterSSD)
 
-AliITSclusterSSD::AliITSclusterSSD()
-{
-  // default constructor
-
-       fSide        = kTRUE;
-       fDigits      = 0;
-       fNDigits     = 0;
-       fDigitsIndex = 0;
-        fNCrosses    = 0;
-       fTotalSignal = -1;
-       fNTracks      = -1;
-       fLeftNeighbour  = kFALSE;
-       fRightNeighbour = kFALSE;
-       fCrossedClusterIndexes = 0;
-       fConsumed=kFALSE;
+//______________________________________________________________________
+AliITSclusterSSD::AliITSclusterSSD(){
+    // default constructor
 
+    fSide        = kTRUE;
+    fDigits      = 0;
+    fNDigits     = 0;
+    fDigitsIndex = 0;
+    fNCrosses    = 0;
+    fTotalSignal = -1;
+    fNTracks      = -1;
+    fLeftNeighbour  = kFALSE;
+    fRightNeighbour = kFALSE;
+    fCrossedClusterIndexes = 0;
+    fConsumed=kFALSE;
 }
-/*************************************************************************/
+//______________________________________________________________________
+AliITSclusterSSD::AliITSclusterSSD(Int_t ndigits, Int_t *DigitIndexes, 
+                                  TObjArray *Digits, Bool_t side){
+    // non-default constructor
 
-AliITSclusterSSD::AliITSclusterSSD
-  (Int_t ndigits, Int_t *DigitIndexes, 
-   TObjArray *Digits, Bool_t side)
-{
-  // non-default constructor
-
-       fNDigits = ndigits;
-       fDigits = Digits;
-       fSide = side;
-       fDigitsIndex = new TArrayI(fNDigits,DigitIndexes );     
-       fNCrosses    = 0;
-       fCrossedClusterIndexes = new TArrayI(300);
-       fLeftNeighbour  = kFALSE;
-       fRightNeighbour = kFALSE;
-       fTotalSignal =-1;
-       fNTracks    = -1;
-        fConsumed=kFALSE;
-}
-/*************************************************************************/
-AliITSclusterSSD::~AliITSclusterSSD()
-{
-  // destructor
-  delete fDigitsIndex;
-  delete fCrossedClusterIndexes;
+    fNDigits = ndigits;
+    fDigits = Digits;
+    fSide = side;
+    fDigitsIndex = new TArrayI(fNDigits,DigitIndexes );        
+    fNCrosses    = 0;
+    fCrossedClusterIndexes = new TArrayI(300);
+    fLeftNeighbour  = kFALSE;
+    fRightNeighbour = kFALSE;
+    fTotalSignal =-1;
+    fNTracks    = -1;
+    fConsumed=kFALSE;
 }
-/*************************************************************************/
-AliITSclusterSSD::AliITSclusterSSD(const AliITSclusterSSD &OneSCluster)
-{
-  // copy constructor
+//______________________________________________________________________
+AliITSclusterSSD::~AliITSclusterSSD(){
+    // destructor
 
-  if (this == &OneSCluster) return;
-  fNDigits = OneSCluster.fNDigits;
-  fSide=OneSCluster.fSide;
-  fDigits=OneSCluster.fDigits;
-  fDigitsIndex = new TArrayI(fNDigits);
-  fLeftNeighbour  = OneSCluster.fLeftNeighbour;
-  fRightNeighbour = OneSCluster.fRightNeighbour;
-  fTotalSignal =-1;
-  fNTracks     = -1;
-  fNCrosses = OneSCluster.fNCrosses;
-  fConsumed = OneSCluster.fConsumed;
-  Int_t i;
-  for (i = 0; i< fNCrosses ; i++)
-   {
-     fCrossedClusterIndexes[i] = OneSCluster.fCrossedClusterIndexes[i];
-   }
-  for (i = 0; i< fNDigits ; i++)
-  {
-    fDigitsIndex[i]=OneSCluster.fDigitsIndex[i];
-  }
-  return;
-}      
+    delete fDigitsIndex;
+    delete fCrossedClusterIndexes;
+}
+//______________________________________________________________________
+AliITSclusterSSD::AliITSclusterSSD(const AliITSclusterSSD &OneSCluster){
+    // copy constructor
 
-/*************************************************************************/
-AliITSclusterSSD& AliITSclusterSSD::operator=(const AliITSclusterSSD & OneSCluster)
-{
-  // assignment operator
+    if (this == &OneSCluster) return;
+    fNDigits = OneSCluster.fNDigits;
+    fSide=OneSCluster.fSide;
+    fDigits=OneSCluster.fDigits;
+    fDigitsIndex = new TArrayI(fNDigits);
+    fLeftNeighbour  = OneSCluster.fLeftNeighbour;
+    fRightNeighbour = OneSCluster.fRightNeighbour;
+    fTotalSignal =-1;
+    fNTracks     = -1;
+    fNCrosses = OneSCluster.fNCrosses;
+    fConsumed = OneSCluster.fConsumed;
+    Int_t i;
+    for (i = 0; i< fNCrosses ; i++){
+       fCrossedClusterIndexes[i] = OneSCluster.fCrossedClusterIndexes[i];
+    }
+    for (i = 0; i< fNDigits ; i++){
+       fDigitsIndex[i]=OneSCluster.fDigitsIndex[i];
+    }
+    return;
+}
+//______________________________________________________________________
+AliITSclusterSSD& AliITSclusterSSD::operator=(const AliITSclusterSSD 
+                                             &OneSCluster){
+    // assignment operator
 
-  if (this == &OneSCluster) return *this;
-  fNDigits = OneSCluster.fNDigits;
-  fSide=OneSCluster.fSide;
-  fDigits=OneSCluster.fDigits;
-  fDigitsIndex = new TArrayI(fNDigits);
-  fLeftNeighbour  = OneSCluster.fLeftNeighbour;
-  fRightNeighbour = OneSCluster.fRightNeighbour;
-  fTotalSignal =-1;
-  fNTracks     = -1;
-  fNCrosses = OneSCluster.fNCrosses;
-  fConsumed = OneSCluster.fConsumed;
-  Int_t i;
-  for (i = 0; i< fNCrosses ; i++)
-   {
-     fCrossedClusterIndexes[i] = OneSCluster.fCrossedClusterIndexes[i];
-   }
-  for (i = 0; i< fNDigits ; i++)
-  {
-    fDigitsIndex[i]=OneSCluster.fDigitsIndex[i];
-  }
-  return *this;
-}      
+    if (this == &OneSCluster) return *this;
+    fNDigits = OneSCluster.fNDigits;
+    fSide=OneSCluster.fSide;
+    fDigits=OneSCluster.fDigits;
+    fDigitsIndex = new TArrayI(fNDigits);
+    fLeftNeighbour  = OneSCluster.fLeftNeighbour;
+    fRightNeighbour = OneSCluster.fRightNeighbour;
+    fTotalSignal =-1;
+    fNTracks     = -1;
+    fNCrosses = OneSCluster.fNCrosses;
+    fConsumed = OneSCluster.fConsumed;
+    Int_t i;
+    for (i = 0; i< fNCrosses ; i++){
+       fCrossedClusterIndexes[i] = OneSCluster.fCrossedClusterIndexes[i];
+    }
+    for (i = 0; i< fNDigits ; i++){
+       fDigitsIndex[i]=OneSCluster.fDigitsIndex[i];
+    }
+    return *this;
+}
+//______________________________________________________________________
+Int_t AliITSclusterSSD::SplitCluster(Int_t where, Int_t *outdigits){
+    //This methods generate data necessery to make new object of this class
+    //I choosen this way, because methods TClonesArray::Add* dont work
+    //so I have to use constraction: new (a[i]) Creator(params...);
+    //where 'a' is a TClonesArray 
+    //This method generate params - see AliITSmoduleSSD::SplitCluster;
+    Int_t tmp = fNDigits;
+    Int_t ind = 0;
 
-/*************************************************************************/
-Int_t AliITSclusterSSD::SplitCluster(Int_t where, Int_t *outdigits)
-{
-//This methods generate data necessery to make new object of this class
-//I choosen this way, because methods TClonesArray::Add* dont work
-//so I have to use constraction: new (a[i]) Creator(params...);
-//where 'a' is a TClonesArray 
-//This method generate params - see AliITSmoduleSSD::SplitCluster;
-               
-       
-  Int_t tmp = fNDigits;
-  Int_t ind = 0;
     outdigits[ind++]=(*fDigitsIndex)[where];
-                     //coping border strip (it is shared by this two clusters)
-    for (Int_t i = (where+1); i < tmp; i++)
-     {
-       outdigits[ind++]=(*fDigitsIndex)[i];  //"moving" strips from this to the new one 
-       (*fDigitsIndex)[i]=-1;   
-       fNDigits--;   //deleting strips from this cluster
-     
-  return ind;          
+    //coping border strip (it is shared by this two clusters)
+    for (Int_t i = (where+1); i < tmp; i++) {
+       outdigits[ind++]=(*fDigitsIndex)[i];  
+       //"moving" strips from this to the new one 
+       (*fDigitsIndex)[i]=-1;   
+       fNDigits--;   //deleting strips from this cluster
+    } 
+    return ind;                
 }
-               
-/*******************************************************************/
-Int_t AliITSclusterSSD::GetDigitStripNo(Int_t digit)
-{
-  // return strip no of a digit
-       if (digit<0) return -1;
-       return (digit>(fNDigits-1))?-1 :
-      //PH            ((AliITSdigitSSD*)((*fDigits)[(*fDigitsIndex)[digit]]))->GetStripNumber();
-            ((AliITSdigitSSD*)(fDigits->At((*fDigitsIndex)[digit])))->GetStripNumber();
+//______________________________________________________________________
+Int_t AliITSclusterSSD::GetDigitStripNo(Int_t digit){
+    // return strip no of a digit
+    if (digit<0) return -1;
+    return (digit>(fNDigits-1)) ? -1 :
+       ((AliITSdigitSSD*)(fDigits->At((*fDigitsIndex)[digit])))->GetStripNumber();
 }
-/************************************************************/
-Int_t AliITSclusterSSD::GetDigitSignal(Int_t digit)
-{
-  // returns digit signal
-  Int_t index,signal;
-  if (digit<0||digit>=fNDigits) return -1;
-  index  = (*fDigitsIndex)[digit];
-  //PH  signal = ((AliITSdigitSSD*)((*fDigits)[index]))->GetSignal();
-  signal = ((AliITSdigitSSD*)(fDigits->At(index)))->GetSignal();
-  /*
-  if(signal>1.e5) printf("GetDigitSignal: digit %d index %d signal %d\n",
-                        digit,index, signal);
-  */
-  return  signal;
+//______________________________________________________________________
+Int_t AliITSclusterSSD::GetDigitSignal(Int_t digit){
+    // returns digit signal
+    Int_t index,signal;
+    if (digit<0||digit>=fNDigits) return -1;
+    index  = (*fDigitsIndex)[digit];
+    signal = ((AliITSdigitSSD*)(fDigits->At(index)))->GetSignal();
+    /*
+      if(signal>1.e5) printf("GetDigitSignal: digit %d index %d signal %d\n",
+      digit,index, signal);
+    */
+    return  signal;
 }
-
-/***********************************************************/
-void  AliITSclusterSSD::AddCross(Int_t clIndex)
-{
-  // add cluster cross to list of cluster crosses
+//______________________________________________________________________
+void  AliITSclusterSSD::AddCross(Int_t clIndex){
+    // add cluster cross to list of cluster crosses
   
-       (*fCrossedClusterIndexes)[fNCrosses++] = clIndex;
+    (*fCrossedClusterIndexes)[fNCrosses++] = clIndex;
 }
-/***********************************************************/
+//______________________________________________________________________
+Int_t AliITSclusterSSD::GetCross(Int_t crIndex){
+    // return crossing cluster
 
-Int_t AliITSclusterSSD::GetCross(Int_t crIndex)
-{
-  // return crossing cluster
-  
-  return ((crIndex>-1)&&(crIndex<fNCrosses))?(*fCrossedClusterIndexes)[crIndex]:-1;
+    return ((crIndex>-1)&&(crIndex<fNCrosses))?(*fCrossedClusterIndexes)[crIndex]:-1;
 }
-/***********************************************************/
-Double_t AliITSclusterSSD::CentrOfGravity()
-{
-  // return center of gravity of the cluster
-  Float_t ret=0;
+//______________________________________________________________________
+Double_t AliITSclusterSSD::CentrOfGravity(){
+    // return center of gravity of the cluster
+    Float_t ret=0;
   
-  if (fLeftNeighbour) ret+=(GetDigitStripNo(0)*0.5*GetDigitSignal(0));
-      else ret+=(GetDigitStripNo(0)*GetDigitSignal(0));
-  
-  if (fRightNeighbour) ret+=(GetDigitStripNo(fNDigits -1)*0.5*GetDigitSignal(fNDigits -1));
-      else ret+=(GetDigitStripNo(fNDigits -1)*GetDigitSignal(fNDigits-1));
-      
-  for (Int_t i=1;i<fNDigits-1;i++)
-    {
-      ret +=GetDigitStripNo(i)*GetDigitSignal(i);
-    }
+    if (fLeftNeighbour) ret+=(GetDigitStripNo(0)*0.5*GetDigitSignal(0));
+    else ret+=(GetDigitStripNo(0)*GetDigitSignal(0));
+    if (fRightNeighbour) ret+=(GetDigitStripNo(fNDigits -1)*0.5*GetDigitSignal(fNDigits -1));
+    else ret+=(GetDigitStripNo(fNDigits -1)*GetDigitSignal(fNDigits-1));
+    for (Int_t i=1;i<fNDigits-1;i++){
+       ret +=GetDigitStripNo(i)*GetDigitSignal(i);
+    }// end for i
   
-  if (fTotalSignal<0) GetTotalSignal();
+    if (fTotalSignal<0) GetTotalSignal();
        
     return (ret/fTotalSignal);
 }
-
-/***********************************************************/
-Float_t AliITSclusterSSD::GetTotalSignal()
-{
-  // return total signal
+//______________________________________________________________________
+Float_t AliITSclusterSSD::GetTotalSignal(){
+    // return total signal
   
-  if(fTotalSignal <0)
-    {
-      fTotalSignal=0;
-      if (fNDigits ==1)  {
-          fTotalSignal = (Float_t)GetDigitSignal(0);
-         //printf("1 digit: signal %d \n",GetDigitSignal(0)); 
-         return fTotalSignal;
-      }
-
-      if (fLeftNeighbour) fTotalSignal += (Float_t)(0.5*GetDigitSignal(0));
-      else fTotalSignal += (Float_t) GetDigitSignal(0);
-      //printf("GetTotalSignal :i  DigitSignal %d %d \n",0,GetDigitSignal(0)); 
-               
-      if (fRightNeighbour) fTotalSignal += (Float_t)(0.5*GetDigitSignal(fNDigits -1));
+    if(fTotalSignal <0){
+       fTotalSignal=0;
+       if (fNDigits ==1)  {
+           fTotalSignal = (Float_t)GetDigitSignal(0);
+           //printf("1 digit: signal %d \n",GetDigitSignal(0)); 
+           return fTotalSignal;
+       }
+       if (fLeftNeighbour) fTotalSignal += (Float_t)(0.5*GetDigitSignal(0));
+       else fTotalSignal += (Float_t) GetDigitSignal(0);
+       //printf("GetTotalSignal :i DigitSignal %d %d \n",0,GetDigitSignal(0));
+       if (fRightNeighbour) fTotalSignal += (Float_t)(0.5*GetDigitSignal(
+                                                                 fNDigits -1));
       else fTotalSignal += (Float_t)GetDigitSignal(fNDigits-1);
-      //printf("GetTotalSignal :i  DigitSignal %d %d \n",fNDigits -1,GetDigitSignal(fNDigits -1)); 
-                               
-      for (Int_t i = 1;i<fNDigits -1;i++) 
-        {
-         fTotalSignal += (Float_t)GetDigitSignal(i);
-         //printf("GetTotalSignal :i  DigitSignal %d %d \n",i,GetDigitSignal(i)); 
+       //printf("GetTotalSignal :i  DigitSignal %d %d \n",fNDigits -1,GetDigitSignal(fNDigits -1));
+       for (Int_t i = 1;i<fNDigits -1;i++){
+           fTotalSignal += (Float_t)GetDigitSignal(i);
+           //printf("GetTotalSignal :i  DigitSignal %d %d \n",i,GetDigitSignal(i)); 
        }
-      //printf("GetTotalSignal: fNDigits %d fTotalSignal %.0f \n",fNDigits,fTotalSignal); 
+       //printf("GetTotalSignal: fNDigits %d fTotalSignal %.0f \n",fNDigits,fTotalSignal); 
     }
-   return fTotalSignal;
+    return fTotalSignal;
 }
-/***********************************************************/
-
-Float_t  AliITSclusterSSD::GetTotalSignalError()
-{
-  // return the error on the signal
-  Float_t err =0;
-  for (Int_t i =1; i<fNDigits -1; i++)
-    {
-      err+=0.1*GetDigitSignal(i);   
+//______________________________________________________________________
+Float_t  AliITSclusterSSD::GetTotalSignalError(){
+    // return the error on the signal
+    Float_t err =0;
+    for (Int_t i =1; i<fNDigits -1; i++){
+       err+=0.1*GetDigitSignal(i);   
     } 
-  if (GetLeftNeighbour())
-   {
-    err+=GetDigitSignal(0);
-   }
-  else
-   {
-    err+=0.1*GetDigitSignal(0);
-   } 
-  if (GetRightNeighbour())
-   {
-    err+=GetDigitSignal(fNDigits -1);
-   }
-  else
-   {
-    err+=0.1*GetDigitSignal(fNDigits -1);
-   }
-  return err; 
-   
+    if (GetLeftNeighbour()){
+       err+=GetDigitSignal(0);
+    }else{
+       err+=0.1*GetDigitSignal(0);
+    } 
+    if (GetRightNeighbour()){
+       err+=GetDigitSignal(fNDigits -1);
+    }else{
+       err+=0.1*GetDigitSignal(fNDigits -1);
+    }
+    return err;
 }
+//______________________________________________________________________
+void AliITSclusterSSD::DelCross(Int_t index){
+    // remove cross clusters from the list of cross clusters
+    Int_t i,j; //iterators
 
-/***********************************************************/
-
-void AliITSclusterSSD::DelCross(Int_t index)
-{
-  // remove cross clusters from the list of cross clusters
-Int_t i,j; //iterators
-
-for (i =0;i<fNCrosses;i++)
- {
-  if ((*fCrossedClusterIndexes)[i] == index)
-   {
-     for (j=i;j<fNCrosses-1;j++)
-      {
-        (*fCrossedClusterIndexes)[j]=(*fCrossedClusterIndexes)[j+1];
-      }
-     fNCrosses--;
-     return; 
-   }
- }
-
+    for (i =0;i<fNCrosses;i++){
+       if ((*fCrossedClusterIndexes)[i] == index){
+           for (j=i;j<fNCrosses-1;j++){
+               (*fCrossedClusterIndexes)[j]=(*fCrossedClusterIndexes)[j+1];
+           }
+           fNCrosses--;
+           return; 
+       }
+    }
 }
-/***********************************************************/
+//______________________________________________________________________
+Int_t  *AliITSclusterSSD::GetTracks(Int_t &nt){
+    // return the track number of the cluster
+    Int_t *tidx=0;
+    Int_t i, j,n;
+    Int_t bit =0;
+    Int_t ntracks=0;
+    nt=0;
 
-Int_t  *AliITSclusterSSD::GetTracks(Int_t &nt)
-{
-  // return the track number of the cluster
-  Int_t *tidx=0;
-  Int_t i, j;
-  Int_t bit =0;
-  Int_t ntracks=0;
-  nt=0;
-
-  for (i=0;i<10;i++) {
-       fTrack[i] = -2;
-  }
+    for (i=0;i<10;i++) fTrack[i] = -3;
    
-  //cout<<"GetTrack start -------: fNDigits ="<<fNDigits<<endl;
+    //cout<<"GetTrack start -------: fNDigits ="<<fNDigits<<endl;
 
-  for (i = 0; i<fNDigits; i++) {
-     tidx=GetDigit(i)->GetTracks();
-     for (j = 0; j<3;j++) {
-       if (tidx[j] >= 0) {
-        if(ntracks == 0){
-         ntracks++; 
-         fTrack[ntracks-1] = tidx[j];
-        }else if(tidx[j] != fTrack[ntracks-1]){
-          ntracks++; 
-          if(ntracks > 9) {
-           bit = 1;
-           break;
-         }
-          fTrack[ntracks-1] = tidx[j];
-        }
-       }
-       //cout<<"digit,dtrack,tidx,bit ="<<i<<","<<j<<","<<tidx[j]<<","<<bit<<endl; 
-       //if(ntracks>0) cout<<"digit,dtrack,fTrack,ntracks ="<<i<<","<<j<<","<<fTrack[ntracks-1]<<","<<ntracks<<endl; 
-     } // 3-tracks loop for the digit 
-     if(bit == 1) break;
-  } // digit loop
+    for (i = 0; i<fNDigits; i++) {
+       tidx = GetDigit(i)->GetTracks();
+       n    = GetDigit(i)->GetNTracks();
+       for (j = 0; j<n && j<10;j++) {
+           if (tidx[j] >= 0) {
+               if(ntracks == 0){
+                   fTrack[ntracks] = tidx[j];
+                   ntracks++; 
+               }else if(tidx[j] != fTrack[ntracks-1]){
+                   ntracks++; 
+                   if(ntracks > 9) {
+                       bit = 1;
+                       break;
+                   } // end if ntracks > 9
+                   fTrack[ntracks-1] = tidx[j];
+               } // end if ntracke == 0
+           } // end if tidx[j] >=0
+       } // 3-tracks loop for the digit 
+       if(bit == 1) break;
+    } // digit loop
 
-  SetNTracks(ntracks); 
-  nt = ntracks;
-  //if(nt == 0) cout<<"!!! No tracks"<<endl;
-  //cout<<"GetTracks: nt,fTrack0,fTrack1,fTrack2 ="<< nt<<","<<fTrack[0]<<","<<fTrack[1]<<","<<fTrack[2]<<endl;
- return &(fTrack[0]);
+    SetNTracks(ntracks); 
+    nt = ntracks;
+    return &(fTrack[0]);
 }
-/***********************************************************/
+//______________________________________________________________________
+Double_t AliITSclusterSSD::GetPosition(){
+    // return position of the cluster
+    Float_t ret;
 
-Double_t AliITSclusterSSD::GetPosition()
-{
-  // return position of the cluster
-  Float_t ret;
-  switch(fNDigits)
-   {
-     case  1:
-       ret = GetDigitStripNo(0);
-       break;
-     case  2:
-       ret = EtaAlgorithm();
-       break;       
-     default:
-       ret = CentrOfGravity();   
-   }
-  return ret;
+    switch(fNDigits){
+    case  1:
+       ret = GetDigitStripNo(0);
+       break;
+    case  2:
+       ret = EtaAlgorithm();
+       break;       
+    default:
+       ret = CentrOfGravity();   
+    }
+    return ret;
 }
+//______________________________________________________________________
+Double_t AliITSclusterSSD::EtaAlgorithm(){
+    // algorithm for determing cluster position
+    if (fNDigits != 2) return -1;
 
-/***********************************************************/
-
-Double_t AliITSclusterSSD::EtaAlgorithm()
-{
-  // algorithm for determing cluster position
-  if (fNDigits != 2) return -1;
+    Int_t strip1  = GetDigit(0)->GetStripNumber(); 
+    Int_t strip2  = GetDigit(1)->GetStripNumber();
+    Int_t signal1 = GetDigit(0)->GetSignal();
+    Int_t signal2 = GetDigit(1)->GetSignal();
 
-  Int_t strip1  = GetDigit(0)->GetStripNumber(); 
-  Int_t strip2  = GetDigit(1)->GetStripNumber();
-  Int_t signal1 = GetDigit(0)->GetSignal();
-  Int_t signal2 = GetDigit(1)->GetSignal();
-
-  Double_t eta;
+    Double_t eta;
   
  
-  if (strip1<strip2)
-   {
-    eta = ((Double_t)signal2)/((Double_t)(signal1+signal2));
-    if (eta<0.04) return strip1;
-    if (eta>0.96) return strip2;
-    return (strip1 + 0.43478261*eta + 0.2826087);   
-   }
-  else
-  {
-    eta = ((Double_t)signal1)/((Double_t)(signal1+signal2));
-    if (eta<0.04) return strip2;
-    if (eta>0.96) return strip1;
-    return (strip2 + 0.43478261*eta + 0.2826087);   
-  }
-
+    if (strip1<strip2){
+       eta = ((Double_t)signal2)/((Double_t)(signal1+signal2));
+       if (eta<0.04) return strip1;
+       if (eta>0.96) return strip2;
+       return (strip1 + 0.43478261*eta + 0.2826087);   
+    } else{
+       eta = ((Double_t)signal1)/((Double_t)(signal1+signal2));
+       if (eta<0.04) return strip2;
+       if (eta>0.96) return strip1;
+       return (strip2 + 0.43478261*eta + 0.2826087);   
+    }
 }
-
-Double_t  AliITSclusterSSD::GetPositionError()
-{
-  // return the position error
- return (GetNumOfDigits()+1)/2;
+//______________________________________________________________________
+Double_t  AliITSclusterSSD::GetPositionError(){
+    // return the position error
+    return (GetNumOfDigits()+1)/2;
 }
+//______________________________________________________________________
+Bool_t AliITSclusterSSD::IsCrossingWith(Int_t idx){
+    // return the cluster to which he crosses
 
-Bool_t AliITSclusterSSD::IsCrossingWith(Int_t idx)
-{
-  // return the cluster to which he crosses
- for (Int_t i =0; i< fNCrosses;i++)
-  {
-    if (GetCross(i) == idx) return kTRUE;
-  }
- return kFALSE;
+    for (Int_t i =0; i< fNCrosses;i++){
+       if (GetCross(i) == idx) return kTRUE;
+    }
+    return kFALSE;
 }
index 7ab9876e64909bbac47720c12213984fd5917866..be874c9a0e79cfdd3f3c1cb1ac9d7be77aa18a0e 100644 (file)
 #ifndef ALIITSCLUSTERSSD_H
 #define ALIITSCLUSTERSSD_H
-
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  $Id$
+ */
+
+    //Piotr Krzysztof Skowronski
+    //Warsaw University of Technology
+    //skowron@if.pw.edu.pl
+    //
+    // Describes set of neighbouring digits on one side of detector,
+    // that are supposed to be generated by one particle.
+    // includes information about clusters on other side that it crosses with
 #include "TObject.h"
-#include "TArrayI.h"
-#include "TClonesArray.h"
 
+class TArrayI;
+class TConesArray;
 class AliITSdigitSSD;
 
-class AliITSclusterSSD : public TObject
-{
-
-
-//Piotr Krzysztof Skowronski
-//Warsaw University of Technology
-//skowron@if.pw.edu.pl
-//
-// Describes set of neighbouring digits on one side of detector,
-// that are supposed to be generated by one particle.
-// includes information about clusters on other side that it crosses with
-
-public:
-
-  AliITSclusterSSD();    //Default Constructor
-  virtual ~AliITSclusterSSD();
-  AliITSclusterSSD(Int_t ndigits, Int_t *DigitIndexes, TObjArray *Digits, Bool_t side);                
-  AliITSclusterSSD(const AliITSclusterSSD &source); 
-  AliITSclusterSSD&  operator=( const AliITSclusterSSD & source);
-               
-  void            AddDigit(Int_t index){
-                                       // //adds on digit
-                                       (*fDigitsIndex)[fNDigits++]=index;
-                                       } 
-  TObjArray*      GetPointer2Digits(){
-                                     // comment to be written 
-                                     return fDigits;
-                                     }
-
-//  TArrayI*        GetDigitsIndexes(Int_t &ndigits);  
-//  void            SetDigitIndex(Int_t index);
-
-  void            SetPointer2Digits(TObjArray *digits){
-                                                      // comment to be written
-                                                      fDigits = digits;
-                                                      }
-  Int_t           GetNumOfDigits(){
-                                  //Returns number of digits that creates this cluster
-                                  return fNDigits;
-                                  }
-  Int_t           GetDigitSignal(Int_t digit);      
-
-  
-  AliITSdigitSSD *GetDigit(Int_t idx) {
-                                      // comment to be written
-                                      return (AliITSdigitSSD *)((*fDigits)[GetDigitIndex(idx)]);
-                                      }
-  Int_t           GetDigitIndex (Int_t digit) {
-                                              // comment to be written
-                                              return (*fDigitsIndex)[digit];
-                                              }
-  Int_t           GetDigitStripNo(Int_t digit);
-  Int_t           GetFirstDigitStripNo(){
-                                        // comment to be written
-                                        return GetDigitStripNo(0);
-                                        }
-  Int_t           GetLastDigitStripNo(){
-                                       // comment to be written
-                                       return GetDigitStripNo(fNDigits-1);
-                                       }
-  Int_t           SplitCluster(Int_t where,Int_t *outdigits); //splits this one side cluster for two
-  void            AddCross(Int_t clIndex);  //Add index of cluster that it crosses with
-  Int_t           GetCross(Int_t crIndex);  //return index of cluster that it crosses with
-  Int_t           GetCrossNo() {
-                               // Returns number of crosses
-                               return fNCrosses;
-                               } 
-  void            DelCross(Int_t index);
-  
-  Double_t        GetPosition();
-  Double_t        GetPositionError();
-  Float_t         GetTotalSignal();  
-  Float_t         GetTotalSignalError();
-  void            CutTotalSignal(Float_t sx) {
-    // comment to be written
-    if (fTotalSignal>sx) fTotalSignal-=sx;
-  }
-  
-  Bool_t         GetRightNeighbour() const {
-                                            // comment to be written
-                                            return fRightNeighbour;
-                                            }
-  Bool_t         GetLeftNeighbour() const {
-                                           // comment to be written
-                                           return fLeftNeighbour;
-                                           }
-  void           SetRightNeighbour(Bool_t nei) {
-                                           // comment to be written
-                                           fRightNeighbour=nei;
-                                           }
-  void           SetLeftNeighbour(Bool_t nei) {
-                                           // comment to be written
-                                           fLeftNeighbour=nei;
-                                           }
-
-  void   SetNTracks(Int_t ntracks) {
-    // set ntracks
-    fNTracks=ntracks;
-  }
-
-
-  Int_t          GetNTracks(){
-                           // comment to be written
-                           return fNTracks;
-                           }
-
-  Bool_t          GetSide(){
-                           // comment to be written
-                           return fSide;
-                           }
-  Int_t           CheckSatus(Int_t *tracks){
-                                           //check if digits comes from the same track
-                                           return 0;
-                                           }  
-  Int_t          *GetTracks(Int_t &nt);
-  void            Consume(){
-                           // comment
-                           fConsumed = kTRUE;
-                           }
-  Bool_t          IsConsumed() const{ 
-                                    // comment
-                                    return fConsumed;
-                                    }
-  Bool_t          IsCrossingWith(Int_t idx);
-  
-protected:
-
-  Bool_t          fSide;           //True if P
-  TObjArray      *fDigits;         //Pointer to List of Digitsbelonging to AliITS
-               
-  Int_t           fNDigits;        //Number of digits that make up that cluster 
-  TArrayI        *fDigitsIndex;    // Digit indexes in fDigits array
-               
-  Int_t           fNCrosses;       //Number of crossed one side clusters on the other siede 
-                                   //   (max 8 : it is not aribtrary)
-  TArrayI        *fCrossedClusterIndexes; //Array of inedexes of crossed clusters (in TClonesArray)
-                                          // not in TArrayI in package
-
-  Bool_t          fLeftNeighbour;   // comment to be written
-  Bool_t          fRightNeighbour;  // comment to be written 
-  Bool_t          fConsumed;        // comment to be written
-  
-  Float_t         fTotalSignal;     // comment to be written
-  Int_t           fTrack[10];       // comment to be written
-  Int_t           fNTracks;         // comment to be written
-
-  Double_t        CentrOfGravity();
-  Double_t        EtaAlgorithm();
-
-private:
-                                                               
-/*************************************/
-/*************************************/                                                
-  ClassDef(AliITSclusterSSD,1)          // Cluster class for reconstructing SSD
+class AliITSclusterSSD : public TObject{
+ public:
+    AliITSclusterSSD();    //Default Constructor
+    virtual ~AliITSclusterSSD();
+    AliITSclusterSSD(Int_t ndigits, Int_t *DigitIndexes,
+                    TObjArray *Digits, Bool_t side);           
+    AliITSclusterSSD(const AliITSclusterSSD &source); 
+    AliITSclusterSSD&  operator=( const AliITSclusterSSD & source);
+    void AddDigit(Int_t index){//adds on digit
+       (*fDigitsIndex)[fNDigits++]=index;} 
+    TObjArray* GetPointer2Digits(){// comment to be written 
+       return fDigits;}
+    void SetPointer2Digits(TObjArray *digits){// comment to be written
+       fDigits = digits;}
+    Int_t GetNumOfDigits(){//Returns number of digits that creates this cluster
+       return fNDigits;}
+    Int_t GetDigitSignal(Int_t digit);
+    AliITSdigitSSD *GetDigit(Int_t idx) { // comment to be written
+       return (AliITSdigitSSD *)((*fDigits)[GetDigitIndex(idx)]);}
+    Int_t GetDigitIndex (Int_t digit) {// comment to be written
+       return (*fDigitsIndex)[digit];}
+    Int_t GetDigitStripNo(Int_t digit);
+    Int_t GetFirstDigitStripNo(){// comment to be written
+       return GetDigitStripNo(0);}
+    Int_t GetLastDigitStripNo(){// comment to be written
+       return GetDigitStripNo(fNDigits-1);}
+     //splits this one side cluster for two
+    Int_t SplitCluster(Int_t where,Int_t *outdigits);
+    void AddCross(Int_t clIndex);  //Add index of cluster that it crosses with
+     //return index of cluster that it crosses with
+    Int_t GetCross(Int_t crIndex);
+    Int_t GetCrossNo() {// Returns number of crosses
+       return fNCrosses;} 
+    void DelCross(Int_t index);
+    Double_t GetPosition();
+    Double_t GetPositionError();
+    Float_t GetTotalSignal();  
+    Float_t GetTotalSignalError();
+    void CutTotalSignal(Float_t sx) {// comment to be written
+       if (fTotalSignal>sx) fTotalSignal-=sx;}
+    Bool_t GetRightNeighbour() const {// comment to be written
+       return fRightNeighbour;}
+    Bool_t GetLeftNeighbour() const {// comment to be written
+       return fLeftNeighbour;}
+    void SetRightNeighbour(Bool_t nei) {// comment to be written
+       fRightNeighbour=nei;}
+    void SetLeftNeighbour(Bool_t nei) {// comment to be written
+       fLeftNeighbour=nei;}
+    void SetNTracks(Int_t ntracks) {// set ntracks
+       fNTracks=ntracks;}
+    Int_t GetNTracks(){// comment to be written
+       return fNTracks;}
+    Bool_t GetSide(){// comment to be written
+       return fSide;}
+    Int_t CheckSatus(Int_t *tracks){//check if digits comes from the same track
+       return 0;}  
+    Int_t *GetTracks(Int_t &nt);
+    void Consume(){// comment
+       fConsumed = kTRUE;}
+    Bool_t IsConsumed() const{// comment
+       return fConsumed;}
+    Bool_t IsCrossingWith(Int_t idx);
+ protected:
+    Bool_t    fSide;        //True if P
+    TObjArray *fDigits;     //Pointer to List of Digitsbelonging to AliITS
+    Int_t     fNDigits;     //Number of digits that make up that cluster 
+    TArrayI  *fDigitsIndex; // Digit indexes in fDigits array
+    Int_t    fNCrosses;     //Number of crossed one side clusters on the
+                            // other side (max 8 : it is not aribtrary)
+    TArrayI *fCrossedClusterIndexes; //Array of inedexes of crossed clusters
+                                     // (in TClonesArray)
+                                     // not in TArrayI in package
+    Bool_t   fLeftNeighbour;   // comment to be written
+    Bool_t   fRightNeighbour;  // comment to be written 
+    Bool_t   fConsumed;        // comment to be written
+    Float_t  fTotalSignal;     // comment to be written
+    Int_t    fTrack[10];       // comment to be written
+    Int_t    fNTracks;         // comment to be written
+    
+    Double_t CentrOfGravity();
+    Double_t EtaAlgorithm();
+  ClassDef(AliITSclusterSSD,1) // Cluster class for reconstructing SSD
 };
 
 #endif
index ec00dc2cb981aa8275bebcea899c5ca2a84078fc..0ebdce786771d61de02f73ebc833fe9ac24f5b30 100644 (file)
@@ -15,6 +15,9 @@
 /*
   $Id$
   $Log$
+  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).
@@ -807,8 +810,9 @@ 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], tracks[size], hits[size];
+    Float_t phys, charges[size];
 
     if( fResponse->Do10to8() ) signal = Convert8to10( signal ); 
     digits[0] = i;
@@ -818,7 +822,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,11 +832,15 @@ 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 ); 
index bbf7e43714a7a192e9318d1ef2f222c1f8188cc4..b59cf5f814fe2e45912bb1c9f42791b448ae295f 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.18  2002/08/21 22:11:13  nilsen
+Debug output now settable via a DEBUG flag.
+
 Revision 1.17  2002/07/16 17:00:17  barbera
 Fixes added to make the slow simulation running with the current HEAD (from M. Masera)
 
@@ -396,7 +399,8 @@ void AliITSsimulationSPD::ChargeSharing(Float_t x1l,Float_t z1l,Float_t x2l,
       <pre>
     */
     //End_Html
-    Float_t xa,za,xb,zb,dx,dz,dtot,dm,refr,refm,refc;
+    //Float_t dm;
+    Float_t xa,za,xb,zb,dx,dz,dtot,refr,refm,refc;
     Float_t refn=0.;
     Float_t arefm, arefr, arefn, arefc, azb, az2l, axb, ax2l;
     Int_t   dirx,dirz,rb,cb;
@@ -579,10 +583,11 @@ void AliITSsimulationSPD::CreateDigit(Int_t module,AliITSpList *pList) {
 
     static AliITS *aliITS  = (AliITS*)gAlice->GetModule("ITS");
 
-    Int_t digits[3];
-    Int_t tracks[3];
-    Int_t hits[3];
-    Float_t charges[3]; 
+    Int_t size = AliITSdigitSPD::GetNTracks();
+    Int_t digits[size];
+    Int_t tracks[size];
+    Int_t hits[size];
+    Float_t charges[size]; 
     Int_t j1;
 
     for (Int_t r=1;r<=GetNPixelsZ();r++) {
@@ -596,9 +601,14 @@ void AliITSsimulationSPD::CreateDigit(Int_t module,AliITSpList *pList) {
                //digits[2] = 1;  
                digits[2] =  (Int_t) signal;  // the signal is stored in
                                               //  electrons
-               for(j1=0;j1<3;j1++){
-                   tracks[j1] = pList->GetTrack(r,c,j1);
-                   hits[j1]   = pList->GetHit(r,c,j1);
+               for(j1=0;j1<size;j1++){
+                   if(j1<pList->GetNEnteries()){
+                       tracks[j1] = pList->GetTrack(r,c,j1);
+                       hits[j1]   = pList->GetHit(r,c,j1);
+                   }else{
+                       tracks[j1] = -3;
+                       hits[j1]   = -1;
+                   } // end if
                    charges[j1] = 0;
                } // end for j1
                Float_t phys = 0;
index ffb10302c9423141e5d0f69758002f02b77225c6..370c96e14d4334be0355d248b267ca776c099793 100644 (file)
 
 /*
 $Log$
+Revision 1.6  2002/08/21 22:09:58  nilsen
+Updated SPD simulation with difusion effects. ReWritten Hit to SDigits
+code.
+
 */
 #include <iostream.h>
 #include <TRandom.h>
@@ -700,7 +704,8 @@ void AliITSsimulationSPDdubna::HitToSDigitOld(AliITSmodule *mod, Int_t module,
                                               // expect module to be an 
                                               // integer
                            UpdateMapSignal(kz-1,kx-1,
-                                           mod->GetHitTrackIndex(hit),
+//                                         mod->GetHitTrackIndex(hit),
+                             ((AliITShit*)(mod->GetHit(hit)))->GetTrack(),
                                            hit,fModule,dXCharge,pList);
                        }      // dXCharge > 1 e-
                    }       // jx loop
@@ -726,7 +731,7 @@ void AliITSsimulationSPDdubna::ChargeToSignal(AliITSpList *pList){
     Float_t  electronics;
 //    Float_t  phys; 
     Double_t sig;
-    const Int_t    nmaxtrk=3;
+    const Int_t    nmaxtrk=AliITSdigitSPD::GetNTracks();
     static AliITSdigitSPD dig;
 
     for(Int_t iz=0; iz<fNPixelsZ; iz++){
@@ -749,7 +754,7 @@ void AliITSsimulationSPDdubna::ChargeToSignal(AliITSpList *pList){
                digits[2] = 1; */
                for(j=0;j<nmaxtrk;j++){
 //                 charges[j] = 0.0;
-                   if (pList->GetTrack(iz,ix,0)) {
+                   if (j<pList->GetNEnteries()) {
                        dig.fTracks[j] = pList->GetTrack(iz,ix,j);
                        dig.fHits[j]   = pList->GetHit(iz,ix,j);
                        /*
@@ -757,8 +762,8 @@ void AliITSsimulationSPDdubna::ChargeToSignal(AliITSpList *pList){
                        hits[j]   = pList->GetHit(iz,ix,j);
                        */
                    }else { // Default values
-                       dig.fTracks[j] = pList->GetTrack(iz,ix,j);
-                       dig.fHits[j]   = pList->GetHit(iz,ix,j);
+                       dig.fTracks[j] = -3;
+                       dig.fHits[j]   = -1;
 /*                     tracks[j] = -2; //noise
                        hits[j]   = -1;  */
                    } // end if pList
index 89ad783480b0e6411fd36ddfae66678d7dcfb1ca..4da6dbdea9d5169404d4aaf54b8012483923ab3e 100644 (file)
@@ -32,6 +32,7 @@
 #include "AliITSdcsSSD.h"
 #include "AliITS.h"
 #include "AliITShit.h"
+#include "AliITSdigit.h"
 #include "AliRun.h"
 #include "AliITSgeom.h"
 #include "AliITSsimulationSSD.h"
@@ -505,7 +506,8 @@ void AliITSsimulationSSD::ChargeToSignal(AliITSpList *pList) {
   // charge to signal
   static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
   Float_t threshold = 0.;
-  Int_t   digits[3], tracks[3],hits[3],j1;
+  Int_t size = AliITSdigitSSD::GetNTracks();
+  Int_t   digits[size], tracks[size],hits[size],j1;
   Float_t charges[3] = {0.0,0.0,0.0};
   Float_t signal;
   Float_t noise[2] = {0.,0.};
@@ -528,9 +530,13 @@ void AliITSsimulationSSD::ChargeToSignal(AliITSpList *pList) {
            digits[0] = k;
            digits[1] = ix;
            digits[2] = (Int_t) signal;
-           for(j1=0;j1<3;j1++){ // only three in digit.
+           for(j1=0;j1<size;j1++)if(j1<pList->GetNEnteries()){
+               // only three in digit.
                tracks[j1]  = pList->GetTrack(k,ix,j1);
                hits[j1]    = pList->GetHit(k,ix,j1);
+           }else{
+               tracks[j1]  = -3;
+               hits[j1]    = -1;
            } // end for j1
            // finally add digit
            aliITS->AddSimDigit(2,0,digits,tracks,hits,charges);