From e8c7e66cf149cc837eb4aa96b68aa44716af05c0 Mon Sep 17 00:00:00 2001 From: snelling Date: Wed, 29 Apr 2009 16:59:59 +0000 Subject: [PATCH] added a few setters --- .../AliFlowEventSimpleMakerOnTheFly.cxx | 47 +++++++++++-------- .../AliFlowEventSimpleMakerOnTheFly.h | 34 +++++++++----- PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C | 29 +++++++----- 3 files changed, 66 insertions(+), 44 deletions(-) diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.cxx b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.cxx index 6892c98fe1f..876eb163d82 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.cxx +++ b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.cxx @@ -41,8 +41,12 @@ ClassImp(AliFlowEventSimpleMakerOnTheFly) AliFlowEventSimpleMakerOnTheFly::AliFlowEventSimpleMakerOnTheFly(UInt_t iseed): fMultiplicityOfRP(0), fMultiplicitySpreadOfRP(0.), - fPtFormula(NULL), - fPhiFormula(NULL), + fV1RP(0.), + fV1SpreadRP(0.), + fV2RP(0.), + fV2SpreadRP(0.), + fPtSpectra(NULL), + fPhiDistribution(NULL), fMyTRandom3(NULL), fCount(0) { @@ -57,8 +61,8 @@ AliFlowEventSimpleMakerOnTheFly::AliFlowEventSimpleMakerOnTheFly(UInt_t iseed): AliFlowEventSimpleMakerOnTheFly::~AliFlowEventSimpleMakerOnTheFly() { // destructor - if (fPtFormula) delete fPtFormula; - if (fPhiFormula) delete fPhiFormula; + if (fPtSpectra) delete fPtSpectra; + if (fPhiDistribution) delete fPhiDistribution; if (fMyTRandom3) delete fMyTRandom3; } @@ -79,37 +83,42 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly() Double_t dPtMin = 0.; // to be improved Double_t dPtMax = 10.; // to be improved - fPtFormula = new TF1("PtFormula","[0]*x*TMath::Exp(-x*x)",dPtMin,dPtMax); + fPtSpectra = new TF1("fPtSpectra","[0]*x*TMath::Exp(-x*x)",dPtMin,dPtMax); + fPtSpectra->SetParName(0,"Multiplicity of RPs"); + // sampling the multiplicity: + fMultiplicityOfRP = fMyTRandom3->Gaus(fMultiplicityOfRP,fMultiplicitySpreadOfRP); + fPtSpectra->SetParameter(0,fMultiplicityOfRP); + - fPtFormula->SetParName(0,"Multiplicity of RPs"); - fPtFormula->SetParameter(0,fMultiplicityOfRP); - // phi: Double_t dPhiMin = 0.; // to be improved Double_t dPhiMax = TMath::TwoPi(); // to be improved - fPhiFormula = new TF1("phiDistribution","(1)*(1+2.*[0]*TMath::Cos(2*x))",dPhiMin,dPhiMax); - - Double_t dV2 = 0.044; // to be improved - - fPhiFormula->SetParName(0,"elliptic flow"); - fPhiFormula->SetParameter(0,dV2); + fPhiDistribution = new TF1("fPhiDistribution","1+2.*[0]*TMath::Cos(x)+2.*[1]*TMath::Cos(2*x)",dPhiMin,dPhiMax); + + // sampling the V1: + fPhiDistribution->SetParName(0,"directed flow"); + if(fV1RP>0.0) fV1RP = fMyTRandom3->Gaus(fV1RP,fV1SpreadRP); + fPhiDistribution->SetParameter(0,fV1RP); - + // sampling the V2: + fPhiDistribution->SetParName(1,"elliptic flow"); + fV2RP = fMyTRandom3->Gaus(fV2RP,fV2SpreadRP); + fPhiDistribution->SetParameter(1,fV2RP); + // eta: Double_t dEtaMin = -1.; // to be improved Double_t dEtaMax = 1.; // to be improved - - + Int_t iGoodTracks = 0; Int_t iSelParticlesRP = 0; Int_t iSelParticlesPOI = 0; for(Int_t i=0;iSetPt(fPtFormula->GetRandom()); + pTrack->SetPt(fPtSpectra->GetRandom()); pTrack->SetEta(fMyTRandom3->Uniform(dEtaMin,dEtaMax)); - pTrack->SetPhi(fPhiFormula->GetRandom()+fMCReactionPlaneAngle); + pTrack->SetPhi(fPhiDistribution->GetRandom()+fMCReactionPlaneAngle); pTrack->SetForRPSelection(kTRUE); iSelParticlesRP++; pTrack->SetForPOISelection(kTRUE); diff --git a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.h b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.h index b8279bb211c..1b5802ad3f1 100644 --- a/PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.h +++ b/PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.h @@ -39,14 +39,23 @@ class AliFlowEventSimpleMakerOnTheFly { // setters and getters for global parameters: void SetMultiplicityOfRP(Int_t multRP) {this->fMultiplicityOfRP = multRP;} Int_t GetMultiplicityOfRP() const {return this->fMultiplicityOfRP;} - //................................................................................................ - //................................................................................................ - // setters and getters for event-by-event parameters: void SetMultiplicitySpreadOfRP(Double_t multSpreadRP) {this->fMultiplicitySpreadOfRP = multSpreadRP;} Double_t GetMultiplicitySpreadOfRP() const {return this->fMultiplicitySpreadOfRP;} - //................................................................................................ + void SetV1RP(Double_t dV1RP) {this->fV1RP = dV1RP;} + Double_t GetV1RP() const {return this->fV1RP;} + + void SetV1SpreadRP(Double_t dV1SpreadRP) {this->fV1SpreadRP = dV1SpreadRP;} + Double_t GetV1SpreadRP() const {return this->fV1SpreadRP;} + + void SetV2RP(Double_t dV2RP) {this->fV2RP = dV2RP;} + Double_t GetV2RP() const {return this->fV2RP;} + + void SetV2SpreadRP(Double_t dV2SpreadRP) {this->fV2SpreadRP = dV2SpreadRP;} + Double_t GetV2SpreadRP() const {return this->fV2SpreadRP;} + //................................................................................................ + private: AliFlowEventSimpleMakerOnTheFly(const AliFlowEventSimpleMakerOnTheFly& anAnalysis); // copy constructor @@ -54,19 +63,18 @@ class AliFlowEventSimpleMakerOnTheFly { //................................................................................................ // global parameters: - Int_t fMultiplicityOfRP; // multiplicity of RPs - //................................................................................................ - - //................................................................................................ - // event-by-event parameters: - Double_t fMultiplicitySpreadOfRP; // multiplicity spread of RPs + Int_t fMultiplicityOfRP; // multiplicity of RPs + Double_t fMultiplicitySpreadOfRP; // multiplicity spread of RPs + Double_t fV1RP; // directed flow of RPs + Double_t fV1SpreadRP; // directed flow spread of RPs + Double_t fV2RP; // elliptic flow of RPs + Double_t fV2SpreadRP; // elliptic flow spread of RPs //................................................................................................ //................................................................................................ // equations for distributions: - TF1 *fPtFormula; // transverse momentum distribution - TF1 *fPhiFormula; // azimuthal distribution - + TF1 *fPtSpectra; // transverse momentum distribution + TF1 *fPhiDistribution; // azimuthal distribution //................................................................................................ TRandom3* fMyTRandom3; // our random generator diff --git a/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C b/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C index c8de913b0ce..b75d7cfd0ae 100644 --- a/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C +++ b/PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C @@ -12,25 +12,28 @@ Bool_t LYZ2 = kFALSE; Bool_t LYZEP = kFALSE; Bool_t GFC = kTRUE; Bool_t QC = kTRUE; -Bool_t FQD = kTRUE; +Bool_t FQD = kFALSE; Bool_t MCEP = kTRUE; //-------------------------------------------------------------------------------------- -//................................................................................. - +//...................................................................................... // Set the event parameters: Int_t iMultiplicityOfRP = 500; // multiplicity of RPs +Double_t dMultiplicitySpreadOfRP = 100; // multiplicity spread of RPs -//................................................................................. - +Double_t dV2RP = 0.05; // elliptic flow of RPs +Double_t dV2SpreadRP = 0.001; // elliptic flow spread of RPs +Double_t dV1RP = 0.0; // directed flow of RPs +Double_t dV1SpreadRP = 0.0; // directed flow spread of RPs +//...................................................................................... enum anaModes {mLocal,mLocalSource,mLocalPAR,}; // mLocal: Analyze data on your computer using aliroot // mLocalPAR: Analyze data on your computer using root + PAR files // mLocalSource: Analyze data on your computer using root + source files -int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=1) +int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=100) { TStopwatch timer; timer.Start(); @@ -49,10 +52,9 @@ int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=1) cout<SetMultiplicityOfRP(iMultiplicityOfRP); + eventMakerOnTheFly->SetMultiplicitySpreadOfRP(dMultiplicitySpreadOfRP); + eventMakerOnTheFly->SetV1RP(dV1RP); + eventMakerOnTheFly->SetV1SpreadRP(dV1SpreadRP); + eventMakerOnTheFly->SetV2RP(dV2RP); + eventMakerOnTheFly->SetV2SpreadRP(dV2SpreadRP); //--------------------------------------------------------------------------------------- // create and analyze events 'on the fly': - // set the global event parameters: - eventMakerOnTheFly->SetMultiplicityOfRP(iMultiplicityOfRP); - for(Int_t i=0;iCreateEventOnTheFly(); -- 2.39.3