ROOT logo
#ifndef ALIFLOWVZERORESULTS_H
#define ALIFLOWVZERORESULTS_H


/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id: AliFlowVZEROResults.h 49869 2011-05-18 04:49:51Z fnoferin $ */

/////////////////////////////////////////////////
//                                             //
//         output v2-VZERO Class               //
//           noferini@bo.infn.it               //
/////////////////////////////////////////////////

#include "TProfile.h"
#include "TClonesArray.h"
#include "TArrayI.h"
#include "TArrayF.h"

class AliFlowVZEROResults : public TNamed
{
 public:
  AliFlowVZEROResults(const char *name,const Int_t nvar,const Int_t* binVar);
  AliFlowVZEROResults();
  ~AliFlowVZEROResults();
  AliFlowVZEROResults(const AliFlowVZEROResults &old);
  AliFlowVZEROResults& operator=(const AliFlowVZEROResults &source);

  Int_t GetNhistos() const {return fV2->GetEntries();};
  Int_t GetNspecies() const;
  TProfile *GetV2(Int_t histo) const {return ((TProfile *) fV2->At(histo));};
  TProfile *GetV2(Int_t species,Float_t x[]) const;
  TProfile *GetV2(Int_t species,Float_t xMin[],Float_t xMax[]) const;
  TProfile *GetV2reweight(Int_t species,Float_t xMin[],Float_t xMax[],Int_t varRW,Float_t rw[]) const;
  void DirectFill(Int_t histo,Float_t pt,Float_t v2){GetV2(histo)->Fill(pt,v2);};
  void Fill(Int_t species,Float_t pt,Float_t v2,Float_t x[]);

  void AddSpecies(const char *name,Int_t nXbin,const Double_t *bin);

  const char *GetSpeciesName(Int_t species){if(species < GetNspecies()) return GetV2(species*GetNhistos()/GetNspecies())->GetName();else return "";};

  Int_t Add(const AliFlowVZEROResults *oth);

  Int_t GetNvar() const {return fNbinVar->GetSize();};
  Int_t GetNbinVar(Int_t ivar) const {return (*fNbinVar)[ivar];};

  void SetVarRange(Int_t ivar,Float_t xMin,Float_t xMax);
  void SetVarName(Int_t ivar,const char *name){TNamed *atemp = (TNamed *) fNameVar->At(ivar); atemp->SetName(name);};

  Float_t GetXmin(Int_t ivar) const {return (*fXmin)[ivar];};
  Float_t GetXmax(Int_t ivar) const {return (*fXmax)[ivar];};
  const char *GetVarName(Int_t ivar) const {TNamed *atemp = (TNamed *) fNameVar->At(ivar); return atemp->GetName();};

  Int_t GetBin(Int_t ivar,Float_t x) const {return Int_t((x-(*fXmin)[ivar])/((*fXmax)[ivar]-(*fXmin)[ivar])*(*fNbinVar)[ivar]);};

  Long64_t Merge(TCollection* list);

  void Reset();

 private:
  TArrayI *fNbinVar;
  TArrayF *fXmin,*fXmax;
  TClonesArray *fNameVar;

  TClonesArray *fV2;


  ClassDef(AliFlowVZEROResults,1)  // v2 vzero outuput object
};
#endif


 AliFlowVZEROResults.h:1
 AliFlowVZEROResults.h:2
 AliFlowVZEROResults.h:3
 AliFlowVZEROResults.h:4
 AliFlowVZEROResults.h:5
 AliFlowVZEROResults.h:6
 AliFlowVZEROResults.h:7
 AliFlowVZEROResults.h:8
 AliFlowVZEROResults.h:9
 AliFlowVZEROResults.h:10
 AliFlowVZEROResults.h:11
 AliFlowVZEROResults.h:12
 AliFlowVZEROResults.h:13
 AliFlowVZEROResults.h:14
 AliFlowVZEROResults.h:15
 AliFlowVZEROResults.h:16
 AliFlowVZEROResults.h:17
 AliFlowVZEROResults.h:18
 AliFlowVZEROResults.h:19
 AliFlowVZEROResults.h:20
 AliFlowVZEROResults.h:21
 AliFlowVZEROResults.h:22
 AliFlowVZEROResults.h:23
 AliFlowVZEROResults.h:24
 AliFlowVZEROResults.h:25
 AliFlowVZEROResults.h:26
 AliFlowVZEROResults.h:27
 AliFlowVZEROResults.h:28
 AliFlowVZEROResults.h:29
 AliFlowVZEROResults.h:30
 AliFlowVZEROResults.h:31
 AliFlowVZEROResults.h:32
 AliFlowVZEROResults.h:33
 AliFlowVZEROResults.h:34
 AliFlowVZEROResults.h:35
 AliFlowVZEROResults.h:36
 AliFlowVZEROResults.h:37
 AliFlowVZEROResults.h:38
 AliFlowVZEROResults.h:39
 AliFlowVZEROResults.h:40
 AliFlowVZEROResults.h:41
 AliFlowVZEROResults.h:42
 AliFlowVZEROResults.h:43
 AliFlowVZEROResults.h:44
 AliFlowVZEROResults.h:45
 AliFlowVZEROResults.h:46
 AliFlowVZEROResults.h:47
 AliFlowVZEROResults.h:48
 AliFlowVZEROResults.h:49
 AliFlowVZEROResults.h:50
 AliFlowVZEROResults.h:51
 AliFlowVZEROResults.h:52
 AliFlowVZEROResults.h:53
 AliFlowVZEROResults.h:54
 AliFlowVZEROResults.h:55
 AliFlowVZEROResults.h:56
 AliFlowVZEROResults.h:57
 AliFlowVZEROResults.h:58
 AliFlowVZEROResults.h:59
 AliFlowVZEROResults.h:60
 AliFlowVZEROResults.h:61
 AliFlowVZEROResults.h:62
 AliFlowVZEROResults.h:63
 AliFlowVZEROResults.h:64
 AliFlowVZEROResults.h:65
 AliFlowVZEROResults.h:66
 AliFlowVZEROResults.h:67
 AliFlowVZEROResults.h:68
 AliFlowVZEROResults.h:69
 AliFlowVZEROResults.h:70
 AliFlowVZEROResults.h:71
 AliFlowVZEROResults.h:72
 AliFlowVZEROResults.h:73