AliPhysics  2aaea23 (2aaea23)
AliAnalysisTaskHeavyNeutralMesonToGG.h
Go to the documentation of this file.
1 
2 #ifndef ALIANALYSISTASKHEAVYNEUTRALMESONTOGG_H
3 #define ALIANALYSISTASKHEAVYNEUTRALMESONTOGG_H
4 
5 #include "AliAnalysisTaskSE.h"
6 #include "AliESDtrack.h"
7 #include "AliV0ReaderV1.h"
11 #include "AliCaloPhotonCuts.h"
12 #include "AliConvEventCuts.h"
14 #include "AliConversionMesonCuts.h"
15 #include "AliAnalysisManager.h"
16 #include "TProfile2D.h"
17 #include "TH3.h"
18 #include "TH3F.h"
19 #include "THnSparse.h"
20 #include <vector>
21 #include <map>
22 
24 public:
25 
27  AliAnalysisTaskHeavyNeutralMesonToGG(const char *name);
29 
30  virtual void UserCreateOutputObjects();
31  virtual Bool_t Notify();
32  virtual void UserExec(Option_t *);
33  virtual void Terminate(const Option_t*);
34  void InitBack();
35 
36  void SetV0ReaderName(TString name){fV0ReaderName=name; return;}
37  void SetIsHeavyIon(Int_t flag){
38  fIsHeavyIon = flag;
39  }
40  // Function to set correction task setting
42 
43  // base functions for selecting photon and meson candidates in reconstructed data
44  void ProcessClusters();
47 
48  // MC functions
49  void SetIsMC ( Int_t isMC) { fIsMC = isMC ;}
50  void ProcessMCParticles ();
51  void ProcessAODMCParticles ();
53  void ProcessTruePhotonCandidates ( AliAODConversionPhoton* TruePhotonCandidate);
54  void ProcessTrueClusterCandidates ( AliAODConversionPhoton* TruePhotonCandidate,
55  Float_t clusM02);
57  Float_t clusM02);
58  void ProcessTruePhotonCandidatesAOD ( AliAODConversionPhoton* TruePhotonCandidate);
60  AliAODConversionPhoton *TrueGammaCandidate0,
61  AliAODConversionPhoton *TrueGammaCandidate1,
62  Bool_t matched);
64  AliAODConversionPhoton *TrueGammaCandidate0,
65  AliAODConversionPhoton *TrueGammaCandidate1,
66  Bool_t matched);
68  AliAODConversionPhoton *TrueGammaCandidate0,
69  AliAODConversionPhoton *TrueGammaCandidate1 );
71  AliAODConversionPhoton *TrueGammaCandidate0,
72  AliAODConversionPhoton *TrueGammaCandidate1 );
74  AliAODConversionPhoton *TrueGammaCandidate0,
75  AliAODConversionPhoton *TrueGammaCandidate1 );
77  AliAODConversionPhoton *TrueGammaCandidate0,
78  AliAODConversionPhoton *TrueGammaCandidate1 );
79 
80  // switches for additional analysis streams or outputs
82  void SetLightOutput ( Bool_t flag ) { fDoLightOutput = flag ;}
83  void SetMesonRecoMode ( Int_t flag ) { fMesonRecoMode = flag ;}
84  void SetMesonType ( Int_t flag ) { fMesonType = flag ;}
85  void SetDoMesonQA ( Int_t flag ) { fDoMesonQA = flag ;}
86  void SetDoPhotonQA ( Int_t flag ) { fDoPhotonQA = flag ;}
87  void SetDoClusterQA ( Int_t flag ) { fDoClusterQA = flag ;}
88  void SetUseTHnSparse ( Bool_t flag ) { fDoTHnSparse = flag ;}
89  void SetPlotHistsExtQA ( Bool_t flag ) { fSetPlotHistsExtQA = flag ;}
92  void SetAllowOverlapHeaders ( Bool_t allowOverlapHeader ) { fAllowOverlapHeaders = allowOverlapHeader ;}
93 
94  // Setting the cut lists for the conversion photons
95  void SetEventCutList ( Int_t nCuts,
96  TList *CutArray) {
97  fnCuts = nCuts ;
98  fEventCutArray = CutArray ;
99  }
100 
101  // Setting the cut lists for the conversion photons
103  TList *CutArray) {
104  fnCuts = nCuts ;
105  fCutArray = CutArray ;
106  }
107 
108  // Setting the cut lists for the calo photons
109  void SetCaloCutList ( Int_t nCuts,
110  TList *CutArray) {
111  fnCuts = nCuts ;
112  fClusterCutArray = CutArray ;
113  }
114 
115  // Setting the cut lists for the meson
116  void SetMesonCutList ( Int_t nCuts,
117  TList *CutArray) {
118  fnCuts = nCuts ;
119  fMesonCutArray = CutArray ;
120  }
121 
122  // BG HandlerSettings
123  void CalculateBackground ();
124  void CalculateBackgroundRP ();
125  void RotateParticle ( AliAODConversionPhoton *gamma );
127  Double_t previousEventEP,
128  Double_t thisEventEP );
132  void UpdateEventByEventData ();
133 
134  // Additional functions for convenience
135  void SetLogBinningXTH2 ( TH2* histoRebin );
136  Bool_t CheckVectorOnly ( vector<Int_t> &vec,
137  Int_t tobechecked );
138  Bool_t CheckVectorForDoubleCount ( vector<Int_t> &vec,
139  Int_t tobechecked );
140 
141  void FillMultipleCountMap ( map<Int_t,Int_t> &ma,
142  Int_t tobechecked );
144  Int_t> &ma,
145  TH1F* hist );
146 
147  // Function to enable MC label sorting
148  void SetEnableSortingOfMCClusLabels (Bool_t enableSort) { fEnableSortForClusMC = enableSort;}
149 
150 
151 protected:
152  AliV0ReaderV1* fV0Reader; // basic photon Selection Task
154  TString fCorrTaskSetting; // Correction Task Special Name
155  AliGammaConversionAODBGHandler** fBGHandler; // BG handler for Conversion
156  AliConversionAODBGHandlerRP** fBGHandlerRP; // BG handler for Conversion (possibility to mix with respect to RP)
157  AliGammaConversionAODBGHandler** fBGClusHandler; // BG handler for Cluster
158  AliConversionAODBGHandlerRP** fBGClusHandlerRP; // BG handler for Cluster (possibility to mix with respect to RP)
159  AliVEvent* fInputEvent; // current event
160  AliMCEvent* fMCEvent; // corresponding MC event
161  TList** fCutFolder; // Array of lists for containers belonging to cut
162  TList** fESDList; // Array of lists with histograms with reconstructed properties
163  TList** fBackList; // Array of lists with BG THnSparseF
164  TList** fMotherList; // Array of lists with Signal THnSparseF
165  TList** fTrueList; // Array of lists with histograms with MC validated reconstructed properties
166  TList** fMCList; // Array of lists with histograms with pure MC information
167  TList* fOutputContainer; // Output container
168  TClonesArray* fReaderGammas; // Array with conversion photons selected by V0Reader Cut
169  TList* fGammaCandidates; // current list of photon candidates
171  TList* fEventCutArray; // List with Event Cuts
172  AliConvEventCuts* fEventCuts; // EventCutObject
173  TList* fCutArray; // List with Conversion Cuts
174  AliConversionPhotonCuts* fConversionCuts; // ConversionCutObject
175  TList* fClusterCutArray; // List with Cluster Cuts
176  AliCaloPhotonCuts* fCaloPhotonCuts; // CaloPhotonCutObject
177  TList* fMesonCutArray; // List with Meson Cuts
178  AliConversionMesonCuts* fMesonCuts; // MesonCutObject
179 
180  //histograms for Conversions reconstructed quantities
182 
183  //histograms for mesons reconstructed quantities
193 
194  // histograms for rec photon clusters
200 
201  //histograms for pure MC quantities
203 
204  //histograms for pure MC quantities for mesaon analysis
214 
215  // MC validated reconstructed quantities mesons
237 
238  // MC validated reconstructed quantities photons
241 
248 
249  // variable to keep track of multiple & missing reco
250  vector<Int_t> fVectorRecTrueMesons;
260  map<Int_t,Int_t> fMapMultipleCountTrueMesons;
263 
264  // event histograms
265  TH1F** fHistoNEvents;
268  TH1F** fHistoVertexZ;
269  TH1F** fHistoVertexX;
270  TH1F** fHistoVertexY;
275  TProfile** fProfileEtaShift;
278 
279  // additional variables
280  Double_t fEventPlaneAngle; // EventPlaneAngle
281  TRandom3 fRandom; // random
282  Int_t fNGammaCandidates; // number of gamma candidates in event
283  Double_t* fUnsmearedPx; //[fNGammaCandidates]
284  Double_t* fUnsmearedPy; //[fNGammaCandidates]
285  Double_t* fUnsmearedPz; //[fNGammaCandidates]
286  Double_t* fUnsmearedE; //[fNGammaCandidates]
287  Int_t* fMCEventPos; //[fNGammaCandidates]
288  Int_t* fMCEventNeg; //[fNGammaCandidates]
289  Int_t* fESDArrayPos; //[fNGammaCandidates]
290  Int_t* fESDArrayNeg; //[fNGammaCandidates]
291  Int_t fnCuts; // number of cuts to be analysed in parallel
292  Int_t fiCut; // current cut
293  Bool_t fMoveParticleAccordingToVertex; // boolean for BG calculation
294  Int_t fIsHeavyIon; // switch for pp = 0, PbPb = 1, pPb = 2
295  Bool_t fDoLightOutput; // switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
296  Int_t fMesonRecoMode; // switch for running with different reconstruction modes: 0 - PCM-PCM, 1 - PCM-Calo, 2 - Calo-Calo
297  Int_t fMesonType; // selector for meson analysis
298  Int_t fMesonPDG; // PDG code for selected meson
299  Double_t fMesonInvMassMin; // minimum inv mass for histos
300  Double_t fMesonInvMassMax; // maximum inv mass for histos
301  Double_t fMesonInvMassNBins; // Number of bins for inv mass histos
302  Double_t* fMesonInvMassWindow; // minimum inv mass for histos
303  Int_t fDoMesonQA; // flag for meson QA
304  Int_t fDoPhotonQA; // flag for photon QA
305  Int_t fDoClusterQA; // flag for cluster QA
306  Bool_t fIsFromDesiredHeader; // flag for MC headers
307  Bool_t fIsOverlappingWithOtherHeader; // flag for particles in MC overlapping between headers
308  Int_t fIsMC; // flag for MC information
309  Bool_t fDoTHnSparse; // flag for using THnSparses for background estimation
310  Bool_t fSetPlotHistsExtQA; // flag for extended QA hists
311  Double_t fWeightJetJetMC; // weight for Jet-Jet MC
312  Bool_t fDoConvGammaShowerShapeTree; // flag for tree with conv gamma R vs energy vs shower shape
313  Bool_t fEnableSortForClusMC; // switch on sorting for MC labels in cluster
314  Bool_t fDoPrimaryTrackMatching; // switch for basic track matching for primaries
315  Bool_t fDoInvMassShowerShapeTree; // flag for producing tree tESDInvMassShowerShape
316  TTree* tBrokenFiles; // tree for keeping track of broken files
317  TObjString* fFileNameBroken; // string object for broken file name
318  Bool_t fAllowOverlapHeaders; // enable overlapping headers for cluster selection
319 
320 private:
323 
325 };
326 
327 #endif // ALIANALYSISTASKHEAVYNEUTRALMESONTOGG_H
328 
TH1F ** fHistoClusOverlapHeadersGammaPt
array of histos with cluster, E
TH1F ** fHistoNGammaConvCandidates
array of histos with vertex y distribution for selected events
TH2F ** fHistoSPDClusterTrackletBackground
array of histos with number of calo gamma candidates per event
TH1F ** fHistoVertexX
array of histos with vertex z distribution for selected events
TH2F ** fHistoTrueMesonCaloMergedClusterPartConvInvMassPt
array of histos with validated mothers, merged cluster invMass, pt
double Double_t
Definition: External.C:58
AliAnalysisTaskHeavyNeutralMesonToGG & operator=(const AliAnalysisTaskHeavyNeutralMesonToGG &)
Bool_t CheckVectorForDoubleCount(vector< Int_t > &vec, Int_t tobechecked)
TH1F ** fHistoMCMesonWOWeightInAccPt
array of histos with weighted meson in acceptance, pT
Definition: External.C:236
TList * fEventCutArray
current list of cluster candidates
TH1F ** fHistoClusGammaE
array of histos with cluster, pt
TH2F ** fHistoTrueMotherMesonConvPhotonEtaPhi
array of histos with validated weighted primary meson, MCpt, resol pt
TH2F ** fHistoTrueBckFullMesonContainedInOneClusterInvMassPt
array of histos with pure gamma gamma combinatorial BG, invMass, pt
TH2F ** fHistoTrueMesonPtOpenAngle
array of histos with validated meson, pt, alpha
TH1F ** fHistoTrueClusGammaPt
array of histos with validated primary
TH1F ** fHistoMultipleCountTrueConvGamma
array of histos how often TrueMesons are counted
TH1F ** fHistoMCMesonPt
array of histos for header names
TH2F ** fHistoTrueMesonCaloConvertedPhotonMatchedInvMassPt
array of histos with validated meson converted photon leading and photon, invMass, pt
Double_t fEventPlaneAngle
array of histos with ntrials for jetjet
TH2F ** fHistoMotherMesonPtY
array of THnSparseF with BG for same event photon pairs, inv Mass, pt
TH2F ** fHistoMCMesonPtY
array of histos without evt weight meson in acceptance, pT
TH2F ** fHistoTrueMesonCaloPhotonInvMassPt
array of histos with rejected meson, invMass, pt
TH2F ** fHistoTruePrimaryMesonInvMassPt
array of histos with validated mothers, merged cluster part conv, invMass, pt
TH1F ** fHistoMCMesonWOEvtWeightPt
array of histos with unweighted meson, pT
map< Int_t, Int_t > fMapMultipleCountTrueClusterGammas
map containing photon labels that are counted at least twice
THnSparseF ** fSparseMotherInvMassPtZM
array of histogram with signal + BG for same event photon pairs, inv Mass, pt
TH1F ** fHistoTruePrimaryClusGammaPt
array of histos with number of labels in cluster
TH1F ** fHistoVertexY
array of histos with vertex x distribution for selected events
TH2F ** fHistoTrueMesonInvMassPt
array of histos with weighted meson, pT, hardest jet pt
TH2F ** fHistoTruePrimaryMesonMCPtResolPt
array of profiles with weights for validated primary mothers, invMass, pt
TH1F ** fHistoMCMesonInAccPt
array of histos without event weights meson, pT
THnSparseF ** fSparseMotherBackInvMassPtZM
array of histogram with BG for mixed event photon pairs, inv Mass, pt
TH2F ** fHistoDoubleCountTrueMesonInvMassPt
array of strings containing the stack position of the reconstructed validated meson ...
Bool_t CheckVectorOnly(vector< Int_t > &vec, Int_t tobechecked)
vector< Int_t > fVectorDoubleCountTrueConvGammas
vector containing labels of validated meson
TH2F ** fHistoTrueBckContInvMassPt
array of histos with asymmetry energy distributions of clusters, invMass, pt
void ProcessTruePhotonCandidates(AliAODConversionPhoton *TruePhotonCandidate)
vector< Int_t > fVectorRecTrueMesons
array of histos with validated primary cluster, converted photons, pt
TH2F ** fHistoTrueMesonMatchedInvMassPt
array of histos with validated meson, invMass, pt
void ProcessTrueMesonCandidatesConvCaloAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1, Bool_t matched)
TH1F ** fHistoTrueConvGammaPt
array of histos with validated meson, pt, openAngle
TProfile2D ** fProfileTruePrimaryMesonWeightsInvMassPt
array of histos with validated unweighted primary mothers, invMass, pt
void ProcessTrueMesonCandidatesConvAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
TH1F ** fHistoNGoodESDTracks
array of histos with event information without event weights
TH1F ** fHistoNEventsWOWeight
array of histos with event information
int Int_t
Definition: External.C:63
Class handling all kinds of selection cuts for Gamma Calo analysis.
TH1F ** fHistoMCMesonWOEvtWeightInAccPt
array of histos without weight meson in acceptance, pT
Definition: External.C:204
void ProcessTrueClusterCandidates(AliAODConversionPhoton *TruePhotonCandidate, Float_t clusM02)
TH2F ** fHistoMotherMesonPtOpenAngle
array of histograms with invariant mass cut around nominal mass, pt, alpha
float Float_t
Definition: External.C:68
TH1F ** fHistoTruePrimaryConvGammaPt
array of histos with validated conversion photon, pt
TH1F ** fHistoClusAllHeadersGammaPt
array of histos with cluster, pt overlapping with other headers
TH1F ** fHistoNEvents
map containing cluster photon labels that are counted at least twice
void RotateParticleAccordingToEP(AliAODConversionPhoton *gamma, Double_t previousEventEP, Double_t thisEventEP)
TH1F ** fHistoVertexZ
array of histos with number of good tracks (2010 Standard track cuts)
TH2F ** fHistoMCMesonPtJetPt
array of histos with weighted meson, pT, alpha
void FillMultipleCountHistoAndClear(map< Int_t, Int_t > &ma, TH1F *hist)
TH2F ** fHistoTrueMesonCaloMixedPhotonConvPhotonInvMassPt
array of histos with validated meson, converted photon leading, invMass, pt
TH2F ** fHistoMotherInvMassPt
histogram conversion photon pT
TH2F ** fHistoDoubleCountTrueConvGammaRPt
array of histos with double counted mesons, invMass, pT
map< Int_t, Int_t > fMapMultipleCountTrueConvGammas
map containing meson labels that are counted at least twice
Class handling all kinds of selection cuts for Gamma Conversion analysis.
void ProcessTrueMesonCandidatesConvCalo(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1, Bool_t matched)
TH2F ** fHistoTrueBckGGInvMassPt
array of histograms with invariant mass cut around nominal mass ,eta/phi of conversion photon ...
TH1F ** fHistoTruePrimaryClusConvGammaPt
array of histos with validated primary cluster, photons, pt
Int_t mode
Definition: anaM.C:41
TH2F ** fHistoTrueMesonCaloMergedClusterInvMassPt
array of histos with validated mothers, electron leading, invMass, pt
TH2F ** fHistoMotherMatchedInvMassPt
array of histogram with signal + BG for same event photon pairs, inv Mass, pt
TH1F ** fHistoMultipleCountTrueClusterGamma
array of histos how often TrueConvGammas are counted
void ProcessTruePhotonCandidatesAOD(AliAODConversionPhoton *TruePhotonCandidate)
TH2F ** fHistoMotherBackInvMassPt
array of THnSparseF with signal + BG for same event photon pairs, inv Mass, pt
TH2F ** fHistoTrueMesonPtAlpha
array of histos with validated meson, pt, Y
TH1F ** fHistoTrueClusConvGammaPt
array of histos with validated cluster (electron or photon), pt
TH1F ** fHistoNGammaCaloCandidates
array of histos with number of conversion gamma candidates per event
Bool_t isMC
TH2F ** fHistoTruePrimaryMesonW0WeightingInvMassPt
array of histos with validated weighted primary mothers, invMass, pt
TH1F ** fHistoJetJetNTrials
array of profiles with xsection for jetjet
Definition: External.C:220
TH2F ** fHistoTrueMesonCaloConvertedPhotonInvMassPt
array of histos with validated meson, photon leading, invMass, pt
void FillMultipleCountMap(map< Int_t, Int_t > &ma, Int_t tobechecked)
void MoveParticleAccordingToVertex(AliAODConversionPhoton *particle, const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex)
map< Int_t, Int_t > fMapMultipleCountTrueMesons
array of histos how often TrueClusterGammas are counted
Class handling all kinds of selection cuts for Gamma Conversion analysis.
vector< Int_t > fVectorDoubleCountTrueClusterGammas
vector containing labels of validated photons
TH1F ** fHistoMCMesonWOWeightPt
array of histos with weighted meson, pT
TH1I ** fHistoMCHeaders
array of histos with cluster, pt rejected headers
vector< Int_t > fVectorDoubleCountTrueMesons
array of histos with double counted cluster photons
TH2F ** fHistoMotherMesonPtAlpha
array of histograms with invariant mass cut around nominal mass, pt, Y
TProfile ** fProfileEtaShift
array of histos with V0 counts
TH2F ** fHistoMotherMesonConvPhotonEtaPhi
array of histograms with invariant mass cut around nominal mass, pt, openAngle
TH2F ** fHistoDoubleCountTrueClusterGammaPt
array of histos with double counted photons, R, pT
TH2F ** fHistoTrueBckAsymEClustersInvMassPt
array of histos with meson fully contained in one cluster, invMass, pt
Class handling all kinds of selection cuts for Gamma Conversion analysis.
void ProcessTrueMesonCandidatesCalo(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
TH2F ** fHistoTrueNLabelsInClusPt
array of histos with validated converted photon, fully contained, pt
TH1F ** fHistoNV0Tracks
array of histos with SPD tracklets vs SPD clusters for background rejection
const char Option_t
Definition: External.C:48
void SetConversionCutList(Int_t nCuts, TList *CutArray)
TH1F ** fHistoClusGammaPt
array of histograms with invariant mass cut around nominal mass ,eta/phi of conversion photon ...
bool Bool_t
Definition: External.C:53
TProfile ** fProfileJetJetXSection
array of profiles with eta shift
TH1F ** fHistoTrueClusConvGammaFullyPt
array of histos with validated converted photon, pt
void ProcessTrueMesonCandidatesCaloAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
TH1F ** fHistoClusRejectedHeadersGammaPt
array of histos with cluster, pt all headers
TH1F ** fHistoMultipleCountTrueMeson
vector containing labels of validated cluster photons
TH2F ** fHistoTrueMesonPtY
array of histos with contamination BG, invMass, pt
void ProcessTrueClusterCandidatesAOD(AliAODConversionPhoton *TruePhotonCandidate, Float_t clusM02)
TH2F ** fHistoTrueMesonCaloElectronInvMassPt
array of histos with validated meson matched with conv photon, converted photon leading, invMass, pt
void ProcessTrueMesonCandidatesConv(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
TH2F ** fHistoMCMesonPtAlpha
array of histos with weighted meson, pT, Y