small mods for separate task
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowEventSimple.cxx
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; 
+  }
 }
 
 //-----------------------------------------------------------------------