cleanup
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Jun 2008 12:26:15 +0000 (12:26 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Jun 2008 12:26:15 +0000 (12:26 +0000)
PWG2/FLOW/AliAnalysisTaskScalarProduct.cxx
PWG2/FLOW/AliAnalysisTaskScalarProduct.h
PWG2/FLOW/AliFlowAnalysisWithScalarProduct.cxx
PWG2/FLOW/AliFlowCommonHist.h

index f777d11063fed5a4df213cd14533533655748374..8a75a0ce78113e0b2a94a3692300c7cc6c0d94c6 100644 (file)
@@ -63,11 +63,22 @@ AliAnalysisTaskScalarProduct::AliAnalysisTaskScalarProduct(const char *name) :
   // Output slot #0 writes into a TList container
   DefineOutput(0, TList::Class());  
 
   // Output slot #0 writes into a TList container
   DefineOutput(0, TList::Class());  
 
- //event maker
-  fEventMaker = new AliFlowEventSimpleMaker();
-  //Analyser
-  fSP  = new AliFlowAnalysisWithScalarProduct() ;
-  fSP-> Init();
+}
+
+//________________________________________________________________________
+AliAnalysisTaskScalarProduct::~AliAnalysisTaskScalarProduct()
+{
+  //
+  // Destructor
+  //
+
+  // histograms are in the output list and deleted when the output
+  // list is deleted by the TSelector dtor
+
+  //  if (ListHistos) {
+  //    delete fListHistos;
+  //    fListHistos = NULL;
+  //  }
 }
 
 //________________________________________________________________________
 }
 
 //________________________________________________________________________
@@ -129,14 +140,20 @@ void AliAnalysisTaskScalarProduct::ConnectInputData(Option_t *)
 //________________________________________________________________________
 void AliAnalysisTaskScalarProduct::CreateOutputObjects() 
 {
 //________________________________________________________________________
 void AliAnalysisTaskScalarProduct::CreateOutputObjects() 
 {
-  // Called once
+  // Called at every worker node to initialize
   cout<<"AliAnalysisTaskScalarProduct::CreateOutputObjects()"<<endl;
   cout<<"AliAnalysisTaskScalarProduct::CreateOutputObjects()"<<endl;
+  //event maker
+  fEventMaker = new AliFlowEventSimpleMaker();
+  //Analyser
+  fSP  = new AliFlowAnalysisWithScalarProduct() ;
+  fSP-> Init();
   
 
   if (fSP->GetHistList()) {
        fSP->GetHistList()->Print();
   
 
   if (fSP->GetHistList()) {
        fSP->GetHistList()->Print();
-//     *fListHistos = new TList();
+//     fListHistos = new TList(fSP->GetHistList());
        fListHistos = fSP->GetHistList();
        fListHistos = fSP->GetHistList();
+       fListHistos->Print();
   }
   else {Printf("ERROR: Could not retrieve histogram list"); }
 }
   }
   else {Printf("ERROR: Could not retrieve histogram list"); }
 }
@@ -205,7 +222,7 @@ void AliAnalysisTaskScalarProduct::Terminate(Option_t *)
 {
   // Called once at the end of the query
   fSP->Finish();
 {
   // Called once at the end of the query
   fSP->Finish();
-  PostData(0,fListHistos);
+  //  PostData(0,fListHistos);
 
   delete fSP;
   delete fEventMaker;
 
   delete fSP;
   delete fEventMaker;
index 7ef07f579ab677e51f8b1b6328dc130c3068440e..4c3fc4c857118cde828db9adbb4824d66214ae7a 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice */
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice */
-/* $Id$ */
+/* $Id$ */
 
 #ifndef AliAnalysisTaskScalarProduct_H
 #define AliAnalysisTaskScalarProduct_H
 
 #ifndef AliAnalysisTaskScalarProduct_H
 #define AliAnalysisTaskScalarProduct_H
@@ -19,8 +19,8 @@ class AliFlowEventSimpleMaker;
 
 class AliAnalysisTaskScalarProduct : public AliAnalysisTask {
  public:
 
 class AliAnalysisTaskScalarProduct : public AliAnalysisTask {
  public:
-  AliAnalysisTaskScalarProduct(const char *name = "AliAnalysisTaskScalarProduct");
-  virtual ~AliAnalysisTaskScalarProduct() {}
+  AliAnalysisTaskScalarProduct(const char *name = "");
+  virtual ~AliAnalysisTaskScalarProduct();
   
   virtual void   ConnectInputData(Option_t *);
   virtual void   CreateOutputObjects();
   
   virtual void   ConnectInputData(Option_t *);
   virtual void   CreateOutputObjects();
index 32dcb3a4d9132d743004e3df6c37557cd42102bb..e224eb4dbebe553e9599eedfbabbfe90e4df88a5 100644 (file)
@@ -93,10 +93,9 @@ void AliFlowAnalysisWithScalarProduct::Init() {
   //fCommonHistsRes = new AliFlowCommonHistResults("SP");
   fHistList->Add(fCommonHists); 
 
   //fCommonHistsRes = new AliFlowCommonHistResults("SP");
   fHistList->Add(fCommonHists); 
 
-  fEventNumber = 0;  //set number of events to zero
-      
-} 
+  fEventNumber = 0;  //set number of events to zero    
+}
+
 //-----------------------------------------------------------------------
  
 void AliFlowAnalysisWithScalarProduct::Make(AliFlowEventSimple* anEvent) {
 //-----------------------------------------------------------------------
  
 void AliFlowAnalysisWithScalarProduct::Make(AliFlowEventSimple* anEvent) {
index f018335936d583d0b37da16784c3ae03e619910e..38b101eef7b1900968eec928ee5c4b779014e36f 100644 (file)
@@ -43,6 +43,7 @@ class AliFlowCommonHist: public TObject {
   TProfile* GetfHistProMeanPtperBin()        {return fHistProMeanPtperBin; } ;
   TH1F*     GetfHistQ()                      {return fHistQ; } ;            
    
   TProfile* GetfHistProMeanPtperBin()        {return fHistProMeanPtperBin; } ;
   TH1F*     GetfHistQ()                      {return fHistQ; } ;            
    
+  //  virtual Long64_t  Merge(TCollection *list);
  
  private:
 
  
  private: