]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSpList.h
Fixed bug in version number of AliITSpListItem and removed delete[] for
[u/mrichter/AliRoot.git] / ITS / AliITSpList.h
index 17a036074c661ac150e0995492470938ceb09365..ec1b948b32f8c55f1f8152ac97084086cf0c4ae9 100644 (file)
@@ -27,6 +27,8 @@ class AliITSpListItem: public TObject {
                            return ( (i>=0&&i<fkSize-1) ? fSignal[i] : 0.0);}
     virtual Double_t GetSignal(){
                            return fTsignal;}
+    virtual Double_t GetSignalAfterElect(){
+                           return fSignalAfterElect;}
     // Returns the Sum/Total signal
     virtual Double_t GetSumSignal() const {return fTsignal+fNoise;}
     // Returns the  noise
@@ -36,6 +38,8 @@ class AliITSpListItem: public TObject {
     // Addes track number and signal to this existing list.
     virtual void AddSignal(Int_t track,Int_t hit,Int_t module,
                           Int_t index,Double_t signal);
+    // Adds signal after electronics to this existing list.
+    virtual void AddSignalAfterElect(Int_t module,Int_t index,Double_t signal);
     // Addes noise to this existing list.
     virtual void AddNoise(Int_t module,Int_t index,Double_t noise);
     // Returns track number.
@@ -50,6 +54,8 @@ class AliITSpListItem: public TObject {
     // Returns index number.
     virtual Int_t GetIndex(){
                            return findex;}
+    // Adds the contents of pl to this 
+    virtual void Add(AliITSpListItem *pl);
     // Adds the contents of pl to this with track number off set given by
     // fileIndex.
     virtual void AddTo(Int_t fileIndex,AliITSpListItem *pl);
@@ -59,9 +65,11 @@ class AliITSpListItem: public TObject {
     void Print(ostream *os);
     // Standard ascii class read function
     void Read(istream *is);
+    // Returns max size of array for for Tracks, Hits, and signals.
+    static Int_t GetMaxKept() {return fkSize;};
 
  private:
-    static const Int_t fkSize = 5; // Array sizes
+    static const Int_t fkSize = 10; // Array sizes
     Int_t    fmodule;         // module number
     Int_t    findex;          // Strip/row,col number linearlized.
     Int_t    fTrack[fkSize];  //[fkSize] track Number
@@ -69,13 +77,15 @@ class AliITSpListItem: public TObject {
     Double_t fSignal[fkSize]; //[fkSize] Signals
     Double_t fTsignal;        // Total signal (no noise)
     Double_t fNoise;          // Total noise, coupling, ...
+    Double_t fSignalAfterElect; // Signal after electronics
 
-    ClassDef(AliITSpListItem,1) // Item list of signals and track numbers
+    ClassDef(AliITSpListItem,3) // Item list of signals and track numbers
 };     
 // Input and output functions for standard C++ input/output.
 ostream & operator<<(ostream &os,AliITSpListItem &source);
 istream & operator>>(istream &is,AliITSpListItem &source);
 
+
 #endif
 
 #ifndef ALIITSPLISTSSD_H
@@ -111,12 +121,19 @@ class AliITSpList: public AliITSMap {
     void GetMaxMapIndex(Int_t &ni,Int_t &nj){ni=fNi;nj=fNj;return;}
     // returns the max index value.
     Int_t GetMaxIndex(){return fNi*fNj;}
+    // returns the largest non-zero entry kept in the array fa.
+    Int_t GetEntries(){return fEnteries;}
     // returns the max number of track/hit entries per cell.
-    Int_t GetNEnteries(){return 5;}
+    Int_t GetNEnteries(){return AliITSpListItem::GetMaxKept();}
     // for a give TObjArray index it returns the corresponding map index
     void  GetMapIndex(Int_t index,Int_t &i,Int_t &j){
-       if(i<0||i>=fNi || j<0||j>-fNj){i=-1;j=-1; return;}
        i = index/fNj;j = index - fNj*i;
+       if(i<0||i>=fNi || j<0||j>=fNj){i=-1;j=-1; return;}
+    }
+    // Returns the signal+noise for a give map coordinate
+    Double_t GetSignal(Int_t index){
+       if(GetpListItem(index)==0) return 0.0;
+       return GetpListItem(index)->GetSumSignal();
     }
     // Returns the signal+noise for a give map coordinate
     Double_t GetSignal(Int_t i,Int_t j){
@@ -159,6 +176,9 @@ class AliITSpList: public AliITSMap {
        if(GetpListItem(i,j)==0) return 0;
        return GetpListItem(i,j)->GetNsignals();
     }
+    // Adds the contents of pl to the list with track number off set given by
+    // fileIndex.
+    virtual void AddItemTo(Int_t fileIndex, AliITSpListItem *pl);
     // Adds a Signal value to the map. Creating and expanding arrays as needed.
     void AddSignal(Int_t i,Int_t j,Int_t trk,Int_t ht,Int_t mod,Double_t sig);
     // Adds a Noise value to the map. Creating and expanding arrays as needed.
@@ -177,10 +197,13 @@ class AliITSpList: public AliITSMap {
     // Returns the pointer to the TObjArray of pList Items
     TObjArray * GetpListItems(){return fa;}
     // returns the pList Item stored in the TObject array
+    AliITSpListItem* GetpListItem(Int_t index){
+       if(fa!=0)return (AliITSpListItem*) (fa->At(index));
+       else return 0;}
+    // returns the pList Item stored in the TObject array
     AliITSpListItem* GetpListItem(Int_t i,Int_t j){
        if(fa!=0)return (AliITSpListItem*) (fa->At(GetIndex(i,j)));
-       else return 0;
-    }
+       else return 0;}
 
     // Fill pList from digits. Not functional yet
     void FillMap(){;}
@@ -194,8 +217,9 @@ class AliITSpList: public AliITSMap {
  private:
     Int_t     fNi,fNj;   // The max index in i,j.
     TObjArray *fa;       // array of pList items
+    Int_t     fEnteries; // keepts track of the number of non-zero entries.
 
-    ClassDef(AliITSpList,1) // list of signals and track numbers
+    ClassDef(AliITSpList,3) // list of signals and track numbers
 };     
 // Input and output functions for standard C++ input/output.
 ostream & operator<<(ostream &os,AliITSpList &source);