Correct treatment of the best hypothesys (Ruben)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Mar 2011 17:41:20 +0000 (17:41 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Mar 2011 17:41:20 +0000 (17:41 +0000)
ITS/AliITStrackMI.cxx
ITS/AliITStrackMI.h

index 9910406..36c2c90 100644 (file)
@@ -91,7 +91,7 @@ fExpQ(t.fExpQ),
 fChi22(t.fChi22),
 fdEdxMismatch(t.fdEdxMismatch),
 fConstrain(t.fConstrain),
-fWinner(t.fWinner),
+fWinner(0),
 fGoldV0(t.fGoldV0) {
   //------------------------------------------------------------------
   //Copy constructor
index 91654ec..3c92898 100644 (file)
@@ -39,6 +39,7 @@ public:
   AliITStrackMI();
   AliITStrackMI(AliESDtrack& t,Bool_t c=kFALSE);
   AliITStrackMI(const AliITStrackMI& t);
+  virtual ~AliITStrackMI()  {if (fWinner) fWinner->fWinner = 0;} // release associated seed
   Int_t GetProlongationFast(Double_t alpha, Double_t xr,Double_t &y, Double_t &z);
   Bool_t UpdateMI(const AliCluster *c, Double_t chi2, Int_t i);  
 
@@ -99,7 +100,7 @@ public:
   void SetDeadZoneProbability(Int_t ilayer,Float_t d) {fDeadZoneProbability[ilayer]=d;}
   //
   AliITStrackMI*  GetWinner()        const {return fWinner;}
-  void   SetWinner(AliITStrackMI* p)       {fWinner = p;}
+  void   SetWinner(AliITStrackMI* p);
   //
   Double_t GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz, Double_t covyz=0.) const;
   Bool_t IsGoldPrimary();
@@ -137,6 +138,14 @@ protected:
   ClassDef(AliITStrackMI,4)   //ITS reconstructed track
 };
 
+inline void AliITStrackMI::SetWinner(AliITStrackMI* p) 
+{
+  // connect winning hypothesis with the seed
+  if (fWinner) fWinner->fWinner = 0; // release previous winner
+  fWinner = p; 
+  if (p) p->fWinner = this;
+}
+
 #endif