AliPhysics  master (3d17d9d)
AliAnalysisTaskGammaCaloMerged.h
Go to the documentation of this file.
1 #ifndef ALIANLYSISTASKGAMMACALOMERGED_cxx
2 #define ALIANLYSISTASKGAMMACALOMERGED_cxx
3 
4 #include "AliAnalysisTaskSE.h"
5 #include "AliESDtrack.h"
6 #include "AliV0ReaderV1.h"
7 #include "AliKFConversionPhoton.h"
9 #include "AliConversionAODBGHandlerRP.h"
10 #include "AliCaloPhotonCuts.h"
11 #include "AliConvEventCuts.h"
12 #include "AliConversionPhotonCuts.h"
13 #include "AliConversionMesonCuts.h"
15 #include "AliAnalysisManager.h"
16 #include "TProfile2D.h"
17 #include "TH3.h"
18 #include "TH3F.h"
19 #include <vector>
20 #include <map>
21 
23  public:
24 
26  AliAnalysisTaskGammaCaloMerged(const char *name);
28 
29  virtual void UserCreateOutputObjects();
30  virtual Bool_t Notify();
31  virtual void UserExec(Option_t *);
32  virtual void Terminate(const Option_t*);
33 
34  void SetV0ReaderName(TString name) {
35  fV0ReaderName = name ;
36  return ;
37  }
38  void SetIsHeavyIon(Int_t flag) { fIsHeavyIon = flag ; }
39 
40  // Function to set correction task setting
41  void SetCorrectionTaskSetting(TString setting) { fCorrTaskSetting = setting ; }
42  // base functions for selecting photon and meson candidates in reconstructed data
43  void ProcessClusters();
44 
45  // MC functions
46  void SetIsMC(Int_t isMC) { fIsMC = isMC ; }
47  void SetSelectedMesonID(Int_t anaMeson) { fSelectedMesonID = anaMeson ; }
48 
49  void ProcessMCParticles();
50  void ProcessAODMCParticles();
51  // determine source according to pdg code of mother
52  Int_t GetSourceClassification(Int_t daughter, Int_t pdgCode);
53 
54  void ProcessTrueClusterCandidates( AliAODConversionPhoton* TruePhotonCandidate, AliVCluster* cluster, AliAODConversionPhoton *TrueSubClusterCandidate1,
55  AliAODConversionPhoton *TrueSubClusterCandidate2);
56  void ProcessTrueClusterCandidatesAOD( AliAODConversionPhoton* TruePhotonCandidate, AliVCluster* cluster, AliAODConversionPhoton *TrueSubClusterCandidate1,
57  AliAODConversionPhoton *TrueSubClusterCandidate2);
58 // // void ProcessTrueMesonCandidates( AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1);
59 
60  // switches for additional analysis streams or outputs
61  void SetLightOutput( Bool_t flag ) { fDoLightOutput = flag;}
62  void SetDoMesonQA(Int_t flag) { fDoMesonQA = flag ; }
63  void SetDoClusterQA(Int_t flag) { fDoClusterQA = flag ; }
65 
66  // Setting the cut lists for the conversion photons
67  void SetEventCutList(Int_t nCuts, TList *CutArray) {
68  fnCuts = nCuts ;
69  fEventCutArray = CutArray ;
70  }
71 
72  // Setting the cut lists for the calo photons
73  void SetCaloCutList(Int_t nCuts, TList *CutArray) {
74  fnCuts = nCuts ;
75  fClusterCutArray = CutArray ;
76  }
77 
78  // Setting the cut lists for the calo photons
79  void SetCaloMergedCutList(Int_t nCuts, TList *CutArray){
80  fnCuts = nCuts ;
81  fClusterMergedCutArray = CutArray ;
82  }
83 
84  // Setting the cut lists for the meson
85  void SetMesonCutList(Int_t nCuts, TList *CutArray) {
86  fnCuts = nCuts ;
87  fMesonCutArray = CutArray ;
88  }
89 
91 
92  // Additional functions for convenience
93  void SetLogBinningXTH2(TH2* histoRebin);
94 
95  Bool_t CheckVectorForDoubleCount(vector<Int_t> &vec, Int_t tobechecked);
96  Bool_t CheckVector1ForEntryAndFillVector2(vector<Int_t> vecCheck, vector<Int_t> &vecFill, Int_t tobechecked);
97 
98  void FillMultipleCountMap(map<Int_t,Int_t> &ma, Int_t tobechecked);
99  void FillMultipleCountHistoAndClear(map<Int_t,Int_t> &ma, TH1F* hist);
100 
101  // Function to enable detailed printouts
103 
104  // Function to enable MC label sorting
105  void SetEnableSortingOfMCClusLabels(Bool_t enableSort) { fEnableSortForClusMC = enableSort ; }
106 
107  // FUnction to enable very detailed M02 distribution
108  void SetEnableDetailedM02Distribtuon(Bool_t enableDetM02) { fDoDetailedM02 = enableDetM02 ; }
109 
111 
113 
115  void ProcessNeutralOverlapsMC(AliMCEvent *mcEvent);
116  void PrintCaloMCLabelsAndInfoAOD(AliVEvent* event, AliAODConversionPhoton *TrueClusterCandidate, AliVCluster* cluster);
117 
118  protected:
119  AliV0ReaderV1* fV0Reader; // basic photon Selection Task
122  Bool_t fDoLightOutput; // switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
123  AliVEvent* fInputEvent; // current event
124  AliMCEvent* fMCEvent; // corresponding MC event
125  TList** fCutFolder; // Array of lists for containers belonging to cut
126  TList** fESDList; // Array of lists with histograms with reconstructed properties
127  TList** fTrueList; // Array of lists with histograms with MC validated reconstructed properties
128  TList** fMCList; // Array of lists with histograms with pure MC information
129  TList** fHeaderNameList; // Array of lists with header names for MC header selection
130  TList* fOutputContainer; // Output container
133  TList* fEventCutArray; // List with Event Cuts
134  AliConvEventCuts* fEventCuts; // EventCutObject
135  TList* fClusterCutArray; // List with Cluster Cuts
136  TList* fClusterMergedCutArray; // List with Cluster Cuts for merged clusters
137  TList* fMesonCutArray; // List with Meson Cuts
138  AliConversionMesonCuts* fMesonCuts; // MesonCutObject
140 
141  //histograms for mesons reconstructed quantities
145 
146  // histograms for rec photon clusters/pi0 candidate
160 
161  //histograms for pure MC quantities
163  TH1F** fHistoMCPi0Pt;
167  TH1F** fHistoMCEtaPt;
185 
194 
195  // MC validated cluster histos
231 
247 // TH2F** fHistoTrueClusElectronPtvsMotherID; //!
248 // TH2F** fHistoTrueClusElectronPtvsTopMotherID; //!
249 // TH2F** fHistoTrueClusElectronPtvsConvPhotonTopMotherID; //!
251 
252  // MC validated reconstructed quantities mesons
261 
269 
270  // MC validated reconstructed quantities photons
276  vector<Int_t> fVectorLabelsLeadingPi0;
277  vector<Int_t> fVectorLabelsMultiplePi0;
282 
283  // event histograms
284  TH1F** fHistoNEvents;
287  TH1F** fHistoVertexZ;
293  TProfile** fProfileEtaShift;
296 
297  // additional variables
298  TRandom3 fRandom; // random
299  Int_t fnCuts; // number of cuts to be analysed in parallel
300  Int_t fiCut; // current cut
301  Int_t fIsHeavyIon; // switch for pp = 0, PbPb = 1, pPb = 2
302  Int_t fDoMesonQA; // flag for meson QA
303  Int_t fDoClusterQA; // flag for cluster QA
304  Bool_t fIsFromMBHeader; // flag for MC headers
305  Bool_t fIsOverlappingWithOtherHeader; // flag for particles in MC overlapping between headers
306  Int_t fIsMC; // flag for MC information
307  Bool_t fSetPlotHistsExtQA; // flag for extended QA hists
308  Double_t fWeightJetJetMC; // weight for Jet-Jet MC
309  Int_t fSelectedMesonID; // switch for meson analysis
310  Bool_t fEnableDetailedPrintOut; // switch on detailed print outs
311  Bool_t fEnableSortForClusMC; // switch on sorting for MC labels in cluster
312  TTree* tBrokenFiles; // tree for keeping track of broken files
313  TObjString* fFileNameBroken; // string object for broken file name
314  Bool_t fDoDetailedM02; // detailed M02 distribution
315  Int_t fTrackMatcherRunningMode; // CaloTrackMatcher running mode
316  Int_t fMaxAllowedPi0OverlapsMC; // Event rejection based on pi0 overlaps in MC
318 
319  private:
320  AliAnalysisTaskGammaCaloMerged(const AliAnalysisTaskGammaCaloMerged&); // Prevent copy-construction
322 
323  ClassDef(AliAnalysisTaskGammaCaloMerged, 36);
324 };
325 
326 #endif
TH2F ** fHistoClusMergedNCellsPt
array of histos with cluster NCells vs Pt
TH1F ** fHistoNGoodESDTracks
array of histos with event information without event weights
vector< Int_t > fVectorLabelsLeadingPi0
array of histos with double counted etas, pT, M02
TH1F ** fHistoMCPi0DalitzInAccPt
array of histos without evt weight eta in acceptance, pT
void SetMesonCutList(Int_t nCuts, TList *CutArray)
TH2F ** fHistoTruePrimaryEtaMCPtResolPt
array of histos with validated weighted primary pi0, MCpt, resol pt
void SetEventCutList(Int_t nCuts, TList *CutArray)
TH2F ** fHistoClusMergedNCellsAroundPt
array of histos with merged cluster N MC paricles in cluster vs Pt
TH2F ** fHistoTruePi0PtAlpha
array of histos with validated eta, pt, Y
TH1F ** fHistoClusOverlapHeadersGammaPt
array of histos with cluster, E
double Double_t
Definition: External.C:58
void FillMultipleCountHistoAndClear(map< Int_t, Int_t > &ma, TH1F *hist)
Definition: External.C:236
vector< Int_t > fVectorDoubleCountTrueMultilePi0s
vector containing labels of validated pi0
TH2F ** fHistoMotherPtAlpha
array of histograms with signal +BG pt, Y
TH1F ** fHistoMCPi0InAccPt
array of histos without event weights eta Dalitz, pT
TH2F ** fHistoTruePrimaryPi0MergedPartConvMCPtResolPt
array of histos with validated weighted primary pi0, MCpt, resol pt
vector< Int_t > fVectorLabelsMultiplePi0
vector containing labels of validated pi0
TH1F ** fHistoMCPi0ReducedInAccPt
array of histos with weighted pi0 in acceptance, pT
TH1F ** fHistoMCEtaDalitzWOWeightPt
array of histos with weighted eta Dalitz, pT
TH2F ** fHistoTrueEtaPtAlpha
array of histos with validated pi0, pt, alpha
Bool_t NumberOfMCEventNeutralPionOverlapInEMCal(AliMCEvent *mcEvent)
TH1F ** fHistoMCPi0DalitzPt
array of histos without event weights eta, pT
TH1F ** fHistoMCAllGammaPt
array of histos with weighted decay gamma
void SetCaloMergedCutList(Int_t nCuts, TList *CutArray)
void SetEnableDetailedM02Distribtuon(Bool_t enableDetM02)
TH1F ** fHistoClusGammaE
array of histos with cluster, pt
TH2F ** fHistoMCPrimaryPtvsSource
array of histos with weighted eta, pT, hardest jet pt
TH2F ** fHistoSPDClusterTrackletBackground
array of histos with number of good tracks vs gamma candidates
TH2F ** fHistoMCSecPi0InAccPtvsSource
array of histos with weighted pi0 from sec, pT for different sources
TH1F ** fHistoNEvents
vector containing labels of validated eta
TH2F ** fHistoTrueClusEtaEM02
array of histos with validated pi0, E, m02
TH2F ** fHistoTrueClusEFracFirstLabel
array of histos with weighted all gamma
TH1F ** fHistoNEventsWOWeight
array of histos with event information
void SetEnableSortingOfMCClusLabels(Bool_t enableSort)
TH2F ** fHistoClusMergedNCellsAroundAndInPt
array of histos with number of cells surrounding merged cluster vs merged cluster Pt ...
TH1F ** fHistoClusGammaPt
array of histograms with signal +BG pt, alpha
TH1F ** fHistoMCEtaWOEvtWeightPt
array of histos with unweighted eta, pT
TH1I ** fHistoMCHeaders
array of histos with E surrounding merged cluster vs merged cluster E
TH1F ** fHistoMCDecayGammaPt
array of histos with weighted primary particles, Y vs source
TH2F ** fHistoClusNCellsPt
array of histos with cluster merged accepted mesons, E vs M02
TH1F ** fHistoMCPi0DalitzWOWeightPt
array of histos with weighted pi0 Dalitz, pT
TH2F ** fHistoClusMergedEvsM02Accepted
array of histos with cluster merged accepted mesons, pt vs M02
void PrintCaloMCLabelsAndInfoAOD(AliVEvent *event, AliAODConversionPhoton *TrueClusterCandidate, AliVCluster *cluster)
void SetCaloCutList(Int_t nCuts, TList *CutArray)
int Int_t
Definition: External.C:63
TH2F ** fHistoClusMergedPtvsM02Accepted
array of histos with cluster merged, pt vs M02
TH1F ** fHistoMCEtaDalitzPt
array of histos without event weights pi0 Dalitz, pT
TH2F ** fHistoClusMergedEAroundE
array of histos with number of cells surrounding merged cluster + Ncells in clus vs merged cluster Pt...
Definition: External.C:204
TH1F ** fHistoNClusterMergedCandidates
array of histos with number of cluster candidates per event
TH2F ** fHistoMCPrimaryYvsSource
array of histos with weighted primary particles, pT vs source
TH1F ** fHistoMCEtaDalitzWOEvtWeightPt
array of histos with unweighted eta Dalitz, pT
TH1F ** fHistoMCPi0WOWeightPt
array of histos with weighted pi0, pT
Bool_t CheckVectorForDoubleCount(vector< Int_t > &vec, Int_t tobechecked)
TH1F ** fHistoMCPi0WOEvtWeightPt
array of histos with unweighted pi0, pT
TH1F ** fHistoNClusterCandidates
array of histos with vertex z distribution for selected events
Int_t fNClusterMergedCandidates
current number of cluster candidates
TH1F ** fHistoMCPi0WOEvtWeightInAccPt
array of histos with weighted eta in acceptance, pT
TH2F ** fHistoMotherPtY
array of histogram with signal + BG for same event photon pairs, inv Mass, pt
TH2F ** fHistoMCPi0PtJetPt
array of histos with weighted pi0 from sec in acceptance, pT for different sources ...
TH1F ** fHistoNV0Tracks
array of histos with SPD tracklets vs SPD clusters for background rejection
TH2F ** fHistoTrueSecondaryPi0MCPtResolPt
array of histos with validated weighted primary eta, MCpt, resol pt
void ProcessTrueClusterCandidatesAOD(AliAODConversionPhoton *TruePhotonCandidate, AliVCluster *cluster, AliAODConversionPhoton *TrueSubClusterCandidate1, AliAODConversionPhoton *TrueSubClusterCandidate2)
TH1F ** fHistoJetJetNTrials
array of profiles with xsection for jetjet
Int_t mode
Definition: anaM.C:41
TH2F ** fHistoTruePrimaryPi01GammaMCPtResolPt
array of histos with validated weighted primary pi0, MCpt, resol pt
TH1F ** fHistoMCEtaDalitzInAccPt
array of histos with weighted pi0 dalitz in acceptance, pT
TH1F ** fHistoMCPi0Pt
array of histos for header names
TH1F ** fHistoMCEtaDalitzWOEvtWeightInAccPt
array of histos without evt weight pi0 in acceptance, pT
TH2F ** fHistoTrueClusPi0EM02
array of histos with validated electrons, E, m02
AliAnalysisTaskJetOutlierRemoval * fOutlierJetReader
TH2F ** fHistoClusMergedNParticlePt
array of histos with merged cluster NCells vs Pt
TH1F ** fHistoMCEtaWOEvtWeightInAccPt
array of histos without evt weight pi0 in acceptance, pT
Int_t GetSourceClassification(Int_t daughter, Int_t pdgCode)
TRandom3 fRandom
array of histos with ntrials for jetjet
TH2F ** fHistoTrueClusGammaEM02
array of histos with validated eta, pt, alpha
AliAnalysisTaskGammaCaloMerged & operator=(const AliAnalysisTaskGammaCaloMerged &)
Bool_t isMC
TH2F ** fHistoDoubleCountTrueEtaPtvsM02
array of histos with double counted secondary pi0s, pT, M02
TH2F ** fHistoClusMergedPtvsM02
array of histos with cluster NLM vs Pt
TH2F ** fHistoTruePrimaryPi0MCPtResolPt
array of histos with validated eta, E, m02
TProfile ** fProfileEtaShift
array of histos with V0 counts
Definition: External.C:220
TH1F ** fHistoMCPi0ReducedPt
array of histos with weighted pi0, pT
TH2F ** fHistoMCEtaPtJetPt
array of histos with weighted pi0, pT, hardest jet pt
TH1F ** fHistoDoubleCountTrueMultipleSecPi0Pt
array of histos with double counted pi0s, pT, M02
TH2F ** fHistoDoubleCountTruePi0PtvsM02
array of histos with validated weighted secondary pi0, MCpt, resol pt
Implementation of a sample jet analysis task.
void ProcessTrueClusterCandidates(AliAODConversionPhoton *TruePhotonCandidate, AliVCluster *cluster, AliAODConversionPhoton *TrueSubClusterCandidate1, AliAODConversionPhoton *TrueSubClusterCandidate2)
TH1F ** fHistoDoubleCountTrueSecPi0Pt
array of histos with double counted pi0s, pT, M02
TH1F ** fHistoMCEtaPt
array of histos without event weights pi0, pT
TH1F ** fHistoMCEtaWOWeightPt
array of histos with weighted eta, pT
TH1F ** fHistoMCPi0DalitzWOEvtWeightInAccPt
array of histos with weighted eta dalitz in acceptance, pT
TH2F ** fHistoNGoodESDTracksVsNClusterCandidates
array of histos with number of merged cluster candidates per event
TH2F ** fHistoMCSecPi0PtvsSource
array of histos without evt weight eta in acceptance, pT
TH1F ** fHistoMCPi0DalitzWOEvtWeightPt
array of histos with unweighted pi0 Dalitz, pT
const char Option_t
Definition: External.C:48
TList * fEventCutArray
current number of merged cluster candidates
TH1F ** fHistoMCEtaInAccPt
array of histos with weighted pi0 in acceptance, pT
bool Bool_t
Definition: External.C:53
TH2F ** fHistoTruePrimaryPi01ElectronMCPtResolPt
array of histos with validated weighted primary pi0, MCpt, resol pt
TProfile ** fProfileJetJetXSection
array of profiles with eta shift
vector< Int_t > fVectorDoubleCountTrueEtas
vector containing labels of validated pi0
TH1F ** fHistoVertexZ
array of histos with number of good tracks (2010 Standard track cuts)
vector< Int_t > fVectorDoubleCountTruePi0s
vector containing labels of validated pi0
TH2F ** fHistoDoubleCountTrueMultiplePi0PtvsM02
array of histos with double counted secondary pi0s, pT, M02
TH2F ** fHistoTruePrimaryPi0PureMergedMCPtResolPt
array of histos with validated weighted primary pi0, MCpt, resol pt
vector< Int_t > fVectorLabelsMultiplePi0Reduced
vector containing labels of validated pi0
TH2F ** fHistoClusNLMPt
array of histos with cluster, pt overlapping with other headers
TH2F ** fHistoTrueEtaPtY
array of histos with validated pi0, pt, Y
Bool_t CheckVector1ForEntryAndFillVector2(vector< Int_t > vecCheck, vector< Int_t > &vecFill, Int_t tobechecked)
void FillMultipleCountMap(map< Int_t, Int_t > &ma, Int_t tobechecked)
TH2F ** fHistoTrueClusElectronEM02
array of histos with validated gamma, E, m02