From 46bec39c472d4f5a781ed983095137d7b9c1a099 Mon Sep 17 00:00:00 2001 From: snelling Date: Wed, 25 Feb 2009 07:14:45 +0000 Subject: [PATCH] small mods for separate task --- .../FLOW/AliFlowCommon/AliFlowEventSimple.cxx | 25 +++++++++++++++---- PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h | 1 + PWG2/FLOW/AliFlowCommon/AliFlowVector.h | 2 +- .../AliFlowTasks/AliAnalysisTaskFlowEvent.cxx | 12 ++++++--- .../AliFlowTasks/AliAnalysisTaskFlowEvent.h | 3 ++- 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx index 2c03bdf9233..c7abab33635 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx +++ b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx @@ -39,10 +39,20 @@ ClassImp(AliFlowEventSimple) //----------------------------------------------------------------------- - AliFlowEventSimple::AliFlowEventSimple(Int_t aLenght): - fTrackCollection(NULL), - fNumberOfTracks(0), - fEventNSelTracksIntFlow(0) +AliFlowEventSimple::AliFlowEventSimple(): + fTrackCollection(NULL), + fNumberOfTracks(0), + fEventNSelTracksIntFlow(0) +{ + cout << "AliFlowEventSimple: Default constructor to be used only by root for io" << endl; +} + +//----------------------------------------------------------------------- + +AliFlowEventSimple::AliFlowEventSimple(Int_t aLenght): + fTrackCollection(NULL), + fNumberOfTracks(0), + fEventNSelTracksIntFlow(0) { //constructor fTrackCollection = new TObjArray(aLenght) ; @@ -75,7 +85,12 @@ AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEv AliFlowEventSimple::~AliFlowEventSimple() { //destructor - fTrackCollection->Delete() ; delete fTrackCollection ; + if (fTrackCollection) { + fTrackCollection->Delete() ; delete fTrackCollection ; + } + else { + cout << "AliFlowEventSimple: Warning trying to delete track collections NULL pointer" << endl; + } } //----------------------------------------------------------------------- diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h index 0ccde4c784b..d5d6d311ddd 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h +++ b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h @@ -24,6 +24,7 @@ class AliFlowTrackSimple; class AliFlowEventSimple: public TObject { public: + AliFlowEventSimple(); AliFlowEventSimple(Int_t aLenght); AliFlowEventSimple(const AliFlowEventSimple& anEvent); AliFlowEventSimple& operator=(const AliFlowEventSimple& anEvent); diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowVector.h b/PWG2/FLOW/AliFlowCommon/AliFlowVector.h index e60877c76d7..d5223d0542f 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowVector.h +++ b/PWG2/FLOW/AliFlowCommon/AliFlowVector.h @@ -56,7 +56,7 @@ class AliFlowVector: public TVector2 { Double_t fSumOfWeightsToPower7; // pow(w_1,7) + pow(w_2,7) + ... + pow(w_n,7) Double_t fSumOfWeightsToPower8; // pow(w_1,8) + pow(w_2,8) + ... + pow(w_n,8) - ClassDef(AliFlowVector, 0) + ClassDef(AliFlowVector, 1) }; #endif diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx index b73046803d7..b6e15a1f636 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx @@ -53,6 +53,7 @@ ClassImp(AliAnalysisTaskFlowEvent) //________________________________________________________________________ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, Bool_t on) : AliAnalysisTask(name, ""), +// fOutputFile(NULL), fESD(NULL), fAOD(NULL), fEventMaker(NULL), @@ -69,17 +70,19 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, Bool_t on) // Define input and output slots here // Input slot #0 works with a TChain DefineInput(0, TChain::Class()); - // Output slot #0 writes into a TList container - DefineOutput(0, TObject::Class()); + // Define here the flow event output + DefineOutput(0, AliFlowEventSimple::Class()); if(on) { DefineOutput(1, TList::Class()); DefineOutput(2, TList::Class()); } - // Define here the flow event output + // and for testing open an output file + // fOutputFile = new TFile("FlowEvents.root","RECREATE"); } //________________________________________________________________________ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent() : + // fOutputFile(NULL), fESD(NULL), fAOD(NULL), fEventMaker(NULL), @@ -262,7 +265,8 @@ void AliAnalysisTaskFlowEvent::Exec(Option_t *) fEvent = fEventMaker->FillTracks(fAOD); } - //fListHistos->Print(); + //fListHistos->Print(); + // fOutputFile->WriteObject(fEvent,"myFlowEventSimple"); PostData(0,fEvent); if (fQA) { PostData(1,fQAInt); diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.h b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.h index 0c8c170d01c..a5bb7703b70 100644 --- a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.h +++ b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.h @@ -48,6 +48,7 @@ class AliAnalysisTaskFlowEvent : public AliAnalysisTask { AliAnalysisTaskFlowEvent(const AliAnalysisTaskFlowEvent& aAnalysisTask); AliAnalysisTaskFlowEvent& operator=(const AliAnalysisTaskFlowEvent& aAnalysisTask); + // TFile* fOutputFile; // temporary output file for testing AliESDEvent* fESD; // ESD object AliAODEvent* fAOD; // AOD object AliFlowEventSimpleMaker* fEventMaker; // FlowEventSimple maker object @@ -59,7 +60,7 @@ class AliAnalysisTaskFlowEvent : public AliAnalysisTask { Bool_t fQA; // flag to set the filling of the QA hostograms - ClassDef(AliAnalysisTaskFlowEvent, 1); // example of analysis + ClassDef(AliAnalysisTaskFlowEvent, 0); // example of analysis }; #endif -- 2.43.0