]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix coding violations
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 11 Mar 2010 17:39:46 +0000 (17:39 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 11 Mar 2010 17:39:46 +0000 (17:39 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithLYZEventPlane.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithLYZEventPlane.h
PWG2/FLOW/AliFlowCommon/AliFlowCommonConstants.cxx
PWG2/FLOW/AliFlowCommon/AliFlowCommonConstants.h

index 5937cf568ba3160c2edf7491430559e20c1dfb59..d5778392f54895ae5f1d0f0b04fc96bebdf7122a 100644 (file)
 * provided "as is" without express or implied warranty.                  * 
 **************************************************************************/
 
+// AliFlowAnalysisWithLYZEventPlane:
+//
+// Class to do flow analysis with the event plane from the LYZ method
+//
+// author: N. van der Kolk (kolk@nikhef.nl)
+
 /*
 $Log$
 */ 
@@ -20,13 +26,12 @@ $Log$
 //#define AliFlowAnalysisWithLYZEventPlane_cxx
  
 #include "Riostream.h"  //needed as include
-#include "TComplex.h"   //needed as include
+#include "TMath.h"   //needed as include
 #include "TProfile.h"   //needed as include
-
-class TH1F;
-class TFile;
-class TList;
-class TVector2;
+#include "TH1F.h"
+#include "TFile.h"
+#include "TList.h"
+#include "TVector2.h"
 
 #include "AliFlowLYZConstants.h"    //needed as include
 #include "AliFlowCommonConstants.h" //needed as include
@@ -36,14 +41,7 @@ class TVector2;
 #include "AliFlowCommonHistResults.h"
 #include "AliFlowLYZEventPlane.h"
 #include "AliFlowAnalysisWithLYZEventPlane.h"
-
-class AliFlowVector;
-
-// AliFlowAnalysisWithLYZEventPlane:
-//
-// Class to do flow analysis with the event plane from the LYZ method
-//
-// author: N. van der Kolk (kolk@nikhef.nl)
+#include "AliFlowVector.h"
 
 
 ClassImp(AliFlowAnalysisWithLYZEventPlane)
@@ -244,11 +242,11 @@ void AliFlowAnalysisWithLYZEventPlane::Make(AliFlowEventSimple* anEvent, AliFlow
 
     //get the Q vector from the FlowEvent
     AliFlowVector vQ = anEvent->GetQ(); 
-    if (vQ.X()== 0. && vQ.Y()== 0. ) { cout<<"Q vector is NULL!"<<endl; }
+    //if (vQ.X()== 0. && vQ.Y()== 0. ) { cout<<"Q vector is NULL!"<<endl; } //coding violation
     //Weight with the multiplicity
     Double_t dQX = 0.;
     Double_t dQY = 0.;
-    if (vQ.GetMult()!=0.) {
+    if (TMath::AreEqualAbs(vQ.GetMult(),0.0,1e-10)) {
       dQX = vQ.X()/vQ.GetMult();
       dQY = vQ.Y()/vQ.GetMult();
     } else {cerr<<"vQ.GetMult() is zero!"<<endl; }
@@ -392,7 +390,7 @@ void AliFlowAnalysisWithLYZEventPlane::Finish() {
   Double_t  dV = 0; 
   for (Int_t theta=0;theta<iNtheta;theta++)    {
     Double_t dR0 = fFirstr0theta->GetBinContent(theta+1); 
-    if (dR0!=0.) { dVtheta = dJ01/dR0 ;}
+    if (TMath::AreEqualAbs(dR0,0.0,1e-10)) { dVtheta = dJ01/dR0 ;}
     dV += dVtheta;
   }
   dV /= iNtheta;
@@ -455,7 +453,7 @@ void AliFlowAnalysisWithLYZEventPlane::Finish() {
     Double_t dErrdifcomb = 0.;  //set error to zero
     Double_t dErr2difcomb = 0.; //set error to zero
     //calculate error
-    if (dNprime!=0.) { 
+    if (TMath::AreEqualAbs(dNprime,0.0,1e-10)) { 
       for (Int_t theta=0;theta<iNtheta;theta++) {
        Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi(); 
        Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
@@ -469,7 +467,7 @@ void AliFlowAnalysisWithLYZEventPlane::Finish() {
       } //loop over theta
     } 
       
-    if (dErr2difcomb!=0.) {
+    if (TMath::AreEqualAbs(dErr2difcomb, 0.0, 1e-10)) {
       dErr2difcomb /= iNtheta;
       dErrdifcomb = TMath::Sqrt(dErr2difcomb);
     }
@@ -554,7 +552,7 @@ void AliFlowAnalysisWithLYZEventPlane::Finish() {
  
   } //loop over bins b
 
-  if (dSum != 0.) {
+  if (TMath::AreEqualAbs(dSum, 0.0, 1e-10)) {
     dVRP /= dSum; //the pt distribution should be normalised
     dErrV /= (dSum*dSum);
     dErrV = TMath::Sqrt(dErrV);
index a026182762018ad8e3b54e131fd97b7bb225315d..6cfa85b6b7209738322beb8e9d13d21ffba0600d 100644 (file)
@@ -1,29 +1,25 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice */
+
+// AliFlowAnalysisWithLYZEventPlane:
+// Class to do flow analysis with the event plane
+// from the LYZ method
+// author: N. van der Kolk (kolk@nikhef.nl)
+
 /* $Id$ */
 
 #ifndef ALIFLOWANALYSISWITHLYZEVENTPLANE_H
 #define ALIFLOWANALYSISWITHLYZEVENTPLANE_H
 
-class AliFlowVector;
-class AliFlowTrackSimple;
 class AliFlowEventSimple;
 class AliFlowCommonHist;
 class AliFlowCommonHistResults;
 class AliFlowLYZEventPlane;
 
 class TString;
-class TFile;
 class TProfile;
 class TH1F;
-class TH1D;
 class TList;
-class Riostream;
-
-// AliFlowAnalysisWithLYZEventPlane:
-// Class to do flow analysis with the event plane from the LYZ method
-// author: N. van der Kolk (kolk@nikhef.nl)
-
 
 class AliFlowAnalysisWithLYZEventPlane {
 
@@ -46,68 +42,68 @@ class AliFlowAnalysisWithLYZEventPlane {
   Double_t  GetQ2sum() const             { return this->fQ2sum; }
 
   //output
-  TList*             GetHistList() const     {return this->fHistList; }
+  TList* GetHistList() const     {return this->fHistList; }
   AliFlowCommonHist* GetCommonHists() const  { return this->fCommonHists; }
-  void               SetCommonHists(AliFlowCommonHist* const aCommonHist)  
-     { this->fCommonHists = aCommonHist; }
+  void SetCommonHists(AliFlowCommonHist* const aCommonHist)  
+         { this->fCommonHists = aCommonHist; }
   AliFlowCommonHistResults* GetCommonHistsRes() const  
-     { return this->fCommonHistsRes; }
-  void               SetCommonHistsRes(AliFlowCommonHistResults* const aCommonHistResult) 
-     { this->fCommonHistsRes = aCommonHistResult; }
+                              { return this->fCommonHistsRes; }
+  void SetCommonHistsRes(AliFlowCommonHistResults* const aCommonHistResult) 
+         { this->fCommonHistsRes = aCommonHistResult; }
 
   // !!!!! make getters and setters for all histograms
   TProfile*  GetSecondReDtheta() const {return this->fSecondReDtheta; } 
   void       SetSecondReDtheta(TProfile* const aSecondReDtheta) 
-    {this->fSecondReDtheta = aSecondReDtheta; }
+               { this->fSecondReDtheta = aSecondReDtheta; }
   TProfile*  GetSecondImDtheta() const {return this->fSecondImDtheta; }
   void       SetSecondImDtheta(TProfile* const aSecondImDtheta)
-    {this->fSecondImDtheta = aSecondImDtheta; }
+               { this->fSecondImDtheta = aSecondImDtheta; }
   TProfile*  GetFirstr0theta() const   {return this->fFirstr0theta; }
   void       SetFirstr0theta(TProfile* const aFirstr0theta)
-    {this->fFirstr0theta = aFirstr0theta; }
+               { this->fFirstr0theta = aFirstr0theta; }
   
   TProfile*  GetHistProVetaRP() const   {return this->fHistProVetaRP;}
   void       SetHistProVetaRP(TProfile* const aHistProVetaRP)
-    {this->fHistProVetaRP =aHistProVetaRP; }
+               { this->fHistProVetaRP =aHistProVetaRP; }
   TProfile*  GetHistProVetaPOI() const  {return this->fHistProVetaPOI;} 
   void       SetHistProVetaPOI(TProfile* const aHistProVetaPOI)
-    {this->fHistProVetaPOI = aHistProVetaPOI; } 
+               { this->fHistProVetaPOI = aHistProVetaPOI; } 
   TProfile*  GetHistProVPtRP() const    {return this->fHistProVPtRP;}
   void       SetHistProVPtRP(TProfile* const aHistProVPtRP)
-    {this->fHistProVPtRP =aHistProVPtRP; } 
+               { this->fHistProVPtRP =aHistProVPtRP; } 
   TProfile*  GetHistProVPtPOI() const   {return this->fHistProVPtPOI;} 
   void       SetHistProVPtPOI(TProfile* const aHistProVPtPOI)
-    {this->fHistProVPtPOI = aHistProVPtPOI; }      
+               { this->fHistProVPtPOI = aHistProVPtPOI; }      
   TProfile*  GetHistProWr() const       {return this->fHistProWr; }
   void       SetHistProWr(TProfile* const aHistProWr)
-    {this->fHistProWr = aHistProWr; }
+               { this->fHistProWr = aHistProWr; }
   TProfile*  GetHistProWrCorr() const {return this->fHistProWrCorr; }
   void       SetHistProWrCorr(TProfile* const aHistProWrCorr)
-    {this->fHistProWrCorr = aHistProWrCorr; }
+               { this->fHistProWrCorr = aHistProWrCorr; }
   TH1F*      GetHistQsumforChi() const {return this->fHistQsumforChi; }
   void       SetHistQsumforChi(TH1F* const aHistQsumforChi) 
-    {this->fHistQsumforChi = aHistQsumforChi; }
+               { this->fHistQsumforChi = aHistQsumforChi; }
   TH1F*      GetHistDeltaPhi()  const {return this->fHistDeltaPhi; }  
   void       SetHistDeltaPhi(TH1F* const aHistDeltaPhi)
-    {this->fHistDeltaPhi = aHistDeltaPhi; }
+               { this->fHistDeltaPhi = aHistDeltaPhi; }
   TH1F*      GetHistDeltaPhi2() const {return this->fHistDeltaPhi2; } 
   void       SetHistDeltaPhi2(TH1F* const aHistDeltaPhi2)
-    {this->fHistDeltaPhi2 = aHistDeltaPhi2; }
+               { this->fHistDeltaPhi2 = aHistDeltaPhi2; }
   TH1F*      GetHistDeltaPhihere() const {return this->fHistDeltaPhihere; }
   void       SetHistDeltaPhihere(TH1F* const aHistDeltaPhihere)
-    {this->fHistDeltaPhihere = aHistDeltaPhihere; }
+               { this->fHistDeltaPhihere = aHistDeltaPhihere; }
   TH1F*      GetHistPhiEP() const     {return this->fHistPhiEP; }   
   void       SetHistPhiEP(TH1F* const aHistPhiEP)
-    {this->fHistPhiEP = aHistPhiEP; }  
+               { this->fHistPhiEP = aHistPhiEP; }  
   TH1F*      GetHistPhiEPhere() const {return this->fHistPhiEPhere; }
   void       SetHistPhiEPhere(TH1F* const aHistPhiEPhere)
-    {this->fHistPhiEPhere = aHistPhiEPhere; }       
+               { this->fHistPhiEPhere = aHistPhiEPhere; }       
   TH1F*      GetHistPhiLYZ()  const   {return this->fHistPhiLYZ; }  
   void       SetHistPhiLYZ(TH1F* const aHistPhiLYZ)
-    {this->fHistPhiLYZ = aHistPhiLYZ; }       
+               { this->fHistPhiLYZ = aHistPhiLYZ; }       
   TH1F*      GetHistPhiLYZ2() const   {return this->fHistPhiLYZ2;}               
   void       SetHistPhiLYZ2(TH1F* const aHistPhiLYZ2)
-    {this->fHistPhiLYZ2 = aHistPhiLYZ2; }
+               { this->fHistPhiLYZ2 = aHistPhiLYZ2; }
 
   //input
   void       SetSecondRunList(TList* const list) { this->fSecondRunList = list; }
@@ -128,23 +124,23 @@ class AliFlowAnalysisWithLYZEventPlane {
   TProfile*  fFirstr0theta;                   // input profile
   
   //output
-  TProfile*  fHistProVetaRP;                  //
-  TProfile*  fHistProVetaPOI;                 //
-  TProfile*  fHistProVPtRP;                   //
-  TProfile*  fHistProVPtPOI;                  //
-  TProfile*  fHistProWr;                      //
-  TProfile*  fHistProWrCorr;                  //
-  TH1F*      fHistQsumforChi;                 //
-  TH1F*      fHistDeltaPhi;                   //
-  TH1F*      fHistDeltaPhi2;                  //
-  TH1F*      fHistDeltaPhihere;               //
-  TH1F*      fHistPhiEP;                      //
-  TH1F*      fHistPhiEPhere;                  //
-  TH1F*      fHistPhiLYZ;                     //
-  TH1F*      fHistPhiLYZ2;                    //
+  TProfile*  fHistProVetaRP;                  // output
+  TProfile*  fHistProVetaPOI;                 // output
+  TProfile*  fHistProVPtRP;                   // output
+  TProfile*  fHistProVPtPOI;                  // output
+  TProfile*  fHistProWr;                      // output
+  TProfile*  fHistProWrCorr;                  // output
+  TH1F*      fHistQsumforChi;                 // output
+  TH1F*      fHistDeltaPhi;                   // output
+  TH1F*      fHistDeltaPhi2;                  // output
+  TH1F*      fHistDeltaPhihere;               // output
+  TH1F*      fHistPhiEP;                      // output
+  TH1F*      fHistPhiEPhere;                  // output
+  TH1F*      fHistPhiLYZ;                     // output
+  TH1F*      fHistPhiLYZ2;                    // output
   
-  AliFlowCommonHist* fCommonHists;            //
-  AliFlowCommonHistResults* fCommonHistsRes;  //
+  AliFlowCommonHist* fCommonHists;            // output
+  AliFlowCommonHistResults* fCommonHistsRes;  // output
 
   Int_t     fEventNumber;                     // event counter
 
index 9d2a3f6bc1051304408fb5e2340d8c343a90be72..bd783c5b65a2d505aa8d88e9ca0d3a657bc1c123 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-
-/*
-$Log$
-*/ 
-
-#include <TNamed.h> 
-#include <TMath.h>
-#include "AliFlowCommonConstants.h" 
 // AliFlowCommonConstants:
 //
 // Constants for the common histograms in the flow analysis
@@ -30,6 +22,13 @@ $Log$
 // Author: Naomi van der Kolk (kolk@nikhef.nl)
 // mod: Mikolaj Krzewicki, Nikhef (mikolaj.krzewicki@cern.ch)
 
+/*
+$Log$
+*/ 
+
+#include <TMath.h>
+#include "AliFlowCommonConstants.h" 
+
 ClassImp(AliFlowCommonConstants)
 
 AliFlowCommonConstants* AliFlowCommonConstants::fgPMasterConfig = NULL;
index ea10660a7eb72e80153ad14ce31ded6be33687b0..91faf2085fa37d956065b8beaeef99122f3de4d5 100644 (file)
@@ -22,22 +22,22 @@ class AliFlowCommonConstants: public TNamed {
   virtual ~AliFlowCommonConstants();
   static AliFlowCommonConstants* GetMaster();
 
-  Int_t GetNbinsMult() { return fNbinsMult; }
-  Int_t GetNbinsPt()   { return fNbinsPt; }
-  Int_t GetNbinsPhi()  { return fNbinsPhi; }
-  Int_t GetNbinsEta()  { return fNbinsEta; }
-  Int_t GetNbinsQ()    { return fNbinsQ; }
+  Int_t GetNbinsMult() const { return fNbinsMult; }
+  Int_t GetNbinsPt()   const { return fNbinsPt; }
+  Int_t GetNbinsPhi()  const { return fNbinsPhi; }
+  Int_t GetNbinsEta()  const { return fNbinsEta; }
+  Int_t GetNbinsQ()    const { return fNbinsQ; }
    
-  Double_t GetMultMin() { return fMultMin; }
-  Double_t GetMultMax() { return fMultMax; }
-  Double_t GetPtMin()   { return fPtMin; }
-  Double_t GetPtMax()   { return fPtMax; }
-  Double_t GetPhiMin()  { return fPhiMin; }
-  Double_t GetPhiMax()  { return fPhiMax; }
-  Double_t GetEtaMin()  { return fEtaMin; }
-  Double_t GetEtaMax()  { return fEtaMax; }
-  Double_t GetQMin()    { return fQMin; }
-  Double_t GetQMax()    { return fQMax; }
+  Double_t GetMultMin() const { return fMultMin; }
+  Double_t GetMultMax() const { return fMultMax; }
+  Double_t GetPtMin()   const { return fPtMin; }
+  Double_t GetPtMax()   const { return fPtMax; }
+  Double_t GetPhiMin()  const { return fPhiMin; }
+  Double_t GetPhiMax()  const { return fPhiMax; }
+  Double_t GetEtaMin()  const { return fEtaMin; }
+  Double_t GetEtaMax()  const { return fEtaMax; }
+  Double_t GetQMin()    const { return fQMin; }
+  Double_t GetQMax()    const { return fQMax; }
   
   void SetNbinsMult( Int_t i ) { fNbinsMult = i; }
   void SetNbinsPt( Int_t i )   { fNbinsPt = i; }
@@ -61,27 +61,27 @@ class AliFlowCommonConstants: public TNamed {
   AliFlowCommonConstants(const AliFlowCommonConstants& a);
   
   //histogram sizes
-  Int_t  fNbinsMult; //
-  Int_t  fNbinsPt;   //
-  Int_t  fNbinsPhi;  //
-  Int_t  fNbinsEta;  //
-  Int_t  fNbinsQ;    //
+  Int_t  fNbinsMult; // histogram size
+  Int_t  fNbinsPt;   // histogram size
+  Int_t  fNbinsPhi;  // histogram size
+  Int_t  fNbinsEta;  // histogram size
+  Int_t  fNbinsQ;    // histogram size
  
   // Histograms limits
-  Double_t  fMultMin;  //          
-  Double_t  fMultMax;  //
-  Double_t  fPtMin;    //
-  Double_t  fPtMax;    //
-  Double_t  fPhiMin;    //  
-  Double_t  fPhiMax;   //
-  Double_t  fEtaMin;    //  
-  Double_t  fEtaMax;    //    
-  Double_t  fQMin;        //  
-  Double_t  fQMax;     //
+  Double_t  fMultMin;  // histogram limit 
+  Double_t  fMultMax;  // histogram limit
+  Double_t  fPtMin;    // histogram limit
+  Double_t  fPtMax;    // histogram limit
+  Double_t  fPhiMin;    // histogram limit
+  Double_t  fPhiMax;   // histogram limit
+  Double_t  fEtaMin;    // histogram limit
+  Double_t  fEtaMax;    // histogram limit
+  Double_t  fQMin;        // histogram limit
+  Double_t  fQMax;     // histogram limit
  
-  static AliFlowCommonConstants* fgPMasterConfig;
+  static AliFlowCommonConstants* fgPMasterConfig; //master object
   
-  ClassDef(AliFlowCommonConstants,1)  // macro for rootcint
+  ClassDef(AliFlowCommonConstants,1) //ClassDef
 };
 
 #endif