- Coverity fixes
authoramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Feb 2012 17:52:26 +0000 (17:52 +0000)
committeramastros <amastros@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Feb 2012 17:52:26 +0000 (17:52 +0000)
- coding conventions
- chi2 minimization improved

ITS/UPGRADE/AliITSDigitUpgrade.cxx
ITS/UPGRADE/AliITSlayerUpgrade.h
ITS/UPGRADE/AliITStrackU.cxx
ITS/UPGRADE/AliITStrackU.h
ITS/UPGRADE/AliITStrackerUpgrade.cxx
ITS/UPGRADE/AliITStrackerUpgrade.h

index d414000c01275ef649a12bb49146a2119887c133..a7ac4a38b208376edb5cb87d5624b1029eb74c52 100644 (file)
@@ -38,11 +38,14 @@ ClassImp(AliITSDigitUpgrade)
     fNelectrons(0),
     fNTracksIdMC(0)
 {
+ //
+ // default constructor
+ //
   for(Int_t i=0; i<kMaxLab ; i++) {
     fTrackIdMC[i]=-1;
     fSignalID[i]=-1;
   }
-} //default creator
+} 
 //_______________________________________________________________________
 AliITSDigitUpgrade::AliITSDigitUpgrade(Int_t *digits): 
   AliDigit(digits),
@@ -53,11 +56,14 @@ AliITSDigitUpgrade::AliITSDigitUpgrade(Int_t *digits):
   fNelectrons(0),
   fNTracksIdMC(0)
 {
+ //
+ // constructor
+ // 
   for(Int_t i=0; i<kMaxLab ; i++) {
     fTrackIdMC[i]=-1;
     fSignalID[i]=-1;
   }
-} //default creator
+} 
 //____________________________________________________________________________________________________
 AliITSDigitUpgrade::AliITSDigitUpgrade(ULong_t pixid, Float_t eloss): 
   AliDigit(),
@@ -68,11 +74,14 @@ AliITSDigitUpgrade::AliITSDigitUpgrade(ULong_t pixid, Float_t eloss):
   fNelectrons(0),
   fNTracksIdMC(0)
 {
+ //
+ // Used constructor in simulation
+ //
   for(Int_t i=0; i<kMaxLab ; i++) {
     fTrackIdMC[i]=-1;
     fSignalID[i]=-1;
   }
-} //standard creator digits only
+} 
 //____________________________________________________________________________________________________
 AliITSDigitUpgrade::AliITSDigitUpgrade(const AliITSDigitUpgrade &d):
   AliDigit(d),
@@ -83,12 +92,15 @@ AliITSDigitUpgrade::AliITSDigitUpgrade(const AliITSDigitUpgrade &d):
   fNelectrons(d.fNelectrons),
   fNTracksIdMC(d.fNTracksIdMC)
 {
+ // 
+ // copy constructor
+ //
   for(Int_t i=0; i<kMaxLab ; i++) {
     fTrackIdMC[i]=d.fTrackIdMC[i];
     fSignalID[i]=d.fSignalID[i];
   }
   for(Int_t i=0; i<3 ; i++) fSignalID[i]=d.fSignalID[i];
-} //copy constructor
+} 
 
 //____________________________________________________________________________________________________
 void AliITSDigitUpgrade::AddTrackID(Int_t tid) { 
index b655271844ec9a77d6ce5aefbfa73275f762f7e6..6c229a6adae58ababdd3d05c3e07327c6dede98d 100644 (file)
@@ -5,9 +5,10 @@
 
 /* $Id$ */
 #include <TObject.h>
-#include "AliITSRecPoint.h"
 #include "AliITSRecoParam.h"
 
+class AliITSRecPoint;
+
  class AliITSlayerUpgrade : public TObject {
 
   public:
index cd9ee7152b8cda674b3bf3eecac1e9feb577c5c7..9b9a21a91ae58fa438a4dd6cba836f01b8bb9666 100755 (executable)
@@ -128,6 +128,7 @@ AliITStrackU::AliITStrackU(const AliITStrackU& t, Bool_t trackMI) :
 //    fSigmaY[i]=t.fSigmaY[i]; fSigmaZ[i]=t.fSigmaZ[i]; fSigmaYZ[i]=t.fSigmaYZ[i]; 
 //  }
 }
+
 //____________________________________________________
 AliITStrackU::AliITStrackU(Double_t alpha, Double_t radius, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab, Int_t nlay ):
   fNLayers(nlay),
index d1126fe0e2bee4f51850cdcf43220d10cde539bf..2ab41c5775a58ab1534c3a0722b54973072d679b 100755 (executable)
@@ -97,8 +97,10 @@ class AliITStrackU : public AliITStrackV2 {
 
   Float_t fNormChi2[fgMaxNLayer];        // normalized chi2
   Int_t    fClIndex[fgMaxNLayer];        //cluster Index
-  
-  
+
+  private:
+  AliITStrackU &operator=(const AliITStrackU &t);
+
   ClassDef(AliITStrackU,2)
     };
 
index 25965963c84392866db748a69f47a5d78f691052..ff4cc50e2510915715361e107e438143d053d7a9 100644 (file)
@@ -102,18 +102,13 @@ AliITStrackerUpgrade::AliITStrackerUpgrade(const AliITStrackerUpgrade& tracker):
     fPoint3[i]=tracker.fPoint3[i];
     fPointc[i]=tracker.fPointc[i];
   }
-  if(tracker.fVertexer && tracker.fVert){
-    fVert = new AliESDVertex(*tracker.fVert);
-  }
-  else {
-    fVert = tracker.fVert;
-  }
   for(Int_t i=0;i<fNLayers;i++){
     fCluLayer[i] = tracker.fCluLayer[i];
     fCluCoord[i] = tracker.fCluCoord[i];
   }
 }
 //______________________________________________________________________
+/*
 AliITStrackerUpgrade& AliITStrackerUpgrade::operator=(const AliITStrackerUpgrade& source){
   // Assignment operator. 
   this->~AliITStrackerUpgrade();
@@ -121,7 +116,7 @@ AliITStrackerUpgrade& AliITStrackerUpgrade::operator=(const AliITStrackerUpgrade
   return *this;
  
 }
-
+*/
 //____________________________________________________________________________
 AliITStrackerUpgrade::~AliITStrackerUpgrade(){
   // destructor
@@ -235,18 +230,18 @@ Int_t AliITStrackerUpgrade::LoadClusters(TTree *clusTree){
   // 
 
   TClonesArray statITSCluster("AliITSRecPointU");
-  TClonesArray *ITSCluster = &statITSCluster;
+  TClonesArray *itsCluster = &statITSCluster;
 
   TBranch* itsClusterBranch=clusTree->GetBranch("ITSRecPoints");
   if (!itsClusterBranch){
     AliError("can't get the branch with the ITS clusters ! \n");
     return 1;
   }
-  itsClusterBranch->SetAddress(&ITSCluster);
+  itsClusterBranch->SetAddress(&itsCluster);
   clusTree->GetEvent(0);
-  Int_t nCluster = ITSCluster->GetEntriesFast();
+  Int_t nCluster = itsCluster->GetEntriesFast();
   for(Int_t i=0; i<nCluster; i++){
-    AliITSRecPointU *recp = (AliITSRecPointU*)ITSCluster->UncheckedAt(i);
+    AliITSRecPointU *recp = (AliITSRecPointU*)itsCluster->UncheckedAt(i);
     fLayers[recp->GetLayer()]->InsertCluster(new AliITSRecPointU(*recp));
   }//loop clusters
 
@@ -881,21 +876,24 @@ Double_t AliITStrackerUpgrade::ChoosePoint(Double_t p1, Double_t p2, Double_t pp
 }
 //_________________________________________________________________
 Int_t AliITStrackerUpgrade::FindTrackLowChiSquare() const {
+
   // returns track with lowest chi square  
-  Int_t dim=fListOfUTracks->GetEntries();
+
+Int_t dim=fListOfUTracks->GetEntries();
   if(dim<=1) return 0;
   AliITStrackV2* trk = (AliITStrackV2*)fListOfUTracks->At(0);
-  Double_t minChi2=trk->GetChi2();
+  Double_t minChi2=trk->GetChi2()/trk->GetNumberOfClusters();
   Int_t index=0;
   for(Int_t i=1;i<dim;i++){
     trk = (AliITStrackV2*)fListOfUTracks->At(i);
-    Double_t chi2=trk->GetChi2();
+    Double_t chi2=trk->GetChi2()/trk->GetNumberOfClusters();
     if(chi2<minChi2){
       minChi2=chi2;
       index=i;
     }
   }
   return index;
+
 }
 
 //__________________________________________________________
index bd59320ddcbca3629286f22c42d381e6db62ff1b..a24e7035de3f0a8de1471ac842fba92d89e2a1b7 100644 (file)
@@ -38,7 +38,6 @@ class AliITStrackerUpgrade : public AliITStrackerMI {
   AliITStrackerUpgrade();
   AliITStrackerUpgrade(Int_t nLay);
   AliITStrackerUpgrade(const AliITStrackerUpgrade& tracker);
-  AliITStrackerUpgrade& operator=(const AliITStrackerUpgrade& source);
   virtual ~AliITStrackerUpgrade();  
   virtual Int_t Clusters2Tracks(AliESDEvent *event);  
   Int_t FindTracks(AliESDEvent* event,Bool_t useAllClusters=kFALSE);
@@ -163,6 +162,9 @@ class AliITStrackerUpgrade : public AliITStrackerMI {
   TClonesArray** fCluLayer; //! array with clusters 
   TClonesArray** fCluCoord; //! array with cluster info
 
+  private:
+  AliITStrackerUpgrade &operator=(const AliITStrackerUpgrade &tr);
+
   ClassDef(AliITStrackerUpgrade,2)
     };