]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New methods to access RecPoints, TrackSegments and RecParticles from memory or from...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Mar 2000 14:31:39 +0000 (14:31 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Mar 2000 14:31:39 +0000 (14:31 +0000)
PHOS/AliPHOS.cxx
PHOS/AliPHOS.h

index bcb9d65367da1ac1a7c4335c09fe73148b6cb888..38c1c3fc481806a68b13e401fd1a9848e241ad59 100644 (file)
@@ -297,7 +297,79 @@ void AliPHOS::CreateMaterials()
   gMC->Gstpar(idtmed[715], "DRAY",0.) ;
   gMC->Gstpar(idtmed[715], "STRA",2.) ;
 
+}
+
+//____________________________________________________________________________
+RecPointsList * AliPHOS::EmcRecPoints(Int_t evt) 
+{
+  // returns the pointer to the EMCA RecPoints list
+  // if the list is empty, get it from TreeR on the disk file
+
+  RecPointsList * rv = 0 ; 
+  
+  if ( fEmcRecPoints ) 
+    rv = fEmcRecPoints ; 
+
+  else {
+    fEmcRecPoints = new TClonesArray("AliPHOSEmcRecPoint", 100) ; 
+    gAlice->GetEvent(evt) ; 
+    TTree * fReconstruct = gAlice->TreeR() ; 
+    fReconstruct->SetBranchAddress( "PHOSEmcRP", &fEmcRecPoints) ;
+    fReconstruct->GetEvent(0) ;
+    fEmcRecPoints->Expand( fEmcRecPoints->GetEntries() ) ; 
+    rv =  fEmcRecPoints ;
+  }
+    
+  return rv ; 
+  
+}
+
+//____________________________________________________________________________
+RecParticlesList * AliPHOS::RecParticles(Int_t evt) 
+{
+  // returns the pointer to the RecParticles list
+  // if the list is empty, get it from TreeR on the disk file
+
+  RecParticlesList * rv = 0 ; 
   
+  if ( fRecParticles ) 
+    rv = fRecParticles ; 
+
+  else {
+    fRecParticles = new TClonesArray("AliPHOSRecParticle", 100) ; 
+    gAlice->GetEvent(evt) ; 
+    TTree * fReconstruct = gAlice->TreeR() ; 
+    fReconstruct->SetBranchAddress( "PHOSRP", &fRecParticles) ;
+    fReconstruct->GetEvent(0) ;
+    fRecParticles->Expand( fRecParticles->GetEntries() ) ; 
+    rv =  fRecParticles ;
+  }
  
+  return rv ; 
+  
+}
+
+//____________________________________________________________________________
+RecParticlesList * AliPHOS::TrackSegments(Int_t evt) 
+{
+  // returns the pointer to the TrackSegments list
+  // if the list is empty, get it from TreeR on the disk file
 
+  TrackSegmentsList * rv = 0 ; 
+  
+  if ( fTrackSegments ) 
+    rv = fTrackSegments ; 
+
+  else {
+    fTrackSegments = new TClonesArray("AliPHOSTrackSegment", 100) ; 
+    gAlice->GetEvent(evt) ; 
+    TTree * fReconstruct = gAlice->TreeR() ; 
+    fReconstruct->SetBranchAddress( "PHOSTS", &fTrackSegments) ;
+    fReconstruct->GetEvent(0) ;
+    fTrackSegments->Expand( fTrackSegments->GetEntries() ) ; 
+    rv =  fTrackSegments ;
+  }
+  return rv ; 
+  
 }
index 25b53000dba9e9dafaff5ea29da799b3b682c2ee..b4b93729f5e5b4947ac927e749649f6b6988c605 100644 (file)
@@ -11,6 +11,7 @@
 //*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH)
 
 // --- ROOT system ---
+#include "TString.h"
 
 // --- AliRoot header files ---
 
@@ -28,16 +29,17 @@ class AliPHOS : public AliDetector {
   AliPHOS() : AliDetector() {} 
   virtual ~AliPHOS() ; 
  
-  virtual void CreateMaterials() ;               // defines the material of the detector
+  virtual void CreateMaterials() ;                     // defines the material of the detector
   virtual AliPHOSGeometry * GetGeometry() = 0 ;  
-  RecPointsList* EmcRecPoints() {return fEmcClusters;}               // gets Array of cluster in the crystals 
-  RecParticlesList * RecParticles() { return fRecParticles ; }      // gets Array of reconstructed particles
-  TrackSegmentsList *    TrackSegments(){return fTrackSegments ;} // gets Array of track segments
-  virtual RecPointsList* PpsdRecPoints() = 0 ;        // gets Array of clusters in the PPSD 
+  RecPointsList* EmcRecPoints(Int_t evt=0) ;           // gets Array of cluster in the crystals 
+  RecParticlesList * RecParticles(Int_t evt = 0) ;     // gets Array of reconstructed particles
+  TrackSegmentsList * TrackSegments(Int_t evt=0) ;     // gets Array of track segments
+  virtual RecPointsList* PpsdRecPoints(Int_t evt=0)=0; // gets Array of clusters in the PPSD 
+  virtual TString Version() {return TString(" ") ; } 
 
  protected:
   
-  RecPointsList * fEmcClusters ;                  // The RecPoints (clusters) list in EMC 
+  RecPointsList * fEmcRecPoints ;                 // The RecPoints (clusters) list in EMC 
   TrackSegmentsList * fTrackSegments ;            // The TrackSegment list in PHOS
   RecParticlesList * fRecParticles ;              // The reconstructed particles list in PHOS