AliPhysics  df4bbdf (df4bbdf)
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
43 
44  // base functions for selecting photon and meson candidates in reconstructed data
45  void ProcessClusters();
48 
49  // MC functions
50  void SetIsMC ( Int_t isMC) { fIsMC = isMC ;}
51  void ProcessMCParticles ();
52  void ProcessAODMCParticles ();
54  void ProcessTruePhotonCandidates ( AliAODConversionPhoton* TruePhotonCandidate);
55  void ProcessTrueClusterCandidates ( AliAODConversionPhoton* TruePhotonCandidate,
56  Float_t clusM02);
58  Float_t clusM02);
59  void ProcessTruePhotonCandidatesAOD ( AliAODConversionPhoton* TruePhotonCandidate);
61  AliAODConversionPhoton *TrueGammaCandidate0,
62  AliAODConversionPhoton *TrueGammaCandidate1,
63  Bool_t matched);
65  AliAODConversionPhoton *TrueGammaCandidate0,
66  AliAODConversionPhoton *TrueGammaCandidate1,
67  Bool_t matched);
69  AliAODConversionPhoton *TrueGammaCandidate0,
70  AliAODConversionPhoton *TrueGammaCandidate1 );
72  AliAODConversionPhoton *TrueGammaCandidate0,
73  AliAODConversionPhoton *TrueGammaCandidate1 );
75  AliAODConversionPhoton *TrueGammaCandidate0,
76  AliAODConversionPhoton *TrueGammaCandidate1 );
78  AliAODConversionPhoton *TrueGammaCandidate0,
79  AliAODConversionPhoton *TrueGammaCandidate1 );
80 
81  // switches for additional analysis streams or outputs
83  void SetLightOutput ( Bool_t flag ) { fDoLightOutput = flag ;}
84  void SetMesonRecoMode ( Int_t flag ) { fMesonRecoMode = flag ;}
85  void SetMesonType ( Int_t flag ) { fMesonType = flag ;}
86  void SetDoMesonQA ( Int_t flag ) { fDoMesonQA = flag ;}
87  void SetDoPhotonQA ( Int_t flag ) { fDoPhotonQA = flag ;}
88  void SetDoClusterQA ( Int_t flag ) { fDoClusterQA = flag ;}
89  void SetUseTHnSparse ( Bool_t flag ) { fDoTHnSparse = flag ;}
90  void SetPlotHistsExtQA ( Bool_t flag ) { fSetPlotHistsExtQA = flag ;}
93  void SetAllowOverlapHeaders ( Bool_t allowOverlapHeader ) { fAllowOverlapHeaders = allowOverlapHeader ;}
94 
95  // Setting the cut lists for the conversion photons
96  void SetEventCutList ( Int_t nCuts,
97  TList *CutArray) {
98  fnCuts = nCuts ;
99  fEventCutArray = CutArray ;
100  }
101 
102  // Setting the cut lists for the conversion photons
104  TList *CutArray) {
105  fnCuts = nCuts ;
106  fCutArray = CutArray ;
107  }
108 
109  // Setting the cut lists for the calo photons
110  void SetCaloCutList ( Int_t nCuts,
111  TList *CutArray) {
112  fnCuts = nCuts ;
113  fClusterCutArray = CutArray ;
114  }
115 
116  // Setting the cut lists for the meson
117  void SetMesonCutList ( Int_t nCuts,
118  TList *CutArray) {
119  fnCuts = nCuts ;
120  fMesonCutArray = CutArray ;
121  }
122 
123  // BG HandlerSettings
124  void CalculateBackground ();
125  void CalculateBackgroundRP ();
126  void RotateParticle ( AliAODConversionPhoton *gamma );
128  Double_t previousEventEP,
129  Double_t thisEventEP );
133  void UpdateEventByEventData ();
134 
135  // Additional functions for convenience
136  void SetLogBinningXTH2 ( TH2* histoRebin );
137  Bool_t CheckVectorOnly ( vector<Int_t> &vec,
138  Int_t tobechecked );
139  Bool_t CheckVectorForDoubleCount ( vector<Int_t> &vec,
140  Int_t tobechecked );
141 
142  void FillMultipleCountMap ( map<Int_t,Int_t> &ma,
143  Int_t tobechecked );
145  Int_t> &ma,
146  TH1F* hist );
147 
148  // Function to enable MC label sorting
149  void SetEnableSortingOfMCClusLabels (Bool_t enableSort) { fEnableSortForClusMC = enableSort;}
150 
151 
152 protected:
153  AliV0ReaderV1* fV0Reader; // basic photon Selection Task
155  TString fCorrTaskSetting; // Correction Task Special Name
156  AliGammaConversionAODBGHandler** fBGHandler; // BG handler for Conversion
157  AliConversionAODBGHandlerRP** fBGHandlerRP; // BG handler for Conversion (possibility to mix with respect to RP)
158  AliGammaConversionAODBGHandler** fBGClusHandler; // BG handler for Cluster
159  AliConversionAODBGHandlerRP** fBGClusHandlerRP; // BG handler for Cluster (possibility to mix with respect to RP)
160  AliVEvent* fInputEvent; // current event
161  AliMCEvent* fMCEvent; // corresponding MC event
162  TList** fCutFolder; // Array of lists for containers belonging to cut
163  TList** fESDList; // Array of lists with histograms with reconstructed properties
164  TList** fBackList; // Array of lists with BG THnSparseF
165  TList** fMotherList; // Array of lists with Signal THnSparseF
166  TList** fTrueList; // Array of lists with histograms with MC validated reconstructed properties
167  TList** fMCList; // Array of lists with histograms with pure MC information
168  TList* fOutputContainer; // Output container
169  TClonesArray* fReaderGammas; // Array with conversion photons selected by V0Reader Cut
170  TList* fGammaCandidates; // current list of photon candidates
172  TList* fEventCutArray; // List with Event Cuts
173  AliConvEventCuts* fEventCuts; // EventCutObject
174  TList* fCutArray; // List with Conversion Cuts
175  AliConversionPhotonCuts* fConversionCuts; // ConversionCutObject
176  TList* fClusterCutArray; // List with Cluster Cuts
177  AliCaloPhotonCuts* fCaloPhotonCuts; // CaloPhotonCutObject
178  TList* fMesonCutArray; // List with Meson Cuts
179  AliConversionMesonCuts* fMesonCuts; // MesonCutObject
180 
181  //histograms for Conversions reconstructed quantities
183 
184  //histograms for mesons reconstructed quantities
194 
195  // histograms for rec photon clusters
201 
202  //histograms for pure MC quantities
204 
205  //histograms for pure MC quantities for mesaon analysis
215 
216  // MC validated reconstructed quantities mesons
238 
239  // MC validated reconstructed quantities photons
242 
249 
250  // variable to keep track of multiple & missing reco
251  vector<Int_t> fVectorRecTrueMesons;
261  map<Int_t,Int_t> fMapMultipleCountTrueMesons;
264 
265  // event histograms
266  TH1F** fHistoNEvents;
269  TH1F** fHistoVertexZ;
270  TH1F** fHistoVertexX;
271  TH1F** fHistoVertexY;
276  TProfile** fProfileEtaShift;
279 
280  // additional variables
281  Double_t fEventPlaneAngle; // EventPlaneAngle
282  TRandom3 fRandom; // random
283  Int_t fNGammaCandidates; // number of gamma candidates in event
284  Double_t* fUnsmearedPx; //[fNGammaCandidates]
285  Double_t* fUnsmearedPy; //[fNGammaCandidates]
286  Double_t* fUnsmearedPz; //[fNGammaCandidates]
287  Double_t* fUnsmearedE; //[fNGammaCandidates]
288  Int_t* fMCEventPos; //[fNGammaCandidates]
289  Int_t* fMCEventNeg; //[fNGammaCandidates]
290  Int_t* fESDArrayPos; //[fNGammaCandidates]
291  Int_t* fESDArrayNeg; //[fNGammaCandidates]
292  Int_t fnCuts; // number of cuts to be analysed in parallel
293  Int_t fiCut; // current cut
294  Bool_t fMoveParticleAccordingToVertex; // boolean for BG calculation
295  Int_t fIsHeavyIon; // switch for pp = 0, PbPb = 1, pPb = 2
296  Bool_t fDoLightOutput; // switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
297  Int_t fMesonRecoMode; // switch for running with different reconstruction modes: 0 - PCM-PCM, 1 - PCM-Calo, 2 - Calo-Calo
298  Int_t fMesonType; // selector for meson analysis
299  Int_t fMesonPDG; // PDG code for selected meson
300  Double_t fMesonInvMassMin; // minimum inv mass for histos
301  Double_t fMesonInvMassMax; // maximum inv mass for histos
302  Double_t fMesonInvMassNBins; // Number of bins for inv mass histos
303  Double_t* fMesonInvMassWindow; // minimum inv mass for histos
304  Int_t fDoMesonQA; // flag for meson QA
305  Int_t fDoPhotonQA; // flag for photon QA
306  Int_t fDoClusterQA; // flag for cluster QA
307  Bool_t fIsFromDesiredHeader; // flag for MC headers
308  Bool_t fIsOverlappingWithOtherHeader; // flag for particles in MC overlapping between headers
309  Int_t fIsMC; // flag for MC information
310  Bool_t fDoTHnSparse; // flag for using THnSparses for background estimation
311  Bool_t fSetPlotHistsExtQA; // flag for extended QA hists
312  Double_t fWeightJetJetMC; // weight for Jet-Jet MC
313  Bool_t fDoConvGammaShowerShapeTree; // flag for tree with conv gamma R vs energy vs shower shape
314  Bool_t fEnableSortForClusMC; // switch on sorting for MC labels in cluster
315  Bool_t fDoPrimaryTrackMatching; // switch for basic track matching for primaries
316  Bool_t fDoInvMassShowerShapeTree; // flag for producing tree tESDInvMassShowerShape
317  TTree* tBrokenFiles; // tree for keeping track of broken files
318  TObjString* fFileNameBroken; // string object for broken file name
319  Bool_t fAllowOverlapHeaders; // enable overlapping headers for cluster selection
320  Bool_t fEnableClusterCutsForTrigger; // enable CLusterCuts output for trigger only
321 
322 private:
325 
327 };
328 
329 #endif // ALIANALYSISTASKHEAVYNEUTRALMESONTOGG_H
330 
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