]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
persistent CommonHist (still need some improvements)
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Aug 2008 14:50:21 +0000 (14:50 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Aug 2008 14:50:21 +0000 (14:50 +0000)
PWG2/FLOW/AliAnalysisTaskScalarProduct.cxx
PWG2/FLOW/AliFlowAnalysisWithScalarProduct.cxx
PWG2/FLOW/AliFlowCommonHist.cxx
PWG2/FLOW/AliFlowCommonHist.h

index 1acf40fdc5e88f4fed8b8d9346d42012d0874771..93fa5f8c04999909becb710a916a0ceb94a09d09 100644 (file)
@@ -37,6 +37,7 @@ class AliAnalysisTask;
 #include "AliAnalysisTaskScalarProduct.h"
 #include "AliFlowEventSimpleMaker.h"
 #include "AliFlowAnalysisWithScalarProduct.h"
+#include "AliFlowCommonHist.h"
 
 // AliAnalysisTaskScalarProduct:
 //
@@ -292,6 +293,20 @@ void AliAnalysisTaskScalarProduct::Terminate(Option_t *)
   if (fListHistos) 
     {
       fListHistos->Print();
+//       AliFlowCommonHist *SDHistClass = dynamic_cast<AliFlowCommonHist*> 
+//     (fListHistos->FindObject("SP"));
+//       if (SDHistClass)
+//     { 
+//       // open a file and write the CLASS to the file
+//       TFile *f = new TFile("mytest.root","recreate");
+//       SDHistClass->Write();
+//       SDHistClass->Print();
+//       f->Close();
+//     }
+//       else
+//     {
+//       cout << "SD class pointer is NULL" << endl;
+//     }
     }  
   else
     {
index 0ef1ae62bc2628b3e10f1d4d3e67f71805640d40..b3106abf3ac7164b3fca7f082cb33439ce00e5c7 100644 (file)
@@ -78,22 +78,22 @@ void AliFlowAnalysisWithScalarProduct::Init() {
   fHistProUQ->SetYTitle("<uQ>");
   fHistList->Add(fHistProUQ);
 
-  fCommonHists = new AliFlowCommonHist("SP");
+  fCommonHists = new AliFlowCommonHist("AliFlowCommonHistSP");
   //  fHistList->Add(fCommonHists->GetHistList());
 
   fHistList->Add(fCommonHists);
   // commented for test writing full object
-  fHistList->Add(fCommonHists->GetHistMultOrig());
-  fHistList->Add(fCommonHists->GetHistMultInt());
-  fHistList->Add(fCommonHists->GetHistMultDiff());
-  fHistList->Add(fCommonHists->GetHistPtInt());
-  fHistList->Add(fCommonHists->GetHistPtDiff());
-  fHistList->Add(fCommonHists->GetHistPhiInt());
-  fHistList->Add(fCommonHists->GetHistPhiDiff());
-  fHistList->Add(fCommonHists->GetHistEtaInt());
-  fHistList->Add(fCommonHists->GetHistEtaDiff());
-  fHistList->Add(fCommonHists->GetHistProMeanPtperBin());
-  fHistList->Add(fCommonHists->GetHistQ());
+  //   fHistList->Add(fCommonHists->GetHistMultOrig());
+  //   fHistList->Add(fCommonHists->GetHistMultInt());
+  //   fHistList->Add(fCommonHists->GetHistMultDiff());
+  //   fHistList->Add(fCommonHists->GetHistPtInt());
+  //   fHistList->Add(fCommonHists->GetHistPtDiff());
+  //   fHistList->Add(fCommonHists->GetHistPhiInt());
+  //   fHistList->Add(fCommonHists->GetHistPhiDiff());
+  //   fHistList->Add(fCommonHists->GetHistEtaInt());
+  //   fHistList->Add(fCommonHists->GetHistEtaDiff());
+  //   fHistList->Add(fCommonHists->GetHistProMeanPtperBin());
+  //   fHistList->Add(fCommonHists->GetHistQ());
   // end test
 
   //fCommonHistsRes = new AliFlowCommonHistResults("SP");
index ec7eb55f38f57453695fb5a93414db9c7a8322e7..d46ceb8d673a201287cd730f68c9d4a44d98378d 100644 (file)
@@ -24,6 +24,7 @@
 #include "TMath.h"   //needed as include
 #include "TList.h"
 #include "AliFlowVector.h"
+#include "TBrowser.h"
 
 class TH1F;
 class TH1D;
@@ -91,24 +92,24 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
 
 }
 
-AliFlowCommonHist& AliFlowCommonHist::operator=(const AliFlowCommonHist& a) 
-{
-  *fHistMultOrig = *a.fHistMultOrig;
-  *fHistMultInt = *a.fHistMultInt;
-  *fHistMultDiff = *a.fHistMultDiff;
-  *fHistPtInt = *a.fHistPtInt;
-  *fHistPtDiff = *a.fHistPtDiff;
-  *fHistPhiInt = *a.fHistPhiInt;
-  *fHistPhiDiff = *a.fHistPhiDiff;
-  *fHistEtaInt = *a.fHistEtaInt;
-  *fHistEtaDiff = *a.fHistEtaDiff;
-  *fHistProMeanPtperBin = *a.fHistProMeanPtperBin;
-  *fHistQ = *a.fHistQ;
-  //  *fHistList = *a.fHistList;
-  fHistList = NULL;
+// AliFlowCommonHist& AliFlowCommonHist::operator=(const AliFlowCommonHist& a) 
+// {
+//   *fHistMultOrig = *a.fHistMultOrig;
+//   *fHistMultInt = *a.fHistMultInt;
+//   *fHistMultDiff = *a.fHistMultDiff;
+//   *fHistPtInt = *a.fHistPtInt;
+//   *fHistPtDiff = *a.fHistPtDiff;
+//   *fHistPhiInt = *a.fHistPhiInt;
+//   *fHistPhiDiff = *a.fHistPhiDiff;
+//   *fHistEtaInt = *a.fHistEtaInt;
+//   *fHistEtaDiff = *a.fHistEtaDiff;
+//   *fHistProMeanPtperBin = *a.fHistProMeanPtperBin;
+//   *fHistQ = *a.fHistQ;
+//   //  *fHistList = *a.fHistList;
+//   fHistList = NULL;
  
-  return *this;
-}
+//   return *this;
+// }
 
 //-----------------------------------------------------------------------
 
@@ -393,7 +394,13 @@ void AliFlowCommonHist::Print(Option_t *option) const
     }
 }
 
+//----------------------------------------------------------------------- 
+ void AliFlowCommonHist::Browse(TBrowser *b)
+{
 
+  if (!b) return;
+  if (fHistList) b->Add(fHistList,"AliFlowCommonHistList");
+}
 
 
 
index de2bd141dcbdd513af3f8deae49e27e0245f7b40..9987db734acd47b1d13e61b57c645c1b8e0492c6 100644 (file)
@@ -18,6 +18,7 @@ class TH1D;
 class TProfile;
 class TCollection;
 class TList;
+class TBrowser;
 
 class AliFlowCommonHist: public TNamed {
 
@@ -26,10 +27,12 @@ class AliFlowCommonHist: public TNamed {
   AliFlowCommonHist();
   AliFlowCommonHist(const char *name,const char *title = "AliFlowCommonHist");
   virtual ~AliFlowCommonHist();
+  AliFlowCommonHist(const AliFlowCommonHist& aSetOfHists);
 
+  Bool_t  IsFolder() const {return kTRUE;};
   //make fill methods here
   Bool_t FillControlHistograms(AliFlowEventSimple* anEvent);
+  void Browse(TBrowser *b); 
   //make get methods here
   Double_t GetEntriesInPtBin(Int_t iBin);   //gets entries from fHistPtDiff
   Double_t GetMeanPt(Int_t iBin);           //gets the mean pt for this bin from fHistProMeanPtperBin   
@@ -54,7 +57,6 @@ class AliFlowCommonHist: public TNamed {
  
  private:
 
-  AliFlowCommonHist(const AliFlowCommonHist& aSetOfHists);
   AliFlowCommonHist& operator=(const AliFlowCommonHist& aSetOfHists);
 
   //define histograms here
@@ -73,7 +75,7 @@ class AliFlowCommonHist: public TNamed {
 
   TList*    fHistList;            //list to hold all histograms  
 
-  ClassDef(AliFlowCommonHist,0);  // macro for rootcint
+  ClassDef(AliFlowCommonHist,1)  // macro for rootcint
 };
 #endif