From b3a29c75e02767e514fe2dae7fcafa56ff6c363b Mon Sep 17 00:00:00 2001 From: snelling Date: Wed, 5 May 2010 18:04:11 +0000 Subject: [PATCH] a few extra histograms --- .../AliFlowAnalysisWithMCEventPlane.cxx | 87 ++++++++++++++++++- .../AliFlowAnalysisWithMCEventPlane.h | 29 ++++++- PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C | 1 + 3 files changed, 112 insertions(+), 5 deletions(-) diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithMCEventPlane.cxx b/PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithMCEventPlane.cxx index c6051afb38f..c9cd270dda6 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithMCEventPlane.cxx +++ b/PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithMCEventPlane.cxx @@ -60,13 +60,25 @@ ClassImp(AliFlowAnalysisWithMCEventPlane) fHistProDiffFlowPtPOI(NULL), fHistProDiffFlowEtaPOI(NULL), fHistSpreadOfFlow(NULL), - fHarmonic(2) + fHarmonic(2), + fResonanceList(NULL), + fFlowOfResonances(kFALSE), + fResonanceSettings(NULL), + fXinPairAngle(0.5) { // Constructor. fHistList = new TList(); fQsum = new TVector2; // flow vector sum + + fResonanceList = new TList(); + // Initialize arrays needed for the flow of resonances: + for(Int_t cs=0;cs<2;cs++) // cos/sin + { + fPairCorrelator[cs] = NULL; + } + } @@ -192,6 +204,8 @@ void AliFlowAnalysisWithMCEventPlane::Init() { fHistList->Add(fHistSpreadOfFlow); fEventNumber = 0; //set number of events to zero + + if(fFlowOfResonances) this->BookObjectsForFlowOfResonances(); TH1::AddDirectory(oldHistAddStatus); } @@ -274,7 +288,9 @@ void AliFlowAnalysisWithMCEventPlane::Make(AliFlowEventSimple* anEvent) { // store flow value for this event: fHistSpreadOfFlow->Fill(flowEBE->GetBinContent(1),flowEBE->GetBinEntries(1)); delete flowEBE; - } + + if(fFlowOfResonances) FlowOfResonances(anEvent); + } } //-------------------------------------------------------------------- @@ -447,5 +463,72 @@ void AliFlowAnalysisWithMCEventPlane::Finish() { //cout<<".....finished"<SetName("Resonances"); + fResonanceList->SetOwner(kTRUE); + fHistList->Add(fResonanceList); + // Profile holding settings for flow of resoances: + TString resonanceSettingsName = "fResonanceSettings"; + fResonanceSettings = new TProfile(resonanceSettingsName.Data(),"Settings for flow of resonances",2,0,2); + //fResonanceSettings->GetXaxis()->SetLabelSize(0.025); + fResonanceSettings->GetXaxis()->SetBinLabel(1,"fFlowOfResonances"); + fResonanceSettings->Fill(0.5,(Int_t)fFlowOfResonances); + fResonanceSettings->GetXaxis()->SetBinLabel(2,"x in #phi_{pair}"); // phi_{pair} = x*phi1+(1-x)*phi2 + fResonanceSettings->Fill(1.5,fXinPairAngle); + fResonanceList->Add(fResonanceSettings); + // Profiles used to calculate and (0 = cos, 1 = sin), where phi_{pair} = x*phi1+(1-x)*phi2: + TString cosSinFlag[2] = {"Cos","Sin"}; + TString cosSinTitleFlag[2] = {"cos[n(#phi_{pair}-#psi_{RP})]","sin[n(#phi_{pair}-#psi_{RP})]"}; + TString pairCorrelatorName = "fPairCorrelator"; + for(Int_t cs=0;cs<2;cs++) + { + fPairCorrelator[cs] = new TProfile(Form("%s%s",pairCorrelatorName.Data(),cosSinFlag[cs].Data()),cosSinTitleFlag[cs].Data(),1,0.,1.); + fPairCorrelator[cs]->GetXaxis()->SetBinLabel(1,cosSinTitleFlag[cs].Data()); + fResonanceList->Add(fPairCorrelator[cs]); + } + +} // end of void AliFlowAnalysisWithMCEventPlane::BookObjectsForFlowOfResonances() + +void AliFlowAnalysisWithMCEventPlane::FlowOfResonances(AliFlowEventSimple* anEvent) +{ + // Evaluate correlators relevant for the flow of resonances. + + // Get the MC reaction plane angle: + Double_t RP = anEvent->GetMCReactionPlaneAngle(); + // Get the number of tracks: + Int_t iNumberOfTracks = anEvent->NumberOfTracks(); + AliFlowTrackSimple *pTrack = NULL; + Double_t dPhi1 = 0.; + Double_t dPhi2 = 0.; + Double_t x = fXinPairAngle; // shortcut + Double_t n = fHarmonic; // shortcut + for(Int_t i=0;iGetTrack(i); + if(pTrack && pTrack->InRPSelection()) + { + dPhi1 = pTrack->Phi(); + } + for(Int_t j=0;jGetTrack(j); + if(pTrack && pTrack->InRPSelection()) + { + dPhi2 = pTrack->Phi(); + } + Double_t dPhiPair = x*dPhi1+(1.-x)*dPhi2; + fPairCorrelator[0]->Fill(0.5,TMath::Cos(n*(dPhiPair-RP)),1.); + fPairCorrelator[1]->Fill(0.5,TMath::Sin(n*(dPhiPair-RP)),1.); + } // end of for(Int_t j=i+1;jfHarmonic = harmonic;}; Int_t GetHarmonic() const {return this->fHarmonic;}; - + + // flow of resonances: + // a) methods: + virtual void BookObjectsForFlowOfResonances(); + virtual void FlowOfResonances(AliFlowEventSimple* anEvent); + // b) setters and getters: + void SetResonanceList(TList* const rl) {this->fResonanceList = rl;} + TList* GetResonanceList() const {return this->fResonanceList;} + void SetFlowOfResonances(Bool_t const ffor) {this->fFlowOfResonances = ffor;}; + Bool_t GetFlowOfResonances() const {return this->fFlowOfResonances;}; + void SetResonanceSettings(TProfile* const rs) {this->fResonanceSettings = rs;}; + TProfile* GetResonanceSettings() const {return this->fResonanceSettings;}; + void SetPairCorrelator(TProfile* const spc, Int_t const cs) {this->fPairCorrelator[cs] = spc;}; + TProfile* GetPairCorrelator(Int_t cs) const {return this->fPairCorrelator[cs];}; + void SetXinPairAngle(Double_t const xipa) {this->fXinPairAngle = xipa;}; + Double_t GetXinPairAngle() const {return this->fXinPairAngle;}; + private: AliFlowAnalysisWithMCEventPlane(const AliFlowAnalysisWithMCEventPlane& aAnalysis); //copy constructor @@ -127,9 +143,16 @@ class AliFlowAnalysisWithMCEventPlane { TProfile2D* fHistProDiffFlowPtEtaPOI; // profile used to calculate the differential flow (Pt,Eta) of POI particles TProfile* fHistProDiffFlowPtPOI; // profile used to calculate the differential flow (Pt) of POI particles TProfile* fHistProDiffFlowEtaPOI; // profile used to calculate the differential flow (Eta) of POI particles - TH1D* fHistSpreadOfFlow; // histogram filled with NONAME integrated flow calculated e-b-e + TH1D* fHistSpreadOfFlow; // histogram filled with reference flow calculated e-b-e Int_t fHarmonic; // harmonic - + + // objects needed for a study of flow of resonances (and in addition for strong parity violation): + TList *fResonanceList; // list to hold all objects relevant for a study of flow of resonances + Bool_t fFlowOfResonances; // evaluate and store objects relevant for study of flow of resonances + TProfile *fResonanceSettings; // profile used to hold all flags relevant for the flow of resonances + TProfile *fPairCorrelator[2]; // profiles used to calculate and (0 = cos, 1 = sin), where phi_{pair} = x*phi1+(1-x)*phi2 + Double_t fXinPairAngle; // x in definition phi_{pair} = x*phi1+(1-x)*phi2 + ClassDef(AliFlowAnalysisWithMCEventPlane,1) // Analyse particle distribution versus MC reaction plane }; diff --git a/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C b/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C index fb920b0f62c..5c6f8f6f400 100644 --- a/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C +++ b/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C @@ -260,6 +260,7 @@ int runFlowAnalysisOnTheFly(Int_t nEvts=1000, Int_t mode=mLocal) if (MCEP) { AliFlowAnalysisWithMCEventPlane *mcep = new AliFlowAnalysisWithMCEventPlane(); //mcep->SetHarmonic(2); // default is v2 + //mcep->SetFlowOfResonances(kTRUE); mcep->Init(); } -- 2.43.0