AliPhysics  88b7ad0 (88b7ad0)
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  void SetPhotonVeto();
49 
50  // MC functions
51  void SetIsMC ( Int_t isMC) { fIsMC = isMC ;}
52  void ProcessMCParticles ();
53  void ProcessAODMCParticles ();
55  void ProcessTruePhotonCandidates ( AliAODConversionPhoton* TruePhotonCandidate);
56  void ProcessTrueClusterCandidates ( AliAODConversionPhoton* TruePhotonCandidate,
57  Float_t clusM02);
59  Float_t clusM02);
60  void ProcessTruePhotonCandidatesAOD ( AliAODConversionPhoton* TruePhotonCandidate);
62  AliAODConversionPhoton *TrueGammaCandidate0,
63  AliAODConversionPhoton *TrueGammaCandidate1,
64  Bool_t matched);
66  AliAODConversionPhoton *TrueGammaCandidate0,
67  AliAODConversionPhoton *TrueGammaCandidate1,
68  Bool_t matched);
70  AliAODConversionPhoton *TrueGammaCandidate0,
71  AliAODConversionPhoton *TrueGammaCandidate1 );
73  AliAODConversionPhoton *TrueGammaCandidate0,
74  AliAODConversionPhoton *TrueGammaCandidate1 );
76  AliAODConversionPhoton *TrueGammaCandidate0,
77  AliAODConversionPhoton *TrueGammaCandidate1 );
79  AliAODConversionPhoton *TrueGammaCandidate0,
80  AliAODConversionPhoton *TrueGammaCandidate1 );
81 
82  // switches for additional analysis streams or outputs
84  void SetLightOutput ( Bool_t flag ) { fDoLightOutput = flag ;}
85  void SetMesonRecoMode ( Int_t flag ) { fMesonRecoMode = flag ;}
86  void SetMesonType ( Int_t flag ) { fMesonType = flag ;}
87  void SetDoMesonQA ( Int_t flag ) { fDoMesonQA = flag ;}
88  void SetDoPhotonQA ( Int_t flag ) { fDoPhotonQA = flag ;}
89  void SetDoClusterQA ( Int_t flag ) { fDoClusterQA = flag ;}
90  void SetUseTHnSparse ( Bool_t flag ) { fDoTHnSparse = flag ;}
91  void SetPlotHistsExtQA ( Bool_t flag ) { fSetPlotHistsExtQA = flag ;}
94  void SetAllowOverlapHeaders ( Bool_t allowOverlapHeader ) { fAllowOverlapHeaders = allowOverlapHeader ;}
95 
96  // Setting the cut lists for the conversion photons
97  void SetEventCutList ( Int_t nCuts,
98  TList *CutArray) {
99  fnCuts = nCuts ;
100  fEventCutArray = CutArray ;
101  }
102 
103  // Setting the cut lists for the conversion photons
105  TList *CutArray) {
106  fnCuts = nCuts ;
107  fCutArray = CutArray ;
108  }
109 
110  // Setting the cut lists for the calo photons
111  void SetCaloCutList ( Int_t nCuts,
112  TList *CutArray) {
113  fnCuts = nCuts ;
114  fClusterCutArray = CutArray ;
115  }
116 
117  // Setting the cut lists for the meson
118  void SetMesonCutList ( Int_t nCuts,
119  TList *CutArray) {
120  fnCuts = nCuts ;
121  fMesonCutArray = CutArray ;
122  }
123 
124  // BG HandlerSettings
125  void CalculateBackground ();
126  void CalculateBackgroundRP ();
127  void RotateParticle ( AliAODConversionPhoton *gamma );
129  Double_t previousEventEP,
130  Double_t thisEventEP );
134  void UpdateEventByEventData ();
135 
136  // Additional functions for convenience
137  void SetLogBinningXTH2 ( TH2* histoRebin );
138  Bool_t CheckVectorOnly ( vector<Int_t> &vec,
139  Int_t tobechecked );
140  Bool_t CheckVectorForDoubleCount ( vector<Int_t> &vec,
141  Int_t tobechecked );
142 
143  void FillMultipleCountMap ( map<Int_t,Int_t> &ma,
144  Int_t tobechecked );
146  Int_t> &ma,
147  TH1F* hist );
148 
149  // Function to enable MC label sorting
150  void SetEnableSortingOfMCClusLabels (Bool_t enableSort) { fEnableSortForClusMC = enableSort;}
151 
152 
153 protected:
154  TRandom3 fRandom; // random number
155  AliV0ReaderV1* fV0Reader; // basic photon Selection Task
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  AliConvEventCuts* fEventCuts; // EventCutObject
163  AliConversionPhotonCuts* fConversionCuts; // ConversionCutObject
164  AliCaloPhotonCuts* fCaloPhotonCuts; // CaloPhotonCutObject
165  AliConversionMesonCuts* fMesonCuts; // MesonCutObject
166 
167  TList** fCutFolder; // Array of lists for containers belonging to cut
168  TList** fESDList; // Array of lists with histograms with reconstructed properties
169  TList** fBackList; // Array of lists with BG THnSparseF
170  TList** fMotherList; // Array of lists with Signal THnSparseF
171  TList** fTrueList; // Array of lists with histograms with MC validated reconstructed properties
172  TList** fMCList; // Array of lists with histograms with pure MC information
173  TList* fOutputContainer; // Output container
176  TList* fEventCutArray; // List with Event Cuts
177  TList* fCutArray; // List with Conversion Cuts
178  TList* fClusterCutArray; // List with Cluster Cuts
179  TList* fMesonCutArray; // List with Meson Cuts
180  TClonesArray* fReaderGammas; // Array with conversion photons selected by V0Reader Cut
181 
182  TString fV0ReaderName; // V0Reader name to be found in input
183  TString fCorrTaskSetting; // Correction Task Special Name
184 
185  TObjString* fFileNameBroken; // string object for broken file name
186 
189 
190  TTree* fTreeBrokenFiles; // tree for keeping track of broken files
191 
193 
229 
230  TProfile** fProfileEtaShift;
232 
234 
258  TH1F** fHistoNEvents;
261  TH1F** fHistoVertexZ;
262  TH1F** fHistoVertexX;
263  TH1F** fHistoVertexY;
268 
269  // variable to keep track of multiple & missing reco
270  map<Int_t,Int_t> fMapMultipleCountTrueMesons;
273  vector<Int_t> fVectorRecTrueMesons;
277 
278  // additional variables
279  Double_t* fUnsmearedPx; //[fNGammaCandidates]
280  Double_t* fUnsmearedPy; //[fNGammaCandidates]
281  Double_t* fUnsmearedPz; //[fNGammaCandidates]
282  Double_t* fUnsmearedE; //[fNGammaCandidates]
283  Double_t* fMesonInvMassWindow; // minimum inv mass for histos
284 
285  Int_t* fMCEventPos; //[fNGammaCandidates]
286  Int_t* fMCEventNeg; //[fNGammaCandidates]
287  Int_t* fESDArrayPos; //[fNGammaCandidates]
288  Int_t* fESDArrayNeg; //[fNGammaCandidates]
289 
290  Double_t fEventPlaneAngle; // EventPlaneAngle
291  Double_t fMesonInvMassMin; // minimum inv mass for histos
292  Double_t fMesonInvMassMax; // maximum inv mass for histos
293  Double_t fMesonInvMassNBins; // Number of bins for inv mass histos
294  Double_t fWeightJetJetMC; // weight for Jet-Jet MC
295 
296  Int_t fNGammaCandidates; // number of gamma candidates in event
297  Int_t fnCuts; // number of cuts to be analysed in parallel
298  Int_t fiCut; // current cut
299  Int_t fIsHeavyIon; // switch for pp = 0, PbPb = 1, pPb = 2
300  Int_t fMesonRecoMode; // switch for running with different reconstruction modes: 0 - PCM-PCM, 1 - PCM-Calo, 2 - Calo-Calo
301  Int_t fMesonType; // selector for meson analysis
302  Int_t fMesonPDG; // PDG code for selected meson
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  Int_t fIsMC; // flag for MC information
307 
308  Bool_t fMoveParticleAccordingToVertex; // boolean for BG calculation
309  Bool_t fDoLightOutput; // switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
310  Bool_t fIsFromDesiredHeader; // flag for MC headers
311  Bool_t fIsOverlappingWithOtherHeader; // flag for particles in MC overlapping between headers
312  Bool_t fDoTHnSparse; // flag for using THnSparses for background estimation
313  Bool_t fSetPlotHistsExtQA; // flag for extended QA hists
314  Bool_t fDoConvGammaShowerShapeTree; // flag for tree with conv gamma R vs energy vs shower shape
315  Bool_t fEnableSortForClusMC; // switch on sorting for MC labels in cluster
316  Bool_t fDoPrimaryTrackMatching; // switch for basic track matching for primaries
317  Bool_t fDoInvMassShowerShapeTree; // flag for producing tree tESDInvMassShowerShape
318  Bool_t fAllowOverlapHeaders; // enable overlapping headers for cluster selection
319  Bool_t fEnableClusterCutsForTrigger; // enable CLusterCuts output for trigger only
320 
321 private:
324 
326 };
327 
328 #endif // ALIANALYSISTASKHEAVYNEUTRALMESONTOGG_H
329 
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 double counted cluster photons
TList * fClusterCandidates
current list of photon candidates
TH1F ** fHistoVertexX
array of histos with vertex z distribution for selected events
TTree * fTreeBrokenFiles
array of THnSparseF with BG for same event photon pairs, inv Mass, pt
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 with invariant mass pairs which were rejected
TH2F ** fHistoTrueMesonCaloConvertedPhotonMatchedInvMassPt
array of histos with validated meson converted photon leading and photon, invMass, pt
TH2F ** fHistoMotherMesonPtY
array of histogram with BG for mixed event photon pairs, inv Mass, pt
TH2F ** fHistoMCMesonPtY
array of histos with validated meson, pt, openAngle
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
TH1F ** fHistoTruePrimaryClusGammaPt
array of histos with validated converted photon, fully contained, pt
TH1F ** fHistoVertexY
array of histos with vertex x distribution for selected events
TH2F ** fHistoTrueMesonInvMassPt
array of histograms with invariant mass cut around nominal mass ,eta/phi of conversion photon ...
TH2F ** fHistoTruePrimaryMesonMCPtResolPt
array of histos with validated unweighted primary mothers, invMass, pt
TH1F ** fHistoMCMesonInAccPt
array of histos without event weights meson, pT
Double_t * fUnsmearedPx
vector containing labels of validated cluster photons
THnSparseF ** fSparseMotherBackInvMassPtZM
array of THnSparseF with signal + BG for same event photon pairs, inv Mass, pt
TH2F ** fHistoDoubleCountTrueMesonInvMassPt
array of histos with number of labels in cluster
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
map containing cluster photon labels that are counted at least twice
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 without evt weight meson in acceptance, pT
void ProcessTrueMesonCandidatesConvAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
TH1F ** fHistoConvGammaPt
array of histos for header names
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
array of histos how often TrueClusterGammas are counted
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
array of profiles with weights for validated primary mothers, invMass, 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 histogram 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 histos with V0 counts
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 with ntrials for jetjet
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 profiles with xsection for jetjet
vector< Int_t > fVectorDoubleCountTrueMesons
array of strings containing the stack position of the reconstructed validated meson ...
TH2F ** fHistoMotherMesonPtAlpha
array of histograms with invariant mass cut around nominal mass, pt, Y
TProfile ** fProfileEtaShift
array of histos for SPD Cluster vs Tracklet plot for pileup monitoring
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 weighted meson, pT, hardest jet pt
TH1F ** fHistoNV0Tracks
array of histos with number of calo gamma candidates per event
const char Option_t
Definition: External.C:48
void SetConversionCutList(Int_t nCuts, TList *CutArray)
TH1F ** fHistoClusGammaPt
array of histogram conversion photon pT
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 ** fHistoMotherInvMassRejected
array of histos with cluster, pt rejected headers
TH1F ** fHistoClusRejectedHeadersGammaPt
array of histos with cluster, pt all headers
TH1F ** fHistoMultipleCountTrueMeson
array of histos with validated primary cluster, converted photons, pt
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