generatio of various plaes in on the fly
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 2 Apr 2013 16:18:57 +0000 (16:18 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 2 Apr 2013 16:18:57 +0000 (16:18 +0000)
PWG/FLOW/Base/AliFlowAnalysisWithQCumulants.cxx
PWG/FLOW/Base/AliFlowEventSimple.cxx
PWG/FLOW/Base/AliFlowEventSimple.h
PWG/FLOW/Base/AliFlowOnTheFlyEventGenerator.cxx

index 02e935f..31e12c1 100644 (file)
@@ -353,7 +353,7 @@ void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
   
  // c) Fill the common control histograms and call the method to fill fAvMultiplicity:
  this->FillCommonControlHistograms(anEvent);                                                               
- this->FillAverageMultiplicities(fNumberOfRPsEBE); 
+ this->FillAverageMultiplicities((Int_t)(fNumberOfRPsEBE)); 
  if(fStoreControlHistograms){this->FillControlHistograms(anEvent);}                                                              
                                                                                                                                                                                                                                                                                         
  // d) Loop over data and calculate e-b-e quantities Q_{n,k}, S_{p,k} and s_{p,k}:
@@ -14322,7 +14322,7 @@ void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
    if(!fUseQvectorTerms)
    {
 
-    cout<<"TProfile"<<endl;
+     //cout<<"TProfile"<<endl;
 
     two = fIntFlowCorrelationsVsMHist[0]->GetBinContent(b); // <<2>>  
     four = fIntFlowCorrelationsVsMHist[1]->GetBinContent(b); // <<4>>  
@@ -14401,7 +14401,7 @@ void AliFlowAnalysisWithQCumulants::CalculateCumulantsIntFlow()
    } else
      {
       // TH2D:
-      Int_t nEntries = fCorrelationProduct2468VsMult[0]->ProjectionY("Cov(2,4)",b,b)->GetEntries();
+       Int_t nEntries = (Int_t)(fCorrelationProduct2468VsMult[0]->ProjectionY("Cov(2,4)",b,b)->GetEntries());
       if(nEntries>0.)
       {      
        wCov24 = (fCorrelationProduct2468VsMult[0]->ProjectionY("Cov(2,4)",b,b)->GetMean()
index 21dbc30..a67a827 100644 (file)
@@ -54,6 +54,16 @@ AliFlowEventSimple::AliFlowEventSimple():
   fNumberOfTracks(0),
   fNumberOfRPs(0),
   fNumberOfPOIs(0),
+  fUseGlauberMCSymmetryPlanes(kFALSE),
+  fUseExternalSymmetryPlanes(kFALSE),
+  fPsi1(0.),
+  fPsi2(0.),
+  fPsi3(0.),
+  fPsi4(0.),
+  fPsi5(0.),
+  fPsi1Psi3(0x0),
+  fPsi2Psi4(0x0),
+  fPsi3Psi5(0x0),
   fMCReactionPlaneAngle(0.),
   fMCReactionPlaneAngleIsSet(kFALSE),
   fAfterBurnerPrecision(0.001),
@@ -81,6 +91,16 @@ AliFlowEventSimple::AliFlowEventSimple( Int_t n,
   fNumberOfTracks(0),
   fNumberOfRPs(0),
   fNumberOfPOIs(0),
+  fUseGlauberMCSymmetryPlanes(kFALSE),
+  fUseExternalSymmetryPlanes(kFALSE),
+  fPsi1(0.),
+  fPsi2(0.),
+  fPsi3(0.),
+  fPsi4(0.),
+  fPsi5(0.),
+  fPsi1Psi3(0x0),
+  fPsi2Psi4(0x0),
+  fPsi3Psi5(0x0),
   fMCReactionPlaneAngle(0.),
   fMCReactionPlaneAngleIsSet(kFALSE),
   fAfterBurnerPrecision(0.001),
@@ -109,6 +129,16 @@ AliFlowEventSimple::AliFlowEventSimple(const AliFlowEventSimple& anEvent):
   fNumberOfTracks(anEvent.fNumberOfTracks),
   fNumberOfRPs(anEvent.fNumberOfRPs),
   fNumberOfPOIs(anEvent.fNumberOfPOIs),
+  fUseGlauberMCSymmetryPlanes(anEvent.fUseGlauberMCSymmetryPlanes),
+  fUseExternalSymmetryPlanes(anEvent.fUseExternalSymmetryPlanes),
+  fPsi1(anEvent.fPsi1),
+  fPsi2(anEvent.fPsi2),
+  fPsi3(anEvent.fPsi3),
+  fPsi4(anEvent.fPsi4),
+  fPsi5(anEvent.fPsi5),
+  fPsi1Psi3(anEvent.fPsi1Psi3),
+  fPsi2Psi4(anEvent.fPsi2Psi4),
+  fPsi3Psi5(anEvent.fPsi3Psi5),
   fMCReactionPlaneAngle(anEvent.fMCReactionPlaneAngle),
   fMCReactionPlaneAngleIsSet(anEvent.fMCReactionPlaneAngleIsSet),
   fAfterBurnerPrecision(anEvent.fAfterBurnerPrecision),
@@ -135,6 +165,16 @@ AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEv
   fNumberOfTracks = anEvent.fNumberOfTracks;
   fNumberOfRPs = anEvent.fNumberOfRPs;
   fNumberOfPOIs = anEvent.fNumberOfPOIs;
+  fUseGlauberMCSymmetryPlanes = anEvent.fUseGlauberMCSymmetryPlanes;
+  fUseExternalSymmetryPlanes = anEvent.fUseExternalSymmetryPlanes;
+  fPsi1 = anEvent.fPsi1;
+  fPsi2 = anEvent.fPsi2;
+  fPsi3 = anEvent.fPsi3;
+  fPsi4 = anEvent.fPsi4;
+  fPsi5 = anEvent.fPsi5;
+  fPsi1Psi3 = anEvent.fPsi1Psi3;
+  fPsi2Psi4 = anEvent.fPsi2Psi4;
+  fPsi3Psi5 = anEvent.fPsi3Psi5;
   fMCReactionPlaneAngle = anEvent.fMCReactionPlaneAngle;
   fMCReactionPlaneAngleIsSet = anEvent.fMCReactionPlaneAngleIsSet;
   fAfterBurnerPrecision = anEvent.fAfterBurnerPrecision;
@@ -162,6 +202,38 @@ AliFlowEventSimple::~AliFlowEventSimple()
 }
 
 //-----------------------------------------------------------------------
+void AliFlowEventSimple::SetUseExternalSymmetryPlanes(TF1 *gPsi1Psi3,
+                                                     TF1 *gPsi2Psi4,
+                                                     TF1 *gPsi3Psi5) {
+  //Use symmetry planes, setup correlations between different Psi_n
+  fUseExternalSymmetryPlanes = kTRUE; 
+    
+  //Correlations between Psi_1 and Psi_3
+  if(gPsi1Psi3) fPsi1Psi3 = gPsi1Psi3;
+  else {
+    fPsi1Psi3 = new TF1("fPsi1Psi3","[0]*x+[1]",0.,2.*TMath::Pi());
+    fPsi1Psi3->SetParameter(0,1.);
+    fPsi1Psi3->SetParameter(1,0.);
+  }
+
+  //Correlations between Psi_2 and Psi_4
+  if(gPsi2Psi4) fPsi2Psi4 = gPsi2Psi4;
+  else {
+    fPsi2Psi4 = new TF1("fPsi2Psi4","[0]*x+[1]",0.,2.*TMath::Pi());
+    fPsi2Psi4->SetParameter(0,1.);
+    fPsi2Psi4->SetParameter(1,0.);
+  }
+
+  //Correlations between Psi_3 and Psi_5
+  if(gPsi3Psi5) fPsi3Psi5 = gPsi3Psi5;
+  else {
+    fPsi3Psi5 = new TF1("fPsi3Psi5","[0]*x+[1]",0.,2.*TMath::Pi());
+    fPsi3Psi5->SetParameter(0,1.);
+    fPsi3Psi5->SetParameter(1,0.);
+  }
+}
+
+//-----------------------------------------------------------------------
 void AliFlowEventSimple::Generate(Int_t nParticles,
                                   TF1* ptDist,
                                   Double_t phiMin,
@@ -186,8 +258,35 @@ void AliFlowEventSimple::Generate(Int_t nParticles,
     track->SetCharge( (gRandom->Uniform()-0.5<0)?-1:1 );
     AddTrack(track);
   }
-  fMCReactionPlaneAngle=gRandom->Uniform(0.0,TMath::TwoPi());
-  fMCReactionPlaneAngleIsSet=kTRUE;
+  if(fUseExternalSymmetryPlanes) {
+    Double_t betaParameter = gRandom->Gaus(0.,1.3);
+    fPsi1Psi3->SetParameter(1,betaParameter);
+    
+    betaParameter = gRandom->Gaus(0.,0.9);
+    fPsi2Psi4->SetParameter(1,betaParameter);
+
+    betaParameter = gRandom->Gaus(0.,1.5);
+    fPsi3Psi5->SetParameter(1,betaParameter);
+
+    fPsi1 = gRandom->Uniform(2.*TMath::Pi());
+    fPsi2 = gRandom->Uniform(2.*TMath::Pi());
+    fPsi3 = fPsi1Psi3->Eval(fPsi1);
+    if(fPsi3 < 0) fPsi3 += 2.*TMath::Pi();
+    else if(fPsi3 > 2.*TMath::Pi()) fPsi3 -= 2.*TMath::Pi();
+    fPsi4 = fPsi2Psi4->Eval(fPsi2);
+    if(fPsi4 < 0) fPsi4 += 2.*TMath::Pi();
+    else if(fPsi4 > 2.*TMath::Pi()) fPsi4 -= 2.*TMath::Pi();
+    fPsi5 = fPsi3Psi5->Eval(fPsi3);
+    if(fPsi5 < 0) fPsi5 += 2.*TMath::Pi();
+    else if(fPsi5 > 2.*TMath::Pi()) fPsi5 -= 2.*TMath::Pi();
+
+    fMCReactionPlaneAngle=fPsi2;
+    fMCReactionPlaneAngleIsSet=kTRUE;
+  }
+  else {
+    fMCReactionPlaneAngle=gRandom->Uniform(0.0,TMath::TwoPi());
+    fMCReactionPlaneAngleIsSet=kTRUE;
+  }
   SetUserModified();
 }
 
@@ -556,6 +655,16 @@ AliFlowEventSimple::AliFlowEventSimple( TTree* inputTree,
   fNumberOfTracks(0),
   fNumberOfRPs(0),
   fNumberOfPOIs(0),
+  fUseGlauberMCSymmetryPlanes(kFALSE),
+  fUseExternalSymmetryPlanes(kFALSE),
+  fPsi1(0.),
+  fPsi2(0.),
+  fPsi3(0.),
+  fPsi4(0.),
+  fPsi5(0.),
+  fPsi1Psi3(0x0),
+  fPsi2Psi4(0x0),
+  fPsi3Psi5(0x0),
   fMCReactionPlaneAngle(0.),
   fMCReactionPlaneAngleIsSet(kFALSE),
   fAfterBurnerPrecision(0.001),
@@ -682,7 +791,12 @@ void AliFlowEventSimple::AddV1( Double_t v1 )
   for (Int_t i=0; i<fNumberOfTracks; i++)
   {
     AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
-    if (track) track->AddV1(v1, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    if (track) {
+      if((fUseExternalSymmetryPlanes)||(fUseGlauberMCSymmetryPlanes))
+       track->AddV1(v1, fPsi1, fAfterBurnerPrecision);
+      else
+       track->AddV1(v1, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    }
   }
   SetUserModified();
 }
@@ -694,7 +808,12 @@ void AliFlowEventSimple::AddV2( Double_t v2 )
   for (Int_t i=0; i<fNumberOfTracks; i++)
   {
     AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
-    if (track) track->AddV2(v2, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    if (track) {
+      if((fUseExternalSymmetryPlanes)||(fUseGlauberMCSymmetryPlanes))
+       track->AddV2(v2, fPsi2, fAfterBurnerPrecision);
+      else
+       track->AddV2(v2, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    }
   }
   SetUserModified();
 }
@@ -706,7 +825,12 @@ void AliFlowEventSimple::AddV3( Double_t v3 )
   for (Int_t i=0; i<fNumberOfTracks; i++)
   {
     AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
-    if (track) track->AddV3(v3, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    if(track) {
+      if((fUseExternalSymmetryPlanes)||(fUseGlauberMCSymmetryPlanes))
+       track->AddV3(v3, fPsi3, fAfterBurnerPrecision);
+      else
+       track->AddV3(v3, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    }
   }
   SetUserModified();
 }
@@ -718,7 +842,12 @@ void AliFlowEventSimple::AddV4( Double_t v4 )
   for (Int_t i=0; i<fNumberOfTracks; i++)
   {
     AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
-    if (track) track->AddV4(v4, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    if(track) {
+      if((fUseExternalSymmetryPlanes)||(fUseGlauberMCSymmetryPlanes))
+       track->AddV4(v4, fPsi4, fAfterBurnerPrecision);
+      else
+       track->AddV4(v4, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    }
   }
   SetUserModified();
 }
@@ -730,7 +859,12 @@ void AliFlowEventSimple::AddV5( Double_t v5 )
   for (Int_t i=0; i<fNumberOfTracks; i++)
   {
     AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
-    if (track) track->AddV5(v5, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    if(track) {
+      if((fUseExternalSymmetryPlanes)||(fUseGlauberMCSymmetryPlanes))
+       track->AddV5(v5, fPsi5, fAfterBurnerPrecision);
+      else
+       track->AddV5(v5, fMCReactionPlaneAngle, fAfterBurnerPrecision);
+    }  
   }
   SetUserModified();
 }
index 6784478..ff6d739 100644 (file)
@@ -58,6 +58,22 @@ class AliFlowEventSimple: public TObject {
   void     SetNumberOfRPs( Int_t nr )               { fNumberOfRPs=nr; }
   Int_t    GetNumberOfPOIs() const                  { return fNumberOfPOIs; }
   void     SetNumberOfPOIs( Int_t np )              { fNumberOfPOIs=np; }
+
+  void     SetUseGlauberMCSymmetryPlanes()          { fUseGlauberMCSymmetryPlanes = kTRUE; }
+  void     SetUseExternalSymmetryPlanes(TF1 *gPsi1Psi3 = 0x0,
+                                       TF1 *gPsi2Psi4 = 0x0,
+                                       TF1 *gPsi3Psi5 = 0x0);
+  void     SetPsi1(Double_t gPsi1)                  { fPsi1 = gPsi1; }
+  void     SetPsi2(Double_t gPsi2)                  { fPsi2 = gPsi2; }
+  void     SetPsi3(Double_t gPsi3)                  { fPsi3 = gPsi3; }
+  void     SetPsi4(Double_t gPsi4)                  { fPsi4 = gPsi4; }
+  void     SetPsi5(Double_t gPsi5)                  { fPsi5 = gPsi5; }
+  Double_t GetPsi1() const                          { return fPsi1; }
+  Double_t GetPsi2() const                          { return fPsi2; }
+  Double_t GetPsi3() const                          { return fPsi3; }
+  Double_t GetPsi4() const                          { return fPsi4; }
+  Double_t GetPsi5() const                          { return fPsi5; }
+
   Double_t GetMCReactionPlaneAngle() const          { return fMCReactionPlaneAngle; }
   void     SetMCReactionPlaneAngle(Double_t fPhiRP) { fMCReactionPlaneAngle=fPhiRP; fMCReactionPlaneAngleIsSet=kTRUE; }
   Bool_t   IsSetMCReactionPlaneAngle() const        { return fMCReactionPlaneAngleIsSet; }
@@ -111,6 +127,16 @@ class AliFlowEventSimple: public TObject {
   Int_t                   fNumberOfTracks;            // number of tracks
   Int_t                   fNumberOfRPs;               // number of tracks that have passed the RP selection
   Int_t                   fNumberOfPOIs;              // number of tracks that have passed the POI selection
+  Bool_t                  fUseGlauberMCSymmetryPlanes;// Use symmetry planes (Glauber MC)
+  Bool_t                  fUseExternalSymmetryPlanes; // Use symmetry planes (external)
+  Double_t                fPsi1;                      // Psi_1
+  Double_t                fPsi2;                      // Psi_2
+  Double_t                fPsi3;                      // Psi_3
+  Double_t                fPsi4;                      // Psi_4
+  Double_t                fPsi5;                      // Psi_5
+  TF1*                    fPsi1Psi3;                  // Correlation between Psi_1 and Psi_3
+  TF1*                    fPsi2Psi4;                  // Correlation between Psi_2 and Psi_4
+  TF1*                    fPsi3Psi5;                  // Correlation between Psi_3 and Psi_5
   Double_t                fMCReactionPlaneAngle;      // the angle of the reaction plane from the MC truth
   Bool_t                  fMCReactionPlaneAngleIsSet; // did we set it from MC?
   Double_t                fAfterBurnerPrecision;      // iteration precision in afterburner
index 1f4dcb6..e06ff5a 100644 (file)
@@ -156,14 +156,14 @@ AliFlowEventSimple* AliFlowOnTheFlyEventGenerator::GenerateOnTheFlyEvent(TClones
     Int_t totalMultiplicity(totalRPMultiplicity+totalPOIMultiplicity);
     // generate the particles of interest. if requested, a vn boost is given to the primary particles
     for(int i(0); i < nSpecies; i++) {
-        if(fluc) GenerateOnTheFlyTracks(gRandom->Uniform(mult[i]-TMath::Sqrt(mult[i]), mult[i]+TMath::Sqrt(mult[i])), species[i], event, fluc_poi);
+      if(fluc) GenerateOnTheFlyTracks((Int_t)(gRandom->Uniform(mult[i]-TMath::Sqrt(mult[i]), mult[i]+TMath::Sqrt(mult[i]))), species[i], event, fluc_poi);
         else GenerateOnTheFlyTracks(mult[i], species[i], event, fluc_poi);
     }
     // generate reference particles. if requested, a vn boost is given to the primary particles
     for(int i(0); i < 3; i++) {
         if(fluc) {
-            GenerateOnTheFlyTracks(gRandom->Uniform(multPiKPr[i]-TMath::Sqrt(multPiKPr[i]), multPiKPr[i]+TMath::Sqrt(mult[i])), fPDGPiKPr[i], event, fluc_rp);
-            GenerateOnTheFlyTracks(gRandom->Uniform(multPiKPr[i]-TMath::Sqrt(multPiKPr[i]), multPiKPr[i]+TMath::Sqrt(mult[i])), -1*fPDGPiKPr[i], event, fluc_rp);
+         GenerateOnTheFlyTracks((Int_t)(gRandom->Uniform(multPiKPr[i]-TMath::Sqrt(multPiKPr[i]), multPiKPr[i]+TMath::Sqrt(mult[i]))), fPDGPiKPr[i], event, fluc_rp);
+         GenerateOnTheFlyTracks((Int_t)(gRandom->Uniform(multPiKPr[i]-TMath::Sqrt(multPiKPr[i]), multPiKPr[i]+TMath::Sqrt(mult[i]))), -1*fPDGPiKPr[i], event, fluc_rp);
         }
         else {
             GenerateOnTheFlyTracks(multPiKPr[i], fPDGPiKPr[i], event, fluc_rp);