ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

/*****************************************************************
  AliFlowEvent: Event container for flow analysis

  origin:   Mikolaj Krzewicki  (mikolaj.krzewicki@cern.ch)
  mods:     Redmer A. Bertens (rbertens@cern.ch)
*****************************************************************/

#include "Riostream.h"
#include "TFile.h"
#include "TList.h"
#include "TH1.h"
#include "TH2F.h"
#include "TArrayD.h"
#include "TProfile.h"
#include "AliMCEvent.h"
#include "AliMCParticle.h"
#include "AliCFManager.h"
#include "AliESDtrack.h"
#include "AliESDPmdTrack.h"
#include "AliESDEvent.h"
#include "AliAODEvent.h"
#include "AliOADBContainer.h"
#include "AliGenCocktailEventHeader.h"
#include "AliGenEposEventHeader.h"
#include "AliGenHijingEventHeader.h"
#include "AliGenGeVSimEventHeader.h"
#include "AliCollisionGeometry.h"
#include "AliMultiplicity.h"
#include "AliFlowTrackCuts.h"
#include "AliFlowEventSimple.h"
#include "AliFlowTrack.h"
#include "AliFlowVector.h"
#include "AliFlowEvent.h"
#include "AliLog.h"

using std::endl;
using std::cout;
ClassImp(AliFlowEvent)

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent():
  AliFlowEventSimple(), fApplyRecentering(-1), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }
  //ctor
  cout << "AliFlowEvent: Default constructor to be used only by root for io" << endl;
}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent(Int_t n):
  AliFlowEventSimple(n), fApplyRecentering(-1), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }
}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent(const AliFlowEvent& event):
  AliFlowEventSimple(event), fApplyRecentering(event.fApplyRecentering), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
  // copy constructor 
  for(Int_t i(0); i < 9; i++) {
      for(Int_t j(0); j < 2; j++) {
          for(Int_t k(0); k < 2; k++) {
              fMeanQ[i][j][k] = 0.; 
              fWidthQ[i][j][k] = 0.;  
              fMeanQv3[i][j][k] = 0.; 
              fWidthQv3[i][j][k] = 0.;
          }
      }
  }
}

//-----------------------------------------------------------------------
AliFlowEvent& AliFlowEvent::operator=(const AliFlowEvent& event)
{
  //assignment operator
  if (&event==this) return *this;       // check self-assignment

  fApplyRecentering = event.fApplyRecentering; 
  fCachedRun = event.fCachedRun; 
  fVZEROcentralityBin = event.fVZEROcentralityBin;
  fEvent = 0x0; // should never be copied
  fChi2A = 0x0; // do not clone these; if 0x0 they will be retrieved from the rp cuts object
  fChi2C = 0x0;
  fChi3A = 0x0;
  fChi3C = 0x0;
  for(Int_t i(0); i < 9; i++) {
      for(Int_t j(0); j < 2; j++) {
          for(Int_t k(0); k < 2; k++) {
              fMeanQ[i][j][k] = event.fMeanQ[i][j][k]; 
              fWidthQ[i][j][k] = event.fWidthQ[i][j][k];  
              fMeanQv3[i][j][k] = event.fMeanQv3[i][j][k]; 
              fWidthQv3[i][j][k] = event.fWidthQv3[i][j][k];
          }
      }
  }
  AliFlowEventSimple::operator=(event);
  return *this;
}
//-----------------------------------------------------------------------
AliFlowTrack* AliFlowEvent::GetTrack(Int_t i)
{
  //get track i from collection
  if (i>=fNumberOfTracks) return NULL;
  AliFlowTrack* pTrack = static_cast<AliFlowTrack*>(fTrackCollection->At(i)) ;
  return pTrack;
}

//-----------------------------------------------------------------------
void AliFlowEvent::SetMCReactionPlaneAngle(const AliMCEvent* mcEvent)
{
  //sets the event plane angle from the proper header in the MC

  //COCKTAIL with HIJING
  if (!strcmp(mcEvent-> GenEventHeader()->GetName(),"Cocktail Header"))   //returns 0 if matches
  {
    AliGenCocktailEventHeader *headerC = dynamic_cast<AliGenCocktailEventHeader *> (mcEvent-> GenEventHeader());
    if (headerC)
    {
      TList *lhd = headerC->GetHeaders();
      if (lhd)
      {
        AliGenHijingEventHeader *hdh = dynamic_cast<AliGenHijingEventHeader *> (lhd->At(0));
        if (hdh) AliFlowEventSimple::SetMCReactionPlaneAngle( hdh->ReactionPlaneAngle() );
      }
    }
  }
  //THERMINATOR
  else if (!strcmp(mcEvent-> GenEventHeader()->GetName(),"Therminator"))   //returns 0 if matches
  {
    AliGenHijingEventHeader* headerH = dynamic_cast<AliGenHijingEventHeader*>(mcEvent->GenEventHeader());
    if (headerH) AliFlowEventSimple::SetMCReactionPlaneAngle( headerH->ReactionPlaneAngle() );
  }
  //GEVSIM
  else if (!strcmp(mcEvent-> GenEventHeader()->GetName(),"GeVSim header"))   //returns 0 if matches
  {
    AliGenGeVSimEventHeader* headerG = dynamic_cast<AliGenGeVSimEventHeader*>(mcEvent->GenEventHeader());
    if (headerG) AliFlowEventSimple::SetMCReactionPlaneAngle( headerG->GetEventPlane() );
  }
  //HIJING
  else if (!strcmp(mcEvent-> GenEventHeader()->GetName(),"Hijing"))   //returns 0 if matches
  {
    AliGenHijingEventHeader* headerH = dynamic_cast<AliGenHijingEventHeader*>(mcEvent->GenEventHeader());
    if (headerH) AliFlowEventSimple::SetMCReactionPlaneAngle( headerH->ReactionPlaneAngle() );
  }
  //AMPT
  else if (!strcmp(mcEvent-> GenEventHeader()->GetName(),"Ampt"))   //returns 0 if matches
  {
    AliGenHijingEventHeader* headerH = dynamic_cast<AliGenHijingEventHeader*>(mcEvent->GenEventHeader());
    if (headerH) AliFlowEventSimple::SetMCReactionPlaneAngle( headerH->ReactionPlaneAngle() );
  }
  //EPOS
  else if (!strcmp(mcEvent->GenEventHeader()->GetName(),"EPOS"))
  {
    AliGenEposEventHeader* headerE = dynamic_cast<AliGenEposEventHeader*>(mcEvent->GenEventHeader());
    if (headerE) AliFlowEventSimple::SetMCReactionPlaneAngle( headerE->ReactionPlaneAngle() );
  }
  //Hydjet
  else
  {
    AliCollisionGeometry* header = dynamic_cast<AliCollisionGeometry*>(mcEvent->GenEventHeader());
    if (header) AliFlowEventSimple::SetMCReactionPlaneAngle( header->ReactionPlaneAngle() );
  }
}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent( const AliMCEvent* anInput,
                            const AliCFManager* rpCFManager,
                            const AliCFManager* poiCFManager):
  AliFlowEventSimple(20), fApplyRecentering(-1), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }
  //Fills the event from the MC kinematic information

  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;

  //loop over tracks
  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
  {
    //get input particle
    AliMCParticle* pParticle = dynamic_cast<AliMCParticle*>(anInput->GetTrack(itrkN));
    if (!pParticle) continue;

    //check if pParticle passes the cuts
    Bool_t rpOK = kTRUE;
    Bool_t poiOK = kTRUE;
    if (rpCFManager && poiCFManager)
    {
      rpOK = rpCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle);
      poiOK = poiCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle);
    }
    if (!(rpOK||poiOK)) continue;

    AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
    pTrack->SetSource(AliFlowTrack::kFromMC);

    if (rpOK && rpCFManager)
    {
      pTrack->SetForRPSelection(kTRUE);
      IncrementNumberOfPOIs(0);
    }
    if (poiOK && poiCFManager)
    {
      pTrack->SetForPOISelection(kTRUE);
      IncrementNumberOfPOIs(1);
    }

    AddTrack(pTrack) ;
  }//for all tracks
  SetMCReactionPlaneAngle(anInput);
}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
                            const AliCFManager* rpCFManager,
                            const AliCFManager* poiCFManager ):
  AliFlowEventSimple(20),  fApplyRecentering(-1), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }
   
  //Fills the event from the ESD

  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;

  //loop over tracks
  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
  {
    AliESDtrack* pParticle = anInput->GetTrack(itrkN);   //get input particle

    //check if pParticle passes the cuts
    Bool_t rpOK = kTRUE;
    Bool_t poiOK = kTRUE;
    if (rpCFManager && poiCFManager)
    {
      rpOK = ( rpCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
               rpCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
      poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
                poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
    }
    if (!(rpOK || poiOK)) continue;

    //make new AliFLowTrack
    AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
    pTrack->SetSource(AliFlowTrack::kFromESD);

    //marking the particles used for int. flow:
    if(rpOK && rpCFManager)
    {
      pTrack->SetForRPSelection(kTRUE);
      IncrementNumberOfPOIs(0);
    }
    //marking the particles used for diff. flow:
    if(poiOK && poiCFManager)
    {
      pTrack->SetForPOISelection(kTRUE);
      IncrementNumberOfPOIs(1);
    }

    AddTrack(pTrack);
  }//end of while (itrkN < iNumberOfInputTracks)
}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent( const AliAODEvent* anInput,
                            const AliCFManager* rpCFManager,
                            const AliCFManager* poiCFManager):
  AliFlowEventSimple(20), fApplyRecentering(-1), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }
  //Fills the event from the AOD
  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;

  //loop over tracks
  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
  {
    AliAODTrack* pParticle = dynamic_cast<AliAODTrack*>(anInput->GetTrack(itrkN));
    if(!pParticle) AliFatal("Not a standard AOD");   //get input particle

    //check if pParticle passes the cuts
    Bool_t rpOK = kTRUE;
    Bool_t poiOK = kTRUE;
    if (rpCFManager && poiCFManager)
    {
      rpOK = ( rpCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
               rpCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
      poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
                poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
    }
    if (!(rpOK || poiOK)) continue;

    //make new AliFlowTrack
    AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
    pTrack->SetSource(AliFlowTrack::kFromAOD);

    if (rpOK /* && rpCFManager */ ) // to be fixed - with CF managers uncommented only empty events (NULL in header files)
    {
      pTrack->SetForRPSelection(kTRUE);
      IncrementNumberOfPOIs(0);
    }
    if (poiOK /* && poiCFManager*/ )
    {
      pTrack->SetForPOISelection(kTRUE);
      IncrementNumberOfPOIs(1);
    }
    AddTrack(pTrack);
  }

  //  if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult)
  //  {
  //    if ( (++fCount % 100) == 0)
  //    {
  //      if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<<  fMCReactionPlaneAngle << endl;
  //      else cout<<" MC Reaction Plane Angle = unknown "<< endl;
  //      cout<<" iGoodTracks = "<<iGoodTracks<<endl;
  //      cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
  //      cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
  //      cout << "# " << fCount << " events processed" << endl;
  //    }
  //    return pEvent;
  //  }
  //  else
  //  {
  //    cout<<"Not enough tracks in the FlowEventSimple"<<endl;
  //    return 0;
  //  }
  //}
  //else
  //{
  //  cout<<"Event does not pass multiplicity cuts"<<endl;
  //  return 0;
  //}

}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
                            const AliMCEvent* anInputMc,
                            KineSource anOption,
                            const AliCFManager* rpCFManager,
                            const AliCFManager* poiCFManager ):
  AliFlowEventSimple(20), fApplyRecentering(-1), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }
  //fills the event with tracks from the ESD and kinematics from the MC info via the track label
  if (anOption==kNoKine)
  {
    AliFatal("WRONG OPTION IN AliFlowEventMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, KineSource anOption)");
    exit(1);
  }

  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;

  Int_t iNumberOfInputTracksMC = anInputMc->GetNumberOfTracks() ;
  if (iNumberOfInputTracksMC==-1)
  {
    AliError("Skipping Event -- No MC information available for this event");
    return;
  }

  //loop over ESD tracks
  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
  {
    AliESDtrack* pParticle = anInput->GetTrack(itrkN);   //get input particle
    //get Label
    Int_t iLabel = pParticle->GetLabel();
    //match to mc particle
    AliMCParticle* pMcParticle = (AliMCParticle*) anInputMc->GetTrack(TMath::Abs(iLabel));

    //check
    if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label())
      AliWarning(Form("pParticle->GetLabel()!=pMcParticle->Label(), %i, %i", pParticle->GetLabel(), pMcParticle->Label()));

    //check if pParticle passes the cuts
    Bool_t rpOK = kFALSE;
    Bool_t poiOK = kFALSE;
    if (rpCFManager && poiCFManager)
    {
      if(anOption == kESDkine)
      {
        if (rpCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts1") &&
            rpCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle))
          rpOK=kTRUE;
        if (poiCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts2") &&
            poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle))
          poiOK=kTRUE;
      }
      else if (anOption == kMCkine)
      {
        if (rpCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
          rpOK=kTRUE;
        if (poiCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle))
          poiOK=kTRUE;
      }
    }

    if (!(rpOK || poiOK)) continue;

    //make new AliFlowTrack
    AliFlowTrack* pTrack = NULL;
    if(anOption == kESDkine)   //take the PID from the MC & the kinematics from the ESD
    {
      pTrack = new AliFlowTrack(pParticle);
    }
    else if (anOption == kMCkine)   //take the PID and kinematics from the MC
    {
      pTrack = new AliFlowTrack(pMcParticle);
    }

    if (rpOK && rpCFManager)
    {
      IncrementNumberOfPOIs(0);
      pTrack->SetForRPSelection();
    }
    if (poiOK && poiCFManager) 
    { 
      IncrementNumberOfPOIs(1);
      pTrack->SetForPOISelection();
    }

    AddTrack(pTrack);
  }
  SetMCReactionPlaneAngle(anInputMc);
}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
			    const AliMultiplicity* anInputTracklets,
			    const AliCFManager* poiCFManager ):
  AliFlowEventSimple(20), fApplyRecentering(-1), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }

  //Select the particles of interest from the ESD
  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;

  //loop over tracks
  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
    {
      AliESDtrack* pParticle = anInput->GetTrack(itrkN);   //get input particle

      //check if pParticle passes the cuts
      Bool_t poiOK = kTRUE;
      if (poiCFManager)
	{
	  poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
		    poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
	}
      if (!poiOK) continue;
      
      //make new AliFLowTrack
      AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
          
      //marking the particles used for the particle of interest (POI) selection:
      if(poiOK && poiCFManager)
	{
          IncrementNumberOfPOIs(1);
	  pTrack->SetForPOISelection(kTRUE);
	  pTrack->SetSource(AliFlowTrack::kFromESD);
	}

      AddTrack(pTrack);
    }//end of while (itrkN < iNumberOfInputTracks)

  //Select the reference particles from the SPD tracklets
  anInputTracklets = anInput->GetMultiplicity();
  Int_t multSPD = anInputTracklets->GetNumberOfTracklets();
  
  //loop over tracklets
  for (Int_t itracklet=0; itracklet<multSPD; ++itracklet) {
    Float_t thetaTr= anInputTracklets->GetTheta(itracklet);
    Float_t phiTr= anInputTracklets->GetPhi(itracklet);
    // calculate eta
    Float_t etaTr = -TMath::Log(TMath::Tan(thetaTr/2.));
    
    //make new AliFLowTrackSimple
    AliFlowTrack* pTrack = new AliFlowTrack();
    pTrack->SetPt(0.0);
    pTrack->SetEta(etaTr);
    pTrack->SetPhi(phiTr);
    //marking the particles used for the reference particle (RP) selection:
    IncrementNumberOfPOIs(0);
    pTrack->SetForRPSelection(kTRUE);
    pTrack->SetSource(AliFlowTrack::kFromTracklet);

    //Add the track to the flowevent
    AddTrack(pTrack);
  }

}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent( const AliESDEvent* esd,
			    const AliCFManager* poiCFManager,
                            Bool_t hybrid):
  AliFlowEventSimple(20), fApplyRecentering(-1), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }

  //Select the particles of interest from the ESD
  Int_t iNumberOfInputTracks = esd->GetNumberOfTracks() ;

  //Double_t gPt = 0.0, gP = 0.0;
  Double_t dca[2] = {0.0,0.0}, cov[3] = {0.0,0.0,0.0};  //The impact parameters and their covariance.
//  Double_t dca3D = 0.0;       FIXME unused variable

  AliESDtrack trackTPC;

  //loop over tracks
  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
    {

      if (!esd->GetTrack(itrkN)) continue;

      Bool_t useTPC = kFALSE;

      AliESDtrack* pParticle = esd->GetTrack(itrkN);   //get input particle

      //check if pParticle passes the cuts
      Bool_t poiOK = kTRUE;

      if (poiCFManager)
      {
        poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
                  poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
      }

      if (!(poiOK)) continue;

      AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)pParticle->GetTPCInnerParam();

      if (tpcTrack)
      {

//      gPt = tpcTrack->Pt();
//      gP = tpcTrack->P();

        useTPC = kTRUE;

        const AliESDVertex *vertexSPD = esd->GetPrimaryVertexSPD();
        const AliESDVertex *vertexTPC = esd->GetPrimaryVertexTPC();

        AliExternalTrackParam copy(*tpcTrack);
        if(hybrid)
          copy.PropagateToDCA(vertexSPD,esd->GetMagneticField(),100.,dca,cov);
        else
          copy.PropagateToDCA(vertexTPC,esd->GetMagneticField(),100.,dca,cov);

//        dca3D = TMath::Sqrt(TMath::Power(dca[0],2)+TMath::Power(dca[1],2));   FIXME unused variable

      }

      //make new AliFLowTrack
      AliFlowTrack* pTrack = new AliFlowTrack(pParticle);

      pTrack->SetSource(AliFlowTrack::kFromESD);

      //marking the particles used for diff. flow:
      if(poiOK && poiCFManager)
      {
        pTrack->SetForPOISelection(kTRUE);
        IncrementNumberOfPOIs(1);
      }

      if(useTPC)
      {
        pTrack->SetForRPSelection(kTRUE);
        IncrementNumberOfPOIs(0);
      }

      AddTrack(pTrack);

    }//end of while (itrkN < iNumberOfInputTracks)

}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
			    const TH2F* anInputFMDhist,
			    const AliCFManager* poiCFManager ):
  AliFlowEventSimple(20), fApplyRecentering(-1), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)
{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }

  //Select the particles of interest from the ESD
  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;

  //loop over tracks
  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
    {
      AliESDtrack* pParticle = anInput->GetTrack(itrkN);   //get input particle

      //check if pParticle passes the cuts
      Bool_t poiOK = kTRUE;
      if (poiCFManager)
	{
	  poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
		    poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
	}
      if (!poiOK) continue;
 
      //make new AliFLowTrack
      AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
          
      //marking the particles used for the particle of interest (POI) selection:
      if(poiOK && poiCFManager)
	{
    IncrementNumberOfPOIs(1);
	  pTrack->SetForPOISelection(kTRUE);
	  pTrack->SetSource(AliFlowTrack::kFromESD);
	}

      AddTrack(pTrack);
    }//end of while (itrkN < iNumberOfInputTracks)

  //Select the reference particles from the FMD hits
  //loop over FMD histogram
  Int_t iBinsEta = anInputFMDhist->GetNbinsX();
  Int_t iBinsPhi = anInputFMDhist->GetNbinsY();
  
  for (Int_t iEta = 1; iEta <= iBinsEta; iEta++){
    Double_t etaFMD = anInputFMDhist->GetXaxis()->GetBinCenter(iEta);
    for (Int_t iPhi = 1; iPhi <= iBinsPhi; iPhi++){
      Double_t phiFMD = anInputFMDhist->GetYaxis()->GetBinCenter(iPhi);
      Double_t weightFMD = anInputFMDhist->GetBinContent(iEta,iPhi);
    
      if (weightFMD > 0.0) { //do not add empty bins
	//make new AliFLowTrackSimple
	AliFlowTrack* pTrack = new AliFlowTrack();
	pTrack->SetPt(0.0);
	pTrack->SetEta(etaFMD);
	pTrack->SetPhi(phiFMD);
	pTrack->SetWeight(weightFMD);
	//marking the particles used for the reference particle (RP) selection:
	pTrack->TagRP();
	IncrementNumberOfPOIs(0);
	pTrack->SetSource(AliFlowTrack::kFromFMD);

	//Add the track to the flowevent
	AddTrack(pTrack);
	
      }
    }
  }

}

//-----------------------------------------------------------------------
void AliFlowEvent::FindDaughters(Bool_t keepDaughtersInRPselection)
{
  //each flow track holds it's esd track index as well as its daughters esd index.
  //fill the array of daughters for every track with the pointers to flow tracks
  //to associate the mothers with daughters directly
  for (Int_t iTrack=0; iTrack<fMothersCollection->GetEntriesFast(); iTrack++)
  {
    AliFlowTrack* mother = static_cast<AliFlowTrack*>(fMothersCollection->At(iTrack));
    if (!mother) continue;
    if (mother->GetNDaughters()<1) continue;
    for (Int_t iDaughterCandidate=0; iDaughterCandidate<fNumberOfTracks; iDaughterCandidate++)
    {
      AliFlowTrack* daughterCandidate = static_cast<AliFlowTrack*>(fTrackCollection->At(iDaughterCandidate));
      Int_t esdIndexDaughterCandidate = daughterCandidate->GetID();
      for (Int_t iDaughter=0; iDaughter<mother->GetNDaughters(); iDaughter++)
      {
        Int_t esdIndexDaughter = mother->GetIDDaughter(iDaughter);
        if (esdIndexDaughter==esdIndexDaughterCandidate)
        {
          mother->SetDaughter(iDaughter,daughterCandidate);
          daughterCandidate->SetForRPSelection(keepDaughtersInRPselection);
        }
      }
    }
  }
}

//-----------------------------------------------------------------------
void AliFlowEvent::Fill( AliFlowTrackCuts* rpCuts,
                         AliFlowTrackCuts* poiCuts )
{
  //Fills the event from a vevent: AliESDEvent,AliAODEvent,AliMCEvent
  //the input data needs to be attached to the cuts
  //we have two cases, if we're cutting the same collection of tracks
  //(same param type) then we can have tracks that are both rp and poi
  //in the other case we want to have two exclusive sets of rps and pois
  //e.g. one tracklets, the other PMD or global - USER IS RESPOSIBLE
  //FOR MAKING SURE THEY DONT OVERLAP OR ELSE THE SAME PARTICLE WILL BE
  //TAKEN TWICE

  ClearFast();
  if (!rpCuts || !poiCuts) return;
  AliFlowTrackCuts::trackParameterType sourceRP = rpCuts->GetParamType();
  AliFlowTrackCuts::trackParameterType sourcePOI = poiCuts->GetParamType();
  AliFlowTrack* pTrack=NULL;
 
  // if the source for rp's or poi's is the VZERO detector, get the calibration 
  // and set the calibration parameters
  if (sourceRP == AliFlowTrackCuts::kVZERO) {
      SetVZEROCalibrationForTrackCuts(rpCuts);
      if(!rpCuts->GetApplyRecentering()) {
          // if the user does not want to recenter, switch the flag
          fApplyRecentering = -1;
      }
      // note: this flag is used in the overloaded implementation of Get2Qsub()
      // and tells the function to use as Qsub vectors the recentered Q-vectors
      // from the VZERO oadb file or from the event header
  }
  if (sourcePOI == AliFlowTrackCuts::kVZERO) {
      // probably no-one will choose vzero tracks as poi's ...
      SetVZEROCalibrationForTrackCuts(poiCuts); 
  }
  

  if (sourceRP==sourcePOI)
  {
    //loop over tracks
    Int_t numberOfInputObjects = rpCuts->GetNumberOfInputObjects();
    for (Int_t i=0; i<numberOfInputObjects; i++)
    {
      //get input object (particle)
      TObject* particle = rpCuts->GetInputObject(i);

      Bool_t rp = rpCuts->IsSelected(particle,i);
      Bool_t poi = poiCuts->IsSelected(particle,i);

      if (!(rp||poi)) continue;

      //make new AliFlowTrack
      if (rp)
      {
        pTrack = rpCuts->FillFlowTrack(fTrackCollection,fNumberOfTracks);
        if (!pTrack) continue;
        pTrack->Tag(0); IncrementNumberOfPOIs(0);
        if (poi) {pTrack->Tag(1); IncrementNumberOfPOIs(1);}
        if (pTrack->GetNDaughters()>0) fMothersCollection->Add(pTrack);
      }
      else if (poi)
      {
        pTrack = poiCuts->FillFlowTrack(fTrackCollection,fNumberOfTracks);
        if (!pTrack) continue;
        pTrack->Tag(1); IncrementNumberOfPOIs(1);
        if (pTrack->GetNDaughters()>0) fMothersCollection->Add(pTrack);
      }
      fNumberOfTracks++;
    }//end of while (i < numberOfTracks)
  }
  else if (sourceRP!=sourcePOI)
  {
    //here we have two different sources of particles, so we fill
    //them independently
    //POI
    for (Int_t i=0; i<poiCuts->GetNumberOfInputObjects(); i++)
    {
      TObject* particle = poiCuts->GetInputObject(i);
      Bool_t poi = poiCuts->IsSelected(particle,i);
      if (!poi) continue;
      pTrack = poiCuts->FillFlowTrack(fTrackCollection,fNumberOfTracks);
      if (!pTrack) continue;
      pTrack->Tag(1);
      IncrementNumberOfPOIs(1);
      fNumberOfTracks++;
      if (pTrack->GetNDaughters()>0) fMothersCollection->Add(pTrack);
    }
    //RP
    Int_t numberOfInputObjects = rpCuts->GetNumberOfInputObjects();
    for (Int_t i=0; i<numberOfInputObjects; i++)
      {
      TObject* particle = rpCuts->GetInputObject(i);
      Bool_t rp = rpCuts->IsSelected(particle,i);
      if (!rp) continue;
      pTrack = rpCuts->FillFlowTrack(fTrackCollection,fNumberOfTracks);
      if (!pTrack) continue;
      pTrack->Tag(0);
      IncrementNumberOfPOIs(0);
      fNumberOfTracks++;
      if (pTrack->GetNDaughters()>0) fMothersCollection->Add(pTrack);
    }
  }
}

//-----------------------------------------------------------------------
void AliFlowEvent::InsertTrack(AliFlowTrack *track) {
  // adds a flow track at the end of the container
  AliFlowTrack *pTrack = ReuseTrack( fNumberOfTracks++ );
  *pTrack = *track;
  if (track->GetNDaughters()>0)
  {
    fMothersCollection->Add(pTrack);
  }
  return;
}

//-----------------------------------------------------------------------
AliFlowTrack* AliFlowEvent::ReuseTrack(Int_t i)
{
  //try to reuse an existing track, if empty, make new one
  AliFlowTrack* pTrack = static_cast<AliFlowTrack*>(fTrackCollection->At(i));
  if (pTrack)
  {
    pTrack->Clear();
  }
  else 
  {
    pTrack = new AliFlowTrack();
    fTrackCollection->AddAtAndExpand(pTrack,i);
  }
  return pTrack;
}

//-----------------------------------------------------------------------
AliFlowEvent::AliFlowEvent( AliFlowTrackCuts* rpCuts,
                            AliFlowTrackCuts* poiCuts ):
  AliFlowEventSimple(20), fApplyRecentering(kFALSE), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)

{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }
  //Fills the event from a vevent: AliESDEvent,AliAODEvent,AliMCEvent
  //the input data needs to be attached to the cuts
  Fill(rpCuts,poiCuts);
}

//-------------------------------------------------------------------//
//---- Including PMD tracks as RP --------------------------//

AliFlowEvent::AliFlowEvent( const AliESDEvent* anInput,
			    const AliESDPmdTrack *pmdtracks,
			    const AliCFManager* poiCFManager ):
  AliFlowEventSimple(20), fApplyRecentering(kFALSE), fCachedRun(-1), fVZEROcentralityBin(-1), fEvent(0x0), fChi2A(0x0), fChi2C(0x0), fChi3A(0x0), fChi3C(0x0)

{
    // constructor
    for(Int_t i(0); i < 9; i++) {
        for(Int_t j(0); j < 2; j++) {
            for(Int_t k(0); k < 2; k++) {
                fMeanQ[i][j][k] = 0.; 
                fWidthQ[i][j][k] = 0.;  
                fMeanQv3[i][j][k] = 0.; 
                fWidthQv3[i][j][k] = 0.;
            }
        }
    }
  Float_t GetPmdEta(Float_t xPos, Float_t yPos, Float_t zPos);
  Float_t GetPmdPhi(Float_t xPos, Float_t yPos);
  //Select the particles of interest from the ESD
  Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
  
  //loop over tracks
  for (Int_t itrkN=0; itrkN<iNumberOfInputTracks; itrkN++)
    {
      AliESDtrack* pParticle = anInput->GetTrack(itrkN);   //get input particle
      //check if pParticle passes the cuts
      Bool_t poiOK = kTRUE;
      if (poiCFManager)
	{
	  poiOK = ( poiCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
		    poiCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle));
	}
      if (!poiOK) continue;
      
      //make new AliFLowTrack
      AliFlowTrack* pTrack = new AliFlowTrack(pParticle);
      
      //marking the particles used for the particle of interest (POI) selection:
      if(poiOK && poiCFManager)
	{
          IncrementNumberOfPOIs(1);
	  pTrack->SetForPOISelection(kTRUE);
	  pTrack->SetSource(AliFlowTrack::kFromESD);
	}
      
      AddTrack(pTrack);
    }//end of while (itrkN < iNumberOfInputTracks)
  
  //Select the reference particles from the PMD tracks
  Int_t npmdcl = anInput->GetNumberOfPmdTracks();
  printf("======There are %d PMD tracks in this event\n-------",npmdcl);
  //loop over clusters 
  for(Int_t iclust=0; iclust < npmdcl; iclust++){
    //AliESDPmdTrack *pmdtr = anInput->GetPmdTrack(iclust);
    pmdtracks = anInput->GetPmdTrack(iclust);
    Int_t   det   = pmdtracks->GetDetector();
    //Int_t   smn   = pmdtracks->GetSmn();
    Float_t clsX  = pmdtracks->GetClusterX();
    Float_t clsY  = pmdtracks->GetClusterY();
    Float_t clsZ  = pmdtracks->GetClusterZ();
    Float_t ncell = pmdtracks->GetClusterCells();
    Float_t adc   = pmdtracks->GetClusterADC();
    //Float_t pid   = pmdtracks->GetClusterPID();
    Float_t etacls = GetPmdEta(clsX,clsY,clsZ);
    Float_t phicls = GetPmdPhi(clsX,clsY);
    //make new AliFLowTrackSimple
    AliFlowTrack* pTrack = new AliFlowTrack();
    //if(det == 0){ //selecting preshower plane only
    if(det == 0 && adc > 270 && ncell > 1){ //selecting preshower plane only
      //pTrack->SetPt(adc);//cluster adc
      pTrack->SetPt(0.0);
      pTrack->SetEta(etacls);
      pTrack->SetPhi(phicls);
      //marking the particles used for the reference particle (RP) selection:
      IncrementNumberOfPOIs(0);
      pTrack->SetForRPSelection(kTRUE);
      pTrack->SetSource(AliFlowTrack::kFromPMD);
      //Add the track to the flowevent
      AddTrack(pTrack);
    }//if det
  }
}
//----------------------------------------------------------------------------//
Float_t GetPmdEta(Float_t xPos, Float_t yPos, Float_t zPos)
{
  Float_t rpxpy, theta, eta;
  rpxpy  = TMath::Sqrt(xPos*xPos + yPos*yPos);
  theta  = TMath::ATan2(rpxpy,zPos);
  eta    = -TMath::Log(TMath::Tan(0.5*theta));
  return eta;
}
//--------------------------------------------------------------------------//
Float_t GetPmdPhi(Float_t xPos, Float_t yPos)
{
  Float_t pybypx, phi = 0., phi1;
  if(xPos==0)
    {
      if(yPos>0) phi = 90.;
      if(yPos<0) phi = 270.;
    }
  if(xPos != 0)
    {
      pybypx = yPos/xPos;
      if(pybypx < 0) pybypx = - pybypx;
      phi1 = TMath::ATan(pybypx)*180./3.14159;
      
      if(xPos > 0 && yPos > 0) phi = phi1;        // 1st Quadrant
      if(xPos < 0 && yPos > 0) phi = 180 - phi1;  // 2nd Quadrant
      if(xPos < 0 && yPos < 0) phi = 180 + phi1;  // 3rd Quadrant
      if(xPos > 0 && yPos < 0) phi = 360 - phi1;  // 4th Quadrant
      
    }
  phi = phi*3.14159/180.;
  return   phi;
}
//---------------------------------------------------------------//
AliFlowVector AliFlowEvent::GetQ(Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
{
  // start with the uncalibrated Q-vector. if we're not looking at vzero data, this will be returned
  // so this is completely backward compatible
  AliFlowVector vQ = AliFlowEventSimple::GetQ(n, weightsList, usePhiWeights, usePhiWeights, useEtaWeights);
    // see if we want to re-center 2010 style
  if(fApplyRecentering == 2010) {
    AliFlowVector Qarray[2];
    AliFlowEvent::Get2Qsub(Qarray, n, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
    AliFlowVector vA = Qarray[0];
    AliFlowVector vB = Qarray[1];

    // now we have the calibrated sub-event q-vectors, these will be merged using a resolution derived weight
    Double_t chiA(1.), chiC(1.), dQX(0.), dQY(0.);
    if(n==2) {
      chiA = fChi2A->At(fVZEROcentralityBin);
      chiC = fChi2C->At(fVZEROcentralityBin);
    } else if (n==3) {
      chiA = fChi3A->At(fVZEROcentralityBin);
      chiC = fChi3C->At(fVZEROcentralityBin);
    }

    // combine the vzera and vzeroc signal, note that vzeroa is stored in vB and vzeroc in vA
    dQX = chiA*chiA*vB.X()+chiC*chiC*vA.X();
    dQY = chiA*chiA*vB.Y()+chiC*chiC*vA.Y();
    vQ.Set(dQX, dQY);

  } else if (fApplyRecentering == 2011) { // 11h style recentering
    Double_t dQX = 0.;
    Double_t dQY = 0.;

    if(fEvent && fEvent->GetEventplane()) {
      fEvent->GetEventplane()->CalculateVZEROEventPlane(fEvent, 10, n, dQX, dQY);
      // set the new q-vectors (which in this case means REPLACING) 
      vQ.Set(dQX, dQY);
    } // if for some reason the info from the event header is not available, the AliFlowTrackCuts object
      // has provided the equalized multiplicity info so this should still be relatively safe
  }

  // return the Q-vector 
  return vQ;
}   
 //---------------------------------------------------------------//
void AliFlowEvent::Get2Qsub(AliFlowVector* Qarray, Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
{
  // get q vectors for the subevents. if no recentering is necessary, get the guy from the flow event simple
  AliFlowEventSimple::Get2Qsub(Qarray, n, weightsList, usePhiWeights, usePtWeights, useEtaWeights);
  AliFlowVector vA = Qarray[0];
  AliFlowVector vB = Qarray[1];
 
  // else get the recentering from the cached info
  if (fApplyRecentering == 2010)        // 10h style recentering, implemented for n=2 and n=3
  {     
    // first retrieve the q-vectors from the AliFlowEventSimple:: routine
    // extract the information form the current flow vectors
    Double_t Qxc(vA.X());       // IMPORTANT: user is responsible for the sign of eta
    Double_t Qyc(vA.Y());       // vzeroC has negative pseudorapidity and is taken as subevent A
    Double_t Qxa(vB.X());       // vzeroA has positive pseudorapidity and is taken as subevent B
    Double_t Qya(vB.Y());
    // init some values for the corrections
    
    // default values for vector a (VZEROA)
    Double_t Qxamean(0);
    Double_t Qxarms(1);
    Double_t Qyamean(0);
    Double_t Qyarms(1);
    // default values for vector b (VZEROC)
    Double_t Qxcmean(0);
    Double_t Qxcrms(1);
    Double_t Qycmean(0);
    Double_t Qycrms(1);	
    // note that defaults are chosen such that for n!=2||n!=3 re-centering is a null-operation
    
    if( n == 2) {       // second order symmetry
        Qxamean = fMeanQ[fVZEROcentralityBin][1][0];
        Qxarms  = fWidthQ[fVZEROcentralityBin][1][0];
        Qyamean = fMeanQ[fVZEROcentralityBin][1][1];
        Qyarms  = fWidthQ[fVZEROcentralityBin][1][1];

        Qxcmean = fMeanQ[fVZEROcentralityBin][0][0];
        Qxcrms  = fWidthQ[fVZEROcentralityBin][0][0];
        Qycmean = fMeanQ[fVZEROcentralityBin][0][1];
        Qycrms  = fWidthQ[fVZEROcentralityBin][0][1];	
    } else if (n == 3) {        // third order symmetry
        Qxamean = fMeanQv3[fVZEROcentralityBin][1][0];
        Qxarms  = fWidthQv3[fVZEROcentralityBin][1][0];
        Qyamean = fMeanQv3[fVZEROcentralityBin][1][1];
        Qyarms  = fWidthQv3[fVZEROcentralityBin][1][1];
  
        Qxcmean = fMeanQv3[fVZEROcentralityBin][0][0];
        Qxcrms  = fWidthQv3[fVZEROcentralityBin][0][0];
        Qycmean = fMeanQv3[fVZEROcentralityBin][0][1];
        Qycrms  = fWidthQv3[fVZEROcentralityBin][0][1];	
    }
    // do the correction    
    Double_t QxaCor = (Qxa - Qxamean)/Qxarms;
    Double_t QyaCor = (Qya - Qyamean)/Qyarms;
    Double_t QxcCor = (Qxc - Qxcmean)/Qxcrms;
    Double_t QycCor = (Qyc - Qycmean)/Qycrms;
    // update the vector
    vA.Set(QxcCor, QycCor);
    vB.Set(QxaCor, QyaCor);
  } else if (fApplyRecentering == 2011) { // 11h style recentering

    Double_t QxaCor = 0.;
    Double_t QyaCor = 0.;
    Double_t QxcCor = 0.;
    Double_t QycCor = 0.;

    if(fEvent && fEvent->GetEventplane()) {
      fEvent->GetEventplane()->CalculateVZEROEventPlane(fEvent, 8, n, QxaCor, QyaCor);
      fEvent->GetEventplane()->CalculateVZEROEventPlane(fEvent, 9, n, QxcCor, QycCor);
 
      // set the new q-vectors (which in this case means REPLACING) 
      vA.Set(QxcCor, QycCor);
      vB.Set(QxaCor, QyaCor);
    } // if for some reason the info from the event header is not available, the AliFlowTrackCuts object
      // has provided the equalized multiplicity info so this should still be relatively safe
  }
}
//_____________________________________________________________________________
void AliFlowEvent::SetVZEROCalibrationForTrackCuts(AliFlowTrackCuts* cuts) {
    // open calibration info, copied from AliAnalyisTaskVnV0.cxx
    fEvent = cuts->GetEvent();
    if(!fEvent) return; // coverity. we need to know the event to get the runnumber and centrlaity
    // get the vzero centrality percentile (cc dependent calibration)
    Float_t v0Centr(fEvent->GetCentrality()->GetCentralityPercentile("V0M"));
    if(v0Centr < 5) fVZEROcentralityBin = 0;
    else if(v0Centr < 10) fVZEROcentralityBin = 1;
    else if(v0Centr < 20) fVZEROcentralityBin = 2;
    else if(v0Centr < 30) fVZEROcentralityBin = 3;
    else if(v0Centr < 40) fVZEROcentralityBin = 4;
    else if(v0Centr < 50) fVZEROcentralityBin = 5;
    else if(v0Centr < 60) fVZEROcentralityBin = 6;
    else if(v0Centr < 70) fVZEROcentralityBin = 7;
    else fVZEROcentralityBin = 8;

    // if this event is from the same run as the previous event
    // we can use the cached calibration values, no need to re-open the 
    // aodb file, else cache the new run
    Int_t run(fEvent->GetRunNumber());
    if(fCachedRun == run) return;
    else fCachedRun = run;
    
    // relevant for 2010 data: check if the proper chi weights for merging vzero a and vzero c ep are present
    // if not, use sane defaults. centrality binning is equal to that given in the fVZEROcentralityBin snippet
    //
    // chi values can be calculated using the static helper function 
    // AliAnalysisTaskJetV2::CalculateEventPlaneChi(Double_t res) where res is the event plane
    // resolution in a given centrality bin
    //
    // the resolutions that were used for these defaults are
    // Double_t R2VZEROA[] = {.35, .40, .48, .50, .48, .45, .38, .26, .16};
    // Double_t R2VZEROC[] = {.45, .60, .70, .73, .68, .60, .40, .36, .17};
    //
    // Double_t R3VZEROA[] = {.22, .23, .22, .19, .15, .12, .08, .00, .00};
    // Double_t R3VZEROC[] = {.30, .30, .28, .25, .22, .17, .11, .00, .00};
    // this might need a bit of updating as they were read 'by-eye' from a performance plot ..
    Double_t chiC2[] = {0.771423, 1.10236, 1.38116, 1.48077, 1.31964, 1.10236, 0.674622, 0.600403, 0.273865};
    Double_t chiA2[] = {0.582214, 0.674622, 0.832214, 0.873962, 0.832214, 0.771423, 0.637146, 0.424255, 0.257385};
    Double_t chiC3[] = {0.493347, 0.493347, 0.458557, 0.407166, 0.356628, 0.273865, 0.176208, 6.10352e-05, 6.10352e-05};
    Double_t chiA3[] = {0.356628, 0.373474, 0.356628, 0.306702, 0.24115, 0.192322, 0.127869, 6.10352e-05, 6.10352e-05};

    // this may seem redundant but in this way the cuts object is owner of the arrays
    // even if they're created here (so we won't get into trouble with dtor, assigmnet and copying) 
    if(!cuts->GetChi2A()) cuts->SetChi2A(new TArrayD(9, chiA2));
    if(!cuts->GetChi2C()) cuts->SetChi2C(new TArrayD(9, chiC2));
    if(!cuts->GetChi3A()) cuts->SetChi3A(new TArrayD(9, chiA3));
    if(!cuts->GetChi3C()) cuts->SetChi3C(new TArrayD(9, chiC3));

    if(!fChi2A) fChi2A = cuts->GetChi2A();
    if(!fChi2C) fChi2C = cuts->GetChi2C();
    if(!fChi3A) fChi3A = cuts->GetChi3A();
    if(!fChi3C) fChi3C = cuts->GetChi3C();
 
   TFile *foadb = TFile::Open("$ALICE_ROOT/OADB/PWGCF/VZERO/VZEROcalibEP.root");
    if(!foadb){
	printf("OADB file $ALICE_ROOT/OADB/PWGCF/VZERO/VZEROcalibEP.root cannot be opened, CALIBRATION FAILED !");
	return;
    }

    AliOADBContainer *cont = (AliOADBContainer*) foadb->Get("hMultV0BefCorr");
    if(!cont){
	printf("OADB object hMultV0BefCorr is not available in the file\n");
	return;	
    }
    if(!(cont->GetObject(run))){
        // if the multiplicity correction cannot be found for the specified run, 
        // loop over the 11h runs to see if it's 11h data
        Int_t runs11h[] = {170593, 170572, 170556, 170552, 170546, 170390, 170389, 170388, 170387, 170315, 170313, 170312, 170311, 170309, 170308, 170306, 170270, 170269, 170268, 170267, 170264, 170230, 170228, 170208, 170207, 170205, 170204, 170203, 170195, 170193, 170163, 170162, 170159, 170155, 170152, 170091, 170089, 170088, 170085, 170084, 170083, 170081, 170040, 170038, 170036, 170027, 169981, 169975, 169969, 169965, 169961, 169956, 169926, 169924, 169923, 169922, 169919, 169918, 169914, 169859, 169858, 169855, 169846, 169838, 169837, 169835, 169683, 169628, 169591, 169590, 169588, 169587, 169586, 169584, 169557, 169555, 169554, 169553, 169550, 169515, 169512, 169506, 169504, 169498, 169475, 169420, 169419, 169418, 169417, 169415, 169411, 169238, 169236, 169167, 169160, 169156, 169148, 169145, 169144, 169143, 169138, 169099, 169094, 169091, 169045, 169044, 169040, 169035, 168992, 168988, 168984, 168826, 168777, 168514, 168512, 168511, 168467, 168464, 168461, 168460, 168458, 168362, 168361, 168356, 168342, 168341, 168325, 168322, 168318, 168311, 168310, 168213, 168212, 168208, 168207, 168206, 168205, 168204, 168203, 168181, 168177, 168175, 168173, 168172, 168171, 168115, 168108, 168107, 168105, 168104, 168103, 168076, 168069, 168068, 168066, 167988, 167987, 167986, 167985, 167921, 167920, 167915, 167909, 167903, 167902, 167818, 167814, 167813, 167808, 167807, 167806, 167713, 167712, 167711, 167706, 167693};
        for(Int_t r(0); r < 176; r++) {
            if(run == runs11h[r]) {
                printf(" > run has been identified as 11h < \n");
 if(cuts->GetVZEROgainEqualizationPerRing()) {
                    // enable or disable rings through the weights, weight 1. is enabled, 0. is disabled
                    // start with the vzero c rings (segments 0 through 31)
                    (cuts->GetUseVZERORing(0)) ? cuts->SetVZEROCpol(0, 1.) : cuts->SetVZEROCpol(0, 0.);
                    (cuts->GetUseVZERORing(1)) ? cuts->SetVZEROCpol(1, 1.) : cuts->SetVZEROCpol(1, 0.);
                    (cuts->GetUseVZERORing(2)) ? cuts->SetVZEROCpol(2, 1.) : cuts->SetVZEROCpol(2, 0.);
                    (cuts->GetUseVZERORing(3)) ? cuts->SetVZEROCpol(3, 1.) : cuts->SetVZEROCpol(3, 0.);
                    // same for vzero a
                    (cuts->GetUseVZERORing(4)) ? cuts->SetVZEROApol(0, 1.) : cuts->SetVZEROApol(0, 0.);
                    (cuts->GetUseVZERORing(5)) ? cuts->SetVZEROApol(1, 1.) : cuts->SetVZEROApol(1, 0.);
                    (cuts->GetUseVZERORing(6)) ? cuts->SetVZEROApol(2, 1.) : cuts->SetVZEROApol(2, 0.);
                    (cuts->GetUseVZERORing(7)) ? cuts->SetVZEROApol(3, 1.) : cuts->SetVZEROApol(3, 0.);
                } else {
                    // else enable all rings, which is also default
                    for(Int_t i(0); i < 4; i++) cuts->SetVZEROCpol(i, 1.);
                    for(Int_t i(0); i < 4; i++) cuts->SetVZEROApol(i, 1.);
                }
                // pass a NULL pointer to the track cuts object, the NULL pointer will identify 11h runs
                cuts->SetVZEROgainEqualisation(NULL);
                fApplyRecentering = 2011;
                return; // the rest of the steps are not necessary
            }
        }
        // the run has not been identified as lhc11h data, so we assume a template calibration
	printf("OADB object hMultVZEROBefCorr is not available for run %i (used default run 137366)\n",run);
	run = 137366;
    }
    printf(" > run has been identified as 10h < \n");
    // step 1) get the proper multiplicity weights from the vzero signal
    TProfile* fMultVZERO = ((TH2F *) cont->GetObject(run))->ProfileX();

    TF1 *fpol0 = new TF1("fpol0","pol0"); 
    if(cuts->GetVZEROgainEqualizationPerRing()) {
        // do the calibration per ring
        // start with the vzero c rings (segments 0 through 31)
        fMultVZERO->Fit(fpol0, "N0", "", 0, 8);
        (cuts->GetUseVZERORing(0)) ? cuts->SetVZEROCpol(0, fpol0->GetParameter(0)) : cuts->SetVZEROCpol(0, 0.);
        fMultVZERO->Fit(fpol0, "N0", "", 8, 16);
        (cuts->GetUseVZERORing(1)) ? cuts->SetVZEROCpol(1, fpol0->GetParameter(0)) : cuts->SetVZEROCpol(1, 0.);
        fMultVZERO->Fit(fpol0, "N0", "", 16, 24);
        (cuts->GetUseVZERORing(2)) ? cuts->SetVZEROCpol(2, fpol0->GetParameter(0)) : cuts->SetVZEROCpol(2, 0.);
        fMultVZERO->Fit(fpol0, "N0", "", 24, 32);
        (cuts->GetUseVZERORing(3)) ? cuts->SetVZEROCpol(3, fpol0->GetParameter(0)) : cuts->SetVZEROCpol(3, 0.);
        // same thing for vero A
        fMultVZERO->Fit(fpol0, "N0", "", 32, 40);
        (cuts->GetUseVZERORing(4)) ? cuts->SetVZEROApol(0, fpol0->GetParameter(0)) : cuts->SetVZEROApol(0, 0.);
        fMultVZERO->Fit(fpol0, "N0", "", 40, 48);
        (cuts->GetUseVZERORing(5)) ? cuts->SetVZEROApol(1, fpol0->GetParameter(0)) : cuts->SetVZEROApol(1, 0.);
        fMultVZERO->Fit(fpol0, "N0", "", 48, 56);
        (cuts->GetUseVZERORing(6)) ? cuts->SetVZEROApol(2, fpol0->GetParameter(0)) : cuts->SetVZEROApol(2, 0.);
        fMultVZERO->Fit(fpol0, "N0", "", 56, 64);
        (cuts->GetUseVZERORing(7)) ? cuts->SetVZEROApol(3, fpol0->GetParameter(0)) : cuts->SetVZEROApol(3, 0.);
    } else {
        // do the calibration in one go. the calibration will still be 
        // stored per ring, but each ring has the same weight now
       fMultVZERO->Fit(fpol0,"N0","",0,31);
       for(Int_t i(0); i < 4; i++) cuts->SetVZEROCpol(i, fpol0->GetParameter(0));
       fMultVZERO->Fit(fpol0,"N0","",32,64);
       for(Int_t i(0); i < 4; i++) cuts->SetVZEROApol(i, fpol0->GetParameter(0));
    }
    // the parameters to weigh the vzero track cuts have been extracted now, 
    // so we can pass them to the current track cuts obect
    cuts->SetVZEROgainEqualisation(fMultVZERO);       // passed as a TH1

    // step 2) reweight the q-vectors that will be  called by flow methods which use
    // subevents
    // underlying assumption is that subevent a uses VZEROA
    // and subevent b uses VZEROC
    for(Int_t iside=0;iside<2;iside++){
	for(Int_t icoord=0;icoord<2;icoord++){
	    for(Int_t i=0;i  < 9;i++){
		char namecont[100];
  		if(iside==0 && icoord==0)
		  snprintf(namecont,100,"hQxc2_%i",i);
		else if(iside==1 && icoord==0)
		  snprintf(namecont,100,"hQxa2_%i",i);
		else if(iside==0 && icoord==1)
		  snprintf(namecont,100,"hQyc2_%i",i);
		else if(iside==1 && icoord==1)
		  snprintf(namecont,100,"hQya2_%i",i);

		cont = (AliOADBContainer*) foadb->Get(namecont);
		if(!cont){
		    printf("OADB object %s is not available in the file\n",namecont);
		    return;	
		}
	
		if(!(cont->GetObject(run))){
		    printf("OADB object %s is not available for run %i (used run 137366)\n",namecont,run);
		    run = 137366;
		}

                // after grabbing all the info, set the CORRECTION TERMS to
                // the 2nd and 3rd order qsub-vectors
                // we do this here for all centralities, so that subsequent events
                // can grab the correction from these cached values
                fMeanQ[i][iside][icoord] = ((TH1F *) cont->GetObject(run))->GetMean();
		fWidthQ[i][iside][icoord] = ((TH1F *) cont->GetObject(run))->GetRMS();

		//for v3
		if(iside==0 && icoord==0)
		  snprintf(namecont,100,"hQxc3_%i",i);
		else if(iside==1 && icoord==0)
		  snprintf(namecont,100,"hQxa3_%i",i);
		else if(iside==0 && icoord==1)
		  snprintf(namecont,100,"hQyc3_%i",i);
		else if(iside==1 && icoord==1)
		  snprintf(namecont,100,"hQya3_%i",i);

		cont = (AliOADBContainer*) foadb->Get(namecont);
		if(!cont){
		    printf("OADB object %s is not available in the file\n",namecont);
		    return;	
		}
		
		if(!(cont->GetObject(run))){
		    printf("OADB object %s is not available for run %i (used run 137366)\n",namecont,run);
		    run = 137366;
		}
		fMeanQv3[i][iside][icoord] = ((TH1F *) cont->GetObject(run))->GetMean();
		fWidthQv3[i][iside][icoord] = ((TH1F *) cont->GetObject(run))->GetRMS();

     	    }
	}
    }
    // set the recentering style (might be switched back to -1 if recentering is disabeled)
    fApplyRecentering = 2010;
}
//_____________________________________________________________________________

void AliFlowEvent::ClearFast()
{
  //clear the event without releasing any memory
  //note that cached run number of recentering settigns are not clear 
  //(see AliFlowEvent::ClearCachedRun() )
  AliFlowEventSimple::ClearFast();
}

//_____________________________________________________________________________

void AliFlowEvent::ClearCachedRun()
{
    //clear the cached run (not in clear fast as cache needs to be persistent in most cases )
  fCachedRun=0;  
  fApplyRecentering=0;
}
 AliFlowEvent.cxx:1
 AliFlowEvent.cxx:2
 AliFlowEvent.cxx:3
 AliFlowEvent.cxx:4
 AliFlowEvent.cxx:5
 AliFlowEvent.cxx:6
 AliFlowEvent.cxx:7
 AliFlowEvent.cxx:8
 AliFlowEvent.cxx:9
 AliFlowEvent.cxx:10
 AliFlowEvent.cxx:11
 AliFlowEvent.cxx:12
 AliFlowEvent.cxx:13
 AliFlowEvent.cxx:14
 AliFlowEvent.cxx:15
 AliFlowEvent.cxx:16
 AliFlowEvent.cxx:17
 AliFlowEvent.cxx:18
 AliFlowEvent.cxx:19
 AliFlowEvent.cxx:20
 AliFlowEvent.cxx:21
 AliFlowEvent.cxx:22
 AliFlowEvent.cxx:23
 AliFlowEvent.cxx:24
 AliFlowEvent.cxx:25
 AliFlowEvent.cxx:26
 AliFlowEvent.cxx:27
 AliFlowEvent.cxx:28
 AliFlowEvent.cxx:29
 AliFlowEvent.cxx:30
 AliFlowEvent.cxx:31
 AliFlowEvent.cxx:32
 AliFlowEvent.cxx:33
 AliFlowEvent.cxx:34
 AliFlowEvent.cxx:35
 AliFlowEvent.cxx:36
 AliFlowEvent.cxx:37
 AliFlowEvent.cxx:38
 AliFlowEvent.cxx:39
 AliFlowEvent.cxx:40
 AliFlowEvent.cxx:41
 AliFlowEvent.cxx:42
 AliFlowEvent.cxx:43
 AliFlowEvent.cxx:44
 AliFlowEvent.cxx:45
 AliFlowEvent.cxx:46
 AliFlowEvent.cxx:47
 AliFlowEvent.cxx:48
 AliFlowEvent.cxx:49
 AliFlowEvent.cxx:50
 AliFlowEvent.cxx:51
 AliFlowEvent.cxx:52
 AliFlowEvent.cxx:53
 AliFlowEvent.cxx:54
 AliFlowEvent.cxx:55
 AliFlowEvent.cxx:56
 AliFlowEvent.cxx:57
 AliFlowEvent.cxx:58
 AliFlowEvent.cxx:59
 AliFlowEvent.cxx:60
 AliFlowEvent.cxx:61
 AliFlowEvent.cxx:62
 AliFlowEvent.cxx:63
 AliFlowEvent.cxx:64
 AliFlowEvent.cxx:65
 AliFlowEvent.cxx:66
 AliFlowEvent.cxx:67
 AliFlowEvent.cxx:68
 AliFlowEvent.cxx:69
 AliFlowEvent.cxx:70
 AliFlowEvent.cxx:71
 AliFlowEvent.cxx:72
 AliFlowEvent.cxx:73
 AliFlowEvent.cxx:74
 AliFlowEvent.cxx:75
 AliFlowEvent.cxx:76
 AliFlowEvent.cxx:77
 AliFlowEvent.cxx:78
 AliFlowEvent.cxx:79
 AliFlowEvent.cxx:80
 AliFlowEvent.cxx:81
 AliFlowEvent.cxx:82
 AliFlowEvent.cxx:83
 AliFlowEvent.cxx:84
 AliFlowEvent.cxx:85
 AliFlowEvent.cxx:86
 AliFlowEvent.cxx:87
 AliFlowEvent.cxx:88
 AliFlowEvent.cxx:89
 AliFlowEvent.cxx:90
 AliFlowEvent.cxx:91
 AliFlowEvent.cxx:92
 AliFlowEvent.cxx:93
 AliFlowEvent.cxx:94
 AliFlowEvent.cxx:95
 AliFlowEvent.cxx:96
 AliFlowEvent.cxx:97
 AliFlowEvent.cxx:98
 AliFlowEvent.cxx:99
 AliFlowEvent.cxx:100
 AliFlowEvent.cxx:101
 AliFlowEvent.cxx:102
 AliFlowEvent.cxx:103
 AliFlowEvent.cxx:104
 AliFlowEvent.cxx:105
 AliFlowEvent.cxx:106
 AliFlowEvent.cxx:107
 AliFlowEvent.cxx:108
 AliFlowEvent.cxx:109
 AliFlowEvent.cxx:110
 AliFlowEvent.cxx:111
 AliFlowEvent.cxx:112
 AliFlowEvent.cxx:113
 AliFlowEvent.cxx:114
 AliFlowEvent.cxx:115
 AliFlowEvent.cxx:116
 AliFlowEvent.cxx:117
 AliFlowEvent.cxx:118
 AliFlowEvent.cxx:119
 AliFlowEvent.cxx:120
 AliFlowEvent.cxx:121
 AliFlowEvent.cxx:122
 AliFlowEvent.cxx:123
 AliFlowEvent.cxx:124
 AliFlowEvent.cxx:125
 AliFlowEvent.cxx:126
 AliFlowEvent.cxx:127
 AliFlowEvent.cxx:128
 AliFlowEvent.cxx:129
 AliFlowEvent.cxx:130
 AliFlowEvent.cxx:131
 AliFlowEvent.cxx:132
 AliFlowEvent.cxx:133
 AliFlowEvent.cxx:134
 AliFlowEvent.cxx:135
 AliFlowEvent.cxx:136
 AliFlowEvent.cxx:137
 AliFlowEvent.cxx:138
 AliFlowEvent.cxx:139
 AliFlowEvent.cxx:140
 AliFlowEvent.cxx:141
 AliFlowEvent.cxx:142
 AliFlowEvent.cxx:143
 AliFlowEvent.cxx:144
 AliFlowEvent.cxx:145
 AliFlowEvent.cxx:146
 AliFlowEvent.cxx:147
 AliFlowEvent.cxx:148
 AliFlowEvent.cxx:149
 AliFlowEvent.cxx:150
 AliFlowEvent.cxx:151
 AliFlowEvent.cxx:152
 AliFlowEvent.cxx:153
 AliFlowEvent.cxx:154
 AliFlowEvent.cxx:155
 AliFlowEvent.cxx:156
 AliFlowEvent.cxx:157
 AliFlowEvent.cxx:158
 AliFlowEvent.cxx:159
 AliFlowEvent.cxx:160
 AliFlowEvent.cxx:161
 AliFlowEvent.cxx:162
 AliFlowEvent.cxx:163
 AliFlowEvent.cxx:164
 AliFlowEvent.cxx:165
 AliFlowEvent.cxx:166
 AliFlowEvent.cxx:167
 AliFlowEvent.cxx:168
 AliFlowEvent.cxx:169
 AliFlowEvent.cxx:170
 AliFlowEvent.cxx:171
 AliFlowEvent.cxx:172
 AliFlowEvent.cxx:173
 AliFlowEvent.cxx:174
 AliFlowEvent.cxx:175
 AliFlowEvent.cxx:176
 AliFlowEvent.cxx:177
 AliFlowEvent.cxx:178
 AliFlowEvent.cxx:179
 AliFlowEvent.cxx:180
 AliFlowEvent.cxx:181
 AliFlowEvent.cxx:182
 AliFlowEvent.cxx:183
 AliFlowEvent.cxx:184
 AliFlowEvent.cxx:185
 AliFlowEvent.cxx:186
 AliFlowEvent.cxx:187
 AliFlowEvent.cxx:188
 AliFlowEvent.cxx:189
 AliFlowEvent.cxx:190
 AliFlowEvent.cxx:191
 AliFlowEvent.cxx:192
 AliFlowEvent.cxx:193
 AliFlowEvent.cxx:194
 AliFlowEvent.cxx:195
 AliFlowEvent.cxx:196
 AliFlowEvent.cxx:197
 AliFlowEvent.cxx:198
 AliFlowEvent.cxx:199
 AliFlowEvent.cxx:200
 AliFlowEvent.cxx:201
 AliFlowEvent.cxx:202
 AliFlowEvent.cxx:203
 AliFlowEvent.cxx:204
 AliFlowEvent.cxx:205
 AliFlowEvent.cxx:206
 AliFlowEvent.cxx:207
 AliFlowEvent.cxx:208
 AliFlowEvent.cxx:209
 AliFlowEvent.cxx:210
 AliFlowEvent.cxx:211
 AliFlowEvent.cxx:212
 AliFlowEvent.cxx:213
 AliFlowEvent.cxx:214
 AliFlowEvent.cxx:215
 AliFlowEvent.cxx:216
 AliFlowEvent.cxx:217
 AliFlowEvent.cxx:218
 AliFlowEvent.cxx:219
 AliFlowEvent.cxx:220
 AliFlowEvent.cxx:221
 AliFlowEvent.cxx:222
 AliFlowEvent.cxx:223
 AliFlowEvent.cxx:224
 AliFlowEvent.cxx:225
 AliFlowEvent.cxx:226
 AliFlowEvent.cxx:227
 AliFlowEvent.cxx:228
 AliFlowEvent.cxx:229
 AliFlowEvent.cxx:230
 AliFlowEvent.cxx:231
 AliFlowEvent.cxx:232
 AliFlowEvent.cxx:233
 AliFlowEvent.cxx:234
 AliFlowEvent.cxx:235
 AliFlowEvent.cxx:236
 AliFlowEvent.cxx:237
 AliFlowEvent.cxx:238
 AliFlowEvent.cxx:239
 AliFlowEvent.cxx:240
 AliFlowEvent.cxx:241
 AliFlowEvent.cxx:242
 AliFlowEvent.cxx:243
 AliFlowEvent.cxx:244
 AliFlowEvent.cxx:245
 AliFlowEvent.cxx:246
 AliFlowEvent.cxx:247
 AliFlowEvent.cxx:248
 AliFlowEvent.cxx:249
 AliFlowEvent.cxx:250
 AliFlowEvent.cxx:251
 AliFlowEvent.cxx:252
 AliFlowEvent.cxx:253
 AliFlowEvent.cxx:254
 AliFlowEvent.cxx:255
 AliFlowEvent.cxx:256
 AliFlowEvent.cxx:257
 AliFlowEvent.cxx:258
 AliFlowEvent.cxx:259
 AliFlowEvent.cxx:260
 AliFlowEvent.cxx:261
 AliFlowEvent.cxx:262
 AliFlowEvent.cxx:263
 AliFlowEvent.cxx:264
 AliFlowEvent.cxx:265
 AliFlowEvent.cxx:266
 AliFlowEvent.cxx:267
 AliFlowEvent.cxx:268
 AliFlowEvent.cxx:269
 AliFlowEvent.cxx:270
 AliFlowEvent.cxx:271
 AliFlowEvent.cxx:272
 AliFlowEvent.cxx:273
 AliFlowEvent.cxx:274
 AliFlowEvent.cxx:275
 AliFlowEvent.cxx:276
 AliFlowEvent.cxx:277
 AliFlowEvent.cxx:278
 AliFlowEvent.cxx:279
 AliFlowEvent.cxx:280
 AliFlowEvent.cxx:281
 AliFlowEvent.cxx:282
 AliFlowEvent.cxx:283
 AliFlowEvent.cxx:284
 AliFlowEvent.cxx:285
 AliFlowEvent.cxx:286
 AliFlowEvent.cxx:287
 AliFlowEvent.cxx:288
 AliFlowEvent.cxx:289
 AliFlowEvent.cxx:290
 AliFlowEvent.cxx:291
 AliFlowEvent.cxx:292
 AliFlowEvent.cxx:293
 AliFlowEvent.cxx:294
 AliFlowEvent.cxx:295
 AliFlowEvent.cxx:296
 AliFlowEvent.cxx:297
 AliFlowEvent.cxx:298
 AliFlowEvent.cxx:299
 AliFlowEvent.cxx:300
 AliFlowEvent.cxx:301
 AliFlowEvent.cxx:302
 AliFlowEvent.cxx:303
 AliFlowEvent.cxx:304
 AliFlowEvent.cxx:305
 AliFlowEvent.cxx:306
 AliFlowEvent.cxx:307
 AliFlowEvent.cxx:308
 AliFlowEvent.cxx:309
 AliFlowEvent.cxx:310
 AliFlowEvent.cxx:311
 AliFlowEvent.cxx:312
 AliFlowEvent.cxx:313
 AliFlowEvent.cxx:314
 AliFlowEvent.cxx:315
 AliFlowEvent.cxx:316
 AliFlowEvent.cxx:317
 AliFlowEvent.cxx:318
 AliFlowEvent.cxx:319
 AliFlowEvent.cxx:320
 AliFlowEvent.cxx:321
 AliFlowEvent.cxx:322
 AliFlowEvent.cxx:323
 AliFlowEvent.cxx:324
 AliFlowEvent.cxx:325
 AliFlowEvent.cxx:326
 AliFlowEvent.cxx:327
 AliFlowEvent.cxx:328
 AliFlowEvent.cxx:329
 AliFlowEvent.cxx:330
 AliFlowEvent.cxx:331
 AliFlowEvent.cxx:332
 AliFlowEvent.cxx:333
 AliFlowEvent.cxx:334
 AliFlowEvent.cxx:335
 AliFlowEvent.cxx:336
 AliFlowEvent.cxx:337
 AliFlowEvent.cxx:338
 AliFlowEvent.cxx:339
 AliFlowEvent.cxx:340
 AliFlowEvent.cxx:341
 AliFlowEvent.cxx:342
 AliFlowEvent.cxx:343
 AliFlowEvent.cxx:344
 AliFlowEvent.cxx:345
 AliFlowEvent.cxx:346
 AliFlowEvent.cxx:347
 AliFlowEvent.cxx:348
 AliFlowEvent.cxx:349
 AliFlowEvent.cxx:350
 AliFlowEvent.cxx:351
 AliFlowEvent.cxx:352
 AliFlowEvent.cxx:353
 AliFlowEvent.cxx:354
 AliFlowEvent.cxx:355
 AliFlowEvent.cxx:356
 AliFlowEvent.cxx:357
 AliFlowEvent.cxx:358
 AliFlowEvent.cxx:359
 AliFlowEvent.cxx:360
 AliFlowEvent.cxx:361
 AliFlowEvent.cxx:362
 AliFlowEvent.cxx:363
 AliFlowEvent.cxx:364
 AliFlowEvent.cxx:365
 AliFlowEvent.cxx:366
 AliFlowEvent.cxx:367
 AliFlowEvent.cxx:368
 AliFlowEvent.cxx:369
 AliFlowEvent.cxx:370
 AliFlowEvent.cxx:371
 AliFlowEvent.cxx:372
 AliFlowEvent.cxx:373
 AliFlowEvent.cxx:374
 AliFlowEvent.cxx:375
 AliFlowEvent.cxx:376
 AliFlowEvent.cxx:377
 AliFlowEvent.cxx:378
 AliFlowEvent.cxx:379
 AliFlowEvent.cxx:380
 AliFlowEvent.cxx:381
 AliFlowEvent.cxx:382
 AliFlowEvent.cxx:383
 AliFlowEvent.cxx:384
 AliFlowEvent.cxx:385
 AliFlowEvent.cxx:386
 AliFlowEvent.cxx:387
 AliFlowEvent.cxx:388
 AliFlowEvent.cxx:389
 AliFlowEvent.cxx:390
 AliFlowEvent.cxx:391
 AliFlowEvent.cxx:392
 AliFlowEvent.cxx:393
 AliFlowEvent.cxx:394
 AliFlowEvent.cxx:395
 AliFlowEvent.cxx:396
 AliFlowEvent.cxx:397
 AliFlowEvent.cxx:398
 AliFlowEvent.cxx:399
 AliFlowEvent.cxx:400
 AliFlowEvent.cxx:401
 AliFlowEvent.cxx:402
 AliFlowEvent.cxx:403
 AliFlowEvent.cxx:404
 AliFlowEvent.cxx:405
 AliFlowEvent.cxx:406
 AliFlowEvent.cxx:407
 AliFlowEvent.cxx:408
 AliFlowEvent.cxx:409
 AliFlowEvent.cxx:410
 AliFlowEvent.cxx:411
 AliFlowEvent.cxx:412
 AliFlowEvent.cxx:413
 AliFlowEvent.cxx:414
 AliFlowEvent.cxx:415
 AliFlowEvent.cxx:416
 AliFlowEvent.cxx:417
 AliFlowEvent.cxx:418
 AliFlowEvent.cxx:419
 AliFlowEvent.cxx:420
 AliFlowEvent.cxx:421
 AliFlowEvent.cxx:422
 AliFlowEvent.cxx:423
 AliFlowEvent.cxx:424
 AliFlowEvent.cxx:425
 AliFlowEvent.cxx:426
 AliFlowEvent.cxx:427
 AliFlowEvent.cxx:428
 AliFlowEvent.cxx:429
 AliFlowEvent.cxx:430
 AliFlowEvent.cxx:431
 AliFlowEvent.cxx:432
 AliFlowEvent.cxx:433
 AliFlowEvent.cxx:434
 AliFlowEvent.cxx:435
 AliFlowEvent.cxx:436
 AliFlowEvent.cxx:437
 AliFlowEvent.cxx:438
 AliFlowEvent.cxx:439
 AliFlowEvent.cxx:440
 AliFlowEvent.cxx:441
 AliFlowEvent.cxx:442
 AliFlowEvent.cxx:443
 AliFlowEvent.cxx:444
 AliFlowEvent.cxx:445
 AliFlowEvent.cxx:446
 AliFlowEvent.cxx:447
 AliFlowEvent.cxx:448
 AliFlowEvent.cxx:449
 AliFlowEvent.cxx:450
 AliFlowEvent.cxx:451
 AliFlowEvent.cxx:452
 AliFlowEvent.cxx:453
 AliFlowEvent.cxx:454
 AliFlowEvent.cxx:455
 AliFlowEvent.cxx:456
 AliFlowEvent.cxx:457
 AliFlowEvent.cxx:458
 AliFlowEvent.cxx:459
 AliFlowEvent.cxx:460
 AliFlowEvent.cxx:461
 AliFlowEvent.cxx:462
 AliFlowEvent.cxx:463
 AliFlowEvent.cxx:464
 AliFlowEvent.cxx:465
 AliFlowEvent.cxx:466
 AliFlowEvent.cxx:467
 AliFlowEvent.cxx:468
 AliFlowEvent.cxx:469
 AliFlowEvent.cxx:470
 AliFlowEvent.cxx:471
 AliFlowEvent.cxx:472
 AliFlowEvent.cxx:473
 AliFlowEvent.cxx:474
 AliFlowEvent.cxx:475
 AliFlowEvent.cxx:476
 AliFlowEvent.cxx:477
 AliFlowEvent.cxx:478
 AliFlowEvent.cxx:479
 AliFlowEvent.cxx:480
 AliFlowEvent.cxx:481
 AliFlowEvent.cxx:482
 AliFlowEvent.cxx:483
 AliFlowEvent.cxx:484
 AliFlowEvent.cxx:485
 AliFlowEvent.cxx:486
 AliFlowEvent.cxx:487
 AliFlowEvent.cxx:488
 AliFlowEvent.cxx:489
 AliFlowEvent.cxx:490
 AliFlowEvent.cxx:491
 AliFlowEvent.cxx:492
 AliFlowEvent.cxx:493
 AliFlowEvent.cxx:494
 AliFlowEvent.cxx:495
 AliFlowEvent.cxx:496
 AliFlowEvent.cxx:497
 AliFlowEvent.cxx:498
 AliFlowEvent.cxx:499
 AliFlowEvent.cxx:500
 AliFlowEvent.cxx:501
 AliFlowEvent.cxx:502
 AliFlowEvent.cxx:503
 AliFlowEvent.cxx:504
 AliFlowEvent.cxx:505
 AliFlowEvent.cxx:506
 AliFlowEvent.cxx:507
 AliFlowEvent.cxx:508
 AliFlowEvent.cxx:509
 AliFlowEvent.cxx:510
 AliFlowEvent.cxx:511
 AliFlowEvent.cxx:512
 AliFlowEvent.cxx:513
 AliFlowEvent.cxx:514
 AliFlowEvent.cxx:515
 AliFlowEvent.cxx:516
 AliFlowEvent.cxx:517
 AliFlowEvent.cxx:518
 AliFlowEvent.cxx:519
 AliFlowEvent.cxx:520
 AliFlowEvent.cxx:521
 AliFlowEvent.cxx:522
 AliFlowEvent.cxx:523
 AliFlowEvent.cxx:524
 AliFlowEvent.cxx:525
 AliFlowEvent.cxx:526
 AliFlowEvent.cxx:527
 AliFlowEvent.cxx:528
 AliFlowEvent.cxx:529
 AliFlowEvent.cxx:530
 AliFlowEvent.cxx:531
 AliFlowEvent.cxx:532
 AliFlowEvent.cxx:533
 AliFlowEvent.cxx:534
 AliFlowEvent.cxx:535
 AliFlowEvent.cxx:536
 AliFlowEvent.cxx:537
 AliFlowEvent.cxx:538
 AliFlowEvent.cxx:539
 AliFlowEvent.cxx:540
 AliFlowEvent.cxx:541
 AliFlowEvent.cxx:542
 AliFlowEvent.cxx:543
 AliFlowEvent.cxx:544
 AliFlowEvent.cxx:545
 AliFlowEvent.cxx:546
 AliFlowEvent.cxx:547
 AliFlowEvent.cxx:548
 AliFlowEvent.cxx:549
 AliFlowEvent.cxx:550
 AliFlowEvent.cxx:551
 AliFlowEvent.cxx:552
 AliFlowEvent.cxx:553
 AliFlowEvent.cxx:554
 AliFlowEvent.cxx:555
 AliFlowEvent.cxx:556
 AliFlowEvent.cxx:557
 AliFlowEvent.cxx:558
 AliFlowEvent.cxx:559
 AliFlowEvent.cxx:560
 AliFlowEvent.cxx:561
 AliFlowEvent.cxx:562
 AliFlowEvent.cxx:563
 AliFlowEvent.cxx:564
 AliFlowEvent.cxx:565
 AliFlowEvent.cxx:566
 AliFlowEvent.cxx:567
 AliFlowEvent.cxx:568
 AliFlowEvent.cxx:569
 AliFlowEvent.cxx:570
 AliFlowEvent.cxx:571
 AliFlowEvent.cxx:572
 AliFlowEvent.cxx:573
 AliFlowEvent.cxx:574
 AliFlowEvent.cxx:575
 AliFlowEvent.cxx:576
 AliFlowEvent.cxx:577
 AliFlowEvent.cxx:578
 AliFlowEvent.cxx:579
 AliFlowEvent.cxx:580
 AliFlowEvent.cxx:581
 AliFlowEvent.cxx:582
 AliFlowEvent.cxx:583
 AliFlowEvent.cxx:584
 AliFlowEvent.cxx:585
 AliFlowEvent.cxx:586
 AliFlowEvent.cxx:587
 AliFlowEvent.cxx:588
 AliFlowEvent.cxx:589
 AliFlowEvent.cxx:590
 AliFlowEvent.cxx:591
 AliFlowEvent.cxx:592
 AliFlowEvent.cxx:593
 AliFlowEvent.cxx:594
 AliFlowEvent.cxx:595
 AliFlowEvent.cxx:596
 AliFlowEvent.cxx:597
 AliFlowEvent.cxx:598
 AliFlowEvent.cxx:599
 AliFlowEvent.cxx:600
 AliFlowEvent.cxx:601
 AliFlowEvent.cxx:602
 AliFlowEvent.cxx:603
 AliFlowEvent.cxx:604
 AliFlowEvent.cxx:605
 AliFlowEvent.cxx:606
 AliFlowEvent.cxx:607
 AliFlowEvent.cxx:608
 AliFlowEvent.cxx:609
 AliFlowEvent.cxx:610
 AliFlowEvent.cxx:611
 AliFlowEvent.cxx:612
 AliFlowEvent.cxx:613
 AliFlowEvent.cxx:614
 AliFlowEvent.cxx:615
 AliFlowEvent.cxx:616
 AliFlowEvent.cxx:617
 AliFlowEvent.cxx:618
 AliFlowEvent.cxx:619
 AliFlowEvent.cxx:620
 AliFlowEvent.cxx:621
 AliFlowEvent.cxx:622
 AliFlowEvent.cxx:623
 AliFlowEvent.cxx:624
 AliFlowEvent.cxx:625
 AliFlowEvent.cxx:626
 AliFlowEvent.cxx:627
 AliFlowEvent.cxx:628
 AliFlowEvent.cxx:629
 AliFlowEvent.cxx:630
 AliFlowEvent.cxx:631
 AliFlowEvent.cxx:632
 AliFlowEvent.cxx:633
 AliFlowEvent.cxx:634
 AliFlowEvent.cxx:635
 AliFlowEvent.cxx:636
 AliFlowEvent.cxx:637
 AliFlowEvent.cxx:638
 AliFlowEvent.cxx:639
 AliFlowEvent.cxx:640
 AliFlowEvent.cxx:641
 AliFlowEvent.cxx:642
 AliFlowEvent.cxx:643
 AliFlowEvent.cxx:644
 AliFlowEvent.cxx:645
 AliFlowEvent.cxx:646
 AliFlowEvent.cxx:647
 AliFlowEvent.cxx:648
 AliFlowEvent.cxx:649
 AliFlowEvent.cxx:650
 AliFlowEvent.cxx:651
 AliFlowEvent.cxx:652
 AliFlowEvent.cxx:653
 AliFlowEvent.cxx:654
 AliFlowEvent.cxx:655
 AliFlowEvent.cxx:656
 AliFlowEvent.cxx:657
 AliFlowEvent.cxx:658
 AliFlowEvent.cxx:659
 AliFlowEvent.cxx:660
 AliFlowEvent.cxx:661
 AliFlowEvent.cxx:662
 AliFlowEvent.cxx:663
 AliFlowEvent.cxx:664
 AliFlowEvent.cxx:665
 AliFlowEvent.cxx:666
 AliFlowEvent.cxx:667
 AliFlowEvent.cxx:668
 AliFlowEvent.cxx:669
 AliFlowEvent.cxx:670
 AliFlowEvent.cxx:671
 AliFlowEvent.cxx:672
 AliFlowEvent.cxx:673
 AliFlowEvent.cxx:674
 AliFlowEvent.cxx:675
 AliFlowEvent.cxx:676
 AliFlowEvent.cxx:677
 AliFlowEvent.cxx:678
 AliFlowEvent.cxx:679
 AliFlowEvent.cxx:680
 AliFlowEvent.cxx:681
 AliFlowEvent.cxx:682
 AliFlowEvent.cxx:683
 AliFlowEvent.cxx:684
 AliFlowEvent.cxx:685
 AliFlowEvent.cxx:686
 AliFlowEvent.cxx:687
 AliFlowEvent.cxx:688
 AliFlowEvent.cxx:689
 AliFlowEvent.cxx:690
 AliFlowEvent.cxx:691
 AliFlowEvent.cxx:692
 AliFlowEvent.cxx:693
 AliFlowEvent.cxx:694
 AliFlowEvent.cxx:695
 AliFlowEvent.cxx:696
 AliFlowEvent.cxx:697
 AliFlowEvent.cxx:698
 AliFlowEvent.cxx:699
 AliFlowEvent.cxx:700
 AliFlowEvent.cxx:701
 AliFlowEvent.cxx:702
 AliFlowEvent.cxx:703
 AliFlowEvent.cxx:704
 AliFlowEvent.cxx:705
 AliFlowEvent.cxx:706
 AliFlowEvent.cxx:707
 AliFlowEvent.cxx:708
 AliFlowEvent.cxx:709
 AliFlowEvent.cxx:710
 AliFlowEvent.cxx:711
 AliFlowEvent.cxx:712
 AliFlowEvent.cxx:713
 AliFlowEvent.cxx:714
 AliFlowEvent.cxx:715
 AliFlowEvent.cxx:716
 AliFlowEvent.cxx:717
 AliFlowEvent.cxx:718
 AliFlowEvent.cxx:719
 AliFlowEvent.cxx:720
 AliFlowEvent.cxx:721
 AliFlowEvent.cxx:722
 AliFlowEvent.cxx:723
 AliFlowEvent.cxx:724
 AliFlowEvent.cxx:725
 AliFlowEvent.cxx:726
 AliFlowEvent.cxx:727
 AliFlowEvent.cxx:728
 AliFlowEvent.cxx:729
 AliFlowEvent.cxx:730
 AliFlowEvent.cxx:731
 AliFlowEvent.cxx:732
 AliFlowEvent.cxx:733
 AliFlowEvent.cxx:734
 AliFlowEvent.cxx:735
 AliFlowEvent.cxx:736
 AliFlowEvent.cxx:737
 AliFlowEvent.cxx:738
 AliFlowEvent.cxx:739
 AliFlowEvent.cxx:740
 AliFlowEvent.cxx:741
 AliFlowEvent.cxx:742
 AliFlowEvent.cxx:743
 AliFlowEvent.cxx:744
 AliFlowEvent.cxx:745
 AliFlowEvent.cxx:746
 AliFlowEvent.cxx:747
 AliFlowEvent.cxx:748
 AliFlowEvent.cxx:749
 AliFlowEvent.cxx:750
 AliFlowEvent.cxx:751
 AliFlowEvent.cxx:752
 AliFlowEvent.cxx:753
 AliFlowEvent.cxx:754
 AliFlowEvent.cxx:755
 AliFlowEvent.cxx:756
 AliFlowEvent.cxx:757
 AliFlowEvent.cxx:758
 AliFlowEvent.cxx:759
 AliFlowEvent.cxx:760
 AliFlowEvent.cxx:761
 AliFlowEvent.cxx:762
 AliFlowEvent.cxx:763
 AliFlowEvent.cxx:764
 AliFlowEvent.cxx:765
 AliFlowEvent.cxx:766
 AliFlowEvent.cxx:767
 AliFlowEvent.cxx:768
 AliFlowEvent.cxx:769
 AliFlowEvent.cxx:770
 AliFlowEvent.cxx:771
 AliFlowEvent.cxx:772
 AliFlowEvent.cxx:773
 AliFlowEvent.cxx:774
 AliFlowEvent.cxx:775
 AliFlowEvent.cxx:776
 AliFlowEvent.cxx:777
 AliFlowEvent.cxx:778
 AliFlowEvent.cxx:779
 AliFlowEvent.cxx:780
 AliFlowEvent.cxx:781
 AliFlowEvent.cxx:782
 AliFlowEvent.cxx:783
 AliFlowEvent.cxx:784
 AliFlowEvent.cxx:785
 AliFlowEvent.cxx:786
 AliFlowEvent.cxx:787
 AliFlowEvent.cxx:788
 AliFlowEvent.cxx:789
 AliFlowEvent.cxx:790
 AliFlowEvent.cxx:791
 AliFlowEvent.cxx:792
 AliFlowEvent.cxx:793
 AliFlowEvent.cxx:794
 AliFlowEvent.cxx:795
 AliFlowEvent.cxx:796
 AliFlowEvent.cxx:797
 AliFlowEvent.cxx:798
 AliFlowEvent.cxx:799
 AliFlowEvent.cxx:800
 AliFlowEvent.cxx:801
 AliFlowEvent.cxx:802
 AliFlowEvent.cxx:803
 AliFlowEvent.cxx:804
 AliFlowEvent.cxx:805
 AliFlowEvent.cxx:806
 AliFlowEvent.cxx:807
 AliFlowEvent.cxx:808
 AliFlowEvent.cxx:809
 AliFlowEvent.cxx:810
 AliFlowEvent.cxx:811
 AliFlowEvent.cxx:812
 AliFlowEvent.cxx:813
 AliFlowEvent.cxx:814
 AliFlowEvent.cxx:815
 AliFlowEvent.cxx:816
 AliFlowEvent.cxx:817
 AliFlowEvent.cxx:818
 AliFlowEvent.cxx:819
 AliFlowEvent.cxx:820
 AliFlowEvent.cxx:821
 AliFlowEvent.cxx:822
 AliFlowEvent.cxx:823
 AliFlowEvent.cxx:824
 AliFlowEvent.cxx:825
 AliFlowEvent.cxx:826
 AliFlowEvent.cxx:827
 AliFlowEvent.cxx:828
 AliFlowEvent.cxx:829
 AliFlowEvent.cxx:830
 AliFlowEvent.cxx:831
 AliFlowEvent.cxx:832
 AliFlowEvent.cxx:833
 AliFlowEvent.cxx:834
 AliFlowEvent.cxx:835
 AliFlowEvent.cxx:836
 AliFlowEvent.cxx:837
 AliFlowEvent.cxx:838
 AliFlowEvent.cxx:839
 AliFlowEvent.cxx:840
 AliFlowEvent.cxx:841
 AliFlowEvent.cxx:842
 AliFlowEvent.cxx:843
 AliFlowEvent.cxx:844
 AliFlowEvent.cxx:845
 AliFlowEvent.cxx:846
 AliFlowEvent.cxx:847
 AliFlowEvent.cxx:848
 AliFlowEvent.cxx:849
 AliFlowEvent.cxx:850
 AliFlowEvent.cxx:851
 AliFlowEvent.cxx:852
 AliFlowEvent.cxx:853
 AliFlowEvent.cxx:854
 AliFlowEvent.cxx:855
 AliFlowEvent.cxx:856
 AliFlowEvent.cxx:857
 AliFlowEvent.cxx:858
 AliFlowEvent.cxx:859
 AliFlowEvent.cxx:860
 AliFlowEvent.cxx:861
 AliFlowEvent.cxx:862
 AliFlowEvent.cxx:863
 AliFlowEvent.cxx:864
 AliFlowEvent.cxx:865
 AliFlowEvent.cxx:866
 AliFlowEvent.cxx:867
 AliFlowEvent.cxx:868
 AliFlowEvent.cxx:869
 AliFlowEvent.cxx:870
 AliFlowEvent.cxx:871
 AliFlowEvent.cxx:872
 AliFlowEvent.cxx:873
 AliFlowEvent.cxx:874
 AliFlowEvent.cxx:875
 AliFlowEvent.cxx:876
 AliFlowEvent.cxx:877
 AliFlowEvent.cxx:878
 AliFlowEvent.cxx:879
 AliFlowEvent.cxx:880
 AliFlowEvent.cxx:881
 AliFlowEvent.cxx:882
 AliFlowEvent.cxx:883
 AliFlowEvent.cxx:884
 AliFlowEvent.cxx:885
 AliFlowEvent.cxx:886
 AliFlowEvent.cxx:887
 AliFlowEvent.cxx:888
 AliFlowEvent.cxx:889
 AliFlowEvent.cxx:890
 AliFlowEvent.cxx:891
 AliFlowEvent.cxx:892
 AliFlowEvent.cxx:893
 AliFlowEvent.cxx:894
 AliFlowEvent.cxx:895
 AliFlowEvent.cxx:896
 AliFlowEvent.cxx:897
 AliFlowEvent.cxx:898
 AliFlowEvent.cxx:899
 AliFlowEvent.cxx:900
 AliFlowEvent.cxx:901
 AliFlowEvent.cxx:902
 AliFlowEvent.cxx:903
 AliFlowEvent.cxx:904
 AliFlowEvent.cxx:905
 AliFlowEvent.cxx:906
 AliFlowEvent.cxx:907
 AliFlowEvent.cxx:908
 AliFlowEvent.cxx:909
 AliFlowEvent.cxx:910
 AliFlowEvent.cxx:911
 AliFlowEvent.cxx:912
 AliFlowEvent.cxx:913
 AliFlowEvent.cxx:914
 AliFlowEvent.cxx:915
 AliFlowEvent.cxx:916
 AliFlowEvent.cxx:917
 AliFlowEvent.cxx:918
 AliFlowEvent.cxx:919
 AliFlowEvent.cxx:920
 AliFlowEvent.cxx:921
 AliFlowEvent.cxx:922
 AliFlowEvent.cxx:923
 AliFlowEvent.cxx:924
 AliFlowEvent.cxx:925
 AliFlowEvent.cxx:926
 AliFlowEvent.cxx:927
 AliFlowEvent.cxx:928
 AliFlowEvent.cxx:929
 AliFlowEvent.cxx:930
 AliFlowEvent.cxx:931
 AliFlowEvent.cxx:932
 AliFlowEvent.cxx:933
 AliFlowEvent.cxx:934
 AliFlowEvent.cxx:935
 AliFlowEvent.cxx:936
 AliFlowEvent.cxx:937
 AliFlowEvent.cxx:938
 AliFlowEvent.cxx:939
 AliFlowEvent.cxx:940
 AliFlowEvent.cxx:941
 AliFlowEvent.cxx:942
 AliFlowEvent.cxx:943
 AliFlowEvent.cxx:944
 AliFlowEvent.cxx:945
 AliFlowEvent.cxx:946
 AliFlowEvent.cxx:947
 AliFlowEvent.cxx:948
 AliFlowEvent.cxx:949
 AliFlowEvent.cxx:950
 AliFlowEvent.cxx:951
 AliFlowEvent.cxx:952
 AliFlowEvent.cxx:953
 AliFlowEvent.cxx:954
 AliFlowEvent.cxx:955
 AliFlowEvent.cxx:956
 AliFlowEvent.cxx:957
 AliFlowEvent.cxx:958
 AliFlowEvent.cxx:959
 AliFlowEvent.cxx:960
 AliFlowEvent.cxx:961
 AliFlowEvent.cxx:962
 AliFlowEvent.cxx:963
 AliFlowEvent.cxx:964
 AliFlowEvent.cxx:965
 AliFlowEvent.cxx:966
 AliFlowEvent.cxx:967
 AliFlowEvent.cxx:968
 AliFlowEvent.cxx:969
 AliFlowEvent.cxx:970
 AliFlowEvent.cxx:971
 AliFlowEvent.cxx:972
 AliFlowEvent.cxx:973
 AliFlowEvent.cxx:974
 AliFlowEvent.cxx:975
 AliFlowEvent.cxx:976
 AliFlowEvent.cxx:977
 AliFlowEvent.cxx:978
 AliFlowEvent.cxx:979
 AliFlowEvent.cxx:980
 AliFlowEvent.cxx:981
 AliFlowEvent.cxx:982
 AliFlowEvent.cxx:983
 AliFlowEvent.cxx:984
 AliFlowEvent.cxx:985
 AliFlowEvent.cxx:986
 AliFlowEvent.cxx:987
 AliFlowEvent.cxx:988
 AliFlowEvent.cxx:989
 AliFlowEvent.cxx:990
 AliFlowEvent.cxx:991
 AliFlowEvent.cxx:992
 AliFlowEvent.cxx:993
 AliFlowEvent.cxx:994
 AliFlowEvent.cxx:995
 AliFlowEvent.cxx:996
 AliFlowEvent.cxx:997
 AliFlowEvent.cxx:998
 AliFlowEvent.cxx:999
 AliFlowEvent.cxx:1000
 AliFlowEvent.cxx:1001
 AliFlowEvent.cxx:1002
 AliFlowEvent.cxx:1003
 AliFlowEvent.cxx:1004
 AliFlowEvent.cxx:1005
 AliFlowEvent.cxx:1006
 AliFlowEvent.cxx:1007
 AliFlowEvent.cxx:1008
 AliFlowEvent.cxx:1009
 AliFlowEvent.cxx:1010
 AliFlowEvent.cxx:1011
 AliFlowEvent.cxx:1012
 AliFlowEvent.cxx:1013
 AliFlowEvent.cxx:1014
 AliFlowEvent.cxx:1015
 AliFlowEvent.cxx:1016
 AliFlowEvent.cxx:1017
 AliFlowEvent.cxx:1018
 AliFlowEvent.cxx:1019
 AliFlowEvent.cxx:1020
 AliFlowEvent.cxx:1021
 AliFlowEvent.cxx:1022
 AliFlowEvent.cxx:1023
 AliFlowEvent.cxx:1024
 AliFlowEvent.cxx:1025
 AliFlowEvent.cxx:1026
 AliFlowEvent.cxx:1027
 AliFlowEvent.cxx:1028
 AliFlowEvent.cxx:1029
 AliFlowEvent.cxx:1030
 AliFlowEvent.cxx:1031
 AliFlowEvent.cxx:1032
 AliFlowEvent.cxx:1033
 AliFlowEvent.cxx:1034
 AliFlowEvent.cxx:1035
 AliFlowEvent.cxx:1036
 AliFlowEvent.cxx:1037
 AliFlowEvent.cxx:1038
 AliFlowEvent.cxx:1039
 AliFlowEvent.cxx:1040
 AliFlowEvent.cxx:1041
 AliFlowEvent.cxx:1042
 AliFlowEvent.cxx:1043
 AliFlowEvent.cxx:1044
 AliFlowEvent.cxx:1045
 AliFlowEvent.cxx:1046
 AliFlowEvent.cxx:1047
 AliFlowEvent.cxx:1048
 AliFlowEvent.cxx:1049
 AliFlowEvent.cxx:1050
 AliFlowEvent.cxx:1051
 AliFlowEvent.cxx:1052
 AliFlowEvent.cxx:1053
 AliFlowEvent.cxx:1054
 AliFlowEvent.cxx:1055
 AliFlowEvent.cxx:1056
 AliFlowEvent.cxx:1057
 AliFlowEvent.cxx:1058
 AliFlowEvent.cxx:1059
 AliFlowEvent.cxx:1060
 AliFlowEvent.cxx:1061
 AliFlowEvent.cxx:1062
 AliFlowEvent.cxx:1063
 AliFlowEvent.cxx:1064
 AliFlowEvent.cxx:1065
 AliFlowEvent.cxx:1066
 AliFlowEvent.cxx:1067
 AliFlowEvent.cxx:1068
 AliFlowEvent.cxx:1069
 AliFlowEvent.cxx:1070
 AliFlowEvent.cxx:1071
 AliFlowEvent.cxx:1072
 AliFlowEvent.cxx:1073
 AliFlowEvent.cxx:1074
 AliFlowEvent.cxx:1075
 AliFlowEvent.cxx:1076
 AliFlowEvent.cxx:1077
 AliFlowEvent.cxx:1078
 AliFlowEvent.cxx:1079
 AliFlowEvent.cxx:1080
 AliFlowEvent.cxx:1081
 AliFlowEvent.cxx:1082
 AliFlowEvent.cxx:1083
 AliFlowEvent.cxx:1084
 AliFlowEvent.cxx:1085
 AliFlowEvent.cxx:1086
 AliFlowEvent.cxx:1087
 AliFlowEvent.cxx:1088
 AliFlowEvent.cxx:1089
 AliFlowEvent.cxx:1090
 AliFlowEvent.cxx:1091
 AliFlowEvent.cxx:1092
 AliFlowEvent.cxx:1093
 AliFlowEvent.cxx:1094
 AliFlowEvent.cxx:1095
 AliFlowEvent.cxx:1096
 AliFlowEvent.cxx:1097
 AliFlowEvent.cxx:1098
 AliFlowEvent.cxx:1099
 AliFlowEvent.cxx:1100
 AliFlowEvent.cxx:1101
 AliFlowEvent.cxx:1102
 AliFlowEvent.cxx:1103
 AliFlowEvent.cxx:1104
 AliFlowEvent.cxx:1105
 AliFlowEvent.cxx:1106
 AliFlowEvent.cxx:1107
 AliFlowEvent.cxx:1108
 AliFlowEvent.cxx:1109
 AliFlowEvent.cxx:1110
 AliFlowEvent.cxx:1111
 AliFlowEvent.cxx:1112
 AliFlowEvent.cxx:1113
 AliFlowEvent.cxx:1114
 AliFlowEvent.cxx:1115
 AliFlowEvent.cxx:1116
 AliFlowEvent.cxx:1117
 AliFlowEvent.cxx:1118
 AliFlowEvent.cxx:1119
 AliFlowEvent.cxx:1120
 AliFlowEvent.cxx:1121
 AliFlowEvent.cxx:1122
 AliFlowEvent.cxx:1123
 AliFlowEvent.cxx:1124
 AliFlowEvent.cxx:1125
 AliFlowEvent.cxx:1126
 AliFlowEvent.cxx:1127
 AliFlowEvent.cxx:1128
 AliFlowEvent.cxx:1129
 AliFlowEvent.cxx:1130
 AliFlowEvent.cxx:1131
 AliFlowEvent.cxx:1132
 AliFlowEvent.cxx:1133
 AliFlowEvent.cxx:1134
 AliFlowEvent.cxx:1135
 AliFlowEvent.cxx:1136
 AliFlowEvent.cxx:1137
 AliFlowEvent.cxx:1138
 AliFlowEvent.cxx:1139
 AliFlowEvent.cxx:1140
 AliFlowEvent.cxx:1141
 AliFlowEvent.cxx:1142
 AliFlowEvent.cxx:1143
 AliFlowEvent.cxx:1144
 AliFlowEvent.cxx:1145
 AliFlowEvent.cxx:1146
 AliFlowEvent.cxx:1147
 AliFlowEvent.cxx:1148
 AliFlowEvent.cxx:1149
 AliFlowEvent.cxx:1150
 AliFlowEvent.cxx:1151
 AliFlowEvent.cxx:1152
 AliFlowEvent.cxx:1153
 AliFlowEvent.cxx:1154
 AliFlowEvent.cxx:1155
 AliFlowEvent.cxx:1156
 AliFlowEvent.cxx:1157
 AliFlowEvent.cxx:1158
 AliFlowEvent.cxx:1159
 AliFlowEvent.cxx:1160
 AliFlowEvent.cxx:1161
 AliFlowEvent.cxx:1162
 AliFlowEvent.cxx:1163
 AliFlowEvent.cxx:1164
 AliFlowEvent.cxx:1165
 AliFlowEvent.cxx:1166
 AliFlowEvent.cxx:1167
 AliFlowEvent.cxx:1168
 AliFlowEvent.cxx:1169
 AliFlowEvent.cxx:1170
 AliFlowEvent.cxx:1171
 AliFlowEvent.cxx:1172
 AliFlowEvent.cxx:1173
 AliFlowEvent.cxx:1174
 AliFlowEvent.cxx:1175
 AliFlowEvent.cxx:1176
 AliFlowEvent.cxx:1177
 AliFlowEvent.cxx:1178
 AliFlowEvent.cxx:1179
 AliFlowEvent.cxx:1180
 AliFlowEvent.cxx:1181
 AliFlowEvent.cxx:1182
 AliFlowEvent.cxx:1183
 AliFlowEvent.cxx:1184
 AliFlowEvent.cxx:1185
 AliFlowEvent.cxx:1186
 AliFlowEvent.cxx:1187
 AliFlowEvent.cxx:1188
 AliFlowEvent.cxx:1189
 AliFlowEvent.cxx:1190
 AliFlowEvent.cxx:1191
 AliFlowEvent.cxx:1192
 AliFlowEvent.cxx:1193
 AliFlowEvent.cxx:1194
 AliFlowEvent.cxx:1195
 AliFlowEvent.cxx:1196
 AliFlowEvent.cxx:1197
 AliFlowEvent.cxx:1198
 AliFlowEvent.cxx:1199
 AliFlowEvent.cxx:1200
 AliFlowEvent.cxx:1201
 AliFlowEvent.cxx:1202
 AliFlowEvent.cxx:1203
 AliFlowEvent.cxx:1204
 AliFlowEvent.cxx:1205
 AliFlowEvent.cxx:1206
 AliFlowEvent.cxx:1207
 AliFlowEvent.cxx:1208
 AliFlowEvent.cxx:1209
 AliFlowEvent.cxx:1210
 AliFlowEvent.cxx:1211
 AliFlowEvent.cxx:1212
 AliFlowEvent.cxx:1213
 AliFlowEvent.cxx:1214
 AliFlowEvent.cxx:1215
 AliFlowEvent.cxx:1216
 AliFlowEvent.cxx:1217
 AliFlowEvent.cxx:1218
 AliFlowEvent.cxx:1219
 AliFlowEvent.cxx:1220
 AliFlowEvent.cxx:1221
 AliFlowEvent.cxx:1222
 AliFlowEvent.cxx:1223
 AliFlowEvent.cxx:1224
 AliFlowEvent.cxx:1225
 AliFlowEvent.cxx:1226
 AliFlowEvent.cxx:1227
 AliFlowEvent.cxx:1228
 AliFlowEvent.cxx:1229
 AliFlowEvent.cxx:1230
 AliFlowEvent.cxx:1231
 AliFlowEvent.cxx:1232
 AliFlowEvent.cxx:1233
 AliFlowEvent.cxx:1234
 AliFlowEvent.cxx:1235
 AliFlowEvent.cxx:1236
 AliFlowEvent.cxx:1237
 AliFlowEvent.cxx:1238
 AliFlowEvent.cxx:1239
 AliFlowEvent.cxx:1240
 AliFlowEvent.cxx:1241
 AliFlowEvent.cxx:1242
 AliFlowEvent.cxx:1243
 AliFlowEvent.cxx:1244
 AliFlowEvent.cxx:1245
 AliFlowEvent.cxx:1246
 AliFlowEvent.cxx:1247
 AliFlowEvent.cxx:1248
 AliFlowEvent.cxx:1249
 AliFlowEvent.cxx:1250
 AliFlowEvent.cxx:1251
 AliFlowEvent.cxx:1252
 AliFlowEvent.cxx:1253
 AliFlowEvent.cxx:1254
 AliFlowEvent.cxx:1255
 AliFlowEvent.cxx:1256
 AliFlowEvent.cxx:1257
 AliFlowEvent.cxx:1258
 AliFlowEvent.cxx:1259
 AliFlowEvent.cxx:1260
 AliFlowEvent.cxx:1261
 AliFlowEvent.cxx:1262
 AliFlowEvent.cxx:1263
 AliFlowEvent.cxx:1264
 AliFlowEvent.cxx:1265
 AliFlowEvent.cxx:1266
 AliFlowEvent.cxx:1267
 AliFlowEvent.cxx:1268
 AliFlowEvent.cxx:1269
 AliFlowEvent.cxx:1270
 AliFlowEvent.cxx:1271
 AliFlowEvent.cxx:1272
 AliFlowEvent.cxx:1273
 AliFlowEvent.cxx:1274
 AliFlowEvent.cxx:1275
 AliFlowEvent.cxx:1276
 AliFlowEvent.cxx:1277
 AliFlowEvent.cxx:1278
 AliFlowEvent.cxx:1279
 AliFlowEvent.cxx:1280
 AliFlowEvent.cxx:1281
 AliFlowEvent.cxx:1282
 AliFlowEvent.cxx:1283
 AliFlowEvent.cxx:1284
 AliFlowEvent.cxx:1285
 AliFlowEvent.cxx:1286
 AliFlowEvent.cxx:1287
 AliFlowEvent.cxx:1288
 AliFlowEvent.cxx:1289
 AliFlowEvent.cxx:1290
 AliFlowEvent.cxx:1291
 AliFlowEvent.cxx:1292
 AliFlowEvent.cxx:1293
 AliFlowEvent.cxx:1294
 AliFlowEvent.cxx:1295
 AliFlowEvent.cxx:1296
 AliFlowEvent.cxx:1297
 AliFlowEvent.cxx:1298
 AliFlowEvent.cxx:1299
 AliFlowEvent.cxx:1300
 AliFlowEvent.cxx:1301
 AliFlowEvent.cxx:1302
 AliFlowEvent.cxx:1303
 AliFlowEvent.cxx:1304
 AliFlowEvent.cxx:1305
 AliFlowEvent.cxx:1306
 AliFlowEvent.cxx:1307
 AliFlowEvent.cxx:1308
 AliFlowEvent.cxx:1309
 AliFlowEvent.cxx:1310
 AliFlowEvent.cxx:1311
 AliFlowEvent.cxx:1312
 AliFlowEvent.cxx:1313
 AliFlowEvent.cxx:1314
 AliFlowEvent.cxx:1315
 AliFlowEvent.cxx:1316
 AliFlowEvent.cxx:1317
 AliFlowEvent.cxx:1318
 AliFlowEvent.cxx:1319
 AliFlowEvent.cxx:1320
 AliFlowEvent.cxx:1321
 AliFlowEvent.cxx:1322
 AliFlowEvent.cxx:1323
 AliFlowEvent.cxx:1324
 AliFlowEvent.cxx:1325
 AliFlowEvent.cxx:1326
 AliFlowEvent.cxx:1327
 AliFlowEvent.cxx:1328
 AliFlowEvent.cxx:1329
 AliFlowEvent.cxx:1330
 AliFlowEvent.cxx:1331
 AliFlowEvent.cxx:1332
 AliFlowEvent.cxx:1333
 AliFlowEvent.cxx:1334
 AliFlowEvent.cxx:1335
 AliFlowEvent.cxx:1336
 AliFlowEvent.cxx:1337
 AliFlowEvent.cxx:1338
 AliFlowEvent.cxx:1339
 AliFlowEvent.cxx:1340
 AliFlowEvent.cxx:1341
 AliFlowEvent.cxx:1342
 AliFlowEvent.cxx:1343
 AliFlowEvent.cxx:1344
 AliFlowEvent.cxx:1345
 AliFlowEvent.cxx:1346
 AliFlowEvent.cxx:1347
 AliFlowEvent.cxx:1348
 AliFlowEvent.cxx:1349
 AliFlowEvent.cxx:1350
 AliFlowEvent.cxx:1351
 AliFlowEvent.cxx:1352
 AliFlowEvent.cxx:1353
 AliFlowEvent.cxx:1354
 AliFlowEvent.cxx:1355
 AliFlowEvent.cxx:1356
 AliFlowEvent.cxx:1357
 AliFlowEvent.cxx:1358
 AliFlowEvent.cxx:1359
 AliFlowEvent.cxx:1360
 AliFlowEvent.cxx:1361
 AliFlowEvent.cxx:1362
 AliFlowEvent.cxx:1363
 AliFlowEvent.cxx:1364
 AliFlowEvent.cxx:1365
 AliFlowEvent.cxx:1366
 AliFlowEvent.cxx:1367
 AliFlowEvent.cxx:1368
 AliFlowEvent.cxx:1369
 AliFlowEvent.cxx:1370
 AliFlowEvent.cxx:1371
 AliFlowEvent.cxx:1372
 AliFlowEvent.cxx:1373
 AliFlowEvent.cxx:1374
 AliFlowEvent.cxx:1375
 AliFlowEvent.cxx:1376
 AliFlowEvent.cxx:1377
 AliFlowEvent.cxx:1378
 AliFlowEvent.cxx:1379
 AliFlowEvent.cxx:1380
 AliFlowEvent.cxx:1381
 AliFlowEvent.cxx:1382
 AliFlowEvent.cxx:1383
 AliFlowEvent.cxx:1384
 AliFlowEvent.cxx:1385
 AliFlowEvent.cxx:1386
 AliFlowEvent.cxx:1387
 AliFlowEvent.cxx:1388
 AliFlowEvent.cxx:1389
 AliFlowEvent.cxx:1390
 AliFlowEvent.cxx:1391
 AliFlowEvent.cxx:1392
 AliFlowEvent.cxx:1393