ROOT logo
#ifndef ALIROOT_ALIFORWARDFLOWWEIGHTS
#define ALIROOT_ALIFORWARDFLOWWEIGHTS
#include <TObject.h>
class TGraph;
class TF1;
class TList;

/** 
 * Utility class to calculate flow weights 
 * 
 */
class AliForwardFlowWeights : public TObject
{
public:
  enum { 
    kEta   = 0x01,  // include eta effect 
    kPt    = 0x02,  // include pt effect
    kPID   = 0x04,  // include PID effect
    kCent  = 0x08,  // include centrality effect
    kB     = 0x10   // include impact parmaeter effect
  };
  /** 
   * Constructor 
   */
  AliForwardFlowWeights();
  /** 
   * copy constructor 
   * 
   * @param o Object to copy from 
   */
  AliForwardFlowWeights(const AliForwardFlowWeights& o);
  /** 
   * Assignment operator 
   * 
   * @param o Object to assign from 
   *
   * @return Reference to this object
   */
  AliForwardFlowWeights& operator=(const AliForwardFlowWeights& o);
  /** 
   * Destructor
   */
  virtual ~AliForwardFlowWeights();

  /** 
   * Initialize 
   * 
   * @param l List to add objects to 
   */
  virtual void Init(TList* l);
  /** 
   * @a what is a bit-wise or of 
   *
   * - kPt      Weight according to transverse momentum 
   * - kEta     Weight according to Pseudo-rapidity
   * - kPID     Weight according to particle type 
   * - kCent    Weight according to centrality 
   * - kB       Weight according to impact parameter. 
   *
   * Note, that kCent and kB are mutually exclusive 
   *
   * @a type can be one of 
   *
   * - 0  No weighting 
   *
   * - 1 Pt is weighted as mean of @f$v_2{2}@f$ and @f$v_2{4}@f$ from
   *     40-50% centrality, unity weight for p, other for @f$\pi@f$,
   *     other particles fixed, and the width of the @f$\eta@f$
   *     Gaussian is 9
   *
   * - 2 Pt is weighted by @f$v_2{2}@f$ from 40-50% centrality, fixed
   *     PID weight, and the width of the @f$\eta@f$ Gaussian is 3
   *
   * - 3 Pt is weighted by @f$v_2{4}@f$ from 30-40% centrality, unity
   *     weight for p, other for @f$\pi@f$, other particles fixed, and
   *     the width of the @f$\eta@f$ Gaussian is 15
   *
   * - 4 Pt is weighted by @f$v_2{4}@f$ from 40-50% centrality, unity
   *     weight for p, other for @f$\pi@f$, other particles fixed, and
   *     the width of the @f$\eta@f$ Gaussian is 9
   * 
   * 
   * @param eta   Pseudo-rapidity of particle (@f$\eta@f$)
   * @param pt    Transverse momentum of particle (@f$p_T@f$) in GeV
   * @param phi   Azimuthal angle of particle (@f$\phi@f$) in radians
   * @param id    Particle type of particle 
   * @param phiR  Event plane angle (@f$\phi_R@f$) in radians
   * @param bOrC  Impact paramter/Centrality of event (@f$b@f$) in fm
   * @param type  Type of flow to add 
   * @param order Order of flow weight 
   * @param what  Which effects to include
   * 
   * @return 
   */
  Double_t CalcWeight(Double_t eta, 
		      Double_t pt, 
		      Double_t phi,  
		      Int_t    id, 
		      Double_t phiR, 
		      Double_t bOrC, 
		      Int_t    type, 
		      UShort_t order,
		      UShort_t what) const;
  /** 
   * Calculate the weights 
   * 
   * @param eta  Pseudo-rapidity of particle (@f$\eta@f$)
   * @param pt   Transverse momentum of particle (@f$p_T@f$) in GeV
   * @param phi  Azimuthal angle of particle (@f$\phi@f$) in radians
   * @param id   Particle type of particle 
   * @param phiR Event plane angle (@f$\phi_R@f$) in radians
   * @param b    Impact paramter of event (@f$b@f$) in fm
   * 
   * @return 
   */
  virtual Double_t CalcWeight(Double_t eta, Double_t pt, 
			      Double_t phi, Int_t id, 
			      Double_t phiR, Double_t b) const;
  /** 
   * Construct an object from objects found in list, or null
   * 
   * @param l List to find objects in 
   * 
   * @return Newly created object, or null 
   */
  static AliForwardFlowWeights* FromList(TList* l);
protected:
  /** 
   * Calculate weight 
   * 
   * @param eta   Psuedo-rapidity 
   * @param type  Parameterization type
   * 
   * @return weight
   */
  Double_t CalcEtaWeight(Double_t eta, Int_t type) const;
  /** 
   * Calculate weight 
   * 
   * @param id    Particle (type) identifier 
   * @param type  Parameterization type
   * 
   * @return weight
   */
  Double_t CalcPidWeight(Int_t id, Int_t type) const;
  /** 
   * Calculate weight 
   * 
   * @param pt    Transverse momentum (GeV)
   * @param type  Parameterization type
   * 
   * @return weight
   */
  Double_t CalcPtWeight(Double_t pt, Int_t type) const;
  /** 
   * Calculate weight 
   * 
   * @param c Centrality
   * 
   * @return weight
   */
  Double_t CalcCentWeight(Double_t c) const;
  /** 
   * Calculate weight 
   * 
   * @param b Impact parameters (fm)
   * 
   * @return weight
   */
  Double_t CalcBWeight(Double_t b) const;

  TGraph* fV22Pt;    // Contribution from v2{2} as a function of pt
  TGraph* fV24Pt;    // Contribution from v2{4} as a function of pt
  TGraph* fV24AltPt; // Contribution from v2{4} as a function of pt
  TGraph* fV2B;      // Contribution from v2 as a function of b
  TGraph* fV2C;      // Contribution from v2 as a function of centrality
    
  ClassDef(AliForwardFlowWeights,2);
};

#endif
//
// Local Variables: 
//  mode: C++ 
// End:
//
 AliForwardFlowWeights.h:1
 AliForwardFlowWeights.h:2
 AliForwardFlowWeights.h:3
 AliForwardFlowWeights.h:4
 AliForwardFlowWeights.h:5
 AliForwardFlowWeights.h:6
 AliForwardFlowWeights.h:7
 AliForwardFlowWeights.h:8
 AliForwardFlowWeights.h:9
 AliForwardFlowWeights.h:10
 AliForwardFlowWeights.h:11
 AliForwardFlowWeights.h:12
 AliForwardFlowWeights.h:13
 AliForwardFlowWeights.h:14
 AliForwardFlowWeights.h:15
 AliForwardFlowWeights.h:16
 AliForwardFlowWeights.h:17
 AliForwardFlowWeights.h:18
 AliForwardFlowWeights.h:19
 AliForwardFlowWeights.h:20
 AliForwardFlowWeights.h:21
 AliForwardFlowWeights.h:22
 AliForwardFlowWeights.h:23
 AliForwardFlowWeights.h:24
 AliForwardFlowWeights.h:25
 AliForwardFlowWeights.h:26
 AliForwardFlowWeights.h:27
 AliForwardFlowWeights.h:28
 AliForwardFlowWeights.h:29
 AliForwardFlowWeights.h:30
 AliForwardFlowWeights.h:31
 AliForwardFlowWeights.h:32
 AliForwardFlowWeights.h:33
 AliForwardFlowWeights.h:34
 AliForwardFlowWeights.h:35
 AliForwardFlowWeights.h:36
 AliForwardFlowWeights.h:37
 AliForwardFlowWeights.h:38
 AliForwardFlowWeights.h:39
 AliForwardFlowWeights.h:40
 AliForwardFlowWeights.h:41
 AliForwardFlowWeights.h:42
 AliForwardFlowWeights.h:43
 AliForwardFlowWeights.h:44
 AliForwardFlowWeights.h:45
 AliForwardFlowWeights.h:46
 AliForwardFlowWeights.h:47
 AliForwardFlowWeights.h:48
 AliForwardFlowWeights.h:49
 AliForwardFlowWeights.h:50
 AliForwardFlowWeights.h:51
 AliForwardFlowWeights.h:52
 AliForwardFlowWeights.h:53
 AliForwardFlowWeights.h:54
 AliForwardFlowWeights.h:55
 AliForwardFlowWeights.h:56
 AliForwardFlowWeights.h:57
 AliForwardFlowWeights.h:58
 AliForwardFlowWeights.h:59
 AliForwardFlowWeights.h:60
 AliForwardFlowWeights.h:61
 AliForwardFlowWeights.h:62
 AliForwardFlowWeights.h:63
 AliForwardFlowWeights.h:64
 AliForwardFlowWeights.h:65
 AliForwardFlowWeights.h:66
 AliForwardFlowWeights.h:67
 AliForwardFlowWeights.h:68
 AliForwardFlowWeights.h:69
 AliForwardFlowWeights.h:70
 AliForwardFlowWeights.h:71
 AliForwardFlowWeights.h:72
 AliForwardFlowWeights.h:73
 AliForwardFlowWeights.h:74
 AliForwardFlowWeights.h:75
 AliForwardFlowWeights.h:76
 AliForwardFlowWeights.h:77
 AliForwardFlowWeights.h:78
 AliForwardFlowWeights.h:79
 AliForwardFlowWeights.h:80
 AliForwardFlowWeights.h:81
 AliForwardFlowWeights.h:82
 AliForwardFlowWeights.h:83
 AliForwardFlowWeights.h:84
 AliForwardFlowWeights.h:85
 AliForwardFlowWeights.h:86
 AliForwardFlowWeights.h:87
 AliForwardFlowWeights.h:88
 AliForwardFlowWeights.h:89
 AliForwardFlowWeights.h:90
 AliForwardFlowWeights.h:91
 AliForwardFlowWeights.h:92
 AliForwardFlowWeights.h:93
 AliForwardFlowWeights.h:94
 AliForwardFlowWeights.h:95
 AliForwardFlowWeights.h:96
 AliForwardFlowWeights.h:97
 AliForwardFlowWeights.h:98
 AliForwardFlowWeights.h:99
 AliForwardFlowWeights.h:100
 AliForwardFlowWeights.h:101
 AliForwardFlowWeights.h:102
 AliForwardFlowWeights.h:103
 AliForwardFlowWeights.h:104
 AliForwardFlowWeights.h:105
 AliForwardFlowWeights.h:106
 AliForwardFlowWeights.h:107
 AliForwardFlowWeights.h:108
 AliForwardFlowWeights.h:109
 AliForwardFlowWeights.h:110
 AliForwardFlowWeights.h:111
 AliForwardFlowWeights.h:112
 AliForwardFlowWeights.h:113
 AliForwardFlowWeights.h:114
 AliForwardFlowWeights.h:115
 AliForwardFlowWeights.h:116
 AliForwardFlowWeights.h:117
 AliForwardFlowWeights.h:118
 AliForwardFlowWeights.h:119
 AliForwardFlowWeights.h:120
 AliForwardFlowWeights.h:121
 AliForwardFlowWeights.h:122
 AliForwardFlowWeights.h:123
 AliForwardFlowWeights.h:124
 AliForwardFlowWeights.h:125
 AliForwardFlowWeights.h:126
 AliForwardFlowWeights.h:127
 AliForwardFlowWeights.h:128
 AliForwardFlowWeights.h:129
 AliForwardFlowWeights.h:130
 AliForwardFlowWeights.h:131
 AliForwardFlowWeights.h:132
 AliForwardFlowWeights.h:133
 AliForwardFlowWeights.h:134
 AliForwardFlowWeights.h:135
 AliForwardFlowWeights.h:136
 AliForwardFlowWeights.h:137
 AliForwardFlowWeights.h:138
 AliForwardFlowWeights.h:139
 AliForwardFlowWeights.h:140
 AliForwardFlowWeights.h:141
 AliForwardFlowWeights.h:142
 AliForwardFlowWeights.h:143
 AliForwardFlowWeights.h:144
 AliForwardFlowWeights.h:145
 AliForwardFlowWeights.h:146
 AliForwardFlowWeights.h:147
 AliForwardFlowWeights.h:148
 AliForwardFlowWeights.h:149
 AliForwardFlowWeights.h:150
 AliForwardFlowWeights.h:151
 AliForwardFlowWeights.h:152
 AliForwardFlowWeights.h:153
 AliForwardFlowWeights.h:154
 AliForwardFlowWeights.h:155
 AliForwardFlowWeights.h:156
 AliForwardFlowWeights.h:157
 AliForwardFlowWeights.h:158
 AliForwardFlowWeights.h:159
 AliForwardFlowWeights.h:160
 AliForwardFlowWeights.h:161
 AliForwardFlowWeights.h:162
 AliForwardFlowWeights.h:163
 AliForwardFlowWeights.h:164
 AliForwardFlowWeights.h:165
 AliForwardFlowWeights.h:166
 AliForwardFlowWeights.h:167
 AliForwardFlowWeights.h:168
 AliForwardFlowWeights.h:169
 AliForwardFlowWeights.h:170
 AliForwardFlowWeights.h:171
 AliForwardFlowWeights.h:172
 AliForwardFlowWeights.h:173
 AliForwardFlowWeights.h:174
 AliForwardFlowWeights.h:175
 AliForwardFlowWeights.h:176
 AliForwardFlowWeights.h:177
 AliForwardFlowWeights.h:178
 AliForwardFlowWeights.h:179
 AliForwardFlowWeights.h:180
 AliForwardFlowWeights.h:181
 AliForwardFlowWeights.h:182
 AliForwardFlowWeights.h:183
 AliForwardFlowWeights.h:184
 AliForwardFlowWeights.h:185
 AliForwardFlowWeights.h:186