]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG0/TPC/AliROCESDAnalysisSelector.cxx
added AliTPCClusterHistograms
[u/mrichter/AliRoot.git] / PWG0 / TPC / AliROCESDAnalysisSelector.cxx
index 31d608de9b48da89884162e06543946cf92498ce..af3ffec475d775c00329ff044b6a2c1f531f1141 100644 (file)
 #include <../TPC/AliTPCclusterMI.h>
 #include <../TPC/AliTPCseed.h>
 
-#include <TH2F.h>
 #include <TFile.h>
 #include <TTree.h>
 #include <TCanvas.h>
-#include <TProfile.h>
+
+#include "TPC/AliTPCClusterHistograms.h"
 
 ClassImp(AliROCESDAnalysisSelector)
 
 AliROCESDAnalysisSelector::AliROCESDAnalysisSelector() :
   AliSelector(),
   fESDfriend(0),
-  fhQmaxVsRow(0)
+  fClusterHistograms(0)
 {
   //
   // Constructor. Initialization of pointers
@@ -67,6 +67,12 @@ AliROCESDAnalysisSelector::~AliROCESDAnalysisSelector()
   //
   // Destructor
   //
+
+  if (fClusterHistograms) {
+    delete fClusterHistograms;
+    fClusterHistograms = 0;    
+  }
+
 }
 
 void AliROCESDAnalysisSelector::SlaveBegin(TTree* tree)
@@ -74,8 +80,9 @@ void AliROCESDAnalysisSelector::SlaveBegin(TTree* tree)
   //
   
   AliSelector::SlaveBegin(tree);
-  
-  fhQmaxVsRow = new TH2F("QmaxVsRow", "Qmax vs. pad row;Pad row;Qmax", 91, -0.5, 90, 201, -0.5, 200.5);
+
+  fClusterHistograms = new AliTPCClusterHistograms("test","test");
+
 } 
 
 void AliROCESDAnalysisSelector::Init(TTree *tree)
@@ -163,7 +170,7 @@ Bool_t AliROCESDAnalysisSelector::Process(Long64_t entry)
       if (cluster->GetDetector() != 5)
         continue;
       
-      fhQmaxVsRow->Fill(cluster->GetRow(), cluster->GetMax());
+      fClusterHistograms->FillCluster(cluster);
     }
   }
    
@@ -174,26 +181,15 @@ void AliROCESDAnalysisSelector::SlaveTerminate()
 {
   //
   
-  fOutput->Add(fhQmaxVsRow);
+  fOutput->Add(fClusterHistograms);
 } 
 
 void AliROCESDAnalysisSelector::Terminate()
 {
   //
-  
-  fhQmaxVsRow = dynamic_cast<TH2F*> (fOutput->FindObject("QmaxVsRow"));
-  if (!fhQmaxVsRow)
-    return;
-
-  new TCanvas;
-  fhQmaxVsRow->DrawCopy("COLZ");
-    
-  new TCanvas;
-  TProfile* profile = fhQmaxVsRow->ProfileX("fhQmaxVsRowProfile");
-  profile->DrawCopy();
     
   TFile* file = TFile::Open("rocESD.root", "RECREATE");
-  fhQmaxVsRow->Write();
-  profile->Write();
+  
+  fClusterHistograms->SaveHistograms();
   file->Close();
 }