Added protection in AliHMPIDReconHTA.cxx and setter methods for charge values in...
authorgvolpe <gvolpe@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 31 Jul 2011 11:14:21 +0000 (11:14 +0000)
committergvolpe <gvolpe@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 31 Jul 2011 11:14:21 +0000 (11:14 +0000)
HMPID/AliHMPIDCluster.h
HMPID/AliHMPIDReconHTA.cxx

index 337a89e..b4dac8e 100644 (file)
@@ -61,7 +61,12 @@ public:
          void           DoCorrSin(Bool_t doCorrSin                         ){fgDoCorrSin=doCorrSin;}                               // Set sinoidal correction
          void           SetX     (Double_t x                               ){fXX=x;}                                               // Setter
          void           SetY     (Double_t y                               ){fYY=y;}                                               // Setter
+         void           SetQ     (Double_t q                               ){fQ=q;if(fQ>4095)fQ=4095;}                             // Setter         
+         void           SetQRaw  (Double_t qRaw                            ){fQRaw=qRaw;if(fQRaw>4095)fQRaw=4095;}                 // Setter         
          void           SetSize  (Int_t size                               ){fSi=size;}                                            // Setter
+         void           SetCh    (Int_t chamber                              ){fCh=chamber;}                                         // Setter
+         void           SetChi2  (Double_t chi2                            ){fChi2=chi2;}                                          // Setter
+         void           SetSt    (Double_t st                                ){fSt=st;}                                              // Setter
          void           FindClusterSize(Int_t i,Int_t *pSigmaCut);                                                                 //Find the clusterSize of deconvoluted clusters 
  virtual void          Clear(const Option_t*) { delete [] fDigs; fDigs=0; delete [] fParam; fParam=0; }
          
index cd53af9..0048322 100644 (file)
@@ -703,6 +703,10 @@ Int_t AliHMPIDReconHTA::r2(Double_t *coef, Double_t &x1, Double_t &x2)
     x1=x2=-b/(2*a);
     return 1;
   }
+  if(a==0) {
+    x1 = -c/b;
+    return 1;
+  }
   // delta>0
   x1 = (-b+TMath::Sqrt(delta))/(2*a);
   x2 = (-b-TMath::Sqrt(delta))/(2*a);
@@ -855,6 +859,7 @@ Bool_t AliHMPIDReconHTA::UniformDistrib()
    Double_t chi2 = 0;
    for(Int_t i=0;i<nPhiBins;i++) {
      Double_t theo = (Double_t)npeff/(Double_t)nPhiBins;
+     if(theo==0) continue;
      chi2+= (iPhiBin[i] - theo)*(iPhiBin[i] - theo)/theo;
    }