uuhhhhaaa - what did I change? Added the run number and fixed coding conventions ;-)
authorekman <ekman@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Nov 2006 15:43:23 +0000 (15:43 +0000)
committerekman <ekman@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Nov 2006 15:43:23 +0000 (15:43 +0000)
PWG0/TPC/AliROCESDAnalysisSelector.cxx
PWG0/TPC/AliROCESDAnalysisSelector.h
PWG0/TPC/AliTPCClusterHistograms.cxx
PWG0/TPC/runROCESDAnalysis.C

index 770296c..4fb9f2f 100644 (file)
@@ -89,9 +89,12 @@ void AliROCESDAnalysisSelector::Init(TTree *tree)
   AliSelector::Init(tree);
 
   // Set branch address
-  if (tree)
+  if (tree) {
+    tree->SetBranchStatus("*", 0);
+    tree->SetBranchStatus("fTracks.*", 1);
+    tree->SetBranchStatus("fTimeStamp", 1);
     tree->SetBranchAddress("ESDfriend", &fESDfriend);
-    
+  }
   if (fESDfriend != 0)
     AliDebug(AliLog::kInfo, "INFO: Found ESDfriend branch in chain.");
 }
@@ -104,6 +107,9 @@ Bool_t AliROCESDAnalysisSelector::Process(Long64_t entry)
   //   return kFALSE;
   //
 
+  //  AliDebug(AliLog::kInfo, Form("Processing event %d \n", entry));
+
+
   if (AliSelector::Process(entry) == kFALSE)
     return kFALSE;
 
@@ -132,6 +138,7 @@ Bool_t AliROCESDAnalysisSelector::Process(Long64_t entry)
   // loop over esd tracks
   for (Int_t t=0; t<nTracks; t++)
   {
+
     AliESDtrack* esdTrack = dynamic_cast<AliESDtrack*> (fESD->GetTrack(t));
     if (!esdTrack)
     {
@@ -198,20 +205,29 @@ void AliROCESDAnalysisSelector::SlaveTerminate()
   for (Int_t i=0; i<kTPCSectors; i++)
     if (fClusterHistograms[i])
         fOutput->Add(fClusterHistograms[i]);
+
 } 
 
 void AliROCESDAnalysisSelector::Terminate()
 {
   // TODO read from output list for PROOF
     
-  TFile* file = TFile::Open("rocESD.root", "RECREATE");
+  TNamed* comment = dynamic_cast<TNamed*>(fTree->GetUserInfo()->FindObject("comment"));
+
+  if (comment)
+    AliDebug(AliLog::kInfo, Form("INFO: Found comment in input list: %s \n", comment->GetTitle()));
+
+  TFile* file = TFile::Open(Form("rocESD_%s.root",comment->GetTitle()), "RECREATE");
   
   for (Int_t i=0; i<kTPCSectors; i++)
     if (fClusterHistograms[i]) {
       fClusterHistograms[i]->SaveHistograms();
       TCanvas* c = fClusterHistograms[i]->DrawHistograms();
-      c->SaveAs(Form("%s.eps",c->GetName()));
-      c->SaveAs(Form("%s.gif",c->GetName()));
+      c->SaveAs(Form("plots_%s_%s.eps",comment->GetTitle(),c->GetName()));
+      c->SaveAs(Form("plots_%s_%s.gif",comment->GetTitle(),c->GetName()));
+
+      c->Close();
+      delete c;
     }
   file->Close();
 } 
index 948d5f3..74a7033 100644 (file)
@@ -31,6 +31,7 @@ class AliROCESDAnalysisSelector : public AliSelector {
     AliTPCClusterHistograms* fClusterHistograms[kTPCSectors];
 
  private:
+
     AliROCESDAnalysisSelector(const AliROCESDAnalysisSelector&);
     AliROCESDAnalysisSelector& operator=(const AliROCESDAnalysisSelector&);
 
index 8b717dc..4101fda 100644 (file)
@@ -401,12 +401,12 @@ TCanvas* AliTPCClusterHistograms::DrawHistograms(const Char_t* opt) {
   // Draws some histograms and save the canvas as eps and gif file.
   //  
 
-  TCanvas* c = new TCanvas(Form("plots_%s",fName.Data()), fName.Data(), 1200, 1000);
+  TCanvas* c = new TCanvas(Form("%s",fName.Data()), fName.Data(), 1200, 1000);
 
   gStyle->SetOptStat(0);
   gStyle->SetOptFit(0);
 
-  gStyle->SetPadLeftMargin(0.05);
+  gStyle->SetPadLeftMargin(0.1);
 
   c->Divide(3,3);
 
index f740b08..051f644 100644 (file)
@@ -7,13 +7,13 @@
 #include "../CreateESDChain.C"
 #include "../PWG0Helper.C"
 
-void runROCESDAnalysis(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, 
+void runROCESDAnalysis(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Int_t runNumber=0, Bool_t aProof = kFALSE, 
     const char* option = "", const char* proofServer = "jgrosseo@lxb6046")
 {
   if (aProof)
     connectProof(proofServer);
 
-  TString libraries("libEG;libGeom;libESD;libPWG0base");
+  TString libraries("libEG;libGeom;libESD;libPWG0base;libPWG0dep");
   TString packages;
 
   if (!prepareQuery(libraries, packages, 2))
@@ -23,6 +23,10 @@ void runROCESDAnalysis(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDeb
 
   TList inputList;
 
+  //  TNamed* comment = new TNamed("comment",runStr.Data());
+  if (runNumber!=0)
+    inputList.Add(new TNamed("comment",Form("%d",runNumber)));
+
   TString selectorName = "AliROCESDAnalysisSelector";
   AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);