]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
make it browsable (partly)
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Feb 2009 11:56:10 +0000 (11:56 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Feb 2009 11:56:10 +0000 (11:56 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.h
PWG2/FLOW/AliFlowCommon/AliFlowVector.h

index c7abab3363548f75ef0c6f7a4261c15de876ffd9..64b76f2eea6618dc5cea7f9340b3dcacd1875ca1 100644 (file)
@@ -21,6 +21,7 @@
 #include "TH1F.h"
 #include "TH1D.h"
 #include "TProfile.h"
+#include "TBrowser.h"
 #include "AliFlowVector.h"
 #include "AliFlowTrackSimple.h"
 #include "AliFlowEventSimple.h"
@@ -42,7 +43,9 @@ ClassImp(AliFlowEventSimple)
 AliFlowEventSimple::AliFlowEventSimple():
   fTrackCollection(NULL),
   fNumberOfTracks(0),
-  fEventNSelTracksIntFlow(0)
+  fEventNSelTracksIntFlow(0),
+  fNumberOfTracksWrap(NULL),
+  fEventNSelTracksIntFlowWrap(NULL)
 {
   cout << "AliFlowEventSimple: Default constructor to be used only by root for io" << endl;
 }
@@ -52,7 +55,9 @@ AliFlowEventSimple::AliFlowEventSimple():
 AliFlowEventSimple::AliFlowEventSimple(Int_t aLenght):
   fTrackCollection(NULL),
   fNumberOfTracks(0),
-  fEventNSelTracksIntFlow(0)
+  fEventNSelTracksIntFlow(0),
+  fNumberOfTracksWrap(NULL),
+  fEventNSelTracksIntFlowWrap(NULL)
 {
   //constructor 
   fTrackCollection =  new TObjArray(aLenght) ;
@@ -64,7 +69,9 @@ AliFlowEventSimple::AliFlowEventSimple(const AliFlowEventSimple& anEvent):
   TObject(),
   fTrackCollection(anEvent.fTrackCollection),
   fNumberOfTracks(anEvent.fNumberOfTracks),
-  fEventNSelTracksIntFlow(anEvent.fEventNSelTracksIntFlow)
+  fEventNSelTracksIntFlow(anEvent.fEventNSelTracksIntFlow),
+  fNumberOfTracksWrap(anEvent.fNumberOfTracksWrap),
+  fEventNSelTracksIntFlowWrap(anEvent.fEventNSelTracksIntFlowWrap)
 {
   //copy constructor 
 }
@@ -76,7 +83,9 @@ AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEv
   *fTrackCollection = *anEvent.fTrackCollection ;
   fNumberOfTracks = anEvent.fNumberOfTracks;
   fEventNSelTracksIntFlow = anEvent.fEventNSelTracksIntFlow;
-  
+  fNumberOfTracksWrap = anEvent.fNumberOfTracksWrap; 
+  fEventNSelTracksIntFlowWrap = anEvent.fEventNSelTracksIntFlowWrap;
+
   return *this;
 }
 
@@ -85,12 +94,9 @@ AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEv
 AliFlowEventSimple::~AliFlowEventSimple()
 {
   //destructor
-  if (fTrackCollection) {
-    fTrackCollection->Delete() ; delete fTrackCollection ;
-  }
-  else { 
-    cout << "AliFlowEventSimple: Warning trying to delete track collections NULL pointer" << endl; 
-  }
+  if (fTrackCollection) fTrackCollection->Delete(); delete fTrackCollection;
+  if (fNumberOfTracksWrap) delete fNumberOfTracksWrap;
+  if (fEventNSelTracksIntFlowWrap) delete fEventNSelTracksIntFlowWrap;
 }
 
 //----------------------------------------------------------------------- 
@@ -231,6 +237,39 @@ AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePh
   
 }
 
+//----------------------------------------------------------------------- 
+void AliFlowEventSimple::Print(Option_t *option) const
+{
+  //   -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
+  //             ===============================================
+  //   printf( "TH1.Print Name  = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
+  printf( "Class.Print Name = %s, Total number of tracks= %d, Number of selected tracks= %d",
+         GetName(),fNumberOfTracks, fEventNSelTracksIntFlow );
+
+  if (fTrackCollection) {  
+    fTrackCollection->Print(option);
+  }
+  else {
+    printf( "Empty track collection \n");
+  }
+}
+
+//----------------------------------------------------------------------- 
+ void AliFlowEventSimple::Browse(TBrowser *b)
+{
+  if (!b) return;
+  if (!fNumberOfTracksWrap) {
+    fNumberOfTracksWrap = new TParameter<int>("fNumberOfTracks", fNumberOfTracks);
+    b->Add(fNumberOfTracksWrap);
+  }
+  if (!fEventNSelTracksIntFlowWrap) {
+    fEventNSelTracksIntFlowWrap = new TParameter<int>("fEventNSelTracksIntFlow", fEventNSelTracksIntFlow);
+    b->Add(fEventNSelTracksIntFlowWrap);
+  }
+  if (fTrackCollection) b->Add(fTrackCollection,"AliFlowTracksSimple");
+}
+
+
 
 
 
index d5d6d311dddbce921d6d27d20735198af2c2d719..39476a670a104bf73583a23adb0de95cb448d9d0 100644 (file)
@@ -9,6 +9,7 @@
 #include "TH1F.h"
 #include "TH1D.h"
 #include "TFile.h"
+#include "TParameter.h"
 class AliFlowTrackSimple;
 
 /**************************************
@@ -29,6 +30,10 @@ class AliFlowEventSimple: public TObject {
   AliFlowEventSimple(const AliFlowEventSimple& anEvent);
   AliFlowEventSimple& operator=(const AliFlowEventSimple& anEvent);
   virtual  ~AliFlowEventSimple();
+
+  Bool_t  IsFolder() const {return kTRUE;};
+  void Browse(TBrowser *b); 
+  void Print(Option_t* option = "") const;      //method to print stats
   
   Int_t NumberOfTracks() const              { return this->fNumberOfTracks; }
   Int_t GetEventNSelTracksIntFlow() const   { return this->fEventNSelTracksIntFlow; }
@@ -44,8 +49,10 @@ class AliFlowEventSimple: public TObject {
   TObjArray*           fTrackCollection;        // collection of tracks
   Int_t                fNumberOfTracks;         // number of tracks
   Int_t                fEventNSelTracksIntFlow; // number of tracks selected for integrated flow calculation
-  
-  ClassDef(AliFlowEventSimple,1)                // macro for rootcint
+  TParameter<Int_t>*   fNumberOfTracksWrap;         //! number of tracks in TBrowser
+  TParameter<Int_t>*   fEventNSelTracksIntFlowWrap; //! number of tracks selected for integrated flow calculation in TBrowser
+
+  ClassDef(AliFlowEventSimple,1)                // track collection used in flow analysis 
 };
 
 #endif
index 550a025dbdbf52e5078eaeded63ff24d06701fab..a518a8e853ca884aec33d8f3174bacfd3d92b6f9 100644 (file)
@@ -19,6 +19,11 @@ class AliFlowTrackSimple: public TObject {
   AliFlowTrackSimple& operator=(const AliFlowTrackSimple& aTrack);
   virtual  ~AliFlowTrackSimple();
   
+  Bool_t  IsFolder() const {return kTRUE;};
+  //  void Browse(TBrowser *b); 
+  //  void Print(Option_t* option = "") const;      //method to print stats
+
   Double_t Eta() const; 
   Double_t Pt()  const; 
   Double_t Phi() const; 
index d5223d0542f8a4435f340af35b155af2b0e8989b..c3271ee996d65d49903c85544184d9613bbc2def 100644 (file)
@@ -22,6 +22,8 @@ class AliFlowVector: public TVector2 {
 
   AliFlowVector& operator=(const AliFlowVector& aVector);
 
+  Bool_t  IsFolder() const {return kTRUE;};
+
   void SetMult(Double_t const mult) {this->fMult = mult;};
   Double_t GetMult() const {return this->fMult;};