added setter for harmonics
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Feb 2011 15:15:48 +0000 (15:15 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Feb 2011 15:15:48 +0000 (15:15 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithScalarProduct.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithScalarProduct.h
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskCumulants.cxx
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskScalarProduct.cxx
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskScalarProduct.h

index 06d9c1c..3e62eb8 100644 (file)
@@ -47,6 +47,7 @@ ClassImp(AliFlowAnalysisWithScalarProduct)
    fEventNumber(0),
    fDebug(kFALSE),
    fApplyCorrectionForNUA(kFALSE),
+   fHarmonic(2),
    fRelDiffMsub(1.),
    fWeightsList(NULL),
    fUsePhiWeights(kFALSE),
@@ -314,6 +315,9 @@ void AliFlowAnalysisWithScalarProduct::Init() {
   fCommonHistsmuQ = new AliFlowCommonHist("AliFlowCommonHistmuQ");
   fHistList->Add(fCommonHistsmuQ);
 
+  (fCommonHistsSP->GetHarmonic())->Fill(0.5,fHarmonic); // store harmonic 
+  (fCommonHistsmuQ->GetHarmonic())->Fill(0.5,fHarmonic); // store harmonic 
+
   fHistQNorm = new TH1D("Flow_QNorm_SP","Flow_QNorm_SP",110,0.,1.1);
   fHistQNorm -> SetYTitle("dN/d(|(Qa+Qb)/(Ma+Mb)|)");
   fHistQNorm -> SetXTitle("|(Qa+Qb)/(Ma+Mb)|");
@@ -429,9 +433,9 @@ void AliFlowAnalysisWithScalarProduct::FillSP(AliFlowEventSimple* anEvent) {
     //get Q vectors for the eta-subevents
     AliFlowVector* vQarray = new AliFlowVector[2];
     if (fUsePhiWeights) {
-      anEvent->Get2Qsub(vQarray,2,fWeightsList,kTRUE);
+      anEvent->Get2Qsub(vQarray,fHarmonic,fWeightsList,kTRUE);
     } else {
-      anEvent->Get2Qsub(vQarray);
+      anEvent->Get2Qsub(vQarray,fHarmonic);
     }
     //subevent a
     AliFlowVector vQa = vQarray[0];
@@ -514,8 +518,8 @@ void AliFlowAnalysisWithScalarProduct::FillSP(AliFlowEventSimple* anEvent) {
              //calculate vU
              TVector2 vU;
              //do not need to use weight for v as the length will be made 1
-             Double_t dUX = TMath::Cos(2*dPhi);
-             Double_t dUY = TMath::Sin(2*dPhi);
+             Double_t dUX = TMath::Cos(fHarmonic*dPhi);
+             Double_t dUY = TMath::Sin(fHarmonic*dPhi);
              vU.Set(dUX,dUY);
              Double_t dModulus = vU.Mod();
              if (dModulus > 0.) vU.Set(dUX/dModulus,dUY/dModulus);  // make length 1
@@ -538,8 +542,8 @@ void AliFlowAnalysisWithScalarProduct::FillSP(AliFlowEventSimple* anEvent) {
                    Int_t phiBin = 1+(Int_t)(TMath::Floor(dPhi*iNBinsPhiSub0/TMath::TwoPi()));
                    dW = fPhiWeightsSub0->GetBinContent(phiBin); 
                    dPhiCenter = fPhiWeightsSub0->GetBinCenter(phiBin);
-                   dQmX = (vQ.X() - dW*(pTrack->Weight())* TMath::Cos(2*dPhiCenter) )/(dMq-1);
-                   dQmY = (vQ.Y() - dW*(pTrack->Weight())* TMath::Sin(2*dPhiCenter) )/(dMq-1);
+                   dQmX = (vQ.X() - dW*(pTrack->Weight())* TMath::Cos(fHarmonic*dPhiCenter) )/(dMq-1);
+                   dQmY = (vQ.Y() - dW*(pTrack->Weight())* TMath::Sin(fHarmonic*dPhiCenter) )/(dMq-1);
                    
                    vQm.Set(dQmX,dQmY);
                  }
@@ -549,8 +553,8 @@ void AliFlowAnalysisWithScalarProduct::FillSP(AliFlowEventSimple* anEvent) {
                    Int_t phiBin = 1+(Int_t)(TMath::Floor(dPhi*iNBinsPhiSub1/TMath::TwoPi()));
                    dW = fPhiWeightsSub1->GetBinContent(phiBin);
                    dPhiCenter = fPhiWeightsSub1->GetBinCenter(phiBin);
-                   dQmX = (vQ.X() - dW*(pTrack->Weight())* TMath::Cos(2*dPhiCenter) )/(dMq-1);
-                   dQmY = (vQ.Y() - dW*(pTrack->Weight())* TMath::Sin(2*dPhiCenter) )/(dMq-1);
+                   dQmX = (vQ.X() - dW*(pTrack->Weight())* TMath::Cos(fHarmonic*dPhiCenter) )/(dMq-1);
+                   dQmY = (vQ.Y() - dW*(pTrack->Weight())* TMath::Sin(fHarmonic*dPhiCenter) )/(dMq-1);
                    
                    vQm.Set(dQmX,dQmY);
                  }
@@ -688,9 +692,9 @@ void AliFlowAnalysisWithScalarProduct::FillmuQ(AliFlowEventSimple* anEvent) {
     //get Q vectors for the eta-subevents
     AliFlowVector* vQarray = new AliFlowVector[2];
     if (fUsePhiWeights) {
-      anEvent->Get2Qsub(vQarray,2,fWeightsList,kTRUE);
+      anEvent->Get2Qsub(vQarray,fHarmonic,fWeightsList,kTRUE);
     } else {
-      anEvent->Get2Qsub(vQarray);
+      anEvent->Get2Qsub(vQarray,fHarmonic);
     }
     //subevent a
     AliFlowVector vQa = vQarray[0];
@@ -732,8 +736,8 @@ void AliFlowAnalysisWithScalarProduct::FillmuQ(AliFlowEventSimple* anEvent) {
                    
            //calculate vU
            TVector2 vU;
-           Double_t dUX = TMath::Cos(2*dPhi);
-           Double_t dUY = TMath::Sin(2*dPhi);
+           Double_t dUX = TMath::Cos(fHarmonic*dPhi);
+           Double_t dUY = TMath::Sin(fHarmonic*dPhi);
            vU.Set(dUX,dUY);
            Double_t dModulus = vU.Mod();
            // make length 1
@@ -759,8 +763,8 @@ void AliFlowAnalysisWithScalarProduct::FillmuQ(AliFlowEventSimple* anEvent) {
                    Int_t phiBin = 1+(Int_t)(TMath::Floor(dPhi*iNBinsPhiSub0/TMath::TwoPi()));
                    dW = fPhiWeightsSub0->GetBinContent(phiBin); 
                    dPhiCenter = fPhiWeightsSub0->GetBinCenter(phiBin);
-                   dQmX = (vQ.X() - dW*(pTrack->Weight())* TMath::Cos(2*dPhiCenter) );
-                   dQmY = (vQ.Y() - dW*(pTrack->Weight())* TMath::Sin(2*dPhiCenter) );
+                   dQmX = (vQ.X() - dW*(pTrack->Weight())* TMath::Cos(fHarmonic*dPhiCenter) );
+                   dQmY = (vQ.Y() - dW*(pTrack->Weight())* TMath::Sin(fHarmonic*dPhiCenter) );
                    
                    vQm.Set(dQmX,dQmY);
                  }
@@ -770,8 +774,8 @@ void AliFlowAnalysisWithScalarProduct::FillmuQ(AliFlowEventSimple* anEvent) {
                    Int_t phiBin = 1+(Int_t)(TMath::Floor(dPhi*iNBinsPhiSub1/TMath::TwoPi()));
                    dW = fPhiWeightsSub1->GetBinContent(phiBin);
                    dPhiCenter = fPhiWeightsSub1->GetBinCenter(phiBin);
-                   dQmX = (vQ.X() - dW*(pTrack->Weight())* TMath::Cos(2*dPhiCenter) );
-                   dQmY = (vQ.Y() - dW*(pTrack->Weight())* TMath::Sin(2*dPhiCenter) );
+                   dQmX = (vQ.X() - dW*(pTrack->Weight())* TMath::Cos(fHarmonic*dPhiCenter) );
+                   dQmY = (vQ.Y() - dW*(pTrack->Weight())* TMath::Sin(fHarmonic*dPhiCenter) );
                    
                    vQm.Set(dQmX,dQmY);
                  }
@@ -987,6 +991,12 @@ void AliFlowAnalysisWithScalarProduct::Finish() {
   //calculate flow and fill the AliFlowCommonHistResults
   if (fDebug) cout<<"AliFlowAnalysisWithScalarProduct::Finish()"<<endl;
   
+  // access harmonic:
+  if(fCommonHistsSP && fCommonHistsSP->GetHarmonic())
+  {
+   fHarmonic = (Int_t)(fCommonHistsSP->GetHarmonic())->GetBinContent(1); 
+  }
+  
   //access all boolean flags needed in Finish():
   this->AccessFlags();
 
@@ -1057,7 +1067,7 @@ void AliFlowAnalysisWithScalarProduct::Finish() {
     dVerr = (1./(2.*pow(dQaQb,0.5)))*dStatErrorQaQb;
   } 
   fCommonHistsResSP->FillIntegratedFlow(dV,dVerr);
-  cout<<"v2(subevents) = "<<dV<<" +- "<<dVerr<<endl;
+  cout<<Form("v%i(subevents) = ",fHarmonic)<<dV<<" +- "<<dVerr<<endl;
        
   //Calculate differential flow and integrated flow (RP, POI)
   //---------------------------------------------------------
@@ -1132,7 +1142,7 @@ void AliFlowAnalysisWithScalarProduct::Finish() {
     dErrVRP = TMath::Sqrt(dErrVRP);
   }
   fCommonHistsResSP->FillIntegratedFlowRP(dVRP,dErrVRP);
-  cout<<"v2(RP) = "<<dVRP<<" +- "<<dErrVRP<<endl;
+  cout<<Form("v%i(RP) = ",fHarmonic)<<dVRP<<" +- "<<dErrVRP<<endl;
   
 
   //v as a function of Pt for POI selection 
@@ -1171,7 +1181,7 @@ void AliFlowAnalysisWithScalarProduct::Finish() {
     dErrVPOI = TMath::Sqrt(dErrVPOI);
   }
   fCommonHistsResSP->FillIntegratedFlowPOI(dVPOI,dErrVPOI);
-  cout<<"v2(POI) = "<<dVPOI<<" +- "<<dErrVPOI<<endl;
+  cout<<Form("v%i(POI) = ",fHarmonic)<<dVPOI<<" +- "<<dErrVPOI<<endl;
 
   cout<<endl;
   cout<<"*************************************"<<endl;
index da18ac0..cf9d270 100644 (file)
@@ -68,8 +68,11 @@ class AliFlowAnalysisWithScalarProduct {
    
    // correction for non-uniform acceptance:
    void   SetApplyCorrectionForNUA(Bool_t const acfNUA) {this->fApplyCorrectionForNUA = acfNUA;}
-   Bool_t GetApplyCorrectionForNUA() const              {return this->fApplyCorrectionForNUA;}        
-
+   Bool_t GetApplyCorrectionForNUA() const              {return this->fApplyCorrectionForNUA;}   
+   // harmonic:     
+   void SetHarmonic(Int_t const harmonic) {this->fHarmonic = harmonic;};
+   Int_t GetHarmonic() const {return this->fHarmonic;};  
+   
    // Output 
    TList*    GetHistList() const    { return this->fHistList ; } // Gets output histogram list
    //histogram getters
@@ -200,6 +203,7 @@ class AliFlowAnalysisWithScalarProduct {
    Int_t      fEventNumber;           // event counter
    Bool_t     fDebug ;                // flag for analysis: more print statements
    Bool_t     fApplyCorrectionForNUA; // apply correction for non-uniform acceptance
+   Int_t      fHarmonic;              // harmonic 
 
    Double_t   fRelDiffMsub;      // the relative difference the two subevent multiplicities can have
 
index ca536c6..95ee9fe 100644 (file)
@@ -114,7 +114,8 @@ void AliAnalysisTaskCumulants::UserCreateOutputObjects()
  cout<<"AliAnalysisTaskCumulants::UserCreateOutputObjects()"<<endl;
 
  // Analyser:
- fGFC = new AliFlowAnalysisWithCumulants();
+ fGFC = new AliFlowAnalysisWithCumulants(); 
+ fGFC->SetHarmonic(fHarmonic);
  
  // Calculation vs multiplicity:
  if(fCalculateVsMultiplicity)
index c61d307..24fbb8c 100644 (file)
@@ -48,7 +48,8 @@ AliAnalysisTaskScalarProduct::AliAnalysisTaskScalarProduct(const char *name, Boo
   fUsePhiWeights(usePhiWeights),
   fListWeights(NULL),
   fRelDiffMsub(1.0),
-  fApplyCorrectionForNUA(kFALSE)
+  fApplyCorrectionForNUA(kFALSE),
+  fHarmonic(2) 
 {
   // Constructor
   cout<<"AliAnalysisTaskScalarProduct::AliAnalysisTaskScalarProduct(const char *name)"<<endl;
@@ -72,7 +73,8 @@ AliAnalysisTaskScalarProduct::AliAnalysisTaskScalarProduct() :
   fUsePhiWeights(kFALSE),
   fListWeights(NULL),
   fRelDiffMsub(1.0),
-  fApplyCorrectionForNUA(kFALSE)
+  fApplyCorrectionForNUA(kFALSE),
+  fHarmonic(0)
   {
   // Constructor
   cout<<"AliAnalysisTaskScalarProduct::AliAnalysisTaskScalarProduct()"<<endl;
@@ -111,6 +113,8 @@ void AliAnalysisTaskScalarProduct::UserCreateOutputObjects()
     cout<<"Corrections for non-uniform acceptance applied in the Scalar Product method"<<endl;
   }
   fSP->SetApplyCorrectionForNUA(fApplyCorrectionForNUA);
+  // harmonic: 
+  fSP->SetHarmonic(fHarmonic);
     
   //for using phi weights:
   if(fUsePhiWeights) {
index 8dead23..0cf02ac 100644 (file)
@@ -38,6 +38,9 @@ class AliAnalysisTaskScalarProduct : public AliAnalysisTaskSE {
   
   void SetApplyCorrectionForNUA(Bool_t const applyCorrectionForNUA) {this->fApplyCorrectionForNUA = applyCorrectionForNUA;};
   Bool_t GetApplyCorrectionForNUA() const {return this->fApplyCorrectionForNUA;};
+  
+  void SetHarmonic(Int_t const harmonic) {this->fHarmonic = harmonic;};
+  Int_t GetHarmonic() const {return this->fHarmonic;};   
 
  private:
 
@@ -55,6 +58,8 @@ class AliAnalysisTaskScalarProduct : public AliAnalysisTaskSE {
   
   Bool_t fApplyCorrectionForNUA; // apply automatic correction for non-uniform acceptance 
   
+  Int_t fHarmonic;               // harmonic
+  
   ClassDef(AliAnalysisTaskScalarProduct, 1); // example of analysis
 };