]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
rulechecker
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 18 Dec 2011 14:10:33 +0000 (14:10 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 18 Dec 2011 14:10:33 +0000 (14:10 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithScalarProduct.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithScalarProduct.h
PWG2/FLOW/AliFlowTasks/AliFlowCandidateTrack.cxx
PWG2/FLOW/AliFlowTasks/AliFlowCandidateTrack.h
PWG2/FLOW/macros/redoFinish.C

index 97c1232843f8bf2c0b3c393cbd9d9c4769bb8f84..6513f0bfde36d8c95315f6ea91d7c0766f8aa364 100644 (file)
@@ -118,9 +118,9 @@ void AliFlowAnalysisWithScalarProduct::Init() {
   errorRelated->SetName("error");
   errorRelated->SetOwner();
 
-  TList *QARelated = new TList();
-  QARelated->SetName("QA");
-  QARelated->SetOwner();
+  TList *tQARelated = new TList();
+  tQARelated->SetName("QA");
+  tQARelated->SetOwner();
 
   fCommonHists = new AliFlowCommonHist("AliFlowCommonHist_SP");
   (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic); // store harmonic 
@@ -238,57 +238,57 @@ void AliFlowAnalysisWithScalarProduct::Init() {
 
   fHistProQNorm = new TProfile("FlowPro_QNorm_SP","FlowPro_QNorm_SP",       1,0.5,1.5,"s");
   fHistProQNorm->SetYTitle("<|Qa+Qb|>");
-  QARelated->Add(fHistProQNorm);
+  tQARelated->Add(fHistProQNorm);
 
   fHistProQaQb  = new TProfile("FlowPro_QaQb_SP","FlowPro_QaQb_SP",         1,0.5,1.5,"s");
   fHistProQaQb->SetYTitle("<QaQb>");
-  QARelated->Add(fHistProQaQb);
+  tQARelated->Add(fHistProQaQb);
 
   fHistProQaQbM = new TProfile("FlowPro_QaQbvsM_SP","FlowPro_QaQbvsM_SP",1000,0.0,10000);
   fHistProQaQbM->SetYTitle("<QaQb>");
   fHistProQaQbM->SetXTitle("M");
   fHistProQaQbM->Sumw2();
-  QARelated->Add(fHistProQaQbM);
+  tQARelated->Add(fHistProQaQbM);
 
   fHistMaMb = new TH2D("Flow_MavsMb_SP","Flow_MavsMb_SP",100,0.,100.,100,0.,100.);
   fHistMaMb->SetYTitle("Ma");
   fHistMaMb->SetXTitle("Mb");
-  QARelated->Add(fHistMaMb);
+  tQARelated->Add(fHistMaMb);
 
   fHistQNormQaQbNorm = new TH2D("Flow_QNormvsQaQbNorm_SP","Flow_QNormvsQaQbNorm_SP",88,-1.1,1.1,22,0.,1.1);
   fHistQNormQaQbNorm->SetYTitle("|Q/Mq|");
   fHistQNormQaQbNorm->SetXTitle("QaQb/MaMb");
-  QARelated->Add(fHistQNormQaQbNorm);
+  tQARelated->Add(fHistQNormQaQbNorm);
 
   fHistQaNormMa = new TH2D("Flow_QaNormvsMa_SP","Flow_QaNormvsMa_SP",100,0.,100.,22,0.,1.1);
   fHistQaNormMa->SetYTitle("|Qa/Ma|");
   fHistQaNormMa->SetXTitle("Ma");
-  QARelated->Add(fHistQaNormMa);
+  tQARelated->Add(fHistQaNormMa);
 
   fHistQbNormMb = new TH2D("Flow_QbNormvsMb_SP","Flow_QbNormvsMb_SP",100,0.,100.,22,0.,1.1);
   fHistQbNormMb->SetYTitle("|Qb/Mb|");
   fHistQbNormMb->SetXTitle("Mb");
-  QARelated->Add(fHistQbNormMb);
+  tQARelated->Add(fHistQbNormMb);
 
   fResolution = new TH1D("Flow_resolution_SP","Flow_resolution_SP",100,-1.0,1.0);
   fResolution->SetYTitle("dN/d(Cos2(#phi_a - #phi_b))");
   fResolution->SetXTitle("Cos2(#phi_a - #phi_b)");
-  QARelated->Add(fResolution);
+  tQARelated->Add(fResolution);
 
   fHistQaQb = new TH1D("Flow_QaQb_SP","Flow_QaQb_SP",200,-100.,100.);
   fHistQaQb->SetYTitle("dN/dQaQb");
   fHistQaQb->SetXTitle("dQaQb");
-  QARelated->Add(fHistQaQb);
+  tQARelated->Add(fHistQaQb);
 
   fHistQaQbCos = new TH1D("Flow_QaQbCos_SP","Flow_QaQbCos_SP",63,0.,TMath::Pi());
   fHistQaQbCos->SetYTitle("dN/d#phi");
   fHistQaQbCos->SetXTitle("#phi");
-  QARelated->Add(fHistQaQbCos);
+  tQARelated->Add(fHistQaQbCos);
 
   fHistList->Add(uQRelated);
   fHistList->Add(nuaRelated);
   fHistList->Add(errorRelated);
-  fHistList->Add(QARelated);
+  fHistList->Add(tQARelated);
 
   TH1::AddDirectory(oldHistAddStatus);
 }
@@ -519,8 +519,9 @@ void AliFlowAnalysisWithScalarProduct::Finish() {
   printf("AliFlowAnalysisWithScalarProduct::Finish()\n");
   
   // access harmonic:
-  if(fCommonHists->GetHarmonic())
-    fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1); 
+  fApplyCorrectionForNUA = fHistProConfig->GetBinContent(1);
+  fNormalizationType = fHistProConfig->GetBinContent(2);
+  fHarmonic = fHistProConfig->GetBinContent(4);
   
   printf("*************************************\n");
   printf("*************************************\n");
@@ -554,7 +555,7 @@ void AliFlowAnalysisWithScalarProduct::Finish() {
   printf("fTotalQvector %d \n",fTotalQvector);
   if(!fNormalizationType) {
     if(fTotalQvector>2) {
-      dV = computeResolution( TMath::Sqrt2()*findXi(dV,1e-6) );
+      dV = ComputeResolution( TMath::Sqrt2()*FindXi(dV,1e-6) );
       printf("An estimate of the event plane resolution is: %f\n", dV );
     }
   }
@@ -614,15 +615,14 @@ void AliFlowAnalysisWithScalarProduct::Finish() {
 }
 
 //-----------------------------------------------------------------------
-void AliFlowAnalysisWithScalarProduct::WriteHistograms(TDirectoryFile *outputFileName)
-{
+void AliFlowAnalysisWithScalarProduct::WriteHistograms(TDirectoryFile *outputFileName) const {
  //store the final results in output .root file
  outputFileName->Add(fHistList);
  outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
 }
 
 //--------------------------------------------------------------------            
-Double_t AliFlowAnalysisWithScalarProduct::CalculateStatisticalError(Int_t iRFPorPOI, Int_t iPTorETA, Int_t b, Double_t aStatErrorQaQb) {
+Double_t AliFlowAnalysisWithScalarProduct::CalculateStatisticalError(Int_t iRFPorPOI, Int_t iPTorETA, Int_t b, Double_t aStatErrorQaQb) const {
   //calculate the statistical error for differential flow for bin b
   Double_t duQproSpread = fHistProUQ[iRFPorPOI][iPTorETA]->GetBinError(b);
   Double_t sumOfMq = fHistSumOfWeightsu[iRFPorPOI][iPTorETA][0]->GetBinContent(b);
@@ -671,7 +671,8 @@ Double_t AliFlowAnalysisWithScalarProduct::CalculateStatisticalError(Int_t iRFPo
   return dv2ProErr;
 }
 
-Double_t AliFlowAnalysisWithScalarProduct::computeResolution( Double_t x ) {
+Double_t AliFlowAnalysisWithScalarProduct::ComputeResolution( Double_t x ) const {
+  // Computes resolution for Event Plane method
   if(x > 51.3) {
     printf("Warning: Estimation of total resolution might be WRONG. Please check!");
     return 0.99981;
@@ -681,7 +682,8 @@ Double_t AliFlowAnalysisWithScalarProduct::computeResolution( Double_t x ) {
   return TMath::Sqrt(TMath::PiOver2())/2*x*b;
 }
 
-Double_t AliFlowAnalysisWithScalarProduct::findXi( Double_t res, Double_t prec ) {
+Double_t AliFlowAnalysisWithScalarProduct::FindXi( Double_t res, Double_t prec ) const {
+  // Computes x(res) for Event Plane method
   if(res > 0.99981) {
     printf("Warning: Resolution for subEvent is high. You reached the precision limit.");
     return 51.3;
@@ -690,7 +692,7 @@ Double_t AliFlowAnalysisWithScalarProduct::findXi( Double_t res, Double_t prec )
   Double_t xtmp=0, xmin=0, xmax=51.3, rtmp=0, delta=2*prec;
   while( delta > prec ) {
     xtmp = 0.5*(xmin+xmax);
-    rtmp = computeResolution(xtmp);
+    rtmp = ComputeResolution(xtmp);
     delta = TMath::Abs( res-rtmp );
     if(rtmp>res) xmax = xtmp;
     if(rtmp<res) xmin = xtmp;
index 7f42e168d6d892a85263dd04a79939a15f6e1922..06bd4d8bde2eed580d853bf1d6a3f9e29c7550f3 100644 (file)
@@ -37,7 +37,7 @@ class AliFlowAnalysisWithScalarProduct {
    void Make(AliFlowEventSimple* anEvent);            //Main routine
    void GetOutputHistograms(TList *outputListHistos); //Copy output objects from TList
    void Finish();                                     //Fill results
-   void WriteHistograms(TDirectoryFile *outputFileName); //writes histograms locally (for OnTheFly)
+   void WriteHistograms(TDirectoryFile *outputFileName) const; //writes histograms locally (for OnTheFly)
 
 
    void SetHarmonic(Int_t iHarmonic)          { fHarmonic = iHarmonic; }
@@ -49,24 +49,24 @@ class AliFlowAnalysisWithScalarProduct {
    void SetUsePhiWeights(Bool_t bVal)        { fUsePhiWeights = bVal; }
    void SetWeightsList(TList* const aWeightsList)  { fWeightsList = (TList*)aWeightsList->Clone(); }
   
-   TList*    GetHistList()      { return fHistList; }
-   TProfile* GetHistProConfig() { return fHistProConfig; }
-   TProfile* GetHistProUQ(Int_t iRFPorPOI, Int_t iPTorETA) { return fHistProUQ[iRFPorPOI][iPTorETA]; }
-   TProfile* GetHistProQaQbNorm()   { return fHistProQaQbNorm; }
-   TProfile* GetHistProNUAq()   { return fHistProNUAq; }
-   TProfile* GetHistProNUAu(Int_t iRFPorPOI, Int_t iPTorETA, Int_t iIMorRE) { return fHistProNUAu[iRFPorPOI][iPTorETA][iIMorRE]; }
-   TH1D*     GetHistSumOfWeights() { return fHistSumOfWeights; }
-   TProfile* GetHistProUQQaQb( Int_t iRFPorPOI, Int_t iPTorETA ) { return fHistProUQQaQb[iRFPorPOI][iPTorETA]; }
-   TH1D*     GetHistSumOfWeightsu(Int_t iRFPorPOI, Int_t iPTorETA, Int_t iWeight) { return fHistSumOfWeightsu[iRFPorPOI][iPTorETA][iWeight]; }
-   AliFlowCommonHist*        GetCommonHists()    { return fCommonHists; }
-   AliFlowCommonHistResults* GetCommonHistsRes() { return fCommonHistsRes; }
+   TList*    GetHistList()      const { return fHistList; }
+   TProfile* GetHistProConfig() const { return fHistProConfig; }
+   TProfile* GetHistProUQ(Int_t iRFPorPOI, Int_t iPTorETA) const { return fHistProUQ[iRFPorPOI][iPTorETA]; }
+   TProfile* GetHistProQaQbNorm() const  { return fHistProQaQbNorm; }
+   TProfile* GetHistProNUAq()     const  { return fHistProNUAq; }
+   TProfile* GetHistProNUAu(Int_t iRFPorPOI, Int_t iPTorETA, Int_t iIMorRE) const { return fHistProNUAu[iRFPorPOI][iPTorETA][iIMorRE]; }
+   TH1D*     GetHistSumOfWeights() const { return fHistSumOfWeights; }
+   TProfile* GetHistProUQQaQb( Int_t iRFPorPOI, Int_t iPTorETA ) const { return fHistProUQQaQb[iRFPorPOI][iPTorETA]; }
+   TH1D*     GetHistSumOfWeightsu(Int_t iRFPorPOI, Int_t iPTorETA, Int_t iWeight) const { return fHistSumOfWeightsu[iRFPorPOI][iPTorETA][iWeight]; }
+   AliFlowCommonHist*        GetCommonHists()    const { return fCommonHists; }
+   AliFlowCommonHistResults* GetCommonHistsRes() const { return fCommonHistsRes; }
    
  private:
    AliFlowAnalysisWithScalarProduct(const AliFlowAnalysisWithScalarProduct& anAnalysis);            //copy constructor
    AliFlowAnalysisWithScalarProduct& operator=(const AliFlowAnalysisWithScalarProduct& anAnalysis); //assignment operator
-   Double_t CalculateStatisticalError( Int_t RFPorPOI, Int_t PTorETA, Int_t bin, Double_t errV );
-   Double_t computeResolution( Double_t x );
-   Double_t findXi( Double_t res, Double_t prec );
+   Double_t CalculateStatisticalError( Int_t RFPorPOI, Int_t PTorETA, Int_t bin, Double_t errV ) const;
+   Double_t ComputeResolution( Double_t x ) const;
+   Double_t FindXi( Double_t res, Double_t prec ) const;
 
       
    Int_t fDebug ;                // flag for analysis: more print statements
index 3bc79a1bd76beed5315eba0b476146a37a1b1c64..3e1e0771a7a8777e52e472ca92df9458e7df290f 100644 (file)
@@ -28,6 +28,7 @@ AliFlowCandidateTrack::AliFlowCandidateTrack():
     fMass(0),
     fNDaughters(0)
 {
+  // ctor
   for(int i=0; i!=5; ++i) {
     fDaughter[i] = -1;
     fTrack[i] = NULL;
@@ -39,6 +40,7 @@ AliFlowCandidateTrack::AliFlowCandidateTrack(const AliFlowCandidateTrack& aTrack
   fMass(aTrack.fMass),
   fNDaughters(aTrack.fNDaughters)
 {
+  // ctor
   for(int i=0; i!=5; ++i) {
     fDaughter[i] = aTrack.fDaughter[i];
     fTrack[i] = aTrack.fTrack[i];
@@ -47,6 +49,7 @@ AliFlowCandidateTrack::AliFlowCandidateTrack(const AliFlowCandidateTrack& aTrack
 
 AliFlowCandidateTrack&  AliFlowCandidateTrack::operator=(const AliFlowCandidateTrack& aTrack)
 {
+  // operator =
   AliFlowTrack::operator=(aTrack);
   fMass = aTrack.fMass;
   fNDaughters = aTrack.fNDaughters;
@@ -59,5 +62,6 @@ AliFlowCandidateTrack&  AliFlowCandidateTrack::operator=(const AliFlowCandidateT
 
 AliFlowCandidateTrack::~AliFlowCandidateTrack()
 {
+  // dtor
 }
 
index 9ac042803e85fbd15a8002f81675917c40ab7763..5244e786d3e76938b35748c0a62d899c5527c8fa 100644 (file)
@@ -2,8 +2,8 @@
 * See cxx source for full Copyright notice */
 /* $Id: $ */
 
-#ifndef AliFlowCandidateTrack_H
-#define AliFlowCandidateTrack_H
+#ifndef ALIFLOWCANDIDATETRACK_H
+#define ALIFLOWCANDIDATETRACK_H
 
 #include "AliFlowTrack.h"
 
 ////////////////////////////////////////////////////
 
 class AliFlowCandidateTrack : public AliFlowTrack {
-  protected:
-    Double_t fMass;           // mass
-    Int_t fNDaughters;        // number of daughters (5 max)
-    Int_t fDaughter[5];       // fID of daughter, points back to ESD track
-    AliFlowTrack *fTrack[5];  // pointer to daughter in FlowEvent
-    
   public:
     AliFlowCandidateTrack();
     AliFlowCandidateTrack(const AliFlowCandidateTrack& );
     AliFlowCandidateTrack& operator=(const AliFlowCandidateTrack& );
     ~AliFlowCandidateTrack();
 
-    Double_t Mass(void)            { return fMass; }
+    Double_t Mass(void)      const { return fMass; }
     void SetMass(Double_t value)   { fMass=value; }
 
-    Int_t GetNDaughters(void)           { return fNDaughters; }
-    void  AddDaughter(Int_t value)      { if(fNDaughters<3) fDaughter[fNDaughters++]=value; }
-    Int_t GetIDDaughter(Int_t value) { return fDaughter[value]; }
+    Int_t GetNDaughters(void)        const { return fNDaughters; }
+    void  AddDaughter(Int_t value)  { if(fNDaughters<3) fDaughter[fNDaughters++]=value; }
+    Int_t GetIDDaughter(Int_t value) const { return fDaughter[value]; }
 
     void SetDaughter(Int_t value, AliFlowTrack *track) { fTrack[value]=track; }
-    AliFlowTrack *GetDaughter(Int_t value) { return fTrack[value]; }
+    AliFlowTrack *GetDaughter(Int_t value) const { return fTrack[value]; }
 
+  protected:
+    Double_t fMass;           // mass
+    Int_t fNDaughters;        // number of daughters (5 max)
+    Int_t fDaughter[5];       // fID of daughter, points back to ESD track
+    AliFlowTrack *fTrack[5];  // pointer to daughter in FlowEvent
+    
 
     ClassDef(AliFlowCandidateTrack, 1);
 };
index 90881992bc553d221d69581602b79d9460905c8a..9ed963adfc020dc6404ade8bcd70db65ed1c5a38 100644 (file)
@@ -75,7 +75,7 @@ void redoFinish()
       {
         AliFlowAnalysisWithScalarProduct* sp = new AliFlowAnalysisWithScalarProduct();
         sp->GetOutputHistograms(list);
-        sp->GetHistProFlags()->SetBinContent(1,(Int_t)bApplyCorrectionForNUA);
+        //sp->GetHistProFlags()->SetBinContent(1,(Int_t)bApplyCorrectionForNUA);
         sp->Finish();
         directory->Add(list,kTRUE);
         directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);