AliPhysics  6cf2591 (6cf2591)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskMuonResolution.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKMUONRESOLUTION_H
2 #define ALIANALYSISTASKMUONRESOLUTION_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 /* $Id$ */
7 
11 //Author: Philippe Pillot - SUBATECH Nantes
12 
13 #include <TString.h>
14 #include <TMatrixD.h>
15 #include <TF1.h>
16 #include "AliAnalysisTaskSE.h"
17 #include "AliMuonEventCuts.h"
18 #include "AliMuonTrackCuts.h"
19 
20 class TH1;
21 class TH2;
22 class TGraphErrors;
23 class TObjArray;
24 class TList;
25 class AliMUONTrack;
26 class AliMUONTrackParam;
27 class AliMUONGeometryTransformer;
28 class AliMUONVCluster;
29 
31 public:
32 
34  AliAnalysisTaskMuonResolution(const char *name);
36 
38  void SetDefaultStorage(const char* ocdbPath) { fDefaultStorage = ocdbPath; }
39 
40  void SetStartingResolution(Int_t chId, Double_t valNB, Double_t valB);
41  void SetStartingResolution(Double_t valNB[10], Double_t valB[10]);
42  void GetStartingResolution(Double_t valNB[10], Double_t valB[10]) const;
43 
44  void SetHalfChShift(Int_t hchId, Double_t valNB, Double_t valB);
45  void SetHalfChShift(Double_t valNB[20], Double_t valB[20]);
46  void GetHalfChShift(Double_t valNB[20], Double_t valB[20]) const;
47  void ShiftHalfCh(Bool_t flag = kTRUE) { fShiftHalfCh = flag; }
48  void PrintHalfChShift(Bool_t flag = kTRUE) { fPrintHalfChShift = flag; }
49 
50  void SetDEShift(Int_t iDE, Double_t valNB, Double_t valB);
51  void SetDEShift(Double_t valNB[200], Double_t valB[200]);
52  void GetDEShift(Double_t valNB[200], Double_t valB[200]) const;
53  void ShiftDE(Bool_t flag = kTRUE) { fShiftDE = flag; }
54  void PrintDEShift(Bool_t flag = kTRUE) { fPrintDEShift = flag; }
55 
57  void SetMinMomentum(Double_t val) { fMinMomentum = val; }
58 
60  void SetMinPt(Double_t val) { fMinPt = val; }
61 
63  void SetMuonSign(Short_t sign) { fSign = sign; }
64 
65  // set standard cuts to select events to be considered
66  void SetMuonEventCuts(AliMuonEventCuts &eventCuts);
67 
68  // set standard cuts to select tracks to be considered
69  void SetMuonTrackCuts(AliMuonTrackCuts &trackCuts);
70 
73  void SetExtrapMode(Int_t val) { fExtrapMode = val; }
74 
76  void CorrectForSystematics(Bool_t flag = kTRUE) { fCorrectForSystematics = flag; }
77 
78  void SetAlignStorage(const char* ocdbPath, Int_t version = -1, Int_t subVersion = -1);
79 
80  void ReAlign(const char* oldAlignStorage = 0x0, Int_t oldVersion = -1, Int_t oldSubVersion = -1,
81  const char* newAlignStorage = "", Int_t newVersion = -1, Int_t newSubVersion = -1);
82 
85 
87  void ShowProgressBar(Bool_t flag = kTRUE) {fShowProgressBar = flag;}
88 
90  void PrintClusterRes(Bool_t perCh = kTRUE, Bool_t perDE = kFALSE) {fPrintClResPerCh = perCh; fPrintClResPerDE = perDE;}
91 
92  void FitResiduals(Bool_t flag = kTRUE);
93 
95  void RemoveMonoCathodClusters(Bool_t flag = kTRUE, Bool_t checkAllPads = kTRUE) {fRemoveMonoCathCl = flag; fCheckAllPads = checkAllPads;}
96 
98  void ImproveTracks(Bool_t flag = kTRUE) {fImproveTracks = flag;}
99 
100  virtual void UserCreateOutputObjects();
101  virtual void UserExec(Option_t *);
102  virtual Bool_t UserNotify();
103  virtual void NotifyRun();
104  virtual void Terminate(Option_t *);
105 
106 private:
107 
112 
113  void ModifyClusters(AliMUONTrack& track);
114  void Zoom(TH1* h, Double_t fractionCut = 0.01);
115  void ZoomLeft(TH1* h, Double_t fractionCut = 0.02);
116  void ZoomRight(TH1* h, Double_t fractionCut = 0.02);
117  void GetMeanRMS(TH1* h, Double_t& mean, Double_t& meanErr,Double_t& rms, Double_t& rmsErr, TGraphErrors* gMean = 0x0,
118  TGraphErrors* gRMS = 0x0, Int_t i = 0, Double_t x = 0, Bool_t zoom = kTRUE, Bool_t enableFit = kTRUE);
119  void FillMeanSigmaClusterVsX(const TH2* hIn, const TH2* hOut, TGraphErrors* gMean, TGraphErrors* gSigma);
120  void Cov2CovP(const AliMUONTrackParam &param, TMatrixD &covP);
121  void CheckPads(AliMUONVCluster *cl, Bool_t &hasBending, Bool_t &hasNonBending) const;
122  void CheckPadsBelow(AliMUONVCluster *cl, Bool_t &hasBending, Bool_t &hasNonBending) const;
123 
124 private:
125 
126  enum eResiduals {
130  kMCSPerCh = 6,
135  kMCSPerDE = 16,
142  };
143 
149  };
150 
156  };
157 
164  };
165 
166  enum eLocalChi2 {
169  };
170 
171  enum eChamberRes {
200  };
201 
202  enum eTrackRes {
204  kPRes = 1,
206  kPtRes = 3,
209  };
210 
211  enum eCanvases {
212  kResPerCh = 0,
213  kResPerDE = 1,
224  };
225 
226  static const Int_t fgkMinEntries;
227 
237 
240 
243 
246 
252  TF1* fGaus;
268  Int_t fDEIds[200];
276  AliMUONGeometryTransformer* fOldGeoTransformer;
277  AliMUONGeometryTransformer* fNewGeoTransformer;
278 
279  AliMuonEventCuts* fMuonEventCuts;
280  AliMuonTrackCuts* fMuonTrackCuts;
281 
282  ClassDef(AliAnalysisTaskMuonResolution, 6); // chamber resolution analysis
283 };
284 
285 //________________________________________________________________________
287 {
289  if (chId < 0 || chId >= 10) return;
290  fClusterResNB[chId] = valNB;
291  fClusterResB[chId] = valB;
292 }
293 
294 //________________________________________________________________________
296 {
298  for (Int_t i = 0; i < 10; i++) {
299  fClusterResNB[i] = valNB[i];
300  fClusterResB[i] = valB[i];
301  }
302 }
303 
304 //________________________________________________________________________
306 {
308  for (Int_t i = 0; i < 10; i++) {
309  valNB[i] = fClusterResNB[i];
310  valB[i] = fClusterResB[i];
311  }
312 }
313 
314 //________________________________________________________________________
316 {
318  if (hchId < 0 || hchId >= 20) return;
319  fHalfChShiftNB[hchId] = valNB;
320  fHalfChShiftB[hchId] = valB;
321 }
322 
323 //________________________________________________________________________
325 {
327  for (Int_t i = 0; i < 20; i++) {
328  fHalfChShiftNB[i] = valNB[i];
329  fHalfChShiftB[i] = valB[i];
330  }
331 }
332 
333 //________________________________________________________________________
335 {
337  for (Int_t i = 0; i < 20; i++) {
338  valNB[i] = fHalfChShiftNB[i];
339  valB[i] = fHalfChShiftB[i];
340  }
341 }
342 
343 //________________________________________________________________________
345 {
347  if (iDE < 0 || iDE >= 200) return;
348  fDEShiftNB[iDE] = valNB;
349  fDEShiftB[iDE] = valB;
350 }
351 
352 //________________________________________________________________________
354 {
356  for (Int_t i = 0; i < 200; i++) {
357  fDEShiftNB[i] = valNB[i];
358  fDEShiftB[i] = valB[i];
359  }
360 }
361 
362 //________________________________________________________________________
363 inline void AliAnalysisTaskMuonResolution::GetDEShift(Double_t valNB[200], Double_t valB[200]) const
364 {
366  for (Int_t i = 0; i < 200; i++) {
367  valNB[i] = fDEShiftNB[i];
368  valB[i] = fDEShiftB[i];
369  }
370 }
371 
372 //________________________________________________________________________
373 inline void AliAnalysisTaskMuonResolution::SetAlignStorage(const char* ocdbPath, Int_t version, Int_t subVersion)
374 {
379  if (ocdbPath) {
380  fNewAlignStorage = ocdbPath;
381  fNewAlignVersion = version;
382  fNewAlignSubVersion = subVersion;
383  } else {
384  fNewAlignStorage = "none";
385  fNewAlignVersion = -1;
386  fNewAlignSubVersion = -1;
387  }
388 }
389 
390 //________________________________________________________________________
391 inline void AliAnalysisTaskMuonResolution::ReAlign(const char* oldAlignStorage, Int_t oldVersion, Int_t oldSubVersion,
392  const char* newAlignStorage, Int_t newVersion, Int_t newSubVersion)
393 {
399  if (oldAlignStorage) {
400  fOldAlignStorage = oldAlignStorage;
401  fOldAlignVersion = oldVersion;
402  fOldAlignSubVersion = oldSubVersion;
403  } else {
404  fOldAlignStorage = "none";
405  fOldAlignVersion = -1;
406  fOldAlignSubVersion = -1;
407  }
408  if (newAlignStorage) {
409  fNewAlignStorage = newAlignStorage;
410  fNewAlignVersion = newVersion;
411  fNewAlignSubVersion = newSubVersion;
412  } else {
413  fNewAlignStorage = "none";
414  fNewAlignVersion = -1;
415  fNewAlignSubVersion = -1;
416  }
417  fReAlign = kTRUE;
418 }
419 
420 //________________________________________________________________________
422 {
425  delete fGaus;
426  if (flag) fGaus = new TF1("fGaus","gaus");
427  else fGaus = NULL;
428 }
429 
430 //________________________________________________________________________
431 inline void AliAnalysisTaskMuonResolution::SetMuonEventCuts(AliMuonEventCuts &eventCuts)
432 {
434  delete fMuonEventCuts;
435  fMuonEventCuts = new AliMuonEventCuts(eventCuts);
436 }
437 
438 //________________________________________________________________________
439 inline void AliAnalysisTaskMuonResolution::SetMuonTrackCuts(AliMuonTrackCuts &trackCuts)
440 {
442  delete fMuonTrackCuts;
443  fMuonTrackCuts = new AliMuonTrackCuts(trackCuts);
444 }
445 
446 #endif
447 
Short_t fSign
use only tracks of this sign
Double_t fHalfChShiftB[20]
half-chamber deplacements in bending direction
muon slope-X/Y reconstructed resolution at first cluster vs p
cluster-track residual-X/Y distribution in chamber i versus momentum (cluster attached to the track) ...
muon momentum reconstructed resolution at first cluster vs p
cluster X/Y-resolution per chamber versus momentum
cluster-track residual-X/Y distribution in half-chamber i versus track angle in X/Y direction (cluste...
cluster-track residual-X/Y distribution integrated over chambers versus centrality (cluster not attac...
static const Int_t fgkMinEntries
minimum number of entries needed to compute resolution
double Double_t
Definition: External.C:58
AliMUONGeometryTransformer * fOldGeoTransformer
geometry transformer used to recontruct the present data
Bool_t fShiftDE
flag telling wether to displace DEs by fDEShift(N)B[i] or not
void RemoveMonoCathodClusters(Bool_t flag=kTRUE, Bool_t checkAllPads=kTRUE)
set the flag to remove mono-cathod clusters (either considering all the pads or only the ones directl...
cluster-track residual-X/Y per DE: mean (cluster in)
cluster-track residual-X/Y distribution in chamber i versus centrality (cluster not attached to the t...
cluster-track residual-X/Y distribution per DE (cluster not attached to the track) ...
Bool_t fPrintClResPerCh
print the cluster resolution per chamber
cluster X/Y-resolution integrated over chambers versus centrality
cluster-track residual-X/Y per chamber: sigma (cluster out)
Bool_t fShowProgressBar
show the progression bar
TString fOldAlignStorage
location of the OCDB storage where to find old MUON/Align/Data (use the default one if empty) ...
TString fNewAlignStorage
location of the OCDB storage where to find new MUON/Align/Data (use the default one if empty) ...
Bool_t fShiftHalfCh
flag telling wether to displace half-chambers by fHalfChShift(N)B[i] or not
cluster X/Y-resolution integrated over chambers versus track angle in X/Y direction ...
Bool_t fImproveTracks
flag telling whether to improve or not the track before measuring the resolution
Bool_t fPrintHalfChShift
print the half-chamber displacements
cluster X/Y-resolution integrated over chambers versus momentum
AliMuonEventCuts * fMuonEventCuts
cuts to select events to be considered
cluster-track residual-X/Y distribution per chamber (cluster not attached to the track) ...
AliMuonTrackCuts * fMuonTrackCuts
cuts to select tracks to be considered
Bool_t fPrintDEShift
print the DE displacements
cluster-track residual-X/Y per chamber: mean (cluster out)
void ZoomLeft(TH1 *h, Double_t fractionCut=0.02)
ClassDef(AliAnalysisTaskMuonResolution, 6)
Int_t fDEIds[200]
ID of DE refered by index in histograms.
cluster-track residual-X/Y distribution integrated over chambers versus track angle in X/Y direction ...
TObjArray * GetCanvases()
return the list of summary canvases
Double_t fClusterResNB[10]
cluster resolution in non-bending direction
void Zoom(TH1 *h, Double_t fractionCut=0.01)
Bool_t fRemoveMonoCathCl
remove or not the mono-cathod clusters
void FillMeanSigmaClusterVsX(const TH2 *hIn, const TH2 *hOut, TGraphErrors *gMean, TGraphErrors *gSigma)
AliAnalysisTaskMuonResolution & operator=(const AliAnalysisTaskMuonResolution &rhs)
Not implemented.
cluster-track residual-X/Y distribution in chamber i versus track angle in X/Y direction (cluster att...
TObjArray * fCanvases
List of canvases summarizing the results.
muon momentum reconstructed resolution at vertex vs p
Double_t fHalfChShiftNB[20]
half-chamber deplacements in non-bending direction
void SetAlignStorage(const char *ocdbPath, Int_t version=-1, Int_t subVersion=-1)
cluster-track residual-X/Y distribution in chamber i versus centrality (cluster attached to the track...
AliMUONGeometryTransformer * fNewGeoTransformer
new geometry transformer containing the new alignment to be applied
muon slope-X/Y reconstructed resolution at vertex vs p
Double_t fMinMomentum
use only tracks with momentum higher than this value
cluster-track residual-X/Y per chamber: dispersion (cluster out)
void ShowProgressBar(Bool_t flag=kTRUE)
set the flag to show the progression bar
int Int_t
Definition: External.C:63
Bool_t fOCDBLoaded
flag telling if the OCDB has been properly loaded or not
void SetHalfChShift(Int_t hchId, Double_t valNB, Double_t valB)
TObjArray * fResidualsVsP
List of residual vs. p histos.
calculated cluster X/Y-resolution per chamber
void CheckPadsBelow(AliMUONVCluster *cl, Bool_t &hasBending, Bool_t &hasNonBending) const
cluster-track residual-X/Y distribution per half chamber (cluster not attached to the track) ...
cluster-track residual-X/Y distribution in chamber i versus momentum (cluster not attached to the tra...
combined cluster-track residual-X/Y per half chamber
void GetMeanRMS(TH1 *h, Double_t &mean, Double_t &meanErr, Double_t &rms, Double_t &rmsErr, TGraphErrors *gMean=0x0, TGraphErrors *gRMS=0x0, Int_t i=0, Double_t x=0, Bool_t zoom=kTRUE, Bool_t enableFit=kTRUE)
cluster-track residual-X/Y distribution integrated over chambers versus centrality (cluster attached ...
cluster-track residual-X/Y per half-chamber versus track angle in X/Y direction: mean (cluster in) ...
void ReAlign(const char *oldAlignStorage=0x0, Int_t oldVersion=-1, Int_t oldSubVersion=-1, const char *newAlignStorage="", Int_t newVersion=-1, Int_t newSubVersion=-1)
local chi2-X/Y/total distribution per chamber
cluster-track residual-X/Y per chamber versus centrality: mean (cluster in)
Int_t fNEvents
number of processed events
TObjArray * fResiduals
List of residual histos.
TObjArray * fResidualsVsAngle
List of residual vs. track angle histos.
muon transverse momentum reconstructed resolution at vertex vs p
cluster-track residual-X/Y distribution integrated over chambers versus momentum (cluster not attache...
void PrintClusterRes(Bool_t perCh=kTRUE, Bool_t perDE=kFALSE)
set the flag to print the cluster resolution per chamber/DE
TObjArray * fTrackRes
List of plots related to track resolution (p, pT, ...)
void GetHalfChShift(Double_t valNB[20], Double_t valB[20]) const
Int_t fOldAlignVersion
specific version of the old MUON/Align/Data/object to load
Double_t fMinPt
use only tracks with pT higher than this value
MCS X/Y-dispersion of extrapolated track per DE.
void ImproveTracks(Bool_t flag=kTRUE)
set the flag to improve the track before measuring the resolution
TObjArray * fLocalChi2
List of plots related to local chi2 per chamber/DE.
cluster-track residual-X/Y distribution per chamber (cluster attached to the track) ...
void SetMuonTrackCuts(AliMuonTrackCuts &trackCuts)
short Short_t
Definition: External.C:23
cluster-track residual-X/Y distribution in chamber i versus track angle in X/Y direction (cluster not...
TObjArray * fResidualsVsCent
List of residual vs. centrality histos.
Int_t fNewAlignSubVersion
specific subversion of the new MUON/Align/Data/object to load
cluster-track residual-X/Y per DE: mean (cluster out)
void GetStartingResolution(Double_t valNB[10], Double_t valB[10]) const
MCS X/Y-dispersion of extrapolated track per chamber.
Double_t fDEShiftB[200]
DE deplacements in bending direction.
Double_t fClusterResB[10]
cluster resolution in bending direction
cluster-track residual-X/Y per half chamber: mean (cluster in)
cluster-track residual-X/Y per chamber versus momentum: mean (cluster in)
cluster X/Y-resolution per chamber versus centrality
Muon spectrometer resolution.
Double_t fDEShiftNB[200]
DE deplacements in non-bending direction.
Definition: External.C:220
cluster-track residual-X/Y per chamber: sigma (cluster in)
MCS X/Y-dispersion of extrapolated track per chamber.
cluster-track residual-X/Y per chamber: mean (cluster in)
cluster-track residual-X/Y distribution integrated over chambers versus momentum (cluster attached to...
cluster-track residual-X/Y per half chamber: mean (cluster out)
Bool_t fCheckAllPads
use all pads or only the ones directly below the cluster to look for mono-cathods ...
void SetDefaultStorage(const char *ocdbPath)
Set location of the default OCDB storage (if not set use "raw://")
void SetDEShift(Int_t iDE, Double_t valNB, Double_t valB)
TObjArray * fChamberRes
List of plots related to chamber/DE resolution.
void SetMuonSign(Short_t sign)
set the sign of the tracks used to compute the resolution
cluster-track residual-X/Y per chamber versus track angle in X/Y direction: mean (cluster in) ...
cluster-track residual-X/Y distribution per half chamber (cluster attached to the track) ...
void ZoomRight(TH1 *h, Double_t fractionCut=0.02)
TString fDefaultStorage
location of the default OCDB storage
void SetMinPt(Double_t val)
set the minimum pT value of the tracks used to compute the resolution
const char Option_t
Definition: External.C:48
MCS X/Y-dispersion of extrapolated track per half chamber.
void CorrectForSystematics(Bool_t flag=kTRUE)
set the flag to add or not the systematic shifts of the residuals to the resolution ...
Bool_t fPrintClResPerDE
print the cluster resolution per DE
bool Bool_t
Definition: External.C:53
void GetDEShift(Double_t valNB[200], Double_t valB[200]) const
Int_t fOldAlignSubVersion
specific subversion of the old MUON/Align/Data/object to load
Bool_t fCorrectForSystematics
add or not the systematic shifts of the residuals to the resolution
Int_t fDEIndices[1100]
index of DE in histograms refered by ID
void Cov2CovP(const AliMUONTrackParam &param, TMatrixD &covP)
cluster X/Y-resolution per chamber versus track angle in X/Y direction
TObjArray * fTmpHists
List of temporary histograms.
TF1 * fGaus
gaussian function to fit the residuals
Int_t fNewAlignVersion
specific version of the new MUON/Align/Data/object to load
void SetStartingResolution(Int_t chId, Double_t valNB, Double_t valB)
muon transverse momentum reconstructed resolution at first cluster vs p
Bool_t fReAlign
flag telling whether to re-align the spectrometer or not before computing resolution ...
Definition: External.C:196
void SetMinMomentum(Double_t val)
set the minimum momentum value of the tracks used to compute the resolution
void SetMuonEventCuts(AliMuonEventCuts &eventCuts)
void CheckPads(AliMUONVCluster *cl, Bool_t &hasBending, Bool_t &hasNonBending) const
cluster-track residual-X/Y distribution per DE (cluster attached to the track)
Int_t fExtrapMode
extrapolation mode to get the track parameters and covariances at a given cluster ...
cluster-track residual-X/Y distribution integrated over chambers versus track angle in X/Y direction ...