AliPhysics  59e0e03 (59e0e03)
AliAnalysisTaskSEDmesonsFilterCJ.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKSEDMESONSFILTERCJ_H
2 #define ALIANALYSISTASKSEDMESONSFILTERCJ_H
3 /**************************************************************************
4  * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5  * *
6  * Author: The ALICE Off-line Project. *
7  * Contributors are mentioned in the code where appropriate. *
8  * *
9  * Permission to use, copy, modify and distribute this software and its *
10  * documentation strictly for non-commercial purposes is hereby granted *
11  * without fee, provided that the above copyright notice appears in all *
12  * copies and that both the copyright notice and this permission notice *
13  * appear in the supporting documentation. The authors make no claims *
14  * about the suitability of this software for any purpose. It is *
15  * provided "as is" without express or implied warranty. *
16  **************************************************************************/
17 
18 //-----------------------------------------------------------------------
19 // Author : A. Grelli, Utrecht University
20 // C. Bianchin, Utrecht University
21 // X. Zhang, LBNL
22 // S. Aiola, Yale University
23 // B. Trzeciak, Utrecht University
24 //-----------------------------------------------------------------------
25 
26 
27 #include "AliAnalysisTaskEmcal.h"
28 
29 class TH2;
30 class TString;
31 class TRandom3;
32 class TClonesArray;
33 class AliAODMCHeader;
34 class AliRDHFCuts;
37 class AliAODRecoDecay;
38 class AliStack;
39 
41 {
42 
43  public:
44 
48 
52 
54  Bool_t Run();
55  void Init();
56  void LocalInit() { Init(); }
57 
58  // inizializations
60 
61  // set MC usage
62  void SetMC(Bool_t theMCon) { fUseMCInfo = theMCon ; }
63  Bool_t GetMC() const { return fUseMCInfo ; }
64 
65  // set MC RM or eff
66  void SetBuildRMEff(Bool_t theRM) { fBuildRMEff = theRM ; }
67  Bool_t GetBuildRMEff() const { return fBuildRMEff ; }
68 
69  void SetUsePythia(Bool_t theUsePythia) { fUsePythia = theUsePythia ; }
70  Bool_t GetUsePythia() const { return fUsePythia ; }
71 
72  // set track fraction rejection for JES systematics
74  Bool_t GetJESsys() const { return fUseRejTracks ; }
76  Double_t GetTrackIneff() const { return fTrackIneff ; }
77 
78  // set usage of generated or reconstucted quantities (relevant for MC)
79  void SetUseReco(Bool_t useReco=kTRUE) { fUseReco = useReco ; }
80  Bool_t GetUseReco() const { return fUseReco ; }
81 
84 
86  Bool_t GetMultipleCandidates() const { return fMultCand ; }
87 
90 
93 
95  Bool_t GetRejectDfromB() const { return fRejectDfromB ; }
96 
99 
100  void SetMassLimits(Double_t range, Int_t pdg);
101  void SetMassLimits(Double_t lowlimit, Double_t uplimit);
102 
103  // Array of D0 width for the Dstar
105 
106  Float_t DeltaR(AliVParticle *p1, AliVParticle *p2) const;
107 
108  static Double_t AddDaughters(AliAODRecoDecay* cand, TObjArray& daughters);
109  static Double_t AddMCDaughters(AliAODMCParticle* mcDmeson, TObjArray& mcdaughters, TClonesArray* mcArray);
110 
111  static Int_t CheckOrigin(AliAODRecoDecay* cand, TClonesArray* mcArray); // AOD
112  static Int_t CheckOrigin(AliAODMCParticle* part, TClonesArray* mcArray); // AOD
113  static Int_t CheckOrigin(AliAODRecoDecay* cand, AliStack* stack); // ESD
114  static Int_t CheckOrigin(Int_t ipart, AliStack* stack); // ESD
115 
116  static Int_t CheckDecayChannel(AliAODMCParticle* part, TClonesArray* mcArray); // AOD
117  static Int_t CheckDecayChannel(Int_t ipart, AliStack* stack); // ESD
118 
119  void GetTrackPrimaryGenerator(AliAODTrack *track,AliAODMCHeader *header,TClonesArray *arrayMC,TString &nameGen);
120  void GetMCTrackPrimaryGenerator(AliAODMCParticle *track,AliAODMCHeader *header,TClonesArray *arrayMC,TString &nameGen);
121  Bool_t IsTrackInjected(AliAODTrack *track,AliAODMCHeader *header,TClonesArray *arrayMC);
122  Bool_t IsMCTrackInjected(AliAODMCParticle *track,AliAODMCHeader *header,TClonesArray *arrayMC);
123 
124 
125  protected:
126  void ExecOnce();
127  void ProcessD0(AliAODRecoDecayHF2Prong* charmCand, Int_t isSelected);
128  void ProcessDstar(AliAODRecoCascadeHF* dstar, Int_t isSelected);
129  void FillD0MCTruthKinHistos(AliAODRecoDecayHF2Prong* charmCand, Int_t isSelected, Int_t isD0);
130  void FillDStarMCTruthKinHistos(AliAODRecoCascadeHF* dstar, Int_t isSelected, Int_t isDstar);
132  void AddEventTracks(TClonesArray* coll, AliParticleContainer* tracks);
133  void AddMCEventTracks(TClonesArray* coll, AliParticleContainer* mctracks);
134 
135 
136  Bool_t fUseMCInfo; // Use MC info
137  Bool_t fBuildRMEff; // MC RM or efficiency studies
138  Bool_t fUsePythia; // Use Pythia info only for MC
139  Bool_t fUseRejTracks; // Reject tracks for JES systematics
140  Double_t fTrackIneff; // Tracking inefficiency for JES systematics
141  Bool_t fUseReco; // use reconstructed tracks when running on MC
142  UInt_t fCandidateType; // Dstar or D0
143  TString fCandidateName; // Dstar or D0
144  Int_t fPDGmother; // PDG code of D meson
145  Int_t fNProngs; // number of prong of the decay channel
146  Int_t fPDGdaughters[4]; // PDG codes of daughters
147  Float_t fSigmaD0[30]; // D0 sigma for Dstar
148  TString fBranchName; // AOD branch name
149  AliRDHFCuts *fCuts; // cuts
150  Double_t fMinMass; // mass lower limit histogram
151  Double_t fMaxMass; // mass upper limit histogram
153  Bool_t fCombineDmesons; // create an additional collection with D meson candidates and the rest of the tracks (for jet finding)
154  Bool_t fMultCand; // In case of multiple candidates per event
155  Int_t fAnalyseCand; // Number of the candidate to be analysed
156  Bool_t fRejectQuarkNotFound; // reject D mesons for which the original charm or bottom quark could not be found (MC)
157  Bool_t fRejectDfromB; // reject D mesons coming from a B meson decay (MC)
158  Bool_t fKeepOnlyDfromB; // only accept D mesons coming from a B meson decay (MC)
160  AliAODMCHeader *fMCHeader;
161  TRandom3 *fRan;
162  TClonesArray *fArrayDStartoD0pi;
163  TClonesArray *fMCarray;
164  TClonesArray *fCandidateArray;
165  TClonesArray *fSideBandArray;
166  TClonesArray *fCombinedDmesons;
167  TClonesArray *fCombinedDmesonsBkg;
168  TClonesArray *fMCCombinedDmesons;
200 
201 
202  private:
203 
206 
207  ClassDef(AliAnalysisTaskSEDmesonsFilterCJ, 7); // task for selecting D mesons to be used as an input for D-Jet correlations
208 };
209 
210 #endif
void ProcessDstar(AliAODRecoCascadeHF *dstar, Int_t isSelected)
Int_t pdg
static Int_t CheckOrigin(AliAODRecoDecay *cand, TClonesArray *mcArray)
double Double_t
Definition: External.C:58
TClonesArray * fCombinedDmesonsBkg
contains candidates selected by AliRDHFCuts and the rest of the event tracks
void ProcessD0(AliAODRecoDecayHF2Prong *charmCand, Int_t isSelected)
Base task in the EMCAL framework.
TClonesArray * fArrayDStartoD0pi
Random number generator.
char Char_t
Definition: External.C:18
void FillD0MCTruthKinHistos(AliAODRecoDecayHF2Prong *charmCand, Int_t isSelected, Int_t isD0)
static Double_t AddDaughters(AliAODRecoDecay *cand, TObjArray &daughters)
void AddEventTracks(TClonesArray *coll, AliParticleContainer *tracks)
TCanvas * c
Definition: TestFitELoss.C:172
AliStack * stack
void GetMCTrackPrimaryGenerator(AliAODMCParticle *track, AliAODMCHeader *header, TClonesArray *arrayMC, TString &nameGen)
void FillDStarMCTruthKinHistos(AliAODRecoCascadeHF *dstar, Int_t isSelected, Int_t isDstar)
static Double_t AddMCDaughters(AliAODMCParticle *mcDmeson, TObjArray &mcdaughters, TClonesArray *mcArray)
Container for particles within the EMCAL framework.
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Int_t fNCand
contains MC D0 and MC event particles
Bool_t IsTrackInjected(AliAODTrack *track, AliAODMCHeader *header, TClonesArray *arrayMC)
void FillDstarSideBands(AliAODRecoCascadeHF *dstar)
TClonesArray * fSideBandArray
contains candidates selected by AliRDHFCuts
AliAnalysisTaskSEDmesonsFilterCJ & operator=(const AliAnalysisTaskSEDmesonsFilterCJ &source)
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
static Int_t CheckDecayChannel(AliAODMCParticle *part, TClonesArray *mcArray)
float Float_t
Definition: External.C:68
TClonesArray * fMCCombinedDmesons
contains bkg candidates selected by AliRDHFCuts and the rest of the event tracks
Bool_t SetD0WidthForDStar(Int_t nptbins, Float_t *width)
void ExecOnce()
Perform steps needed to initialize the analysis.
Definition: External.C:220
Int_t fNSBCand
number of selected D candidates already added to fCandidateArray
Bool_t IsMCTrackInjected(AliAODMCParticle *track, AliAODMCHeader *header, TClonesArray *arrayMC)
TH1 * fHistStat
number of selected side-band D candidates already added to fSideBandArray
Float_t DeltaR(AliVParticle *p1, AliVParticle *p2) const
bool Bool_t
Definition: External.C:53
void AddMCEventTracks(TClonesArray *coll, AliParticleContainer *mctracks)
Int_t nptbins
void GetTrackPrimaryGenerator(AliAODTrack *track, AliAODMCHeader *header, TClonesArray *arrayMC, TString &nameGen)
Definition: External.C:196
TClonesArray * fCombinedDmesons
contains candidates selected by AliRDHFCuts::IsSelected(kTracks), to be used for side bands (DStar ca...