]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/vertexingHF/AliAnalysisTaskSECharmFraction.h
Bugfix: wrong logic in determining which v0 reader to use
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAnalysisTaskSECharmFraction.h
index adca2df0d00f72392cb2e64f8d026ed4c2061545..2a4fb7579306681771b023b05a222fe1c62f4bf6 100644 (file)
@@ -8,6 +8,8 @@
 // Class AliAnalysisTaskSECharmFraction
 // AliAnalysisTask for the extraction of the fraction of prompt charm
 // using the charm hadron impact parameter to the primary vertex
+//
+//
 // Author: Andrea Rossi andrea.rossi@ts.infn.it
 //*************************************************************************
 
@@ -18,6 +20,7 @@ class AliAODMCHeader;
 class AliAODRecoDecayHF2Prong;
 class AliAODRecoDecayHF;
 class AliAODMCParticle;
+class AliAnalysisVertexingHF;
 #include "AliAnalysisTaskSE.h"
 
 class AliAnalysisTaskSECharmFraction : public AliAnalysisTaskSE {
@@ -33,32 +36,23 @@ class AliAnalysisTaskSECharmFraction : public AliAnalysisTaskSE {
   virtual void LocalInit() {Init();}
   virtual void UserExec(Option_t *option);
   virtual void Terminate(Option_t *option);  
-
-  void SetNPtBins(Int_t nbins,Double_t *ptbins){if(fptbins!=0x0)delete fptbins;fnbins=nbins;fptbins=ptbins;}
-  void SetSignalInvMassCut(Double_t signalInvMassCut=0.027){fsignalInvMassCut=signalInvMassCut;}
-  void SetLargeInvMassCut(Double_t largeInvMassCut=2.){flargeInvMassCut=largeInvMassCut;}
-  void SetSideBandInvMassCut(Double_t sidebandInvMassCut=0.054){
-    // default value ~ 3x2 times inv mass resol. 
-    //a factor 2 is applied w.r.t. 3sigma, 
-    //should be safe enough to exclude most of the reflections 
+  void SetReadMC(Bool_t readMC=kTRUE){fReadMC=readMC;}
+  void SetNPtBins(Int_t nbins,const Double_t *ptbins);
+  void SetSignalInvMassCut(const Double_t signalInvMassCut=0.027){fsignalInvMassCut=signalInvMassCut;}
+  void SetLargeInvMassCut(const Double_t largeInvMassCut=2.){flargeInvMassCut=largeInvMassCut;}
+  void SetSideBandInvMassCut(const Double_t sidebandInvMassCut=0.054){// default value ~ 2x3 times inv mass resol.: a factor 2 is applied w.r.t. 3sigma, should be safe enough to exclude most of the reflections 
     fsidebandInvMassCut=sidebandInvMassCut;  
   }
-  void SetSideBandInvMassWindow(Double_t sidebandInvMassWindow=0.066){//~ 6 times inv. mass resol.
+  void SetSideBandInvMassWindow(const Double_t sidebandInvMassWindow=0.108){//~ 6 times inv. mass resol.
     fsidebandInvMassWindow=sidebandInvMassWindow;
-  }
-  
-  void SetStandardMassSelection(){
-    SetSignalInvMassCut();
-    SetLargeInvMassCut();
-    SetSideBandInvMassCut();
-    SetSideBandInvMassWindow();
-    return;
-  }
+  }  
+  void SetAcceptanceCut(const Double_t eta=0.9,const Double_t nITSpoints=5.,const Double_t nSPDpoints=2.){fAcceptanceCuts[0]=eta;fAcceptanceCuts[1]=nITSpoints;fAcceptanceCuts[2]=nSPDpoints;}
+  void SetStandardMassSelection();
   Int_t SetStandardCuts(Double_t pt,Double_t invMassCut);
   void CheckInvMassD0(AliAODRecoDecayHF2Prong *d,Double_t &invMassD0,Double_t &invMassD0bar,Bool_t &isPeakD0,Bool_t &isPeakD0bar,Bool_t &isSideBandD0,Bool_t &isSideBandD0bar);
-  AliAODRecoDecayHF *GetD0toKPiSignalType(AliAODRecoDecayHF2Prong *d,TClonesArray *arrayMC,Int_t &signaltype,Double_t &massMumTrue,Double_t *primaryVtx);
-  AliAODRecoDecayHF* ConstructFakeTrueSecVtx(AliAODMCParticle *b1, AliAODMCParticle *b2, AliAODMCParticle *mum,Double_t *primaryVtxTrue);
-  void SetUseMC(Bool_t useMC){ fUseMC=useMC;}
+  AliAODRecoDecayHF *GetD0toKPiSignalType(const AliAODRecoDecayHF2Prong *d,TClonesArray *arrayMC,Int_t &signaltype,Double_t &massMumTrue,Double_t *primaryVtx);
+  AliAODRecoDecayHF* ConstructFakeTrueSecVtx(const AliAODMCParticle *b1,const AliAODMCParticle *b2,const AliAODMCParticle *mum,Double_t *primaryVtxTrue);
+  void SetUseMC(Bool_t useMC){fUseMC=useMC;}
   //#################
    /* ######### THE FOLLOWING IS FOR FURTHER IMPLEMENATION ############
     Int_t GetPtBin(Double_t pt)const;
@@ -82,33 +76,35 @@ class AliAnalysisTaskSECharmFraction : public AliAnalysisTaskSE {
  
   AliAnalysisVertexingHF *fVHFloose;        // Vertexer heavy flavour
   AliAnalysisVertexingHF *fVHFtight;        // Vertexer heavy flavour
+  Bool_t  fReadMC;                          // Flag To switch on/off access to MC 
   Double_t    fmD0PDG;                      //  MC D0 mass
   Int_t        fnbins;                      // Number of pt bins
   Double_t *fptbins;                        //[fnbins] ptbins 
+  Double_t fAcceptanceCuts[3];                // array with acceptance cuts
   Double_t fsignalInvMassCut;               // invariant mass cut to define signal region
   Double_t flargeInvMassCut;                // invariant mass cut to accept all inv mass window
   Double_t fsidebandInvMassCut;             // invariant mass cut to define side band region lower limit
   Double_t fsidebandInvMassWindow;          // invariant mass cut to define side band region width
   Bool_t fUseMC;                            // flag to use or not MC info
-  TH1F *fNentries;                          //! histo for #AOD analysed, container 1
-  TH1F *fSignalType;                        //! histo for the type of MC signal , container 2
-  TH1F *fSignalTypeLsCuts;                 //! histo for the type of MC signal with loose cuts , container 3
-  TH1F *fSignalTypeTghCuts;                //! histo for the type of MC signal with tight cuts, container 4
-  TList *flist_NoCuts_Signal;               //! TList for signal (D prompt) with nocuts, container 5
-  TList *flist_NoCuts_Back;               //! TList for backgrnd with nocuts, container 6
-  TList *flist_NoCuts_FromB;               //! TList for D from B with nocuts, container 7
-  TList *flist_NoCuts_FromDstar;               //! TList for Dstar with nocuts, container 8
-  TList *flist_NoCuts_Other;               //! TList for others with nocuts, container 9
-  TList *flist_LsCuts_Signal;               //! TList for signal (D prompt) with loose cuts, container 10
-  TList *flist_LsCuts_Back;               //! TList for backgrnd with loose cuts, container 11
-  TList *flist_LsCuts_FromB;               //! TList for D from B with loose cuts, container 12
-  TList *flist_LsCuts_FromDstar;               //! TList for Dstar with loose cuts, container 13
-  TList *flist_LsCuts_Other;               //! TList for others with loose cuts, container 14
-  TList *flist_TghCuts_Signal;               //! TList for signal (D prompt) with tight cuts, container 15
-  TList *flist_TghCuts_Back;               //! TList for backgrnd with tight cuts, container 16
-  TList *flist_TghCuts_FromB;               //! TList for D from B with tight cuts, container 17
-  TList *flist_TghCuts_FromDstar;               //! TList for Dstar with tight cuts, container 18
-  TList *flist_TghCuts_Other;               //! TList for others with tight cuts, container 19
+  TH1F *fNentries;                          //!histo for #AOD analysed, container 1
+  TH1F *fSignalType;                        //!histo for the type of MC signal , container 2
+  TH1F *fSignalTypeLsCuts;                 //!histo for the type of MC signal with loose cuts , container 3
+  TH1F *fSignalTypeTghCuts;                //!histo for the type of MC signal with tight cuts, container 4
+  TList *flistNoCutsSignal;               //!TList for signal (D prompt) with nocuts, container 5
+  TList *flistNoCutsBack;               //!TList for background with nocuts, container 6
+  TList *flistNoCutsFromB;               //!TList for D from B or D from Dstar from Bwith nocuts, container 7
+  TList *flistNoCutsFromDstar;               //!TList for D from Dstar with nocuts, container 8
+  TList *flistNoCutsOther;               //!TList for others with nocuts, container 9
+  TList *flistLsCutsSignal;               //!TList for signal (D prompt) with loose cuts, container 10
+  TList *flistLsCutsBack;               //!TList for background with loose cuts, container 11
+  TList *flistLsCutsFromB;               //!TList for D from B or D from Dstar from B with loose cuts, container 12
+  TList *flistLsCutsFromDstar;               //!TList for D from Dstar with loose cuts, container 13
+  TList *flistLsCutsOther;               //!TList for others with loose cuts, container 14
+  TList *flistTghCutsSignal;               //!TList for signal (D prompt) with tight cuts, container 15
+  TList *flistTghCutsBack;               //!TList for backgrnd with tight cuts, container 16
+  TList *flistTghCutsFromB;               //!TList for D from B or D from Dstar from Bwith tight cuts, container 17
+  TList *flistTghCutsFromDstar;               //!TList for D from Dstar Dstar with tight cuts, container 18
+  TList *flistTghCutsOther;               //!TList for others with tight cuts, container 19
   /*  Bool_t       fD0usecuts;            // Switch on the use of the cuts             TO BE IMPLEMENTED 
       Bool_t       fcheckMC;              //  Switch on MC check: minimum check is same mother  TO BE IMPLEMENTED
       Bool_t       fcheckMCD0;           //  check the mother is a D0                  TO BE IMPLEMENTED