3 #include "AlidNdEtaAnalysisSelector.h"
14 #include <AliGenEventHeader.h>
15 #include <AliHeader.h>
17 #include "dNdEtaAnalysis.h"
19 ClassImp(AlidNdEtaAnalysisSelector)
21 AlidNdEtaAnalysisSelector::AlidNdEtaAnalysisSelector() :
26 // Constructor. Initialization of pointers
30 AlidNdEtaAnalysisSelector::~AlidNdEtaAnalysisSelector()
36 // histograms are in the output list and deleted when the output
37 // list is deleted by the TSelector dtor
40 void AlidNdEtaAnalysisSelector::SlaveBegin(TTree * tree)
42 // The SlaveBegin() function is called after the Begin() function.
43 // When running with PROOF SlaveBegin() is called on each slave server.
44 // The tree argument is deprecated (on PROOF 0 is passed).
46 AliSelector::SlaveBegin(tree);
48 fdNdEtaAnalysis = new dNdEtaAnalysis("dndeta", "dndeta");
51 void AlidNdEtaAnalysisSelector::SlaveTerminate()
53 // The SlaveTerminate() function is called after all entries or objects
54 // have been processed. When running with PROOF SlaveTerminate() is called
55 // on each slave server.
57 AliSelector::SlaveTerminate();
59 // Add the histograms to the output on each slave server
62 AliDebug(AliLog::kError, Form("ERROR: Output list not initialized."));
66 fOutput->Add(fdNdEtaAnalysis);
69 void AlidNdEtaAnalysisSelector::Terminate()
71 // The Terminate() function is the last function to be called during
72 // a query. It always runs on the client, it can be used to present
73 // the results graphically or save the results to file.
75 AliSelector::Terminate();
77 fdNdEtaAnalysis = dynamic_cast<dNdEtaAnalysis*> (fOutput->FindObject("dndeta"));
81 AliDebug(AliLog::kError, Form("ERROR: Histograms not available %p", (void*) fdNdEtaAnalysis));
85 fdNdEtaAnalysis->Finish();
87 TFile* fout = new TFile("out.root","RECREATE");
92 fdNdEtaAnalysis->DrawHistograms();
95 void AlidNdEtaAnalysisSelector::WriteObjects()
97 // Write objects to output file
98 // this is an extra function to be overloaded...
101 fdNdEtaAnalysis->SaveHistograms();