ROOT logo
#ifndef ALICFVERTEXINGHF_H
#define ALICFVERTEXINGHF_H


/**************************************************************************
 * Copyright(c) 1998-2009, 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.                  *
 **************************************************************************/

//-----------------------------------------------------------------------
// Class for HF corrections as a function of many variables and step 
// Author : C. Zampolli, CERN
// D. Caffarri, Univ & INFN Padova caffarri@pd.infn.it
// Base class for HF Unfolding - agrelli@uu.nl
//-----------------------------------------------------------------------

#include "AliCFContainer.h"
#include "AliAODRecoDecayHF.h"

class TH1I;
class TParticle ;
class TFile ;
class TClonesArray ;
class AliAODMCParticle;
class AliAODMCHeader;
class AliAODEvent;
class THnSparse;
class TClonesArray;
class AliESDtrackCuts;



class AliCFVertexingHF : public TObject {
	public:

  enum DecayChannel{kD0toKpi = 2, kDStartoKpipi = 21, kLctoV0bachelor = 22, kDplustoKpipi = 31, kLctopKpi = 32, kDstoKKpi = 33, kD0toKpipipi = 4};

	AliCFVertexingHF() ;
	AliCFVertexingHF(TClonesArray *mcArray, UShort_t originDselection);
	AliCFVertexingHF(const AliCFVertexingHF& c);
	AliCFVertexingHF& operator= (const AliCFVertexingHF& c);

	virtual ~AliCFVertexingHF();
		
	virtual Bool_t GetGeneratedValuesFromMCParticle(Double_t* /*vectorMC*/) {return kFALSE;} 
	virtual Bool_t GetRecoValuesFromCandidate(Double_t* /*vectorReco*/) const {return kFALSE;}
	virtual Bool_t CheckMCChannelDecay() const {return kFALSE;}
	virtual Bool_t SetRecoCandidateParam(AliAODRecoDecayHF* /*recoCand*/) {return kFALSE;}

        virtual void SetDecay3Prong(Int_t /*decay*/){};
	
	void   SetFillFromGenerated(Bool_t flag) {fFillFromGenerated = flag;}
	Bool_t GetFillFromGenerated() const {return fFillFromGenerated;}
		
	void  SetNVar(Int_t nVar) {fNVar = nVar;}  

	void  SetRecoPrimVertex (Double_t zPrimVertex) {fzPrimVertex = zPrimVertex;}
	void  SetMCPrimaryVertex (Double_t zMCVertex){fzMCVertex = zMCVertex;}
	void  SetMCLabel (Int_t mcLabel) {fmcLabel = mcLabel;}
	Int_t GetMCLabel () const {return  fmcLabel;}
		
	void   SetMCCandidateParam(Int_t label);

	Int_t  MCcquarkCounting(AliAODMCParticle* mcPart) const; 
	Bool_t CheckMCPartFamily(AliAODMCParticle */*mcPart*/, TClonesArray */*mcArray*/) const;
	//	Int_t  CheckOrigin(AliAODMCParticle* mcPart) const;
	Int_t  CheckOrigin() const;
  	Bool_t CheckMCDaughters() const;
	Bool_t FillMCContainer(Double_t *containerInputMC); 
	Bool_t FillRecoContainer(Double_t *containerInput); 
	Bool_t MCAcceptanceStep() const;
	Bool_t MCRefitStep(AliAODEvent *aodEvent, AliESDtrackCuts **trackCuts) const;
	Bool_t RecoStep();

	virtual Double_t GetEtaProng(Int_t iProng) const;
	virtual Double_t GetPtProng(Int_t iProng) const;

	Double_t GetPtCand() const {return fRecoCandidate->Pt();}
	Double_t GetYCand(UInt_t pdg) const {return fRecoCandidate->Y(pdg);}

	Bool_t RecoAcceptStep(AliESDtrackCuts **trackCuts) const;
	
	Bool_t FillUnfoldingMatrix(UInt_t pdg, Double_t fill[4]) const;
	
	void SetNProngs(Int_t nProngs){fProngs = nProngs;}
	Int_t GetNProngs() const {return fProngs;}
	void SetDselection(UShort_t originDselection); 
	UShort_t GetDselection() {return fOriginDselection;}; 
	Int_t CheckReflexion(Char_t isSign);
	virtual Bool_t SetLabelArray();

	void SetCentralityValue(Float_t centValue) {fCentValue = centValue;}

	virtual void SetPtAccCut(Float_t* ptAccCut);
	virtual void SetEtaAccCut(Float_t* etaAccCut);
	virtual void SetAccCut(Float_t* ptAccCut, Float_t* etaAccCut);
	virtual void SetAccCut();
	virtual void SetGeneratedDsOption(Int_t /*opt*/){
	  AliError("Method implemented in derived class");
	}

	void SetFakeSelection(Int_t fakeSel){fFakeSelection = fakeSel;}
	Int_t GetFakeSelection(){return fFakeSelection;}

	void SetRejectCandidateIfNotFromQuark(Bool_t opt){fRejectIfNoQuark=opt;}

	void SetMultiplicity(Double_t multiplicity) {fMultiplicity = multiplicity;}
	void SetConfiguration(Int_t configuration) {fConfiguration = configuration;}

	protected:
	
	TClonesArray      *fmcArray;               //mcArray candidate
	AliAODRecoDecayHF *fRecoCandidate;         // Reconstructed HF candidate 
	AliAODMCParticle  *fmcPartCandidate;
	Int_t fNDaughters;
	Int_t fNVar;                // get Number of variables for the container from the channel decay
	Double_t fzPrimVertex;       //Reco z primary vertex	
	Double_t fzMCVertex;         //MC z primary vertex
	
	Bool_t fFillFromGenerated;   //  flag to indicate whether data container should be filled  
	UShort_t fOriginDselection;      // flag to select D0 origins. 0 Only from charm 1 only from beauty 2 both from charm and beauty
	
	Bool_t fKeepDfromB;           //flag for the feed down from b quark decay. 			
	Bool_t fKeepDfromBOnly;       // flag to keep only the charm particles that comes from beauty decays
	Int_t fmcLabel;              // results of the MatchToMC()
	Int_t fProngs;               // n. of prongs	
	Int_t* fLabelArray;          //[fProngs]  array of labels

	Float_t fCentValue;         // centrality value
	Float_t* fPtAccCut;         //[fProngs] array of pt cut values for the Acceptance (MC+Rec) steps 
	Float_t* fEtaAccCut;          //[fProngs] array of eta (absolute value) cut values for the Acceptance (MC+Rec) steps 
	Int_t fFakeSelection; // fakes selection: 0 --> all, 1 --> non-fake, 2 --> fake
	Float_t fFake;              // variable to indicate whether the D0 was a fake or not: 0 --> fake, 1 --> MC, 2 --> non-fake
	Bool_t fRejectIfNoQuark;  // flag to remove events not geenrated with PYTHIA
	Double_t fMultiplicity;    // multiplicity of the event
	Int_t fConfiguration;    // configuration (slow / fast) of the CF --> different variables will be allocated (all / reduced number)

	ClassDef(AliCFVertexingHF, 7);
	
};

#endif
 AliCFVertexingHF.h:1
 AliCFVertexingHF.h:2
 AliCFVertexingHF.h:3
 AliCFVertexingHF.h:4
 AliCFVertexingHF.h:5
 AliCFVertexingHF.h:6
 AliCFVertexingHF.h:7
 AliCFVertexingHF.h:8
 AliCFVertexingHF.h:9
 AliCFVertexingHF.h:10
 AliCFVertexingHF.h:11
 AliCFVertexingHF.h:12
 AliCFVertexingHF.h:13
 AliCFVertexingHF.h:14
 AliCFVertexingHF.h:15
 AliCFVertexingHF.h:16
 AliCFVertexingHF.h:17
 AliCFVertexingHF.h:18
 AliCFVertexingHF.h:19
 AliCFVertexingHF.h:20
 AliCFVertexingHF.h:21
 AliCFVertexingHF.h:22
 AliCFVertexingHF.h:23
 AliCFVertexingHF.h:24
 AliCFVertexingHF.h:25
 AliCFVertexingHF.h:26
 AliCFVertexingHF.h:27
 AliCFVertexingHF.h:28
 AliCFVertexingHF.h:29
 AliCFVertexingHF.h:30
 AliCFVertexingHF.h:31
 AliCFVertexingHF.h:32
 AliCFVertexingHF.h:33
 AliCFVertexingHF.h:34
 AliCFVertexingHF.h:35
 AliCFVertexingHF.h:36
 AliCFVertexingHF.h:37
 AliCFVertexingHF.h:38
 AliCFVertexingHF.h:39
 AliCFVertexingHF.h:40
 AliCFVertexingHF.h:41
 AliCFVertexingHF.h:42
 AliCFVertexingHF.h:43
 AliCFVertexingHF.h:44
 AliCFVertexingHF.h:45
 AliCFVertexingHF.h:46
 AliCFVertexingHF.h:47
 AliCFVertexingHF.h:48
 AliCFVertexingHF.h:49
 AliCFVertexingHF.h:50
 AliCFVertexingHF.h:51
 AliCFVertexingHF.h:52
 AliCFVertexingHF.h:53
 AliCFVertexingHF.h:54
 AliCFVertexingHF.h:55
 AliCFVertexingHF.h:56
 AliCFVertexingHF.h:57
 AliCFVertexingHF.h:58
 AliCFVertexingHF.h:59
 AliCFVertexingHF.h:60
 AliCFVertexingHF.h:61
 AliCFVertexingHF.h:62
 AliCFVertexingHF.h:63
 AliCFVertexingHF.h:64
 AliCFVertexingHF.h:65
 AliCFVertexingHF.h:66
 AliCFVertexingHF.h:67
 AliCFVertexingHF.h:68
 AliCFVertexingHF.h:69
 AliCFVertexingHF.h:70
 AliCFVertexingHF.h:71
 AliCFVertexingHF.h:72
 AliCFVertexingHF.h:73
 AliCFVertexingHF.h:74
 AliCFVertexingHF.h:75
 AliCFVertexingHF.h:76
 AliCFVertexingHF.h:77
 AliCFVertexingHF.h:78
 AliCFVertexingHF.h:79
 AliCFVertexingHF.h:80
 AliCFVertexingHF.h:81
 AliCFVertexingHF.h:82
 AliCFVertexingHF.h:83
 AliCFVertexingHF.h:84
 AliCFVertexingHF.h:85
 AliCFVertexingHF.h:86
 AliCFVertexingHF.h:87
 AliCFVertexingHF.h:88
 AliCFVertexingHF.h:89
 AliCFVertexingHF.h:90
 AliCFVertexingHF.h:91
 AliCFVertexingHF.h:92
 AliCFVertexingHF.h:93
 AliCFVertexingHF.h:94
 AliCFVertexingHF.h:95
 AliCFVertexingHF.h:96
 AliCFVertexingHF.h:97
 AliCFVertexingHF.h:98
 AliCFVertexingHF.h:99
 AliCFVertexingHF.h:100
 AliCFVertexingHF.h:101
 AliCFVertexingHF.h:102
 AliCFVertexingHF.h:103
 AliCFVertexingHF.h:104
 AliCFVertexingHF.h:105
 AliCFVertexingHF.h:106
 AliCFVertexingHF.h:107
 AliCFVertexingHF.h:108
 AliCFVertexingHF.h:109
 AliCFVertexingHF.h:110
 AliCFVertexingHF.h:111
 AliCFVertexingHF.h:112
 AliCFVertexingHF.h:113
 AliCFVertexingHF.h:114
 AliCFVertexingHF.h:115
 AliCFVertexingHF.h:116
 AliCFVertexingHF.h:117
 AliCFVertexingHF.h:118
 AliCFVertexingHF.h:119
 AliCFVertexingHF.h:120
 AliCFVertexingHF.h:121
 AliCFVertexingHF.h:122
 AliCFVertexingHF.h:123
 AliCFVertexingHF.h:124
 AliCFVertexingHF.h:125
 AliCFVertexingHF.h:126
 AliCFVertexingHF.h:127
 AliCFVertexingHF.h:128
 AliCFVertexingHF.h:129
 AliCFVertexingHF.h:130
 AliCFVertexingHF.h:131
 AliCFVertexingHF.h:132
 AliCFVertexingHF.h:133
 AliCFVertexingHF.h:134
 AliCFVertexingHF.h:135
 AliCFVertexingHF.h:136
 AliCFVertexingHF.h:137
 AliCFVertexingHF.h:138
 AliCFVertexingHF.h:139
 AliCFVertexingHF.h:140
 AliCFVertexingHF.h:141
 AliCFVertexingHF.h:142
 AliCFVertexingHF.h:143
 AliCFVertexingHF.h:144
 AliCFVertexingHF.h:145
 AliCFVertexingHF.h:146
 AliCFVertexingHF.h:147
 AliCFVertexingHF.h:148
 AliCFVertexingHF.h:149
 AliCFVertexingHF.h:150
 AliCFVertexingHF.h:151
 AliCFVertexingHF.h:152