]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix for coverity
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 10:33:46 +0000 (10:33 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 10:33:46 +0000 (10:33 +0000)
TOF/AliTOFAlignment.cxx
TOF/AliTOFClusterFinder.cxx
TOF/AliTOFClusterFinderV1.cxx
TOF/AliTOFGeometry.cxx
TOF/AliTOFGeometry.h
TOF/AliTOFTrigger.cxx
TOF/AliTOFtracker.cxx
TOF/AliTOFtrackerMI.cxx

index d9a37281677378973375a8933489ee035cc60856..511cd4c0dc99103fc361e770810aade794adf095 100644 (file)
@@ -131,6 +131,10 @@ AliTOFAlignment::AliTOFAlignment():
    for(Int_t i=0; i<72; i++)
     for (Int_t j=0; j<6; j++)
       fCombFMData[i][j]=0;
+
+   for(Int_t i=0; i<18;i++)
+     fTOFMatrixId[i]=0;
+
 }
 //_____________________________________________________________________________
 AliTOFAlignment::AliTOFAlignment(const AliTOFAlignment &t):
@@ -148,6 +152,10 @@ AliTOFAlignment::AliTOFAlignment(const AliTOFAlignment &t):
   for(Int_t i=0; i<72; i++)
     for (Int_t j=0; j<6; j++)
       fCombFMData[i][j]=t.fCombFMData[i][j]; 
+
+  for(Int_t i=0; i<18;i++)
+    fTOFMatrixId[i]=t.fTOFMatrixId[i];
+
 }
 //_____________________________________________________________________________
 AliTOFAlignment& AliTOFAlignment::operator=(const AliTOFAlignment &t){ 
@@ -160,6 +168,9 @@ AliTOFAlignment& AliTOFAlignment::operator=(const AliTOFAlignment &t){
   fNTOFAlignObj=t.fNTOFAlignObj;
   fTOFmgr=t.fTOFmgr;
   fTOFAlignObjArray=t.fTOFAlignObjArray;
+  for(Int_t i=0; i<18;i++)
+    fTOFMatrixId[i]=t.fTOFMatrixId[i];
+
   return *this;
 
 }
index 5878b302481492e17f572bab84c8e46873e2277b..f266fd71bc7ed47f9569de3085eecb9eb047ba30 100644 (file)
@@ -261,7 +261,8 @@ AliTOFClusterFinder::~AliTOFClusterFinder()
       fRecPoints=0;
     }
 
-  if (fTofClusters || fNumberOfTofClusters) {
+  //if (fTofClusters || fNumberOfTofClusters) {
+  if (fNumberOfTofClusters) {
     for (Int_t ii=0; ii<fNumberOfTofClusters; ii++)
       if (fTofClusters[ii]) fTofClusters[ii]->Delete();
     fNumberOfTofClusters=0;
@@ -793,6 +794,10 @@ void AliTOFClusterFinder::Raw2Digits(Int_t iEvent, AliRawReader *rawReader)
     fTOFLoader->MakeTree("D");
     fTreeD = fTOFLoader->TreeD();
     }
+  else {
+    AliFatal("Can not get TreeD");
+    return;
+  }
 
   Int_t bufsize = 32000;
   fDigits->Clear();
index 5e34090e2c5e7709b2d048841a22764d12e7f6cd..e1250695c6dc0e8c37256628ee220fa9becaf477 100644 (file)
@@ -226,7 +226,8 @@ AliTOFClusterFinderV1::~AliTOFClusterFinderV1()
 
   delete fTOFdigits;
 
-  if (fTofClusters || fNumberOfTofClusters) {
+  //if (fTofClusters || fNumberOfTofClusters) {
+  if (fNumberOfTofClusters) {
     for (Int_t ii=0; ii<fNumberOfTofClusters; ii++)
       if (fTofClusters[ii]) fTofClusters[ii]->Delete();
     fNumberOfTofClusters = 0;
index 8683b2280227a3165bcb908e6994dc7d84c4902a..729d163763de04e76b5f6381fa0781535395577d 100644 (file)
@@ -463,7 +463,7 @@ Bool_t AliTOFGeometry::IsInsideThePadPar(Int_t *det, const Float_t * const pos)
 
 }
 //_____________________________________________________________________________
-Bool_t AliTOFGeometry::IsInsideThePad(TGeoHMatrix mat, const Float_t * const pos, Float_t *dist3d) const
+Bool_t AliTOFGeometry::IsInsideThePad(TGeoHMatrix *mat, const Float_t * const pos, Float_t *dist3d) const
 {
   //
   // Returns true if space point with coor pos (x,y,z) [cm] falls inside
@@ -483,7 +483,7 @@ Bool_t AliTOFGeometry::IsInsideThePad(TGeoHMatrix mat, const Float_t * const pos
   // from ALICE global reference system
   // towards TOF pad reference system
   Double_t posl[3] = {0., 0., 0.};
-  mat.MasterToLocal(posg,posl);
+  mat->MasterToLocal(posg,posl);
 
   Float_t xr = posl[0];
   Float_t yr = posl[1];
@@ -505,7 +505,7 @@ Bool_t AliTOFGeometry::IsInsideThePad(TGeoHMatrix mat, const Float_t * const pos
     Double_t padg[3] = {0., 0., 0.};
     // from TOF pad local reference system
     // towards ALICE global reference system
-    TGeoHMatrix inverse = mat.Inverse();
+    TGeoHMatrix inverse = mat->Inverse();
     inverse.MasterToLocal(padl,padg);
 
     // returns the 3d distance
index 14c552268dee0b6bf3104f6dae7b2045fbc6c5cf..92e63f2d3ad3f63805a64b7f7ba8ccaa9b8c6c5a 100644 (file)
@@ -81,7 +81,7 @@ class AliTOFGeometry: public TObject{
   virtual Bool_t  GetHoles() const {return fHoles;};
   virtual Float_t DistanceToPadPar(Int_t *det, const Float_t * const pos, Float_t *dist3d=0) const;
   virtual Bool_t  IsInsideThePadPar(Int_t *det, const Float_t * const pos) const;
-  virtual Bool_t  IsInsideThePad(TGeoHMatrix mat, const Float_t * const pos, Float_t *dist3d=0) const;
+  virtual Bool_t  IsInsideThePad(TGeoHMatrix *mat, const Float_t * const pos, Float_t *dist3d=0) const;
   virtual void    GetVolumePath(const Int_t * const ind, Char_t *path );
   virtual void    GetVolumePath(Int_t sector, Char_t *path );
   virtual void    GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_t *path );
index bd0bbf7b947a070cfc3b6ed7a037fe68819c8c89..4e1768ca6473eb4da1de319e7fc84e77f63974f6 100644 (file)
@@ -78,8 +78,10 @@ ClassImp(AliTOFTrigger)
     fTOFTrigMask(0)
 {
   //main ctor
+  for (Int_t i=0;i<kNCTTM;i++) fLTMarray[i] = kFALSE;
+
   for (Int_t i=0;i<kNLTM;i++){
-  fLTMarray[i] = kFALSE;  //*******************************************************************************************************
+
     for (Int_t j=0;j<kNLTMchannels;j++){
       fLTMmatrix[i][j]=kFALSE;
     }
@@ -124,8 +126,8 @@ AliTOFTrigger::AliTOFTrigger(Int_t HighMultTh, Int_t ppMBTh, Int_t MultiMuonTh,
   fTOFTrigMask(0)
 {
   //ctor with thresholds for triggers
+  for (Int_t i=0;i<kNCTTM;i++) fLTMarray[i] = kFALSE;
   for (Int_t i=0;i<kNLTM;i++){
-  fLTMarray[i] = kFALSE;  //*******************************************************************************************************
     for (Int_t j=0;j<kNLTMchannels;j++){
       fLTMmatrix[i][j]=kFALSE;
     }
@@ -171,8 +173,8 @@ AliTOFTrigger::AliTOFTrigger(const AliTOFTrigger & tr):
   fTOFTrigMask(0)
 {
   //copy ctor
+  for (Int_t i=0;i<kNCTTM;i++) fLTMarray[i] = kFALSE;
   for (Int_t i=0;i<kNLTM;i++){
-  fLTMarray[i] = tr.fLTMarray[i]; 
     for (Int_t j=0;j<kNLTMchannels;j++){
       fLTMmatrix[i][j]=tr.fLTMmatrix[i][j];
     }
@@ -442,8 +444,8 @@ void AliTOFTrigger::CreateLTMMatrixFromDigits() {
   //
 
   //initialization
+  for (Int_t i=0;i<kNCTTM;i++) fLTMarray[i]= kFALSE;
   for (Int_t i=0;i<kNLTM;i++){
-  fLTMarray[i]= kFALSE;
     for (Int_t j=0;j<kNLTMchannels;j++){
       fLTMmatrix[i][j]=kFALSE;
     }
@@ -466,10 +468,10 @@ void AliTOFTrigger::CreateLTMMatrixFromDigits() {
 
   tofLoader->LoadDigits("read");
   TTree *treeD = tofLoader->TreeD();
-  if (treeD == 0x0)
-    {
-      AliFatal("AliTOFTrigger: Can not get TreeD");
-    }
+  if (treeD == 0x0) {
+    AliFatal("AliTOFTrigger: Can not get TreeD");
+    return;
+  }
 
   TBranch *branch = treeD->GetBranch("TOF");
   if (!branch) {
index bc7b99b06ebff700d7050cd5fee90555407f1a17..abd2f2668677fea94e02f47acda6d6de3f3dbb5b 100644 (file)
@@ -572,7 +572,7 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){
       Float_t dist3d[3];
       accept = kFALSE;
       for (Int_t i=0; i<nc; i++) {
-        isInside = fGeom->IsInsideThePad(global[i],ctrackPos,dist3d);
+        isInside = fGeom->IsInsideThePad((TGeoHMatrix*)(&global[i]),ctrackPos,dist3d);
 
         if ( mLastStep ) {
           Float_t yLoc = dist3d[1];
index 95a6fbfb34987701e12616ad311cb9c10e43ca5d..8a9359000ab8c85e461c36f24a84bd7a211927f3 100644 (file)
@@ -282,7 +282,7 @@ void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){
   const Float_t kMaxQualityD = 1.;  // max delta quality if cluster used
   const Float_t kForbiddenR  = 0.1; // minimal PID according TPC
 
-  static const Double_t kMasses[6]={
+  static const Double_t kMasses[AliPID::kSPECIES+1]={
     0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
   };
   
@@ -303,7 +303,7 @@ void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){
   Float_t       mintimedist[kNclusterMax];
   Float_t       likelihood[kNclusterMax];
   Float_t       length[kNclusterMax];
-  Double_t      tpcpid[AliPID::kSPECIES];
+  Double_t      tpcpid[AliPID::kSPECIES+1]; // overrun_static - coverity warning
   dist3D[0][0]=1;
   
   for (Int_t i=0; i<fNseedsTOF; i++) {
@@ -439,7 +439,7 @@ void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){
       Double_t tof2=AliTOFGeometry::TdcBinWidth()*cluster->GetTDC()+kTofOffset; // in ps
       // Float_t tgamma = TMath::Sqrt(cluster->GetR()*cluster->GetR()+cluster->GetZ()*cluster->GetZ())/0.03;  //time for "primary" gamma
       //if (trackTOFin->GetPt()<0.7 && TMath::Abs(tgamma-tof2)<350) continue;  // gamma conversion candidate - TEMPORARY
-      for(Int_t j=0;j<=5;j++){
+      for(Int_t j=0;j<AliPID::kSPECIES+1;j++){
        
        Double_t mass=kMasses[j];
        times[nfound][j]+=distances[4]/3e-2*TMath::Sqrt(mom*mom+mass*mass)/mom;   // add time distance