Coding rule violations.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 5 Mar 2011 18:37:52 +0000 (18:37 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 5 Mar 2011 18:37:52 +0000 (18:37 +0000)
FASTSIM/AliFastGlauber.cxx
FASTSIM/AliFastGlauber.h
FASTSIM/AliFastMuonTriggerEff.cxx
FASTSIM/AliMUONFastTracking.cxx
FASTSIM/AliMUONFastTrackingEntry.cxx
FASTSIM/AliQuenchingWeights.cxx
FASTSIM/AliQuenchingWeights.h

index 13699f1..0f1c5ba 100644 (file)
@@ -1455,7 +1455,7 @@ void AliFastGlauber::GetLengthsBackToBack(Double_t& ell1,Double_t& ell2,
   return;
 }
 
-void AliFastGlauber::GetLengthsForPythia(Int_t n,Double_t* phi,Double_t* ell, Double_t b)
+void AliFastGlauber::GetLengthsForPythia(Int_t n,Double_t* const phi,Double_t* ell, Double_t b)
 {
   //
   // Returns lenghts for n partons with azimuthal angles phi[n] 
index 13e4579..97581b9 100644 (file)
@@ -34,7 +34,7 @@ class AliFastGlauber : public TObject {
     void SetNucleus(Int_t n=208) {fA=n;}
     void SetAuAuRhic();
     void SetPbPbLHC();
-    void SetFileName(TString &fn){fName=fn;}
+    void SetFileName(const TString &fn){fName=fn;}
     void SetFileName(const char *fn="$(ALICE_ROOT)/FASTSIM/data/glauberPbPb.root"){fName=fn;}
 
     const TF1* GetWSB()            const {return fgWSb;}
@@ -107,8 +107,8 @@ class AliFastGlauber : public TObject {
     void SetCentralityClass(Double_t xsecFrLow=0.0,Double_t xsecFrUp=0.1);    
     void GetRandomBHard(Double_t& b);
     void GetRandomXY(Double_t& x,Double_t& y);
-    void GetSavedXY(Double_t xy[2]) {xy[0] = fXY[0]; xy[1] = fXY[1];}
-    void GetSavedI0I1(Double_t i0i1[2]) {i0i1[0] = fI0I1[0]; i0i1[1] = fI0I1[1];}
+    void GetSavedXY(Double_t xy[2]) const {xy[0] = fXY[0]; xy[1] = fXY[1];} 
+    void GetSavedI0I1(Double_t i0i1[2]) const {i0i1[0] = fI0I1[0]; i0i1[1] = fI0I1[1];}
     void SaveXY(Double_t x, Double_t y) {fXY[0] = x; fXY[1] = y;}
     void SaveI0I1(Double_t i0, Double_t i1) {fI0I1[0] = i0; fI0I1[1] = i1;}
 
@@ -122,7 +122,7 @@ class AliFastGlauber : public TObject {
                                    Double_t b=-1.);
     void GetLengthsBackToBack(Double_t& ell1,Double_t& ell2,
                              Double_t b=-1.);
-    void GetLengthsForPythia(Int_t n,Double_t* phi,Double_t* ell,
+    void GetLengthsForPythia(Int_t n,Double_t* const phi,Double_t* ell,
                             Double_t b=-1.);
     void PlotBDistr(Int_t n=1000);
     void PlotLengthDistr(Int_t n=1000,Bool_t save=kFALSE,
index 29a8e84..564e8eb 100644 (file)
@@ -455,7 +455,7 @@ void AliFastMuonTriggerEff::Evaluate(Float_t charge, Float_t pt,Float_t theta,
        printf(" 6:1 No more points above! No interpolation is needed!\n");
         #endif
        return;        
-      }else if(ptc==pt){
+      }else if(TMath::Abs(ptc-pt) < 1.e-10){
         #ifdef MYTRIGDEBUG
          printf(" 6:1 No interpolation is needed!\n");
         #endif
index 2b4f90d..64c1ff2 100644 (file)
@@ -47,6 +47,7 @@ ClassImp(AliMUONFastTracking)
 AliMUONFastTracking* AliMUONFastTracking::fgMUONFastTracking=NULL;
 
 static Double_t FitP(Double_t *x, Double_t *par){
+// Fit function
     Double_t dx = x[0] - par[0];
     Double_t dx2 = x[0] - par[4];
     Double_t sigma = par[1] * ( 1 + par[2] * dx);
index e2bf9ea..b3db221 100644 (file)
@@ -35,6 +35,7 @@ AliMUONFastTrackingEntry::AliMUONFastTrackingEntry():
     fMeanG2(0.),
     fSigmaG2(0.)
 { 
+// Default constructor
   for (Int_t i=0; i<5; i++) { 
     for (Int_t j=0; j<3; j++) { 
       fAcc[i][j] = 0;
index ac3f72b..b8e0c2a 100644 (file)
@@ -75,9 +75,7 @@ AliQuenchingWeights::AliQuenchingWeights()
       fTablesLoaded(kFALSE)
 {
   //default constructor 
-  fHisto = new TH1F(Form("hhistoqw_%d",fInstanceNumber),"",fgkBins,0.,fgkMaxBin);
-  for(Int_t bin=1;bin<=fgkBins;bin++) 
-    fHisto->SetBinContent(bin,0.);
+
 }
 
 AliQuenchingWeights::AliQuenchingWeights(const AliQuenchingWeights& a) 
@@ -122,6 +120,15 @@ AliQuenchingWeights::~AliQuenchingWeights()
   delete fHisto;
 }
 
+void AliQuenchingWeights::Init()
+{
+//    Initialization
+    if (fHisto) return;
+    fHisto = new TH1F(Form("hhistoqw_%d",fInstanceNumber),"",fgkBins,0.,fgkMaxBin);
+    for(Int_t bin=1;bin<=fgkBins;bin++) 
+       fHisto->SetBinContent(bin,0.);
+}
+
 void AliQuenchingWeights::Reset()
 {
   //reset tables if there were used
@@ -877,7 +884,7 @@ Double_t AliQuenchingWeights::GetELossRandom(Int_t ipart, Double_t length, Doubl
       ret=fHistos[ipart-1][l-1]->GetRandom(); 
       if(++ws==1e6){
        Warning("GetELossRandom",
-                "Aborted reweighting; maximum loss assigned after 1e6 trials.");
+                "Stopping reweighting; maximum loss assigned after 1e6 trials.");
        return e;
       }
     }
@@ -961,7 +968,7 @@ Double_t AliQuenchingWeights::GetELossRandomK(Int_t ipart, Double_t I0, Double_t
       ret=fHisto->GetRandom(); 
       if(++ws==1e6){
        Warning("GetELossRandomK",
-                "Aborted reweighting; maximum loss assigned after 1e6 trials.");
+                "Stopping reweighting; maximum loss assigned after 1e6 trials.");
        return e;
       }
     }
@@ -1032,7 +1039,8 @@ Double_t AliQuenchingWeights::GetELossRandomKFastR(Int_t ipart, Double_t r, Doub
   if(discrete>=1.0) {
     return 0.; //no energy loss
   }
-
+  if (!fHisto) Init();
+  
   fHisto->SetBinContent(bin,continuous);
   Int_t kbinmax=fHisto->FindBin(e/wc);
   if(kbinmax>=fgkBins) kbinmax=fgkBins-1;
@@ -1142,7 +1150,7 @@ void AliQuenchingWeights::GetZeroLossProbR(Double_t &p,Double_t &prw,Double_t &p
 
   Double_t discrete=0.;
   Double_t continuous=0.;
-
+  if (!fHisto) Init();
   Int_t kbinmax=fHisto->FindBin(e/wc);
   if(kbinmax>=fgkBins) kbinmax=fgkBins-1;
   if(fMultSoft) {
@@ -1278,6 +1286,7 @@ Int_t AliQuenchingWeights::SampleEnergyLoss(Int_t ipart, Double_t r)
   Double_t discrete=0.;
   Double_t continuous=0;;
   Int_t bin=1;
+  if (!fHisto) Init();
   Double_t xxxx = fHisto->GetBinCenter(bin);
   if(fMultSoft)
     CalcMult(ipart,r,xxxx,continuous,discrete);
index 9348ac0..0f5d088 100644 (file)
@@ -30,7 +30,7 @@ class AliQuenchingWeights : public TObject {
   AliQuenchingWeights& operator=(const AliQuenchingWeights& a)
       {a.Copy(*this); return(*this);}
   virtual ~AliQuenchingWeights();
-
+  void Init();
   void Reset();
   Int_t SampleEnergyLoss();
   Int_t SampleEnergyLoss(Int_t ipart, Double_t r);