]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New version to support new PHOS code
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Mar 2000 14:22:25 +0000 (14:22 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Mar 2000 14:22:25 +0000 (14:22 +0000)
STEER/AliDigitNew.h
STEER/AliRecPoint.cxx
STEER/AliRecPoint.h

index ec0045a2b99c93aa58d50de69ec5ed3315e03cd6..bec71f741dbe75ec20e176a5bc496e4d8873c9c6 100644 (file)
@@ -10,6 +10,9 @@
 ////////////////////////////////////////////////
 
 #include "TObject.h"
+#include "TClonesArray.h" 
+
+typedef TClonesArray DigitsList ;       
 
 class AliDigitNew : public TObject {
 
@@ -17,13 +20,16 @@ class AliDigitNew : public TObject {
   AliDigitNew() ;   
   ~AliDigitNew() {;}
   Int_t   GetAmp() const { return fAmp  ; } 
-  Int_t   GetId() const { return fId ; }     
-   
+  Int_t   GetId() const  { return fId ; }      
+  Int_t   GetIndexInList() const { return fIndexInList ; } 
+  void    SetIndexInList(Int_t val) { fIndexInList = val ; } 
+
  protected:
  
-  Int_t fId ;                // absolute id
   Int_t fAmp ;               // digitalized energy
-     
+  Int_t fId ;                // absolute id
+  Int_t fIndexInList ;       // the index of this digit in the list stored in TreeD
+   
   ClassDef(AliDigitNew,1)  //Base class for all Alice digits
 
 } ;
index ccf0ce43efa1874529c6c6cb48bb5103904df6c7..ab820caac505ef4affde7c786d9bec7d01ead87a 100644 (file)
 
 /*
 $Log$
+Revision 1.2  2000/02/15 09:43:54  fca
+Corrections
+- a bug in the streamer (wrong size of the arrays)
+- replace Read/WriteArray by Read/WriteFastArray (suggestion R.Brun)
+
 Revision 1.1  1999/12/17 09:01:14  fca
 Y.Schutz new classes for reconstruction
 
@@ -46,13 +51,14 @@ AliRecPoint::AliRecPoint()
   fAmp = 0.0 ; 
   
   fLocPos.SetXYZ(0., 0., 0.) ;
-  fLocPosM = new TMatrix(3,3) ;
-  fMaxDigit = 100 ; 
-  fMulDigit = 0 ; 
-  fDigitsList = new int[fMaxDigit]; ; 
-  fMaxTrack = 5 ; 
-  fMulTrack = 0 ; 
-  fTracksList = new int[fMaxTrack]; ; 
+  fLocPosM     = new TMatrix(3,3) ;
+  fMaxDigit    = 100 ; 
+  fMulDigit    = 0 ; 
+  fDigitsList  = new int[fMaxDigit]; ; 
+  fMaxTrack    = 5 ; 
+  fMulTrack    = 0 ; 
+  fTracksList  = new int[fMaxTrack]; ; 
+  fIndexInList = -1 ; // to be set when the point is already stored
 }
 
 //____________________________________________________________________________
@@ -87,7 +93,8 @@ void AliRecPoint::AddDigit(AliDigitNew & digit)
     fDigitsList = tempo ; 
   }
   
-  fDigitsList[fMulDigit++]=  (int) &digit  ; 
+  fDigitsList[fMulDigit] = digit.GetIndexInList()  ; 
+  fMulDigit++ ; 
   fAmp += digit.GetAmp() ; 
 }
 
@@ -143,12 +150,12 @@ void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat)
 //______________________________________________________________________________
 void AliRecPoint::Streamer(TBuffer &R__b)
 {
-   // Stream an object of class AliRecPoint.
-
-   if (R__b.IsReading()) {
+  //  Stream an object of class AliRecPoint.
+ if (R__b.IsReading()) {
       Version_t R__v = R__b.ReadVersion(); if (R__v) { }
       TObject::Streamer(R__b);
       R__b >> fAmp;
+      R__b >> fIndexInList;
       R__b >> fMulDigit;
       fDigitsList = new Int_t[fMulDigit] ; 
       R__b.ReadFastArray(fDigitsList, fMulDigit);
@@ -162,6 +169,7 @@ void AliRecPoint::Streamer(TBuffer &R__b)
       R__b.WriteVersion(AliRecPoint::IsA());
       TObject::Streamer(R__b);
       R__b << fAmp;
+      R__b << fIndexInList;
       R__b << fMulDigit;
       R__b.WriteFastArray(fDigitsList, fMulDigit);
       R__b << fGeom;
@@ -171,3 +179,4 @@ void AliRecPoint::Streamer(TBuffer &R__b)
       R__b.WriteFastArray(fTracksList, fMulTrack);
    }
 }
+
index 378b2bf219c0ded8e9c9c990f95bfa876048eebd..140fb1437f5ca7ea1b8b01a241fe212069c50f47 100644 (file)
@@ -18,6 +18,7 @@
 #include "TObject.h"
 #include "TVector3.h"
 #include "TMatrix.h"
+#include "TClonesArray.h"
 
 // --- Standard library ---
 
@@ -40,7 +41,7 @@ public:
   AliRecPoint() ;                   // ctor            
   virtual ~AliRecPoint() ;          // dtor
  
-  virtual void  AddDigit(AliDigitNew & digit) ;  // add a digit to the digits list  
+  virtual void  AddDigit(AliDigitNew & digit) ;  // add a digit to the digit's indexes list  
   //  virtual void  AddTrack(AliTrack & track) ;  // add a track to the tracks list  
   virtual void  GetCovarianceMatrix(TMatrix & mat) ;
   virtual AliGeometry * GetGeom() const { return fGeom; } 
@@ -50,25 +51,28 @@ public:
   virtual Float_t GetEnergy() {return fAmp; } 
   virtual void  GetLocalPosition(TVector3 & pos) ;
   virtual Int_t GetDigitsMultiplicity(void) const { return fMulDigit ; }
+  Int_t         GetIndexInList() const { return fIndexInList ; } 
   virtual Int_t GetMaximumDigitMultiplicity() const { return  fMaxDigit; } 
   virtual Int_t GetMaximumTrackMultiplicity() const { return  fMaxTrack; } 
   virtual Int_t GetTracksMultiplicity(void) const { return fMulTrack ; }
   virtual void  Print(Option_t * opt = "void") = 0 ; 
+  void          SetIndexInList(Int_t val) { fIndexInList = val ; } 
 
 
 protected:
 
   Float_t       fAmp ;        // summed amplitude of digits 
-  int *         fDigitsList ; // list of digits from which the point was reconstructed 
-  AliGeometry * fGeom ;       // pointer to the geometry class 
+  Int_t *       fDigitsList ; // list of digit's indexes from which the point was reconstructed 
+  AliGeometry * fGeom ;       //! pointer to the geometry class 
+  Int_t         fIndexInList ;// the index of this RecPoint in the list stored in TreeR (to be set by analysis)
   TVector3      fLocPos ;     // local position in the sub-detector coordinate
   TMatrix *     fLocPosM ;    // covariance matrix ;  
   Int_t         fMaxDigit ;   //! max initial size of digits array (not saved)
   Int_t         fMulDigit ;   // total multiplicity of digits
   Int_t         fMaxTrack ;   //! max initial size of tracks array (not saved)
   Int_t         fMulTrack ;   // total multiplicity of tracks
-  int *         fTracksList ; // list of tracks to which the point was assigned 
+  Int_t *       fTracksList ; // list of tracks to which the point was assigned 
+
 public: