AliPhysics  vAN-20151014 (f894c76)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
MuonTrackingEfficiency.C File Reference

Compute trk efficiency at DE, chamber, station and spectro levels vs various variables from the output of the efficiency task. More...

#include <TROOT.h>
#include <TH1.h>
#include <TH2.h>
#include <THnSparse.h>
#include <TAxis.h>
#include <TString.h>
#include <TObjString.h>
#include <Riostream.h>
#include <TFile.h>
#include <TList.h>
#include <TCanvas.h>
#include <TGraphAsymmErrors.h>
#include <TMath.h>
#include <TArrayD.h>
#include <TStyle.h>
#include <THashList.h>
#include <TParameter.h>
Include dependency graph for MuonTrackingEfficiency.C:

Go to the source code of this file.

Functions

void PlotMuonEfficiencyVsX (TString var, TString fileNameData, TString fileNameSave, Bool_t saveEdges, Bool_t print, Bool_t draw)
 
void PlotIntegratedMuonEfficiencyVsX (TString var, TString runList, TString fileNameWeights, TString fileNameData, TString fileNameSave, Bool_t print, Bool_t draw)
 
void PlotMuonEfficiencyVsXY (TString xVar, TString yVar, TString fileNameData, TString fileNameSave, Bool_t draw, Bool_t rap=kFALSE)
 
void PlotMuonEfficiency (TString fileNameData, TString fileNameSave, Bool_t saveEdges, Bool_t print, Bool_t draw)
 
void PlotMuonEfficiencyVsRun (TString runList, TString fileNameData, TString fileNameSave, Bool_t print, Bool_t draw)
 
void PlotIntegratedMuonEfficiency (TString fileNameWeights, TString fileNameSave, Bool_t print, Bool_t draw)
 
void PlotMuonEfficiencyPerDE (TString fileNameData, TString fileNameSave, Bool_t saveEdges)
 
void PlotMuonEfficiencyPerDEVsRun (TString runList, TString fileNameData, TString fileNameSave)
 
void PlotIntegratedMuonEfficiencyPerDE (TString fileNameWeights, TString fileNameSave)
 
Bool_t GetChamberEfficiency (THnSparse &TT, THnSparse &TD, TArrayD &chEff, TArrayD chEffErr[2], Bool_t printError=kFALSE)
 
void GetDEEfficiency (THnSparse &TT, THnSparse &TD, TGraphAsymmErrors &effVsDE)
 
void ComputeStationEfficiency (TArrayD &chEff, TArrayD chEffErr[2], Int_t iSt, Double_t &stEff, Double_t stEffErr[2])
 
void GetStationEfficiency (TArrayD &chEff, TArrayD chEffErr[2], Int_t iSt, TGraphAsymmErrors *effVsX[3], Int_t ip, Double_t xp)
 
void ComputeStation45Efficiency (TArrayD &chEff, TArrayD chEffErr[2], Double_t &st45Eff, Double_t st45EffErr[2])
 
void GetStation45Efficiency (TArrayD &chEff, TArrayD chEffErr[2], TGraphAsymmErrors *effVsX[3], Int_t ip, Double_t xp)
 
void ComputeTrackingEfficiency (Double_t stEff[6], Double_t stEffErr[6][2], Double_t &spectroEff, Double_t spectroEffErr[2])
 
void GetTrackingEfficiency (TArrayD &chEff, TArrayD chEffErr[2], TGraphAsymmErrors *effVsSt[3], TGraphAsymmErrors *effVsX[3], Int_t ip, Double_t xp, Bool_t print=kFALSE)
 
void IntegrateMuonEfficiency (TGraphAsymmErrors &effVsRunLow, TGraphAsymmErrors &effVsRunUp, TGraphAsymmErrors &effVsX, Int_t ip, Double_t xp)
 
void LoadRunWeights (TString fileName)
 
void SetCentPtCh (THnSparse &SparseData)
 
TGraphAsymmErrors * CreateGraph (const char *name, const char *title, int value=-1)
 
void BeautifyGraph (TGraphAsymmErrors &g, const char *xAxisName, const char *yAxisName)
 
void BeautifyGraphs (TObjArray &array, const char *xAxisName, const char *yAxisName)
 
void SetRunLabel (TGraphAsymmErrors &g, Int_t irun, const TList &runs)
 
void SetRunLabel (TObjArray &array, Int_t irun, const TList &runs)
 
void MuonTrackingEfficiency (TString runList="runList.txt", TString fileNameWeights="", TString fileNameData="AnalysisResults.root", TString fileNameSave="efficiency_new.root")
 

Variables

const Char_t * effErrMode = "b(1,1)mode"
 
Double_t centMin = -999.
 
Double_t centMax = 999.
 
Double_t ptMin = 0.
 
Double_t ptMax = -1.
 
Int_t charge = 0
 
Bool_t moreTrackCandidates = kFALSE
 
THashList * runWeights = 0x0
 

Detailed Description

Compute trk efficiency at DE, chamber, station and spectro levels vs various variables from the output of the efficiency task.

Author
Philippe Pillot, Antoine Lardeux, Lizardo Valencia Palomo, Javier Martin Blanco 1) efficiency estimator and error calculation at chamber and DE level: 2 options:
  • using bayesian method with uniform prior
  • using Clopper-Pearson or other frequentist method if n ≠ 0: use above methods if n = 0: eff = -1 ± 0

2) efficiency and error propagation at station and spectrometer level: if eff = -1 for one or several ch/DE:

  • assume eff_ch = 1 ± 0 to compute eff_up and err_up with std error propagation at nth order
  • assume eff_ch = 0 ± 0 to compute eff_low and err_low with std error propagation at nth order
  • eff_spectro = eff_up + err_up - (eff_up-eff_low + err_low) otherwise: std efficiency and error propagation at nth order

3) efficiency and error integration over runs

  • performed from efficiency plots versus run
  • compute weighted average and apply standard error propagation to err_up and err_low
  • do it for both extreme cases above (with eff_up ± err–up and eff_low ± err_low)
  • int_eff = int_eff_up + int_err_up - (int_eff_up-int_eff_low + int_err_low)

Definition in file MuonTrackingEfficiency.C.

Function Documentation

void BeautifyGraph ( TGraphAsymmErrors &  g,
const char *  xAxisName,
const char *  yAxisName 
)
void BeautifyGraphs ( TObjArray &  array,
const char *  xAxisName,
const char *  yAxisName 
)
void ComputeStation45Efficiency ( TArrayD &  chEff,
TArrayD  chEffErr[2],
Double_t &  st45Eff,
Double_t  st45EffErr[2] 
)

compute the station 4-5 efficiency and errors from chamber efficiencies and errors

Definition at line 1464 of file MuonTrackingEfficiency.C.

Referenced by GetStation45Efficiency(), and GetTrackingEfficiency().

void ComputeStationEfficiency ( TArrayD &  chEff,
TArrayD  chEffErr[2],
Int_t  iSt,
Double_t &  stEff,
Double_t  stEffErr[2] 
)

compute the station iSt (0...4) efficiency and errors from the individual chamber efficiencies and errors

Definition at line 1388 of file MuonTrackingEfficiency.C.

Referenced by GetStationEfficiency(), and GetTrackingEfficiency().

void ComputeTrackingEfficiency ( Double_t  stEff[6],
Double_t  stEffErr[6][2],
Double_t &  spectroEff,
Double_t  spectroEffErr[2] 
)

compute the spectrometer efficiency and errors from the station efficiencies and errors

Definition at line 1555 of file MuonTrackingEfficiency.C.

Referenced by GetTrackingEfficiency().

TGraphAsymmErrors * CreateGraph ( const char *  name,
const char *  title,
int  value = -1 
)
Bool_t GetChamberEfficiency ( THnSparse &  TT,
THnSparse &  TD,
TArrayD &  chEff,
TArrayD  chEffErr[2],
Bool_t  printError = kFALSE 
)

compute chamber efficiency and errors return kFALSE if efficiency unknown for all chambers

Definition at line 1273 of file MuonTrackingEfficiency.C.

Referenced by PlotMuonEfficiency(), PlotMuonEfficiencyVsX(), and PlotMuonEfficiencyVsXY().

void GetDEEfficiency ( THnSparse &  TT,
THnSparse &  TD,
TGraphAsymmErrors &  effVsDE 
)

compute DE efficiency and errors

Definition at line 1338 of file MuonTrackingEfficiency.C.

Referenced by PlotMuonEfficiencyPerDE().

void GetStation45Efficiency ( TArrayD &  chEff,
TArrayD  chEffErr[2],
TGraphAsymmErrors *  effVsX[3],
Int_t  ip,
Double_t  xp 
)

compute the station 4-5 efficiency and errors from chamber efficiencies and errors

Definition at line 1501 of file MuonTrackingEfficiency.C.

Referenced by PlotMuonEfficiencyPerDE().

void GetStationEfficiency ( TArrayD &  chEff,
TArrayD  chEffErr[2],
Int_t  iSt,
TGraphAsymmErrors *  effVsX[3],
Int_t  ip,
Double_t  xp 
)

compute the station iSt (0...4) efficiency and errors from the individual chamber efficiencies and errors

Definition at line 1410 of file MuonTrackingEfficiency.C.

Referenced by PlotMuonEfficiencyPerDE().

void GetTrackingEfficiency ( TArrayD &  chEff,
TArrayD  chEffErr[2],
TGraphAsymmErrors *  effVsSt[3],
TGraphAsymmErrors *  effVsX[3],
Int_t  ip,
Double_t  xp,
Bool_t  print = kFALSE 
)

compute the tracking efficiency from the individual chamber efficiencies

Definition at line 1607 of file MuonTrackingEfficiency.C.

Referenced by PlotMuonEfficiency(), PlotMuonEfficiencyVsX(), and PlotMuonEfficiencyVsXY().

void IntegrateMuonEfficiency ( TGraphAsymmErrors &  effVsRunLow,
TGraphAsymmErrors &  effVsRunUp,
TGraphAsymmErrors &  effVsX,
Int_t  ip,
Double_t  xp 
)

integrate efficiency over runs return kFALSE if efficiency unknown in all runs

Definition at line 1720 of file MuonTrackingEfficiency.C.

Referenced by PlotIntegratedMuonEfficiency(), and PlotIntegratedMuonEfficiencyPerDE().

void LoadRunWeights ( TString  fileName)

Set the number of interested events per run (used to weight the acc*eff correction integrated over run for any pt/y/centrality bins)

Definition at line 1792 of file MuonTrackingEfficiency.C.

Referenced by PlotIntegratedMuonEfficiency(), PlotIntegratedMuonEfficiencyPerDE(), and PlotIntegratedMuonEfficiencyVsX().

void MuonTrackingEfficiency ( TString  runList = "runList.txt",
TString  fileNameWeights = "",
TString  fileNameData = "AnalysisResults.root",
TString  fileNameSave = "efficiency_new.root" 
)

main function to compute, print and plot efficiencies

Definition at line 97 of file MuonTrackingEfficiency.C.

void PlotIntegratedMuonEfficiency ( TString  fileNameWeights,
TString  fileNameSave,
Bool_t  print,
Bool_t  draw 
)

plot chamber, station and overall tracking efficiency integrated over runs

Definition at line 781 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency().

void PlotIntegratedMuonEfficiencyPerDE ( TString  fileNameWeights,
TString  fileNameSave 
)

plot chamber and station efficiency per DE integrated over runs

Definition at line 1168 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency().

void PlotIntegratedMuonEfficiencyVsX ( TString  var,
TString  runList,
TString  fileNameWeights,
TString  fileNameData,
TString  fileNameSave,
Bool_t  print,
Bool_t  draw 
)

plot the tracking efficiency versus X for each run and integrated

Definition at line 239 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency().

void PlotMuonEfficiency ( TString  fileNameData,
TString  fileNameSave,
Bool_t  saveEdges,
Bool_t  print,
Bool_t  draw 
)

plot chamber, station and overall tracking efficiency

Definition at line 536 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency(), and PlotMuonEfficiencyVsRun().

void PlotMuonEfficiencyPerDE ( TString  fileNameData,
TString  fileNameSave,
Bool_t  saveEdges 
)

plot chamber and station efficiency per DE

Definition at line 877 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency(), and PlotMuonEfficiencyPerDEVsRun().

void PlotMuonEfficiencyPerDEVsRun ( TString  runList,
TString  fileNameData,
TString  fileNameSave 
)

plot chamber and station efficiency per DE versus run

Definition at line 1019 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency().

void PlotMuonEfficiencyVsRun ( TString  runList,
TString  fileNameData,
TString  fileNameSave,
Bool_t  print,
Bool_t  draw 
)

plot chamber, station and overall tracking efficiency versus run

Definition at line 646 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency().

void PlotMuonEfficiencyVsX ( TString  var,
TString  fileNameData,
TString  fileNameSave,
Bool_t  saveEdges,
Bool_t  print,
Bool_t  draw 
)

plot the tracking efficiency versus X

Definition at line 133 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency(), and PlotIntegratedMuonEfficiencyVsX().

void PlotMuonEfficiencyVsXY ( TString  xVar,
TString  yVar,
TString  fileNameData,
TString  fileNameSave,
Bool_t  draw,
Bool_t  rap = kFALSE 
)

plot the tracking efficiency versus X,Y

Definition at line 382 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency().

void SetCentPtCh ( THnSparse &  SparseData)

Sets the centrality and pT range and the charge for integration If maxPt = -1, it sets maxPt as the maximum Pt value on the THnSparse

Definition at line 1844 of file MuonTrackingEfficiency.C.

Referenced by PlotMuonEfficiency(), PlotMuonEfficiencyPerDE(), PlotMuonEfficiencyVsX(), and PlotMuonEfficiencyVsXY().

void SetRunLabel ( TGraphAsymmErrors &  g,
Int_t  irun,
const TList &  runs 
)

set the run label for all the graphs

Definition at line 1943 of file MuonTrackingEfficiency.C.

Referenced by PlotMuonEfficiencyPerDEVsRun(), PlotMuonEfficiencyVsRun(), and SetRunLabel().

void SetRunLabel ( TObjArray &  array,
Int_t  irun,
const TList &  runs 
)

set the run label for all the graphs

Definition at line 1961 of file MuonTrackingEfficiency.C.

Variable Documentation

Double_t centMax = 999.
Double_t centMin = -999.
Int_t charge = 0

Definition at line 54 of file MuonTrackingEfficiency.C.

Referenced by AliAnaCalorimeterQA::ClusterMatchedWithTrackHistograms(), AliAnaCalorimeterQA::ClusterMCHistograms(), AliAnalysisTaskSECharmFraction::ConstructFakeTrueSecVtx(), AliCaloTrackMCReader::FillInputEvent(), AliAnaChargedParticles::FillPrimaryHistograms(), AliCFVertexingHFLctoV0bachelor::FillVectorFromMCarray(), AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(), AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(), AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(), AliCFVertexingHF3Prong::GetGeneratedValuesFromMCParticle(), AliCFVertexingHF2Prong::GetGeneratedValuesFromMCParticle(), AliCFVertexingHFCascade::GetGeneratedValuesFromMCParticle(), AliAnaInsideClusterInvariantMass::GetMCPrimaryKine(), AliCFVertexingHF3Prong::GetRecoValuesFromCandidate(), AliAnalysisTaskSED0MassCutVarFDSub::GetTrueImpactParameter(), AliAnalysisTaskSED0Mass::GetTrueImpactParameter(), AliAnalysisTaskSEDplus::GetTrueImpactParameter(), AliAnalysisTaskSEDStarSpectra::GetTrueImpactParameterD0(), AliVertexingHFUtils::GetTrueImpactParameterDplus(), AliVertexingHFUtils::GetTrueImpactParameterDzero(), AliAnaGeneratorKine::GetXE(), AliHFsubtractBFDcuts::IsInAcceptance(), AliAnaGeneratorKine::IsLeadingAndIsolated(), AliCaloPID::IsTrackMatched(), AliAnalysisVertexingHF::Make3Prong(), AliAnalysisVertexingHF::Make4Prong(), AliAnalysisTaskSELc2pK0sfromAODtracks::MakeCascadeHF(), AliAnalysisTaskSEOmegac2eleOmegafromAODtracks::MakeCascadeHF(), AliAnalysisTaskSELc2eleLambdafromAODtracks::MakeCascadeHF(), AliAnalysisTaskSEXic2eleXifromAODtracks::MakeCascadeHF(), AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks::MakeCascadeHF3Prong(), AliAnaParticleHadronCorrelation::MakeMCChargedCorrelation(), AliAnalysisTaskMuonQA::SelectCharge(), SetCentPtCh(), HighPtTracks::AliReducedReconstructedTrack::SetCharge(), and AliAnalysisTaskSEDvsMultiplicity::UserExec().

const Char_t* effErrMode = "b(1,1)mode"

Definition at line 48 of file MuonTrackingEfficiency.C.

Referenced by GetChamberEfficiency(), and GetDEEfficiency().

Bool_t moreTrackCandidates = kFALSE

Definition at line 56 of file MuonTrackingEfficiency.C.

Referenced by ComputeTrackingEfficiency().