AliPhysics  c2ade29 (c2ade29)
AliAnalysisTaskConvCaloCalibration.h
Go to the documentation of this file.
1 
2 #ifndef AliAnalysisTaskConvCaloCalibration_H
3 #define AliAnalysisTaskConvCaloCalibration_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  AliAnalysisTaskConvCaloCalibration(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 
56  // switches for additional analysis streams or outputs
58  void SetLightOutput ( Bool_t flag ) { fDoLightOutput = flag ;}
59  void SetMesonRecoMode ( Int_t flag ) { fMesonRecoMode = flag ;}
60  void SetMesonType ( Int_t flag ) { fMesonType = flag ;}
61  void SetDoMesonQA ( Int_t flag ) { fDoMesonQA = flag ;}
62  void SetDoPhotonQA ( Int_t flag ) { fDoPhotonQA = flag ;}
63  void SetDoClusterQA ( Int_t flag ) { fDoClusterQA = flag ;}
64  void SetUseTHnSparse ( Bool_t flag ) { fDoTHnSparse = flag ;}
65  void SetPlotHistsExtQA ( Bool_t flag ) { fSetPlotHistsExtQA = flag ;}
68  void SetAllowOverlapHeaders ( Bool_t allowOverlapHeader ) { fAllowOverlapHeaders = allowOverlapHeader ;}
69 
70  // Setting the cut lists for the conversion photons
71  void SetEventCutList ( Int_t nCuts,
72  TList *CutArray) {
73  fnCuts = nCuts ;
74  fEventCutArray = CutArray ;
75  }
76 
77  // Setting the cut lists for the conversion photons
79  TList *CutArray) {
80  fnCuts = nCuts ;
81  fCutArray = CutArray ;
82  }
83 
84  // Setting the cut lists for the calo photons
85  void SetCaloCutList ( Int_t nCuts,
86  TList *CutArray) {
87  fnCuts = nCuts ;
88  fClusterCutArray = CutArray ;
89  }
90 
91  // Setting the cut lists for the meson
92  void SetMesonCutList ( Int_t nCuts,
93  TList *CutArray) {
94  fnCuts = nCuts ;
95  fMesonCutArray = CutArray ;
96  }
97 
98 void SetNumOfCaloModules ( Int_t nModules) {
99  fnModules = nModules ;
100  if(nModules < 1 || nModules > 20){
101  fnModules = 20 ;
102  }
103  }
104 
105  // BG HandlerSettings
106  void CalculateBackground ();
107  void CalculateBackgroundRP ();
108  void RotateParticle ( AliAODConversionPhoton *gamma );
110  Double_t previousEventEP,
111  Double_t thisEventEP );
115  void UpdateEventByEventData ();
116 
117  // Additional functions for convenience
118  void SetLogBinningXTH2 ( TH2* histoRebin );
119  Bool_t CheckVectorOnly ( vector<Int_t> &vec,
120  Int_t tobechecked );
121  Bool_t CheckVectorForDoubleCount ( vector<Int_t> &vec,
122  Int_t tobechecked );
123 
124  void FillMultipleCountMap ( map<Int_t,Int_t> &ma,
125  Int_t tobechecked );
127  Int_t> &ma,
128  TH1F* hist );
129 
130  // Function to enable MC label sorting
131  void SetEnableSortingOfMCClusLabels (Bool_t enableSort) { fEnableSortForClusMC = enableSort;}
132 
133 
134 
135 
136 protected:
137  TRandom3 fRandom; // random number
138  AliV0ReaderV1* fV0Reader; // basic photon Selection Task
139  AliGammaConversionAODBGHandler** fBGHandler; // BG handler for Conversion
140  AliConversionAODBGHandlerRP** fBGHandlerRP; // BG handler for Conversion (possibility to mix with respect to RP)
141  AliGammaConversionAODBGHandler** fBGClusHandler; // BG handler for Cluster
142  AliConversionAODBGHandlerRP** fBGClusHandlerRP; // BG handler for Cluster (possibility to mix with respect to RP)
143  AliVEvent* fInputEvent; // current event
144  AliMCEvent* fMCEvent; // corresponding MC event
145  AliConvEventCuts* fEventCuts; // EventCutObject
146  AliConversionPhotonCuts* fConversionCuts; // ConversionCutObject
147  AliCaloPhotonCuts* fCaloPhotonCuts; // CaloPhotonCutObject
148  AliConversionMesonCuts* fMesonCuts; // MesonCutObject
149  AliEMCALGeometry* fGeomEMCAL; // pointer to EMCAL geometry
150 
151  TList** fCutFolder; // Array of lists for containers belonging to cut
152  TList** fESDList; // Array of lists with histograms with reconstructed properties
153  TList** fBackList; // Array of lists with BG THnSparseF
154  TList** fMotherList; // Array of lists with Signal THnSparseF
155  TList* fOutputContainer; // Output container
158  TList* fEventCutArray; // List with Event Cuts
159  TList* fCutArray; // List with Conversion Cuts
160  TList* fClusterCutArray; // List with Cluster Cuts
161  TList* fMesonCutArray; // List with Meson Cuts
162  TClonesArray* fReaderGammas; // Array with conversion photons selected by V0Reader Cut
163 
164  TString fV0ReaderName; // V0Reader name to be found in input
165  TString fCorrTaskSetting; // Correction Task Special Name
166 
167  TObjString* fFileNameBroken; // string object for broken file name
168 
171 
172  TTree* fTreeBrokenFiles; // tree for keeping track of broken files
173 
174  // TProfile2D** fProfileTruePrimaryMesonWeightsInvMassPt; //! array of profiles with weights for validated primary mothers, invMass, pt
175 
188 
189  TProfile** fProfileEtaShift;
191 
192  // TH1I** fHistoMCHeaders; //! array of histos for header names
193 
203  TH1F** fHistoNEvents;
206  TH1F** fHistoVertexZ;
207  TH1F** fHistoVertexX;
208  TH1F** fHistoVertexY;
213 
214  // additional variables
215  Double_t* fUnsmearedPx; //[fNGammaCandidates]
216  Double_t* fUnsmearedPy; //[fNGammaCandidates]
217  Double_t* fUnsmearedPz; //[fNGammaCandidates]
218  Double_t* fUnsmearedE; //[fNGammaCandidates]
219  Double_t* fMesonInvMassWindow; // minimum inv mass for histos
220 
221  Int_t* fMCEventPos; //[fNGammaCandidates]
222  Int_t* fMCEventNeg; //[fNGammaCandidates]
223  Int_t* fESDArrayPos; //[fNGammaCandidates]
224  Int_t* fESDArrayNeg; //[fNGammaCandidates]
225 
226  Double_t fEventPlaneAngle; // EventPlaneAngle
227  Double_t fMesonInvMassMin; // minimum inv mass for histos
228  Double_t fMesonInvMassMax; // maximum inv mass for histos
229  Double_t fMesonInvMassNBins; // Number of bins for inv mass histos
230  Double_t fWeightJetJetMC; // weight for Jet-Jet MC
231 
232  Int_t fNGammaCandidates; // number of gamma candidates in event
233  Int_t fnCuts; // number of cuts to be analysed in parallel
234  Int_t fiCut; // current cut
235  Int_t fIsHeavyIon; // switch for pp = 0, PbPb = 1, pPb = 2
236  Int_t fMesonRecoMode; // switch for running with different reconstruction modes: 0 - PCM-PCM, 1 - PCM-Calo, 2 - Calo-Calo
237  Int_t fMesonType; // selector for meson analysis
238  Int_t fMesonPDG; // PDG code for selected meson
239  Int_t fDoMesonQA; // flag for meson QA
240  Int_t fDoPhotonQA; // flag for photon QA
241  Int_t fDoClusterQA; // flag for cluster QA
242  Int_t fIsMC; // flag for MC information
243  Int_t fnModules; // number of SM of EMCal+DCal
244 
245  Bool_t fMoveParticleAccordingToVertex; // boolean for BG calculation
246  Bool_t fDoLightOutput; // switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
247  Bool_t fIsFromDesiredHeader; // flag for MC headers
248  Bool_t fIsOverlappingWithOtherHeader; // flag for particles in MC overlapping between headers
249  Bool_t fDoTHnSparse; // flag for using THnSparses for background estimation
250  Bool_t fSetPlotHistsExtQA; // flag for extended QA hists
251  Bool_t fDoConvGammaShowerShapeTree; // flag for tree with conv gamma R vs energy vs shower shape
252  Bool_t fEnableSortForClusMC; // switch on sorting for MC labels in cluster
253  Bool_t fDoPrimaryTrackMatching; // switch for basic track matching for primaries
254  Bool_t fDoInvMassShowerShapeTree; // flag for producing tree tESDInvMassShowerShape
255  Bool_t fAllowOverlapHeaders; // enable overlapping headers for cluster selection
256  Bool_t fEnableClusterCutsForTrigger; // enable CLusterCuts output for trigger only
257 
258 private:
259  AliAnalysisTaskConvCaloCalibration(const AliAnalysisTaskConvCaloCalibration&); // Prevent copy-construction
261 
263 };
264 
265 #endif // AliAnalysisTaskConvCaloCalibration_H
TH1F ** fHistoClusGammaE
array of histos with cluster, pt
TH1F ** fHistoNV0Tracks
array of histos with number of calo gamma candidates per event
AliGammaConversionAODBGHandler ** fBGClusHandler
double Double_t
Definition: External.C:58
TH1F ** fHistoNGammaConvCandidates
array of histos with vertex y distribution for selected events
Definition: External.C:236
void FillMultipleCountMap(map< Int_t, Int_t > &ma, Int_t tobechecked)
TList * fClusterCandidates
current list of photon candidates
void FillMultipleCountHistoAndClear(map< Int_t, Int_t > &ma, TH1F *hist)
TH1F ** fHistoVertexX
array of histos with vertex z distribution for selected events
TProfile ** fProfileJetJetXSection
array of profiles with eta shift
TH1F ** fHistoClusRejectedHeadersGammaPt
array of histos with cluster, pt all headers
TH1F ** fHistoVertexY
array of histos with vertex x distribution for selected events
TH1F *** fHistoClusGammaESM
array of histos with cluster, pt
Bool_t CheckVectorOnly(vector< Int_t > &vec, Int_t tobechecked)
TH1F ** fHistoNEvents
array of histos with invariant mass pairs which were rejected
AliAnalysisTaskConvCaloCalibration & operator=(const AliAnalysisTaskConvCaloCalibration &)
void RotateParticle(AliAODConversionPhoton *gamma)
Double_t * fUnsmearedPx
array of histos with ntrials for jetjet
TH2F ** fHistoMotherMesonPtAlpha
array of histograms with invariant mass cut around nominal mass, pt, Y
TProfile ** fProfileEtaShift
array of histos with mixed event background with alpha < 0.1 for NonLin
void SetConversionCutList(Int_t nCuts, TList *CutArray)
TH2F ** fHistoMotherMatchedInvMassPt
array of histogram with signal + BG for same event photon pairs, inv Mass, pt
TH1F ** fHistoConvGammaPt
array of profiles with xsection for jetjet
TH1F ** fHistoMotherInvMassRejected
array of histos with cluster, pt rejected headers
TH2F ** fHistoMotherMesonConvPhotonEtaPhi
array of histograms with invariant mass cut around nominal mass, pt, openAngle
int Int_t
Definition: External.C:63
TH1F ** fHistoNGammaCaloCandidates
array of histos with number of conversion gamma candidates per event
Class handling all kinds of selection cuts for Gamma Calo analysis.
TH1F ** fHistoClusGammaPt
array of histogram conversion photon pT
TH1F ** fHistoVertexZ
array of histos with number of good tracks (2010 Standard track cuts)
void SetEventCutList(Int_t nCuts, TList *CutArray)
Class handling all kinds of selection cuts for Gamma Conversion analysis.
TH1F ** fHistoNEventsWOWeight
array of histos with event information
TH2F ** fHistoMotherMesonPtY
array of histogram with BG for mixed event photon pairs, inv Mass, pt
TH1F ** fHistoClusOverlapHeadersGammaPt
array of histos with cluster, E
void MoveParticleAccordingToVertex(AliAODConversionPhoton *particle, const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex)
Int_t mode
Definition: anaM.C:41
TH2F ** fHistoMotherBackInvMassECalib
array of histos with signal + background with alpha < 0.1 for NonLin
TList * fEventCutArray
current list of cluster candidates
THnSparseF ** fSparseMotherBackInvMassPtZM
array of THnSparseF with signal + BG for same event photon pairs, inv Mass, pt
TH2F *** fHistoMotherInvMassECalibSM
array of histos for SPD Cluster vs Tracklet plot for pileup monitoring
TTree * fTreeBrokenFiles
array of THnSparseF with BG for same event photon pairs, inv Mass, pt
Bool_t isMC
TH2F ** fHistoSPDClusterTrackletBackground
array of histograms with invariant mass cut around nominal mass ,eta/phi of conversion photon ...
void SetAllowOverlapHeaders(Bool_t allowOverlapHeader)
TH2F ** fHistoMotherMesonPtOpenAngle
array of histograms with invariant mass cut around nominal mass, pt, alpha
Definition: External.C:220
TH1F ** fHistoClusAllHeadersGammaPt
array of histos with cluster, pt overlapping with other headers
Class handling all kinds of selection cuts for Gamma Conversion analysis.
TH1F *** fHistoClusGammaPtSM
array of histos with cluster, E
Bool_t CheckVectorForDoubleCount(vector< Int_t > &vec, Int_t tobechecked)
TH1F ** fHistoJetJetNTrials
array of histos with V0 counts
void RotateParticleAccordingToEP(AliAODConversionPhoton *gamma, Double_t previousEventEP, Double_t thisEventEP)
Class handling all kinds of selection cuts for Gamma Conversion analysis.
const char Option_t
Definition: External.C:48
TH2F ** fHistoMotherBackInvMassPt
array of histogram with signal + BG for same event photon pairs, inv Mass, pt
void SetCaloCutList(Int_t nCuts, TList *CutArray)
TH1F ** fHistoNGoodESDTracks
array of histos with event information without event weights
bool Bool_t
Definition: External.C:53
TH2F ** fHistoMotherInvMassECalib
array of histos with mixed event background with alpha < 0.1 for NonLin for every Supermodule ...
TH2F *** fHistoMotherBackInvMassECalibSM
array of histos with signal + background with alpha < 0.1 for NonLin for every Supermodule ...
void SetMesonCutList(Int_t nCuts, TList *CutArray)