]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDClusterFinder.cxx
Fixing coverity 17919
[u/mrichter/AliRoot.git] / PMD / AliPMDClusterFinder.cxx
index 18d5d27d4a6d3968aebc3ce043d2582d74b62fc2..4d9a77a140e71081a0dd6afda2b8ad74f3b11c3e 100644 (file)
@@ -48,6 +48,7 @@
 #include "AliPMDNoiseCut.h"
 #include "AliPMDddlinfoData.h"
 #include "AliPMDRecoParam.h"
+#include "AliRecoParam.h"
 #include "AliPMDReconstructor.h"
 
 #include "AliDAQ.h"
@@ -154,7 +155,7 @@ AliPMDClusterFinder::~AliPMDClusterFinder()
 // ------------------------------------------------------------------------- //
 
 void AliPMDClusterFinder::Digits2RecPoints(TTree *digitsTree,
-                                          TTree *clustersTree)
+                                          TTree *clustersTree, Int_t gRecoMode)
 {
   // Converts digits to recpoints after running clustering
   // algorithm on CPV plane and PREshower plane
@@ -268,9 +269,33 @@ void AliPMDClusterFinder::Digits2RecPoints(TTree *digitsTree,
 
 
       // Int_t cluspar = fRecoParam->GetPbPbParam()->GetClusteringParam();
-      Int_t cluspar = fRecoParam->GetPPParam()->GetClusteringParam();
+      AliPMDRecoParam * par = fRecoParam->GetPPParam();
+      Int_t cluspar = par->GetClusteringParam();
+      delete par;
+
       // Int_t cluspar = fRecoParam->GetCosmicParam()->GetClusteringParam();
+      
+      //_______________________________________________________// 
+      //Added to switch Refine and crude Clustering - satya//
+      // temporary solution - will be sorted out later
+      /*cluspar = 1;
+      static AliPMDRecoParam *reconp = NULL;
+      reconp = (AliPMDRecoParam*)AliPMDReconstructor::GetRecoParam();
+      if(!reconp) {
+       cluspar = 1;
+      } 
+      else { 
+       
+      if( reconp->GetClusteringParam() == 1) 
+       cluspar = 1;
+      if( reconp->GetClusteringParam() == 2) 
+       cluspar = 2;
+       }
 
+      */
+      cluspar = gRecoMode;
+      //_______________________________________________________// 
+      
       pmdclust->SetClusteringParam(cluspar);
 
       Float_t encut = 4.;
@@ -326,7 +351,7 @@ void AliPMDClusterFinder::Digits2RecPoints(TTree *digitsTree,
 // ------------------------------------------------------------------------- //
 
 void AliPMDClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
-                                          TTree *clustersTree)
+                                          TTree *clustersTree, Int_t gRecoMode)
 {
   // Converts RAW data to recpoints after running clustering
   // algorithm on CPV and PREshower plane
@@ -572,8 +597,32 @@ void AliPMDClusterFinder::Digits2RecPoints(AliRawReader *rawReader,
          Int_t imod = idet*24 + ismn;
 
          // Int_t cluspar = fRecoParam->GetPbPbParam()->GetClusteringParam();
-         Int_t cluspar = fRecoParam->GetPPParam()->GetClusteringParam();
+         AliPMDRecoParam * par = fRecoParam->GetPPParam();
+          Int_t cluspar = par->GetClusteringParam();
+          delete par;
          // Int_t cluspar = fRecoParam->GetCosmicParam()->GetClusteringParam();
+
+         //_______________________________________________________// 
+         //Added to switch Refine and crude Clustering - satya//
+         // temporary solution - will be sorted out later
+         /* cluspar = 1;
+         static AliPMDRecoParam *reconp = NULL;
+         reconp = (AliPMDRecoParam*)AliPMDReconstructor::GetRecoParam();
+         if(!reconp) {
+           cluspar = 1;
+         } 
+         else { 
+           if( reconp->GetClusteringParam() == 1) 
+             cluspar = 1;
+           if( reconp->GetClusteringParam() == 2) 
+             cluspar = 2;
+         }*/
+
+
+         cluspar = gRecoMode; // permanent solution
+
+         //_______________________________________________________// 
+
          pmdclust->SetClusteringParam(cluspar);
          Float_t encut = fNoiseCut->GetNoiseCut(imod);