eventplane determination changed, subtract the current track from the eventplane...
authorpluettig <philipp.luettig@cern.ch>
Mon, 21 Jul 2014 12:37:36 +0000 (14:37 +0200)
committerpluettig <philipp.luettig@cern.ch>
Mon, 21 Jul 2014 12:37:36 +0000 (14:37 +0200)
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtAnalysisPbPbAOD.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtAnalysisPbPbAOD.h

index 651c22a..1a43ec3 100644 (file)
@@ -642,6 +642,8 @@ void AlidNdPtAnalysisPbPbAOD::UserExec(Option_t *option)
   //AliGenPythiaEventHeader *genPythiaHeader = NULL;
   AliEventplane *ep = NULL;
   
+  TVector2 *epQvector = NULL;
+  
   Bool_t bIsEventSelectedMB = kFALSE;
   Bool_t bIsEventSelectedSemi = kFALSE;
   Bool_t bIsEventSelectedCentral = kFALSE;
@@ -667,6 +669,7 @@ void AlidNdPtAnalysisPbPbAOD::UserExec(Option_t *option)
   Double_t dEventZv = -100;
   Int_t iAcceptedMultiplicity = 0;
   Double_t dEventplaneAngle = -10;
+  Double_t dEventplaneAngleCorrected = -10; // event plane angle, where tracks contributing to this angle have been subtracted
   Double_t dMCEventplaneAngle = -10;
   
   fIsMonteCarlo = kFALSE;
@@ -741,10 +744,41 @@ void AlidNdPtAnalysisPbPbAOD::UserExec(Option_t *option)
   
   fEventStatistics->Fill("after centrality selection",1);
   
+  // start with track analysis
+//   Int_t *iIndexAcceptedTracks = new Int_t[eventAOD->GetNumberOfTracks()]; // maximum number of track indices, this array can have
+//   Int_t nTotalNumberAcceptedTracks = 0;
+//   for(Int_t i = 0; i < eventAOD->GetNumberOfTracks(); i++) { iIndexAcceptedTracks[i] = 0; }
+//   for(Int_t itrack = 0; itrack < eventAOD->GetNumberOfTracks(); itrack++) 
+//   { 
+//     track = eventAOD->GetTrack(itrack);
+//     if(!track) continue;
+//     
+//     GetDCA(track, eventAOD, dDCA);
+//     
+//     Double_t dDCAxyDCAzPt[5] = { dDCA[0], dDCA[1], track->Pt(), track->Eta(), track->Phi() };
+//     
+//     fDCAPtAll->Fill(dDCAxyDCAzPt);
+//     
+//     if( !(IsTrackAccepted(track, dCentrality, eventAOD->GetMagneticField())) ) continue;
+//     
+//     iIndexAcceptedTracks[nTotalNumberAcceptedTracks] = itrack;
+//     nTotalNumberAcceptedTracks++;
+//   }
+  
   // get event plane Angle from AODHeader, default is Q
   ep = const_cast<AliAODEvent*>(eventAOD)->GetEventplane();
   if(ep) {
        dEventplaneAngle = MoveEventplane(ep->GetEventplane(GetEventplaneSelector().Data(),eventAOD));
+       if(GetEventplaneSelector().CompareTo("Q") == 0) 
+       {
+         epQvector = ep->GetQVector(); 
+       }
+  }
+  
+  if( (GetEventplaneSelector().CompareTo("Q") == 0) && !epQvector )
+  {
+       AliWarning("ERROR: epQvector not available \n");
+       return;
   }
   
   //   cout << dEventplaneAngle << endl;
@@ -848,8 +882,10 @@ void AlidNdPtAnalysisPbPbAOD::UserExec(Option_t *option)
   }
   
   for(Int_t itrack = 0; itrack < eventAOD->GetNumberOfTracks(); itrack++)
+//   for(Int_t itrack = 0; itrack < nTotalNumberAcceptedTracks; itrack++)
   {
        track = eventAOD->GetTrack(itrack);
+//     track = eventAOD->GetTrack(iIndexAcceptedTracks[itrack]);
        if(!track) continue;
        
        mcPart = NULL;
@@ -876,7 +912,26 @@ void AlidNdPtAnalysisPbPbAOD::UserExec(Option_t *option)
        dTrackZvPtEtaCent[2] = track->Eta();
        dTrackZvPtEtaCent[3] = dCentrality;
        
-       dTrackPhiPtEtaCent[0] = RotatePhi(track->Phi(), dEventplaneAngle); 
+       if(GetEventplaneSelector().CompareTo("Q") == 0) 
+       {
+         // subtract track contribution from eventplane
+         Double_t dX = -10;
+         Double_t dY = -10;
+         
+         dX = epQvector->X();
+         dY = epQvector->Y();
+         
+         dX -= ep->GetQContributionX(track);
+         dY -= ep->GetQContributionY(track);
+         TVector2 epCorrected(dX, dY);
+         dEventplaneAngleCorrected = MoveEventplane(epCorrected.Phi());
+       }
+       else
+       {
+         dEventplaneAngleCorrected = dEventplaneAngle; 
+       }
+       
+       dTrackPhiPtEtaCent[0] = RotatePhi(track->Phi(), dEventplaneAngleCorrected); 
        
        //      if( dTrackPhiPtEtaCent[0] < -1.0*TMath::Pi()) dTrackPhiPtEtaCent[0] += 2.*TMath::Pi();
        //      else if( dTrackPhiPtEtaCent[0] > TMath::Pi()) dTrackPhiPtEtaCent[0] -= 2.*TMath::Pi();
@@ -997,7 +1052,7 @@ void AlidNdPtAnalysisPbPbAOD::UserExec(Option_t *option)
   PostData(1, fOutputList);
   
   // delete pointers:
-  
+//   delete [] iIndexAcceptedTracks;
 }
 
 Double_t AlidNdPtAnalysisPbPbAOD::MoveEventplane(Double_t dMCEP)
index 4bb2c96..cd6c2f3 100644 (file)
@@ -26,6 +26,7 @@ class iostream;
 #include "TClonesArray.h"
 #include "TString.h"
 #include "TProfile.h"
+#include "TVector2.h"
 
 #include "TParticlePDG.h"
 #include "TDatabasePDG.h"