#ifndef ALIFLOWEVENTSIMPLE_H
#define ALIFLOWEVENTSIMPLE_H
#include "TObject.h"
#include "TParameter.h"
#include "TMath.h"
class TTree;
class TF1;
class AliFlowVector;
class AliFlowTrackSimple;
class AliFlowTrackSimpleCuts;
class AliFlowEventSimple: public TObject {
public:
enum ConstructionMethod {kEmpty,kGenerate};
AliFlowEventSimple();
AliFlowEventSimple( Int_t nParticles,
ConstructionMethod m=kEmpty,
TF1* ptDist=NULL,
Double_t phiMin=0.0,
Double_t phiMax=TMath::TwoPi(),
Double_t etaMin=-1.0,
Double_t etaMax= 1.0 );
AliFlowEventSimple(TTree* anInput, const AliFlowTrackSimpleCuts* rpCuts, const AliFlowTrackSimpleCuts* poiCuts);
AliFlowEventSimple(const AliFlowEventSimple& anEvent);
AliFlowEventSimple& operator=(const AliFlowEventSimple& anEvent);
virtual ~AliFlowEventSimple();
Bool_t IsFolder() const {return kTRUE;};
void Browse(TBrowser *b);
void Print(Option_t* option = "") const;
Int_t NumberOfTracks() const { return fNumberOfTracks; }
Int_t GetReferenceMultiplicity() const { return fReferenceMultiplicity; }
void SetReferenceMultiplicity( Int_t m ) { fReferenceMultiplicity = m; }
Int_t GetEventNSelTracksRP() const { return GetNumberOfPOIs(0); }
void SetEventNSelTracksRP(Int_t nr) { SetNumberOfPOIs(nr,0); }
Int_t GetEventNSelTracksPOI() const { return GetNumberOfPOIs(1); }
void SetEventNSelTracksPOI(Int_t np) { SetNumberOfPOIs(np,1); }
Int_t GetNumberOfRPs() const { return GetNumberOfPOIs(0); }
void SetNumberOfRPs( Int_t nr ) { SetNumberOfPOIs(nr,0); }
Int_t GetNumberOfPOIs(Int_t i=1) const { return (i<fNumberOfPOItypes)?fNumberOfPOIs[i]:0; }
void SetNumberOfPOIs( Int_t nubmerOfPOIs, Int_t poiType=1 );
void IncrementNumberOfPOIs(Int_t poiType=1);
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; }
void SetAfterBurnerPrecision(Double_t p) { fAfterBurnerPrecision=p; }
Double_t GetAfterBurnerPrecision() const { return fAfterBurnerPrecision; }
void SetUserModified(Bool_t s=kTRUE) { fUserModified=s; }
Bool_t IsUserModified() const { return fUserModified; }
void SetShuffleTracks(Bool_t b) {fShuffleTracks=b;}
void ShuffleTracks();
void ResolutionPt(Double_t res);
void TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, Double_t etaMinB, Double_t etaMaxB );
void TagSubeventsByCharge();
void TagRP(const AliFlowTrackSimpleCuts* cuts );
void TagPOI(const AliFlowTrackSimpleCuts* cuts, Int_t poiType=1);
void TagTracks(const AliFlowTrackSimpleCuts* cutsRP, const AliFlowTrackSimpleCuts* cutsPOI);
void CloneTracks(Int_t n);
void AddV1( Double_t v1 );
void AddV2( Double_t v2 );
void AddV3( Double_t v3 );
void AddV4( Double_t v4 );
void AddV5( Double_t v5 );
void AddFlow( Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5 );
void AddFlow(Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5,
Double_t rp1, Double_t rp2, Double_t rp3, Double_t rp4, Double_t rp5 );
void AddV2( TF1* ptDepV2 );
void DefineDeadZone( Double_t etaMin, Double_t etaMax, Double_t phiMin, Double_t phiMax );
Int_t CleanUpDeadTracks();
virtual void ClearFast();
static TF1* SimplePtSpectrum();
static TF1* SimplePtDepV2();
AliFlowTrackSimple* GetTrack(Int_t i);
void AddTrack( AliFlowTrackSimple* track );
void TrackAdded();
AliFlowTrackSimple* MakeNewTrack();
virtual AliFlowVector GetQ(Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);
virtual void Get2Qsub(AliFlowVector* Qarray, Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);
void SetCentrality(Double_t c) {fCentrality=c;}
Double_t GetCentrality() const {return fCentrality;}
protected:
virtual void Generate( Int_t nParticles,
TF1* ptDist=NULL,
Double_t phiMin=0.0,
Double_t phiMax=TMath::TwoPi(),
Double_t etaMin=-1.0,
Double_t etaMax= 1.0 );
TObjArray* fTrackCollection;
Int_t fReferenceMultiplicity;
Int_t fNumberOfTracks;
Bool_t fUseGlauberMCSymmetryPlanes;
Bool_t fUseExternalSymmetryPlanes;
Double_t fPsi1;
Double_t fPsi2;
Double_t fPsi3;
Double_t fPsi4;
Double_t fPsi5;
TF1* fPsi1Psi3;
TF1* fPsi2Psi4;
TF1* fPsi3Psi5;
Double_t fMCReactionPlaneAngle;
Bool_t fMCReactionPlaneAngleIsSet;
Double_t fAfterBurnerPrecision;
Bool_t fUserModified;
TParameter<Int_t>* fNumberOfTracksWrap;
TParameter<Int_t>* fNumberOfRPsWrap;
TParameter<Int_t>* fNumberOfPOIsWrap;
TParameter<Double_t>* fMCReactionPlaneAngleWrap;
Int_t* fShuffledIndexes;
Bool_t fShuffleTracks;
TObjArray* fMothersCollection;
Double_t fCentrality;
private:
Int_t fNumberOfPOItypes;
Int_t* fNumberOfPOIs;
ClassDef(AliFlowEventSimple,1)
};
#endif