AliPhysics  master (3d17d9d)
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 
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 
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 
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 
321  Int_t fDEIds[200];
322 
323  AliCFContainer* fCFContainer;
335 
336  ClassDef(AliAnalysisTaskMuonPerformance, 3); // Muon performance analysis
337 };
338 
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
TCanvas * DrawVsAng(const char *name, const char *title, TH1 *h1, TH2 *h2)
void Zoom(TH1 *h, Double_t fractionCut=0.01)
Int_t RecoTrackMother(AliMCParticle *mcParticle)
slope-Y residual at vertex in 3 MC angular regions
double Double_t
Definition: External.C:58
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
slope-Y residual at vertex in 3 angular regions
momentum residual at vertex in 3 angular regions
const char * title
Definition: MakeQAPdf.C:27
momentum residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
mean P * MCS deviation angle versus P for tracks in ]3,10[ degrees at absorber end ...
momentum residual at vertex versus angle at absorber end
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 ...
void SetRecoParamStorage(const char *ocdbPath)
Set the OCDB path to the recoParam file used in the reco (if not set use default storage) ...
P * DCA distribution versus angle at absorber end.
slope-X residual at vertex in 3 angular regions
phi residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
momentum residual at first cluster versus P
Residual of x position in first trigger chamber.
TObjArray * fSlopeAt1stClList
List of graph and canvas about slope resolution at first cluster.
TObjArray * fClusterList
List of graph and canvas about cluster resolution.
void FillEffHistos(AliCFEffGrid *efficiency, const char *suffix, TObjArray *list)
momentum residual at vertex versus P for tracks with MC angle < 2 degrees
P * DCA distribution versus P for tracks in ]3,10[ degrees at absorber end.
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)
matched with reconstructible track and triggerable track of different ID
eta residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
TObjArray * fTriggerList
List of histograms for trigger resolution.
eta residual at vertex versus angle at absorber end
P * DCA resolution versus P for tracks in ]3,10[ degrees at absorber end.
momentum residuals for tracks with MC angle < 2 degrees
slope-X residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
slope-X residual at vertex versus position at absorber end for tracks with MC angle in ]2...
P * MCS deviation angle distribution versus P for tracks in ]2,3] degrees at absorber end...
mean momentum residual at first cluster versus P
void FitPDCAVsMom(TH2 *h, const char *fitting, TGraphAsymmErrors *gMean, TGraphAsymmErrors *gSigma)
P * DCA resolution versus P for tracks in ]2,3] degrees at absorber end.
momentum residual at vertex in 3 MC angular regions
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...
Residual of y position in first trigger chamber.
phi residual at vertex versus position at absorber end for tracks with MC angle in ]2...
UInt_t fRequestedStationMask
mask of requested stations
Double_t * sigma
P * DCA distribution versus position at absorber end for tracks with MC angle in ]3,10[ degrees.
P * MCS deviation angle dispersion versus P for tracks in ]2,3] degrees at absorber end...
TCanvas * DrawResPVsP(const char *name, const char *title, TH2 *h, const Int_t nBins)
phi residual at vertex in 3 angular regions
eta residual at vertex in 3 MC angular regions
void FillContainerInfoMC(Double_t *containerInput, AliMCParticle *mcPart)
slope-X residual at vertex versus position at absorber end in 3 MC angular regions ...
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
TObjArray * fPhiAtVtxList
List of graph and canvas about phi resolution at vertex.
float Float_t
Definition: External.C:68
Double_t fSigmaCutTrig
sigma cut to associate trigger track to triggerable track
P * MCS deviation angle dispersion versus P for tracks in ]3,10[ degrees at absorber end...
slope-X residual at vertex in 3 MC angular regions
slope-Y residual at vertex versus angle at absorber end
momentum residual at vertex versus position at absorber end for tracks with MC angle in ]2...
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)
momentum residual at vertex versus P for tracks in ]2,3] degrees at absorber end
mean P * DCA 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 in ]3...
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 &)
momentum residual at vertex versus angle at absorber end versus momentum
TObjArray * fEfficiencyList
List of histograms for tracker/trigger efficiencies.
P * DCA distribution versus P for tracks in ]2,3] degrees at absorber end.
momentum residual at vertex versus position at absorber end in 3 MC angular regions ...
Bool_t fMCTrigLevelFromMatchTrk
set the triggerable level from the MC matching the trk part
Bool_t fRequest2ChInSameSt45
2 fired chambers requested in the same station (4 or 5) or not
TObjArray * fPAtVtxList
List of graph and canvas about momentum resolution at vertex.
not matched with either reconstructible track or triggerable track
relative momentum resolution at vertex versus P
TObjArray * fDCAList
List of graph and canvas about DCA.
P * DCA distribution versus position at absorber end for tracks with MC angle <= 2 degrees...
phi residual at vertex versus position at absorber end for tracks with MC angle in ]3...
TObjArray * fTrackerList
List of histograms for tracker resolution.
momentum residual for tracks between 3 and 10 degrees
most probable momentum residual at vertex versus P
mean P * DCA versus P for tracks in ]2,3] degrees at absorber end
mean P * MCS deviation angle versus P for tracks in ]2,3] degrees at absorber end ...
momentum residual at vertex versus P for tracks in ]3,10[ degrees at absorber end ...
TString fDefaultStorage
location of the default OCDB storage
Match trigger not passing any Pt threshold (MC)
TObjArray * fPAt1stClList
List of graph and canvas about momentum resolution at first cluster.
slope-Y residual at vertex versus position at absorber end for tracks with MC angle <= 2 degrees ...
P * DCA distribution versus position at absorber end for tracks with MC angle in ]2,3] degrees.
void SetPBins(Int_t nBins, Double_t min, Double_t max)
slope-Y residual at vertex versus position at absorber end for tracks with MC angle in ]3...
Int_t fDEIds[200]
ID of DE refered by index in histograms.
momentum residual at vertex versus position at absorber end for tracks with MC angle in ]3...
Definition: External.C:220
P * DCA versus position at absorber end in 3 MC angular regions.
void FitClusterResiduals(Bool_t flag=kTRUE)
set the flag to fit or not the cluster residuals to extract means and sigmas
slope-X residual at vertex versus angle at absorber end
eta residual at vertex versus position at absorber end for tracks with MC angle in ]3...
AliCFContainer * fCFContainer
Pointer to the CF container.
relative momentum resolution at first cluster versus P
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://")
transverse momentum residual at first cluster versus pT
momentum residual for tracks between 2 and 3 degrees
TString fRecoParamOCDBpath
OCDB path to the recoParam file.
phi residual at vertex versus position at absorber end in 3 MC angular regions
const char Option_t
Definition: External.C:48
phi residual at vertex versus angle at absorber end
Float_t GetBinThetaAbsEnd(Float_t RAtAbsEnd, Bool_t isTheta=kFALSE)
transverse momentum residual at vertex versus pT
bool Bool_t
Definition: External.C:53
slope-Y residual at vertex versus position at absorber end for tracks with MC angle in ]2...
Bool_t fCorrectForSystematics
add or not the systematic shifts of the residuals to the resolution
matched with reconstructible track and triggerable track of same ID
void FillContainerInfoReco(Double_t *containerInput, AliESDMuonTrack *esdTrack, Bool_t isValid, Int_t mcID)
eta residual at vertex versus position at absorber end in 3 MC angular regions
eta residual at vertex in 3 angular regions
Definition: External.C:196
eta residual at vertex versus position at absorber end for tracks with MC angle in ]2...
TString fAlignOCDBpath
OCDB path to the alignment file.
P * MCS deviation angle distribution versus P for tracks in ]3,10[ degrees at absorber end...
phi residual at vertex in 3 MC angular regions
slope-Y residual at vertex versus position at absorber end in 3 MC angular regions ...
Double_t fClusterMaxRes[2]
highest chamber resolution in both directions
Bool_t GetEfficiency(AliCFEffGrid *efficiency, Double_t &calcEff, Double_t &calcEffErr)