When the galice.root file is opened it gets the PHOS geometry from file and posts...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Jun 2001 20:46:21 +0000 (20:46 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Jun 2001 20:46:21 +0000 (20:46 +0000)
PHOS/AliPHOSIndexToObject.cxx
PHOS/AliPHOSIndexToObject.h

index 5d68a6d75f2d3779f200f59f18189c1029d592db..ab0bb4fd1fcb3c6820c370a0d537a457eecebdce 100644 (file)
@@ -48,6 +48,7 @@
 #include "TTree.h"
 #include "TROOT.h"
 #include "TObjString.h"
+#include "TFolder.h"
 
 // --- Standard library ---
 #include <iostream.h>
@@ -56,6 +57,7 @@
 
 #include "AliRun.h"
 #include "AliPHOSIndexToObject.h"
+#include "AliPHOS.h"
 #include "AliPHOSDigitizer.h"
 #include "AliPHOSSDigitizer.h"
 #include "AliPHOSClusterizer.h"
@@ -64,7 +66,8 @@
 #include "AliPHOSTrackSegmentMakerv1.h"
 #include "AliPHOSTrackSegment.h"
 #include "AliPHOSPID.h" 
-#include "AliPHOSPIDv1.h" 
+#include "AliPHOSPIDv1.h"
 
 ClassImp(AliPHOSIndexToObject)
   
@@ -102,6 +105,16 @@ AliPHOSIndexToObject::AliPHOSIndexToObject(const char* headerFile,const char* br
     gAlice = (AliRun *) file->Get("gAlice") ;
   }
 
+  // Posts a few item to the white board (folders)
+
+  TFolder * aliceF = (TFolder*)gROOT->GetListOfBrowsables()->FindObject("YSAlice") ;
+  AliPHOS * phos   = GetPHOS() ;
+  // -- the geometry
+  TFolder * geomF  = (TFolder*)aliceF->FindObject("folders/Geometry/PHOS") ; 
+  AliPHOSGeometry * geom = phos->GetGeometry() ;  
+  geomF->Add(geom) ; 
+
   fMaxEvent = (Int_t) gAlice->TreeE()->GetEntries() ;
 
   DefineBranchTitles(branch,branchTitle) ;
@@ -281,6 +294,7 @@ void AliPHOSIndexToObject:: DefineBranchTitles(const char* startBranch,const cha
     delete sdigs[index] ;
   
 }
+
 //____________________________________________________________________________ 
 AliPHOSIndexToObject * AliPHOSIndexToObject::GetInstance()
 {
@@ -326,6 +340,24 @@ AliPHOSIndexToObject * AliPHOSIndexToObject::GetInstance(const char* headerFile,
   
 }
 
+//____________________________________________________________________________ 
+  AliPHOSGeometry *  AliPHOSIndexToObject::GetPHOSGeometry() const 
+{
+  // retrieves the geometr from the folder
+
+  TFolder * aliceF = (TFolder *)gROOT->GetListOfBrowsables()->FindObject("YSAlice") ; 
+  TString path("folders/Geometry/PHOS/") ;
+  path += GetPHOS()->GetTitle() ;
+  return (AliPHOSGeometry*)aliceF->FindObject(path.Data()) ; 
+}
+
+//____________________________________________________________________________ 
+  AliPHOS * AliPHOSIndexToObject::GetPHOS() const 
+{
+  // returns the PHOS object 
+  return ( (AliPHOS*)gAlice->GetDetector("PHOS") ); 
+}  
+
 //____________________________________________________________________________ 
 TParticle * AliPHOSIndexToObject::GimePrimary(Int_t index) const
 {
index f8e0c47b34cc8938fb8112157afd7e97fadc88e0..858f9545542cc5aa5129e9479f322b50c46ba7cd 100644 (file)
@@ -26,6 +26,8 @@ class TParticle ;
 
 // --- AliRoot header files ---
 
+class AliPHOS ;
+class AliPHOSGeometry ;
 class AliPHOSDigit ;
 class AliPHOSDigitizer ;
 class AliPHOSSDigitizer ;
@@ -58,8 +60,9 @@ class AliPHOSIndexToObject : public TObject {
   void  GetEvent(Int_t event) ; // reads event from file 
   Int_t GetEventNumber(){ return fEvent; }
   Int_t GetMaxEvent()   { return fMaxEvent;}
-  
-  static AliPHOSIndexToObject * GetInstance(const char* headerFile,const char* branch = "PHOSRP",
+  AliPHOSGeometry * GetPHOSGeometry() const  ; 
+  AliPHOS * GetPHOS() const ;  
+ static AliPHOSIndexToObject * GetInstance(const char* headerFile,const char* branch = "PHOSRP",
                                            const char* branchTitle =0 ) ; 
   static AliPHOSIndexToObject * GetInstance() ;