AliPhysics  vAN-20150723 (baea2bf)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskMuonPerformance.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKMUONPERFORMANCE_H
2 #define ALIANALYSISTASKMUONPERFORMANCE_H
3 
8 // Author D.Stocco and P.Pillot, Subatech, Nantes
9 
10 
11 #include "AliAnalysisTaskSE.h"
12 #include "AliLog.h"
13 
14 class TObjArray;
15 class TH1;
16 class TH2;
17 class TGraphAsymmErrors;
18 class TGraphErrors;
19 class TCanvas;
20 class AliMUONRecoParam;
21 class AliCFContainer;
22 class AliMCParticle;
23 class AliESDMuonTrack;
24 class AliCFEffGrid;
25 
26 class AliAnalysisTaskMuonPerformance : public AliAnalysisTaskSE {
27  public:
29  AliAnalysisTaskMuonPerformance(const char *name);
31 
33  void SetDefaultStorage(const char* ocdbPath) { fDefaultStorage = ocdbPath; }
34 
36  void SetAlignStorage(const char* ocdbPath) { fAlignOCDBpath = ocdbPath; }
37 
39  void SetRecoParamStorage(const char* ocdbPath) { fRecoParamOCDBpath = ocdbPath; }
40 
41  // Set the binning to be used to study the detector resolution versus momentum
42  void SetPBins(Int_t nBins, Double_t min, Double_t max);
43 
45  void CorrectClusterResForSystematics(Bool_t flag = kTRUE) { fCorrectForSystematics = flag; }
46 
48  void FitClusterResiduals(Bool_t flag = kTRUE) { fFitResiduals = flag; }
49 
51  void EnforceTrackingCriteria(Bool_t flag = kTRUE) { fEnforceTrkCriteria = flag; }
52 
54  void UseMCKinematics(Bool_t flag = kTRUE) { fUseMCKinematics = flag; }
55 
57  void SetMCTrigLevelFromMatchTrk(Bool_t flag = kTRUE) { fMCTrigLevelFromMatchTrk = flag; }
58 
59  virtual void UserCreateOutputObjects();
60  virtual void UserExec(Option_t *option);
61  virtual void Terminate(Option_t *option);
62  virtual void NotifyRun();
63 
64  enum {
78  };
79 
80  enum {
84  };
85 
86  private:
87 
90 
91  Bool_t GetEfficiency(AliCFEffGrid* efficiency, Double_t& calcEff, Double_t& calcEffErr);
92  Int_t RecoTrackMother(AliMCParticle* mcParticle);
93  Float_t GetBinThetaAbsEnd(Float_t RAtAbsEnd, Bool_t isTheta = kFALSE);
94  void FillContainerInfoReco(Double_t* containerInput, AliESDMuonTrack* esdTrack, Bool_t isValid, Int_t mcID);
95  void FillContainerInfoMC(Double_t* containerInput, AliMCParticle* mcPart);
96 
97  void FitLandauGausResVsP(TH2* h, const char* fitting, TGraphAsymmErrors* gMean, TGraphAsymmErrors* gMostProb, TGraphAsymmErrors* gSigma);
98  void FitGausResVsMom(TH2* h, const Double_t mean0, const Double_t sigma0, const char* fitting, TGraphAsymmErrors* gMean, TGraphAsymmErrors* gSigma);
99  void FitPDCAVsMom(TH2* h, const char* fitting, TGraphAsymmErrors* gMean, TGraphAsymmErrors* gSigma);
100  void FitClusterResidual(TH1* h, Int_t i, Double_t& sigma, TGraphErrors* gMean, TGraphErrors* gSigma);
101 
102  TCanvas* DrawVsAng(const char* name, const char* title, TH1* h1, TH2* h2);
103  TCanvas* DrawVsPos(const char* name, const char* title, TH2* h1, TH2* h2, TH2* h3);
104  TCanvas* DrawFitLandauGausResPVsP(const char* name, const char* title, TH2* h, const Int_t nBins, const char* fitting);
105  TCanvas* DrawResPVsP(const char* name, const char* title, TH2* h, const Int_t nBins);
106 
107  void Zoom(TH1* h, Double_t fractionCut = 0.01);
108 
109  void FillEffHistos(AliCFEffGrid* efficiency, const char* suffix, TObjArray* list);
110 
111  enum {
118  };
119 
120  enum {
128  };
129 
130  enum {
137  };
138 
139  // Histograms for trigger resolution
140  enum {
144  };
145 
146  // Histograms for tracker resolution
147  enum {
160 
164 
179 
184 
192 
200 
209 
212 
217  };
218 
219  // Graphs and canvases for momentum resolution at vertex
220  enum {
230  };
231 
232  // Graphs for momentum resolution at first cluster
233  enum {
236  };
237 
238  // Graphs and canvases for slope resolution at vertex
239  enum {
250  };
251 
252  // Graphs for slope resolution at first cluster
253  enum {
258  };
259 
260  // Graphs and canvases for eta resolution at vertex
261  enum {
267  };
268 
269  // Graphs and canvases for phi resolution at vertex
270  enum {
276  };
277 
278  // Graphs and cavases for DCA resolution and MCS dispersion
279  enum {
291  };
292 
293  // Graphs for cluster resolution
294  enum {
303  };
304 
305  TString fDefaultStorage;
306  TString fAlignOCDBpath;
308  Int_t fNPBins;
309  Double_t fPRange[2];
311  Bool_t fFitResiduals;
317  Double_t fSigmaCutTrig;
318  Double_t fClusterMaxRes[2];
319  Int_t fNDE;
320  Int_t fDEIndices[1100];
321  Int_t fDEIds[200];
322 
323  AliCFContainer* fCFContainer;
324  TObjArray* fEfficiencyList;
325  TObjArray* fTriggerList;
326  TObjArray* fTrackerList;
327  TObjArray* fPAtVtxList;
328  TObjArray* fSlopeAtVtxList;
329  TObjArray* fEtaAtVtxList;
330  TObjArray* fPhiAtVtxList;
331  TObjArray* fPAt1stClList;
332  TObjArray* fSlopeAt1stClList;
333  TObjArray* fDCAList;
334  TObjArray* fClusterList;
335 
336  ClassDef(AliAnalysisTaskMuonPerformance, 3); // Muon performance analysis
337 };
338 
339 inline void AliAnalysisTaskMuonPerformance::SetPBins(Int_t nBins, Double_t pMin, Double_t pMax)
340 {
342  if (nBins > 0) fNPBins = nBins;
343  else AliError("Incorrect number of momentum bins");
344  if (pMin >= 0. && pMax > pMin) {
345  fPRange[0] = pMin;
346  fPRange[1] = pMax;
347  } else AliError("Incorrect momentum range");
348 }
349 
350 
351 #endif
momentum residual at first cluster versus P
eta residual at vertex in 3 MC angular regions
TCanvas * DrawVsAng(const char *name, const char *title, TH1 *h1, TH2 *h2)
mean P * MCS deviation angle versus P for tracks in ]3,10[ degrees at absorber end ...
momentum residual at vertex versus P for tracks in ]3,10[ degrees at absorber end ...
momentum residual at vertex versus position at absorber end in 3 MC angular regions ...
phi residual at vertex in 3 MC angular regions
slope-Y residual at vertex in 3 angular regions
eta residual at vertex versus position at absorber end in 3 MC angular regions
P * DCA resolution versus P for tracks in ]2,3] degrees at absorber end.
void Zoom(TH1 *h, Double_t fractionCut=0.01)
Int_t RecoTrackMother(AliMCParticle *mcParticle)
slope-Y residual at vertex versus position at absorber end in 3 MC angular regions ...
phi residual at vertex versus angle at absorber end
TObjArray * fSlopeAtVtxList
List of graph and canvas about slope resolution at vertex.
Bool_t fFitResiduals
fit or not the cluster residuals to extract means and sigmas
P * DCA resolution versus P for tracks in ]3,10[ degrees at absorber end.
slope-X residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
slope-X residual at vertex in 3 MC angular regions
const char * title
Definition: MakeQAPdf.C:26
Int_t fDEIndices[1100]
index of DE in histograms refered by ID
Bool_t fUseMCKinematics
use kinematics from MC track when available
void CorrectClusterResForSystematics(Bool_t flag=kTRUE)
set the flag to add or not the systematic shifts of the residuals to the resolution ...
eta residual at vertex versus position at absorber end for tracks with MC angle in ]3...
transverse momentum residual at vertex versus pT
void SetRecoParamStorage(const char *ocdbPath)
Set the OCDB path to the recoParam file used in the reco (if not set use default storage) ...
P * MCS deviation angle distribution versus P for tracks in ]2,3] degrees at absorber end...
momentum residual at vertex in 3 MC angular regions
TObjArray * fSlopeAt1stClList
List of graph and canvas about slope resolution at first cluster.
P * DCA distribution versus position at absorber end for tracks with MC angle in ]3,10[ degrees.
TObjArray * fClusterList
List of graph and canvas about cluster resolution.
momentum residual at vertex versus angle at absorber end versus momentum
void FillEffHistos(AliCFEffGrid *efficiency, const char *suffix, TObjArray *list)
slope-X residual at vertex in 3 angular regions
TList * list
void SetAlignStorage(const char *ocdbPath)
Set the OCDB path to the alignment file used in the reco (if not set use default storage) ...
void FitClusterResidual(TH1 *h, Int_t i, Double_t &sigma, TGraphErrors *gMean, TGraphErrors *gSigma)
ClassDef(AliAnalysisTaskMuonPerformance, 3)
eta residual at vertex versus position at absorber end for tracks with MC angle in ]2...
matched with reconstructible track and triggerable track of same ID
P * DCA versus position at absorber end in 3 MC angular regions.
TObjArray * fTriggerList
List of histograms for trigger resolution.
matched with reconstructible track and triggerable track of different ID
slope-Y residual at vertex versus position at absorber end for tracks with MC angle in ]3...
eta residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
void FitPDCAVsMom(TH2 *h, const char *fitting, TGraphAsymmErrors *gMean, TGraphAsymmErrors *gSigma)
phi residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
void SetMCTrigLevelFromMatchTrk(Bool_t flag=kTRUE)
if trk and trig parts match different MC, set the triggerable level from the MC matching the trk part...
P * DCA distribution versus position at absorber end for tracks with MC angle in ]2,3] degrees.
mean P * DCA versus P for tracks in ]2,3] degrees at absorber end
UInt_t fRequestedStationMask
mask of requested stations
mean P * DCA versus P for tracks in ]3,10[ degrees at absorber end
momentum residual at vertex versus position at absorber end for tracks with MC angle in ]3...
TCanvas * DrawResPVsP(const char *name, const char *title, TH2 *h, const Int_t nBins)
relative momentum resolution at first cluster versus P
void FillContainerInfoMC(Double_t *containerInput, AliMCParticle *mcPart)
P * DCA distribution versus angle at absorber end.
mean P * MCS deviation angle versus P for tracks in ]2,3] degrees at absorber end ...
phi residual at vertex versus position at absorber end in 3 MC angular regions
TObjArray * fPhiAtVtxList
List of graph and canvas about phi resolution at vertex.
phi residual at vertex versus position at absorber end for tracks with MC angle in ]3...
momentum residual at vertex in 3 angular regions
Double_t fSigmaCutTrig
sigma cut to associate trigger track to triggerable track
P * DCA distribution versus position at absorber end for tracks with MC angle <= 2 degrees...
void FitLandauGausResVsP(TH2 *h, const char *fitting, TGraphAsymmErrors *gMean, TGraphAsymmErrors *gMostProb, TGraphAsymmErrors *gSigma)
TCanvas * DrawFitLandauGausResPVsP(const char *name, const char *title, TH2 *h, const Int_t nBins, const char *fitting)
TObjArray * fEtaAtVtxList
List of graph and canvas about eta resolution at vertex.
void EnforceTrackingCriteria(Bool_t flag=kTRUE)
set the flag to select reconstructed tracks still reconstructible for efficiency calculations ...
TCanvas * DrawVsPos(const char *name, const char *title, TH2 *h1, TH2 *h2, TH2 *h3)
AliAnalysisTaskMuonPerformance & operator=(const AliAnalysisTaskMuonPerformance &)
P * DCA distribution versus P for tracks in ]3,10[ degrees at absorber end.
TObjArray * fEfficiencyList
List of histograms for tracker/trigger efficiencies.
phi residual at vertex in 3 angular regions
Bool_t fMCTrigLevelFromMatchTrk
set the triggerable level from the MC matching the trk part
momentum residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
transverse momentum residual at first cluster versus pT
Bool_t fRequest2ChInSameSt45
2 fired chambers requested in the same station (4 or 5) or not
slope-X residual at vertex versus position at absorber end for tracks with MC angle in ]3...
TObjArray * fPAtVtxList
List of graph and canvas about momentum resolution at vertex.
momentum residual at vertex versus P for tracks in ]2,3] degrees at absorber end
TObjArray * fDCAList
List of graph and canvas about DCA.
mean momentum residual at first cluster versus P
Residual of x position in first trigger chamber.
P * DCA distribution versus P for tracks in ]2,3] degrees at absorber end.
TObjArray * fTrackerList
List of histograms for tracker resolution.
TString fDefaultStorage
location of the default OCDB storage
TObjArray * fPAt1stClList
List of graph and canvas about momentum resolution at first cluster.
eta residual at vertex in 3 angular regions
void SetPBins(Int_t nBins, Double_t min, Double_t max)
slope-X residual at vertex versus position at absorber end in 3 MC angular regions ...
Int_t fDEIds[200]
ID of DE refered by index in histograms.
slope-Y residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
slope-X residual at vertex versus angle at absorber end
void FitClusterResiduals(Bool_t flag=kTRUE)
set the flag to fit or not the cluster residuals to extract means and sigmas
momentum residual at vertex versus position at absorber end for tracks with MC angle in ]2...
slope-Y residual at vertex versus angle at absorber end
AliCFContainer * fCFContainer
Pointer to the CF container.
momentum residual for tracks between 3 and 10 degrees
not matched with either reconstructible track or triggerable track
void FitGausResVsMom(TH2 *h, const Double_t mean0, const Double_t sigma0, const char *fitting, TGraphAsymmErrors *gMean, TGraphAsymmErrors *gSigma)
Bool_t fEnforceTrkCriteria
select reconstructed tracks still reconstructible
void UseMCKinematics(Bool_t flag=kTRUE)
set the flag to use kinematics from MC track for efficiency calculations when available ...
void SetDefaultStorage(const char *ocdbPath)
Set location of the default OCDB storage (if not set use "raw://")
momentum residual at vertex versus P for tracks with MC angle < 2 degrees
momentum residual at vertex versus angle at absorber end
phi residual at vertex versus position at absorber end for tracks with MC angle in ]2...
TString fRecoParamOCDBpath
OCDB path to the recoParam file.
Float_t GetBinThetaAbsEnd(Float_t RAtAbsEnd, Bool_t isTheta=kFALSE)
Residual of y position in first trigger chamber.
P * MCS deviation angle dispersion versus P for tracks in ]2,3] degrees at absorber end...
Bool_t fCorrectForSystematics
add or not the systematic shifts of the residuals to the resolution
slope-X residual at vertex versus position at absorber end for tracks with MC angle in ]2...
momentum residual for tracks between 2 and 3 degrees
slope-Y residual at vertex in 3 MC angular regions
P * MCS deviation angle distribution versus P for tracks in ]3,10[ degrees at absorber end...
void FillContainerInfoReco(Double_t *containerInput, AliESDMuonTrack *esdTrack, Bool_t isValid, Int_t mcID)
eta residual at vertex versus angle at absorber end
momentum residuals for tracks with MC angle < 2 degrees
relative momentum resolution at vertex versus P
TString fAlignOCDBpath
OCDB path to the alignment file.
Match trigger not passing any Pt threshold (MC)
slope-Y residual at vertex versus position at absorber end for tracks with MC angle in ]2...
most probable momentum residual at vertex versus P
P * MCS deviation angle dispersion versus P for tracks in ]3,10[ degrees at absorber end...
Double_t fClusterMaxRes[2]
highest chamber resolution in both directions
Bool_t GetEfficiency(AliCFEffGrid *efficiency, Double_t &calcEff, Double_t &calcEffErr)