//
#include "AliFlowEvent.h"
+#include "AliFlowTrack.h"
+#include "AliFlowV0.h"
+#include "AliFlowSelection.h"
#include "AliFlowConstants.h"
+
#include "TVector.h"
#include "TVector2.h"
#include "TVector3.h"
+#include "TClonesArray.h"
+#include "TMath.h"
+#include "TRandom.h"
+#include "TString.h"
#include <iostream>
using namespace std; //required for resolving the 'cout' symbol
// - Flags & Sets
-Bool_t AliFlowEvent::fPtWgt = kFALSE ; // gives pT-based weights
-Bool_t AliFlowEvent::fEtaWgt = kFALSE ; // gives eta-based weights
-Bool_t AliFlowEvent::fOnePhiWgt = kTRUE ; // kTRUE --> ENABLEs SINGLE WEIGHT ISTOGRAM , kFALSE --> ENABLEs 3 WEIGHT ISTOGRAMS
-Bool_t AliFlowEvent::fNoWgt = kFALSE ; // No Weight is used
+Bool_t AliFlowEvent::fgPtWgt = kFALSE ; // gives pT-based weights
+Bool_t AliFlowEvent::fgEtaWgt = kFALSE ; // gives eta-based weights
+Bool_t AliFlowEvent::fgOnePhiWgt = kTRUE ; // kTRUE --> ENABLEs SINGLE WEIGHT ISTOGRAM , kFALSE --> ENABLEs 3 WEIGHT ISTOGRAMS
+Bool_t AliFlowEvent::fgNoWgt = kFALSE ; // No Weight is used
// - Eta Sub-Events (later used to calculate the resolution)
-Bool_t AliFlowEvent::fEtaSubs = kFALSE ; // makes eta subevents
+Bool_t AliFlowEvent::fgEtaSubs = kFALSE ; // makes eta subevents
+Bool_t AliFlowEvent::fgCustomRespFunc = kFALSE ; // custom "detector response function" is used for P.Id (see AliFlowTrack)
ClassImp(AliFlowEvent)
//-----------------------------------------------------------
-AliFlowEvent::AliFlowEvent(Int_t lenght)
+AliFlowEvent::AliFlowEvent(Int_t lenght):
+ fEventID(0),
+ fRunID(0),
+ fOrigMult(0),
+ fL0Trigger(0),
+ fZDCpart(0),
+ fCentrality(-1),
+ fTrackCollection(0x0),
+ fV0Collection(0x0),
+ fDone(kFALSE)
{
// Default constructor: initializes the ObjArray of FlowTracks and FlowV0s,
// cleans the internal variables, sets all the weights to 1, sets default flags.
- fEventID = 0 ;
- fRunID = 0 ;
- fOrigMult = 0 ;
- fL0TriggerWord = 0 ;
- fCentrality = -1 ;
- fZDCpart = 0 ;
for(int zz=0;zz<3;zz++) { fZDCenergy[zz] = 0. ; }
+ for(int i=0;i<AliFlowConstants::kHars;i++) { fExtPsi[i] = 0. ; fExtRes[i] = 0.; }
// Make a new track collection
- fTrackCollection = new TObjArray(lenght) ;
- fV0Collection = new TObjArray(0) ;
+ fTrackCollection = new TClonesArray("AliFlowTrack",lenght) ; fTrackCollection->BypassStreamer(kTRUE) ;
+ fV0Collection = new TClonesArray("AliFlowV0",lenght) ; fV0Collection->BypassStreamer(kTRUE) ;
// Set Weights Arrays to 1 (default)
- for(int nS=0;nS<Flow::nSels;nS++)
+ for(int nS=0;nS<AliFlowConstants::kSels;nS++)
{
- for(int nH=0;nH<Flow::nHars;nH++)
+ for(int nH=0;nH<AliFlowConstants::kHars;nH++)
{
- for(int nP=0;nP<Flow::nPhiBins;nP++)
+ for(int nP=0;nP<AliFlowConstants::kPhiBins;nP++)
{
// enable this with: SetOnePhiWgt()
fPhiWgt[nS][nH][nP] = 1. ; // cout << nS << nH << nP << " val " << fPhiWgt[nS][nH][nP] << endl ;
}
}
}
- //for(int nH=0;nH<Flow::nHars;nH++) { fExtPsi[nH] = 0. ; fExtRes[nH] = 0. ; }
+ //for(int nH=0;nH<AliFlowConstants::kHars;nH++) { fExtPsi[nH] = 0. ; fExtRes[nH] = 0. ; }
- // The Expected particles abundance is taken directly from Flow::fBayesian[] (see Bayesian P.Id.)
+ // The Expected particles abundance is taken directly from AliFlowConstants::fgBayesian[] (see Bayesian P.Id.)
- fDone = kFALSE ;
}
//-----------------------------------------------------------
AliFlowEvent::~AliFlowEvent()
float phi = pFlowTrack->Phi() ; if(phi < 0.) { phi += 2*TMath::Pi() ; }
Double_t eta = (Double_t)pFlowTrack->Eta() ;
- int n = (int)((phi/(2*TMath::Pi()))*Flow::nPhiBins);
+ int n = (int)((phi/(2*TMath::Pi()))*AliFlowConstants::kPhiBins);
Double_t phiWgt = 1. ;
if(OnePhiWgt())
{
// Weight for enhancing the resolution (eta gives sign +/- for Odd Harmonics)
- if(selN>Flow::nSels) { selN = 0 ; }
+ if(selN>AliFlowConstants::kSels) { selN = 0 ; }
bool oddHar = (harN+1) % 2 ;
Double_t phiWgt = 1. ;
if(PtWgt())
{
Double_t pt = (Double_t)pFlowTrack->Pt();
- if(pt < Flow::fPtWgtSaturation) { phiWgt *= pt ; }
- else { phiWgt *= Flow::fPtWgtSaturation ; } // pt weighting going constant
+ if(pt < AliFlowConstants::fgPtWgtSaturation) { phiWgt *= pt ; }
+ else { phiWgt *= AliFlowConstants::fgPtWgtSaturation ; } // pt weighting going constant
}
Double_t eta = (Double_t)pFlowTrack->Eta();
Double_t etaAbs = TMath::Abs(eta);
Double_t AliFlowEvent::PhiWeight(Int_t selN, Int_t harN, AliFlowTrack* pFlowTrack) const
{
// Weight for making the event plane isotropic in the lab and enhancing the resolution
- // (it simply rerurns PhiWeightRaw() * Weight()). If fNoWgt = kTRUE, returns +/-1 ,
+ // (it simply rerurns PhiWeightRaw() * Weight()). If fgNoWgt = kTRUE, returns +/-1 ,
// basing on Sign(eta), for odd harmonics .
- if(fNoWgt) // no weights (but +/- according to eta)
+ if(fgNoWgt) // no weights (but +/- according to eta)
{
bool oddHar = (harN+1) % 2 ;
if(oddHar) { return TMath::Sign((Double_t)1.,(Double_t)pFlowTrack->Eta()) ; }
}
Double_t phiWgtRaw = PhiWeightRaw(selN, harN, pFlowTrack);
Double_t weight = Weight(selN, harN, pFlowTrack);
- if(Flow::fDebug) { cout << "[PhiWeight]: phiWgtRaw = " << phiWgtRaw << " , weight = " << weight << " , eta = " << pFlowTrack->Eta() << endl ; }
+ if(AliFlowConstants::fgDebug) { cout << "[PhiWeight]: phiWgtRaw = " << phiWgtRaw << " , weight = " << weight << " , eta = " << pFlowTrack->Eta() << endl ; }
return phiWgtRaw * weight;
}
//-------------------------------------------------------------
-Int_t AliFlowEvent::Mult(AliFlowSelection* pFlowSelect)
+Int_t AliFlowEvent::Mult(AliFlowSelection* pFlowSelect) const
{
// Multiplicity of tracks in the specified Selection
return mult;
}
//-------------------------------------------------------------
-Float_t AliFlowEvent::MeanPt(AliFlowSelection* pFlowSelect)
+Float_t AliFlowEvent::MeanPt(AliFlowSelection* pFlowSelect) const
{
// Mean pt of tracks in the specified Selection
return meanPt ;
}
//-------------------------------------------------------------
-TVector2 AliFlowEvent::Q(AliFlowSelection* pFlowSelect)
+TVector2 AliFlowEvent::Q(AliFlowSelection* pFlowSelect) const
{
// Event plane vector for the specified Selection
float phi = pFlowTrack->Phi();
mQx += phiWgt * cos(phi * order) ;
mQy += phiWgt * sin(phi * order) ;
- if(Flow::fDebug) { cout << itr << " phi = " << phi << " , wgt = " << phiWgt << endl ; }
+ if(AliFlowConstants::fgDebug) { cout << itr << " phi = " << phi << " , wgt = " << phiWgt << endl ; }
}
}
mQ.Set(mQx, mQy);
return mQ;
}
//-------------------------------------------------------------
-Float_t AliFlowEvent::Psi(AliFlowSelection* pFlowSelect)
+Float_t AliFlowEvent::Psi(AliFlowSelection* pFlowSelect) const
{
// Event plane angle for the specified Selection
return psi;
}
//-------------------------------------------------------------
-TVector2 AliFlowEvent::NormQ(AliFlowSelection* pFlowSelect)
+TVector2 AliFlowEvent::NormQ(AliFlowSelection* pFlowSelect) const
{
// Normalized Q = Q/sqrt(sum of weights^2) for the specified Selection
if(fDone)
{
TVector2 mQ = fQ[pFlowSelect->Sel()][pFlowSelect->Har()] ;
- double SumOfWeightSqr = fSumOfWeightSqr[pFlowSelect->Sel()][pFlowSelect->Har()] ;
- if(SumOfWeightSqr) { mQ /= TMath::Sqrt(SumOfWeightSqr) ; }
+ double sumOfWeightSqr = fSumOfWeightSqr[pFlowSelect->Sel()][pFlowSelect->Har()] ;
+ if(sumOfWeightSqr) { mQ /= TMath::Sqrt(sumOfWeightSqr) ; }
else { mQ.Set(0.,0.) ; }
return mQ ;
}
// -
TVector2 mQ ;
Double_t mQx=0. , mQy=0. ;
- double SumOfWeightSqr = 0 ;
+ double sumOfWeightSqr = 0 ;
int selN = pFlowSelect->Sel() ;
int harN = pFlowSelect->Har() ;
double order = (double)(harN + 1) ;
if (pFlowSelect->Select(pFlowTrack))
{
double phiWgt = PhiWeight(selN, harN, pFlowTrack);
- SumOfWeightSqr += phiWgt*phiWgt;
+ sumOfWeightSqr += phiWgt*phiWgt;
float phi = pFlowTrack->Phi();
mQx += phiWgt * cos(phi * order);
mQy += phiWgt * sin(phi * order);
}
}
- if(SumOfWeightSqr) { mQ.Set(mQx/TMath::Sqrt(SumOfWeightSqr), mQy/TMath::Sqrt(SumOfWeightSqr)); }
+ if(sumOfWeightSqr) { mQ.Set(mQx/TMath::Sqrt(sumOfWeightSqr), mQy/TMath::Sqrt(sumOfWeightSqr)); }
else { mQ.Set(0.,0.); }
return mQ;
}
//-------------------------------------------------------------
-Float_t AliFlowEvent::q(AliFlowSelection* pFlowSelect)
+Float_t AliFlowEvent::OldQ(AliFlowSelection* pFlowSelect) const
{
// Magnitude of normalized Q vector (without pt or eta weighting) for the specified Selection
int selN = pFlowSelect->Sel() ;
int harN = pFlowSelect->Har() ;
double order = (double)(harN + 1) ;
- double SumOfWeightSqr = 0 ;
+ double sumOfWeightSqr = 0 ;
Int_t itr ;
for(itr=0;itr<TrackCollection()->GetEntries();itr++)
if(pFlowSelect->Select(pFlowTrack))
{
double phiWgt = PhiWeightRaw(selN, harN, pFlowTrack); // Raw
- SumOfWeightSqr += phiWgt*phiWgt;
+ sumOfWeightSqr += phiWgt*phiWgt;
float phi = pFlowTrack->Phi();
mQx += phiWgt * cos(phi * order);
mQy += phiWgt * sin(phi * order);
}
}
- if(SumOfWeightSqr) { mQ.Set(mQx/TMath::Sqrt(SumOfWeightSqr), mQy/TMath::Sqrt(SumOfWeightSqr)); }
+ if(sumOfWeightSqr) { mQ.Set(mQx/TMath::Sqrt(sumOfWeightSqr), mQy/TMath::Sqrt(sumOfWeightSqr)); }
else { mQ.Set(0.,0.); }
return mQ.Mod();
}
//-----------------------------------------------------------------------
-Double_t AliFlowEvent::G_New(AliFlowSelection* pFlowSelect, Double_t Zx, Double_t Zy)
+Double_t AliFlowEvent::NewG(AliFlowSelection* pFlowSelect, Double_t Zx, Double_t Zy) const
{
// Generating function for the new cumulant method. Eq. 3 in the Practical Guide
return theG;
}
//-----------------------------------------------------------------------
-Double_t AliFlowEvent::G_Old(AliFlowSelection* pFlowSelect, Double_t Zx, Double_t Zy)
+Double_t AliFlowEvent::OldG(AliFlowSelection* pFlowSelect, Double_t Zx, Double_t Zy) const
{
// Generating function for the old cumulant method (if expanded in Taylor
- // series, one recovers G_New() in new new cumulant method)
+ // series, one recovers NewG() in new new cumulant method)
- TVector2 normQ = NormQ(pFlowSelect);
+ TVector2 normQ = NormQ(pFlowSelect) ;
return exp(2*Zx*normQ.X() + 2*Zy*normQ.Y());
}
//-----------------------------------------------------------------------
-Double_t AliFlowEvent::SumWeightSquare(AliFlowSelection* pFlowSelect)
+Double_t AliFlowEvent::SumWeightSquare(AliFlowSelection* pFlowSelect) const
{
// Return sum of weights^2 for the specified Selection (used for normalization)
- if(fDone)
- {
- return fSumOfWeightSqr[pFlowSelect->Sel()][pFlowSelect->Har()] ;
- }
- // -
+ if(fDone) { return fSumOfWeightSqr[pFlowSelect->Sel()][pFlowSelect->Har()] ; }
+
int selN = pFlowSelect->Sel();
int harN = pFlowSelect->Har();
- Double_t SumOfWeightSqr = 0;
-
+ Double_t sumOfWeightSqr = 0;
Int_t itr ;
for(itr=0;itr<TrackCollection()->GetEntries();itr++)
{
if (pFlowSelect->Select(pFlowTrack))
{
double phiWgt = PhiWeight(selN, harN, pFlowTrack);
- SumOfWeightSqr += phiWgt*phiWgt;
+ sumOfWeightSqr += phiWgt*phiWgt;
}
}
- if(SumOfWeightSqr < 0.) { return Mult(pFlowSelect) ; }
+ if(sumOfWeightSqr < 0.) { return Mult(pFlowSelect) ; }
- return SumOfWeightSqr;
+ return sumOfWeightSqr;
}
//-------------------------------------------------------------
-Double_t AliFlowEvent::WgtMult_q4(AliFlowSelection* pFlowSelect)
+Double_t AliFlowEvent::WgtMultQ4(AliFlowSelection* pFlowSelect) const
{
// Used only for the old cumulant method, for getting q4 when weight is on.
// Replace multiplicity in Eq.(74b) by this quantity when weight is on.
return (theSumOfWgtSqr*theSumOfWgtSqr)/(theMult*(-theMeanWj4+2*theMeanWj2*theMeanWj2));
}
//-------------------------------------------------------------
-Double_t AliFlowEvent::WgtMult_q6(AliFlowSelection* pFlowSelect)
+Double_t AliFlowEvent::WgtMultQ6(AliFlowSelection* pFlowSelect) const
{
// Used only for the old cumulant method. For getting q6 when weight is on.
// Replace multiplicity in Eq.(74c) by this quantity when weight is on.
pFlowTrack->ResetSelection() ; // this re-sets all the mSelection flags to 0
// * this sets all the selection n.[0] flag kTRUE (all harmonics) *
- for(int harN=0;harN<Flow::nHars;harN++) { pFlowTrack->SetSelect(harN,0) ; }
+ for(int harN=0;harN<AliFlowConstants::kHars;harN++) { pFlowTrack->SetSelect(harN,0) ; }
// Track need to be Constrainable
if(pFlowSelect->ConstrainCut() && !pFlowTrack->IsConstrainable()) continue ;
}
}
double eta = (double)(pFlowTrack->Eta());
- float Pt = pFlowTrack->Pt();
+ float pt = pFlowTrack->Pt();
float gDca = pFlowTrack->Dca() ;
// Global DCA - gets rid of the track with DCA outside the range
if((pFlowSelect->DcaGlobalCutHi()>pFlowSelect->DcaGlobalCutLo()) && (gDca<pFlowSelect->DcaGlobalCutLo() || gDca>pFlowSelect->DcaGlobalCutHi())) continue ;
// Pt & Eta - this is done differently for different Harmonic & Selection
- for(int selN = 1; selN < Flow::nSels; selN++) // not even consider the 0th selection (no cut applied there)
+ for(int selN = 1; selN < AliFlowConstants::kSels; selN++) // not even consider the 0th selection (no cut applied there)
{
// min. TPC hits required
if(pFlowSelect->NhitsCut(selN) && (pFlowTrack->FitPtsTPC()<pFlowSelect->NhitsCut(selN))) continue ;
- for(int harN = 0; harN < Flow::nHars; harN++)
+ for(int harN = 0; harN < AliFlowConstants::kHars; harN++)
{
// Eta - gets rid of the track with Eta outside the range
if((pFlowSelect->EtaCutHi(harN%2,selN)>pFlowSelect->EtaCutLo(harN%2,selN)) && (TMath::Abs(eta)<pFlowSelect->EtaCutLo(harN%2,selN) || TMath::Abs(eta)>pFlowSelect->EtaCutHi(harN%2,selN))) continue ;
// Pt - gets rid of the track with Pt outside the range
- if((pFlowSelect->PtCutHi(harN%2,selN)>pFlowSelect->PtCutLo(harN%2,selN)) && (Pt<pFlowSelect->PtCutLo(harN%2,selN) || Pt>pFlowSelect->PtCutHi(harN%2,selN))) continue ;
+ if((pFlowSelect->PtCutHi(harN%2,selN)>pFlowSelect->PtCutLo(harN%2,selN)) && (pt<pFlowSelect->PtCutLo(harN%2,selN) || pt>pFlowSelect->PtCutHi(harN%2,selN))) continue ;
pFlowTrack->SetSelect(harN, selN) ; // if cuts defined (low<high) && track is in the range -> Set [har][sel] Flag ON
- if(Flow::fDebug)
+ if(AliFlowConstants::fgDebug)
{
- cout << " harN " << harN%2 << " , selN " << selN << " - si" << endl ;
- if(pFlowSelect->Pid()[0] != '\0') { cout << " track: pid " << pFlowTrack->Pid() << " = "<< pFlowSelect->Pid() << endl ; }
- cout << " track: dca " << pFlowSelect->DcaGlobalCutLo() << " < " << gDca << " < " << pFlowSelect->DcaGlobalCutHi() << endl ;
- cout << " track: eta " << pFlowSelect->EtaCutLo(harN,selN) << " < |" << eta << "| < " << pFlowSelect->EtaCutHi(harN,selN) << endl ;
- cout << " track: pT " << pFlowSelect->PtCutLo(harN,selN) << " < " << Pt << " < " << pFlowSelect->PtCutHi(harN,selN) << endl ;
- pFlowTrack->PrintSelection() ;
+ if(harN==1)
+ {
+ cout << " n. " << itr << " , pFlowTrack->PrintSelection() = " ; pFlowTrack->PrintSelection() ;
+ if(pFlowSelect->Pid()[0] != '\0') { cout << " track: pid " << pFlowTrack->Pid() << " = "<< pFlowSelect->Pid() << endl ; }
+ cout << " track: dca " << pFlowSelect->DcaGlobalCutLo() << " < " << gDca << " < " << pFlowSelect->DcaGlobalCutHi() << endl ;
+ cout << " track: eta " << pFlowSelect->EtaCutLo(harN,selN) << " < |" << eta << "| < " << pFlowSelect->EtaCutHi(harN,selN) << endl ;
+ cout << " track: pT " << pFlowSelect->PtCutLo(harN,selN) << " < " << pt << " < " << pFlowSelect->PtCutHi(harN,selN) << endl ;
+ cout << " pFlowTrack->PrintSelection() = " ; pFlowTrack->PrintSelection() ;
+ }
+ // cout << " selN " << selN << " , harN " << harN%2 << " - si" << endl ;
}
}
}
//-------------------------------------------------------------
void AliFlowEvent::SetPids()
{
- // Re-sets the tracks P.id. (using the current Flow::fBayesian[] array)
+ // Re-sets the tracks P.id. (using the current AliFlowConstants::fgBayesian[] array).
+ // To use the Raw P.Id (just the detector response function), set fgBayesian[] = {1,1,1,1,1,1}.
- const Int_t code[] = {11,13,211,321,2212,10010020} ;
+ const Int_t kCode[] = {11,13,211,321,2212,10010020} ;
for(Int_t itr=0;itr<TrackCollection()->GetEntries();itr++)
{
AliFlowTrack* pFlowTrack ;
pFlowTrack = (AliFlowTrack*)TrackCollection()->At(itr) ;
- TVector bayPid = pFlowTrack->PidProbs() ;
- Int_t maxN = 2 ; // if No id. -> then is a Pi
- Float_t pid_max = bayPid[2] ; // (if all equal, Pi probability get's the advantage to be the first)
- for(Int_t nP=0;nP<Flow::nPid;nP++)
+
+ Float_t bayPid[AliFlowConstants::kPid] ;
+ if(fgCustomRespFunc) { pFlowTrack->PidProbsC(bayPid) ; }
+ else { pFlowTrack->PidProbs(bayPid) ; }
+
+ Int_t maxN = 2 ; // if No id. -> then is a Pi
+ Float_t pidMax = bayPid[2] ; // (if all equal, Pi probability was the first)
+ for(Int_t nP=0;nP<AliFlowConstants::kPid;nP++)
{
- if(bayPid[nP]>pid_max) { maxN = nP ; pid_max = bayPid[nP] ; }
+ if(bayPid[nP]>pidMax) { maxN = nP ; pidMax = bayPid[nP] ; }
}
- Int_t pdg_code = TMath::Sign(code[maxN],pFlowTrack->Charge()) ;
- pFlowTrack->SetMostLikelihoodPID(pdg_code);
+ Int_t pdgCode = TMath::Sign(kCode[maxN],pFlowTrack->Charge()) ;
+ pFlowTrack->SetMostLikelihoodPID(pdgCode) ;
}
}
//-------------------------------------------------------------
-void AliFlowEvent::MakeSubEvents()
+void AliFlowEvent::MakeSubEvents() const
{
// Make random or eta sub-events
- if(EtaSubs()) { MakeEtaSubEvents() ; }
+ if(fgEtaSubs) { MakeEtaSubEvents() ; }
else { MakeRndSubEvents() ; }
}
//-------------------------------------------------------------
-void AliFlowEvent::MakeRndSubEvents()
+void AliFlowEvent::MakeRndSubEvents() const
{
// Make random subevents
- int eventMult[Flow::nHars][Flow::nSels] = {{0}};
+ int eventMult[AliFlowConstants::kHars][AliFlowConstants::kSels] = {{0}};
int harN, selN, subN = 0;
// loop to count the total number of tracks for each selection
{
AliFlowTrack* pFlowTrack ;
pFlowTrack = (AliFlowTrack*)TrackCollection()->At(itr) ;
- for (selN = 0; selN < Flow::nSels; selN++)
+ for (selN = 0; selN < AliFlowConstants::kSels; selN++)
{
- for (harN = 0; harN < Flow::nHars; harN++)
+ for (harN = 0; harN < AliFlowConstants::kHars; harN++)
{
if(pFlowTrack->Select(harN, selN)) { eventMult[harN][selN]++ ; }
}
}
}
// loop to set the SubEvent member
- for (selN = 0; selN < Flow::nSels; selN++)
+ for (selN = 0; selN < AliFlowConstants::kSels; selN++)
{
- for (harN = 0; harN < Flow::nHars; harN++)
+ for (harN = 0; harN < AliFlowConstants::kHars; harN++)
{
- int subEventMult = eventMult[harN][selN] / Flow::nSubs;
+ int subEventMult = eventMult[harN][selN] / AliFlowConstants::kSubs;
if (subEventMult)
{
subN = 0;
return ;
}
//-------------------------------------------------------------
-void AliFlowEvent::MakeEtaSubEvents()
+void AliFlowEvent::MakeEtaSubEvents() const
{
// Make subevents for positive and negative eta
- // (when done, fEtaSubs flag setted to kTRUE).
+ // (when done, fgEtaSubs flag setted to kTRUE).
int harN, selN = 0;
// loop to set the SubEvent member
- for (selN = 0; selN < Flow::nSels; selN++)
+ for (selN = 0; selN < AliFlowConstants::kSels; selN++)
{
- for (harN = 0; harN < Flow::nHars; harN++)
+ for (harN = 0; harN < AliFlowConstants::kHars; harN++)
{
for(Int_t itr=0;itr<TrackCollection()->GetEntries();itr++)
{
// primary, the reference carried by the reconstructed mother (in
// the v0 array) is changed accordingly.
- Int_t tot = 0 ;
- UInt_t imax = TrackCollection()->GetEntries() ;
- TRandom* rnd = new TRandom(0) ; // SetSeed(0) ;
- TObjArray* newTrackCollection = new TObjArray(imax) ;
-
- // re-arranges the ObjArray (TrackCollection())
- for(UInt_t itr=0;itr<imax;itr++)
- {
- AliFlowTrack* pFlowTrack ;
- pFlowTrack = (AliFlowTrack*)TrackCollection()->At(itr) ;
-
- UInt_t rndNumber = rnd->Integer(imax) ;
- Bool_t put = kFALSE ;
- while(!put)
- {
- if(!newTrackCollection->At(rndNumber))
- {
- newTrackCollection->AddAt(pFlowTrack, rndNumber) ;
- put = kTRUE ; tot++ ; if(Flow::fDebug) { cout << " " << itr << " --> " << rndNumber << endl ; }
- }
- else
- {
- rndNumber++ ; if(rndNumber>=imax) { rndNumber -= imax ; }
- }
- }
- }
- if(Flow::fDebug) { cout << "* RandomShuffle() : " << tot << "/" << imax << " flow tracks have been shuffled " << endl ; }
- fTrackCollection = newTrackCollection ;
+ return ; // ...at the moment is disabled ... //
+
+// Int_t tot = 0 ;
+// UInt_t imax = fTrackCollection->GetEntries() ;
+// TRandom* rnd = new TRandom(0) ; // SetSeed(0) ;
+// TClonesArray* newTrackCollection = new TClonesArray("AliFlowTrack",imax) ;
+//
+// // re-arranges the ObjArray (TrackCollection())
+// for(UInt_t itr=0;itr<imax;itr++)
+// {
+// AliFlowTrack* pFlowTrack ;
+// pFlowTrack = (AliFlowTrack*)TrackCollection()->At(itr) ;
+//
+// UInt_t rndNumber = rnd->Integer(imax) ;
+// Bool_t put = kFALSE ;
+// while(!put)
+// {
+// if(!newTrackCollection->AddrAt(rndNumber))
+// {
+// ... new(newTrackCollection[rndNumber]) AliFlowTrack(*pFlowTrack) ;
+// put = kTRUE ; tot++ ;
+// if(AliFlowConstants::fgDebug) { cout << " " << itr << " --> " << rndNumber << endl ; }
+// }
+// else
+// {
+// rndNumber++ ; if(rndNumber>=imax) { rndNumber -= imax ; }
+// }
+// }
+// }
+// if(AliFlowConstants::fgDebug) { cout << "* RandomShuffle() : " << tot << "/" << imax << " flow tracks have been shuffled " << endl ; }
+// fTrackCollection = newTrackCollection ;
}
//-----------------------------------------------------------------------
UInt_t AliFlowEvent::Centrality()
return fCentrality ;
}
//-----------------------------------------------------------------------
-void AliFlowEvent::SetCentrality(Int_t cent)
-{
- // Set the Centrality Classes to "cent" .
-
- fCentrality = cent ;
-}
-//-----------------------------------------------------------------------
void AliFlowEvent::SetCentrality()
{
// Sets the Centrality Classes basing on Multiplicity at mid rapidity,
if(RunID() == -1)
{
- cent = Flow::fCentNorm ;
+ cent = AliFlowConstants::fgCentNorm ;
//if centrality classes are not defined, does it now (with CentNorm & MaxMult)
- if(cent[Flow::nCents-1] <= 1)
+ if(cent[AliFlowConstants::kCents-1] <= 1)
{
- for(Int_t ic=0;ic<Flow::nCents;ic++)
+ for(Int_t ic=0;ic<AliFlowConstants::kCents;ic++)
{
- cent[ic] *= Flow::fMaxMult ;
- if(Flow::fDebug) { cout << "Centrality[" << ic << "] = " << cent[ic] << " . " << endl ; }
+ cent[ic] *= AliFlowConstants::fgMaxMult ;
+ if(AliFlowConstants::fgDebug) { cout << "Centrality[" << ic << "] = " << cent[ic] << " . " << endl ; }
}
}
}
else if((RunID() != -1) && (CenterOfMassEnergy() == 5500.))
{
- cent = (Float_t*)Flow::fCent0 ;
+ cent = (Float_t*)AliFlowConstants::fgCent0 ;
}
- else // other definition of centrality are possible...
+ else // other definition of centrality are possible ...
{
- cent = (Float_t*)Flow::fCent0 ;
+ cent = (Float_t*)AliFlowConstants::fgCent0 ;
}
if (tracks < cent[0]) { fCentrality = 0; }
else if (tracks < cent[1]) { fCentrality = 1; }
else if (tracks < cent[8]) { fCentrality = 8; }
else { fCentrality = 9; }
- if(Flow::fDebug) { cout << " * Centrality Class : " << fCentrality << " . " << endl ; }
-}
-//-----------------------------------------------------------------------
-void AliFlowEvent::Bayesian(Double_t bayes[Flow::nPid])
-{
- // Returns bayesian array of particles' abundances (from Flow::)
-
- for(Int_t i=0;i<Flow::nPid;i++) { bayes[i] = Flow::fBayesian[i] ; }
+ if(AliFlowConstants::fgDebug) { cout << " * Centrality Class : " << fCentrality << " . " << endl ; }
}
//-----------------------------------------------------------------------
-TVector AliFlowEvent::Bayesian()
+TVector AliFlowEvent::Bayesian() const
{
- TVector bayes(Flow::nPid) ;
- for(Int_t i=0;i<Flow::nPid;i++) { bayes[i] = Flow::fBayesian[i] ; }
+ // Returns bayesian array of particle abundances (from AliFlowConstants::)
+
+ TVector bayes(AliFlowConstants::kPid) ;
+ for(Int_t i=0;i<AliFlowConstants::kPid;i++) { bayes[i] = AliFlowConstants::fgBayesian[i] ; }
return bayes ;
}
//-----------------------------------------------------------------------
if(PtWgt())
{
cout << "# PtWgt = kTRUE " << endl ; // (also for output of PhiWgt file?)
- cout << "# PtWgt Saturation = " << Flow::fPtWgtSaturation << endl;
+ cout << "# PtWgt Saturation = " << AliFlowConstants::fgPtWgtSaturation << endl;
}
else
{
cout << "#######################################################" << endl;
}
//-----------------------------------------------------------------------
-void AliFlowEvent::SetEventID(const Int_t& id)
-{
- // Sets Event ID and the Event name (name = evtNumber_runId)
-
- fEventID = id ;
- TString name = "" ;
- name += fEventID ;
- if(fRunID) { name += "_" ; name += fRunID ; }
- SetName(name) ; // from TNamed::SetName
-}
-//-----------------------------------------------------------------------
-Int_t AliFlowEvent::MultEta()
+Int_t AliFlowEvent::MultEta() const
{
- // Returns the multiplicity in the interval |eta|<(Flow::fEetaMid), used
+ // Returns the multiplicity in the interval |eta|<(AliFlowConstants::fgEetaMid), used
// for centrality measurement (see centrality classes in fCentrality) .
Int_t goodtracks = 0 ;
{
AliFlowTrack* pFlowTrack ;
pFlowTrack = (AliFlowTrack*)TrackCollection()->At(itr) ;
- if((pFlowTrack->Charge()) && (TMath::Abs(pFlowTrack->Eta())<Flow::fEtaMid)) { goodtracks++ ; }
+ if((pFlowTrack->Charge()) && (TMath::Abs(pFlowTrack->Eta())<AliFlowConstants::fgEtaMid)) { goodtracks++ ; }
}
return goodtracks ;
}
Int_t AliFlowEvent::UncorrNegMult(Float_t eta) const
{
// Negative multiplicity in the interval (-eta..eta)
- // (default is Flow::fEetaGood = 0.9)
+ // (default is AliFlowConstants::fgEetaGood = 0.9)
Int_t negMult = 0 ;
for(Int_t itr=0;itr<TrackCollection()->GetEntries();itr++)
Int_t AliFlowEvent::UncorrPosMult(Float_t eta) const
{
// Positive multiplicity in the interval (-eta..eta)
- // (default is Flow::fEetaGood = 0.9)
+ // (default is AliFlowConstants::fgEetaGood = 0.9)
Int_t posMult = 0 ;
for(Int_t itr=0;itr<TrackCollection()->GetEntries();itr++)
return posMult;
}
//-----------------------------------------------------------------------
-void AliFlowEvent::VertexPos(Float_t vtx[3]) const
-{
- for(Int_t ii=0;ii<3;ii++) { vtx[ii] = fVertexPos[ii] ; }
-}
-//-----------------------------------------------------------------------
TVector3 AliFlowEvent::VertexPos() const
{
+ // Returns primary vertex position as a TVector3
+
Float_t vertex[3] ;
VertexPos(vertex) ;
return TVector3(vertex) ;
}
//-----------------------------------------------------------------------
-void AliFlowEvent::SetVertexPos(Float_t v1,Float_t v2,Float_t v3)
-{
- fVertexPos[0] = v1 ; fVertexPos[1] = v2 ; fVertexPos[2] = v3 ;
-}
-//-----------------------------------------------------------------------
void AliFlowEvent::MakeAll()
{
- // calculates all quantities in 1 shoot ...
- // ...
+ // calculates all quantities in 1 shoot
- Double_t mQx[Flow::nSels][Flow::nHars] ;
- Double_t mQy[Flow::nSels][Flow::nHars] ;
- Double_t mQxSub[Flow::nSubs][Flow::nSels][Flow::nHars] ;
- Double_t mQySub[Flow::nSubs][Flow::nSels][Flow::nHars] ;
+ Double_t mQx[AliFlowConstants::kSels][AliFlowConstants::kHars] ;
+ Double_t mQy[AliFlowConstants::kSels][AliFlowConstants::kHars] ;
+ Double_t mQxSub[AliFlowConstants::kSubs][AliFlowConstants::kSels][AliFlowConstants::kHars] ;
+ Double_t mQySub[AliFlowConstants::kSubs][AliFlowConstants::kSels][AliFlowConstants::kHars] ;
// -
int selN, harN, subN ;
- for(selN=0;selN<Flow::nSels;selN++)
+ for(selN=0;selN<AliFlowConstants::kSels;selN++)
{
- for(harN=0;harN<Flow::nHars;harN++)
+ for(harN=0;harN<AliFlowConstants::kHars;harN++)
{
mQx[selN][harN] = 0. ;
mQy[selN][harN] = 0. ;
fMult[selN][harN] = 0 ;
fSumOfWeightSqr[selN][harN] = 0. ;
- for(subN=0;subN<Flow::nSubs;subN++)
+ for(subN=0;subN<AliFlowConstants::kSubs;subN++)
{
mQxSub[subN][selN][harN] = 0. ;
mQySub[subN][selN][harN] = 0. ;
AliFlowTrack* pFlowTrack ;
pFlowTrack = (AliFlowTrack*)TrackCollection()->At(itr) ;
phi = pFlowTrack->Phi();
- for(selN=0;selN<Flow::nSels;selN++)
+ for(selN=0;selN<AliFlowConstants::kSels;selN++)
{
- for(harN=0;harN<Flow::nHars;harN++)
+ for(harN=0;harN<AliFlowConstants::kHars;harN++)
{
order = (double)(harN+1) ;
if(pFlowTrack->Select(harN,selN))
mQx[selN][harN] += phiWgt * cos(phi * order) ;
mQy[selN][harN] += phiWgt * sin(phi * order) ;
fMult[selN][harN]++ ;
- for(subN=0;subN<Flow::nSubs;subN++)
+ for(subN=0;subN<AliFlowConstants::kSubs;subN++)
{
if(pFlowTrack->Select(harN,selN,subN))
{
} // sel
} //itr
- for(selN=0;selN<Flow::nSels;selN++)
+ for(selN=0;selN<AliFlowConstants::kSels;selN++)
{
- for(harN=0;harN<Flow::nHars;harN++)
+ for(harN=0;harN<AliFlowConstants::kHars;harN++)
{
fQ[selN][harN].Set(mQx[selN][harN],mQy[selN][harN]) ;
- for(subN=0;subN<Flow::nSubs;subN++) { fQSub[subN][selN][harN].Set(mQxSub[subN][selN][harN],mQySub[subN][selN][harN]) ; }
+ for(subN=0;subN<AliFlowConstants::kSubs;subN++) { fQSub[subN][selN][harN].Set(mQxSub[subN][selN][harN],mQySub[subN][selN][harN]) ; }
}
}
fDone = kTRUE ;
}
-// //-----------------------------------------------------------------------
-// Float_t AliFlowEvent::ExtPsi(Int_t harN) const
-// {
-// // external R.P. angle (check input source...)
-//
-// if(harN<Flow::nHars) { return fExtPsi[harN] ; }
-// else
-// {
-// cout << "AliFlowEvent::ExtPsi(" << harN << ") : harmonic " << harN+1 << " is not there !" << endl ;
-// return 0. ;
-// }
-// }
-// //-----------------------------------------------------------------------
-// Float_t AliFlowEvent::ExtRes(Int_t harN) const
-// {
-// // external R.P. resolution (check input source...)
-//
-// if(harN<Flow::nHars) { return fExtRes[harN] ; }
-// else
-// {
-// cout << "AliFlowEvent::ExtRes(" << harN << ") : harmonic " << harN+1 << " is not there !" << endl ;
-// return 0. ;
-// }
-// }
-// //-----------------------------------------------------------------------
-// void AliFlowEvent::SetExtPsi(Int_t harN,Float_t psi)
-// {
-// if(harN<Flow::nHars) { fExtPsi[harN] = psi ; }
-// }
-// //-----------------------------------------------------------------------
-// void AliFlowEvent::SetExtRes(Int_t harN,Float_t res)
-// {
-// if(harN<Flow::nHars) { fExtRes[harN] = res ; }
-// }
-// //-----------------------------------------------------------------------
-
-
-
-//-----------------------------------------------------------------------
-// - those will go into the .h as inline functions .....................
-//-----------------------------------------------------------------------
-TObjArray* AliFlowEvent::TrackCollection() const { return fTrackCollection; }
-TObjArray* AliFlowEvent::V0Collection() const { return fV0Collection; }
-//-----------------------------------------------------------------------
-Int_t AliFlowEvent::EventID() const { return fEventID; }
-Int_t AliFlowEvent::RunID() const { return fRunID; }
-Double_t AliFlowEvent::CenterOfMassEnergy() const { return Flow::fCenterOfMassEnergy ; }
-Double_t AliFlowEvent::MagneticField() const { return Flow::fMagneticField ; }
-Short_t AliFlowEvent::BeamMassNumberEast() const { return Flow::fBeamMassNumberEast ; }
-Short_t AliFlowEvent::BeamMassNumberWest() const { return Flow::fBeamMassNumberWest ; }
-UInt_t AliFlowEvent::OrigMult() const { return fOrigMult; }
-Long_t AliFlowEvent::L0TriggerWord() const { return fL0TriggerWord; }
-Int_t AliFlowEvent::V0Mult() const { return V0Collection()->GetEntries() ; }
-Int_t AliFlowEvent::FlowEventMult() const { return TrackCollection()->GetEntries() ; }
-Int_t AliFlowEvent::ZDCpart() const { return fZDCpart; }
-Float_t AliFlowEvent::ZDCenergy(Int_t npem) const { return fZDCenergy[npem]; }
-Float_t AliFlowEvent::PtWgtSaturation() const { return Flow::fPtWgtSaturation; }
-Bool_t AliFlowEvent::PtWgt() const { return fPtWgt; }
-Bool_t AliFlowEvent::EtaWgt() const { return fEtaWgt; }
-Bool_t AliFlowEvent::FirstLastPhiWgt() const { return !fOnePhiWgt ; }
-Bool_t AliFlowEvent::OnePhiWgt() const { return fOnePhiWgt ; }
-Bool_t AliFlowEvent::NoWgt() const { return fNoWgt; }
-Bool_t AliFlowEvent::EtaSubs() const { return fEtaSubs ; }
-//-----------------------------------------------------------------------
-void AliFlowEvent::SetEtaSubs(Bool_t etasub) { fEtaSubs = etasub ; }
-void AliFlowEvent::SetRunID(const Int_t& id) { fRunID = id; }
-void AliFlowEvent::SetMagneticField(const Double_t& mf) { Flow::fMagneticField = mf; }
-void AliFlowEvent::SetCenterOfMassEnergy(const Double_t& cms) { Flow::fCenterOfMassEnergy = cms; }
-void AliFlowEvent::SetBeamMassNumberEast(const Short_t& bme) { Flow::fBeamMassNumberEast = bme; }
-void AliFlowEvent::SetBeamMassNumberWest(const Short_t& bmw) { Flow::fBeamMassNumberWest = bmw; }
-void AliFlowEvent::SetOrigMult(const UInt_t& tracks) { fOrigMult = tracks; }
-void AliFlowEvent::SetL0TriggerWord(const Long_t& trigger) { fL0TriggerWord = trigger; }
-void AliFlowEvent::SetZDCpart(Int_t zdcp) { fZDCpart = zdcp ; }
-void AliFlowEvent::SetZDCenergy(Float_t n, Float_t p, Float_t em) { fZDCenergy[0] = n ; fZDCenergy[1] = p ; fZDCenergy[2] = em ; }
-//-----------------------------------------------------------------------
-void AliFlowEvent::SetBayesian(Double_t bayes[Flow::nPid])
-{
- for(Int_t i=0;i<Flow::nPid;i++) { Flow::fBayesian[i] = bayes[i] ; }
-}
-//-----------------------------------------------------------------------
-void AliFlowEvent::SetNoWgt(Bool_t nowgt)
-{
- // Sets no phi weightening, but Wgt = 1*sign(Eta) for odd harmonics .
-
- fNoWgt = nowgt ; // cout << " Wgt = +1 (positive Eta) or -1 (negative Eta) . " << endl ;
-}
-//-----------------------------------------------------------------------
-void AliFlowEvent::SetOnePhiWgt() { fOnePhiWgt = kTRUE ; }
-void AliFlowEvent::SetFirstLastPhiWgt() { fOnePhiWgt = kFALSE ; }
-void AliFlowEvent::SetPtWgt(Bool_t PtWgt) { fPtWgt = PtWgt; }
-void AliFlowEvent::SetEtaWgt(Bool_t EtaWgt) { fEtaWgt = EtaWgt; }
//-----------------------------------------------------------------------
-#ifndef __CINT__
-void AliFlowEvent::SetPhiWeight(const Flow::PhiWgt_t& pPhiWgt) { memcpy (fPhiWgt, pPhiWgt, sizeof(Flow::PhiWgt_t)); }
-void AliFlowEvent::SetPhiWeightPlus(const Flow::PhiWgt_t& pPhiWgtPlus) { memcpy (fPhiWgtPlus, pPhiWgtPlus, sizeof(Flow::PhiWgt_t)); }
-void AliFlowEvent::SetPhiWeightMinus(const Flow::PhiWgt_t& pPhiWgtMinus) { memcpy (fPhiWgtMinus, pPhiWgtMinus, sizeof(Flow::PhiWgt_t)); }
-void AliFlowEvent::SetPhiWeightCross(const Flow::PhiWgt_t& pPhiWgtCross) { memcpy (fPhiWgtCross, pPhiWgtCross, sizeof(Flow::PhiWgt_t)); }
-#endif
-//-----------------------------------------------------------------------
-//////////////////////////////////////////////////////////////////////