small mods for separate task
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Feb 2009 07:14:45 +0000 (07:14 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Feb 2009 07:14:45 +0000 (07:14 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h
PWG2/FLOW/AliFlowCommon/AliFlowVector.h
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.h

index 2c03bdf9233cfff1d8b950965bb910a6b55a9c7f..c7abab3363548f75ef0c6f7a4261c15de876ffd9 100644 (file)
@@ -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; 
+  }
 }
 
 //----------------------------------------------------------------------- 
index 0ccde4c784bc609f6d54b6a2265b13535662a765..d5d6d311dddbce921d6d27d20735198af2c2d719 100644 (file)
@@ -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);
index e60877c76d71465fd13659656520c7b37a1869cf..d5223d0542f8a4435f340af35b155af2b0e8989b 100644 (file)
@@ -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
 
index b73046803d70b98013114d21e58107c8e6d69cff..b6e15a1f6361a85265550229ef1ab4881e06a169 100644 (file)
@@ -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);
index 0c8c170d01c740fa1d6cd3fc0779fd2053d2a830..a5bb7703b704189667c21b74573f8a20fed6114e 100644 (file)
@@ -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