AliPhysics  e6c8d43 (e6c8d43)
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)
 
TGraphAsymmErrorsCreateGraph (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 objNameExtension="", TString fileNameData="AnalysisResults.root", TString fileNameSave="efficiency_new.root")
 

Variables

const Char_teffErrMode = "b(1,1)mode"
 
Double_t centMin = -999.
 
Double_t centMax = 999.
 
Double_t ptMin = 0.
 
Double_t ptMax = -1.
 
Double_t yMin = -99.
 
Double_t yMax = 99.
 
Double_t phiMin = -99.
 
Double_t phiMax = 99.
 
Int_t charge = 0
 
Bool_t moreTrackCandidates = kFALSE
 
THashList * runWeights = 0x0
 
TString gObjNameExtension = ""
 

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 1487 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 1411 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 1578 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 1296 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 1361 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 1524 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 1433 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 1630 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 1743 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 1815 of file MuonTrackingEfficiency.C.

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

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

main function to compute, print and plot efficiencies

Definition at line 102 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 804 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 1191 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 247 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 544 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 900 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 1042 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 669 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 141 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 390 of file MuonTrackingEfficiency.C.

Referenced by MuonTrackingEfficiency().

void SetCentPtCh ( THnSparse &  SparseData)

Sets the centrality, pT and y range and the charge for integration If ptMax < 0, it sets ptMax as the maximum pT value on the THnSparse If yMin < -4, it sets yMin as the minimum y value on the THnSparse If yMax > -2.5, it sets yMax as the maximum y value on the THnSparse If phiMin < 0, it sets phiMin as the minimum phi value on the THnSparse If phiMax > 2π, it sets phiMax as the maximum phi value on the THnSparse

Definition at line 1867 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 1995 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 2013 of file MuonTrackingEfficiency.C.

Variable Documentation

Int_t charge = 0

Definition at line 58 of file MuonTrackingEfficiency.C.

Referenced by AliAnalysisTaskVnV0::Analyze(), AliCaloPhotonCuts::ClassifyClusterForTMEffi(), AliAnaCalorimeterQA::ClusterMatchedWithTrackHistograms(), AliAnaCalorimeterQA::ClusterMCHistograms(), AliAnalysisTaskSECharmFraction::ConstructFakeTrueSecVtx(), AliAnalysisTaskMultiparticleFemtoscopy::FillControlHistogramsIdentifiedParticles(), AliCaloTrackMCReader::FillInputEvent(), AliTrackletdNdetaMCTask::FillPrimaries(), AliCFVertexingHFLctoV0bachelor::FillVectorFromMCarray(), AliV0ReaderV1::GetExternalTrackParam(), AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(), AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(), AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(), AliVertexingHFUtils::GetGeneratedSpherocity(), AliCFVertexingHF3Prong::GetGeneratedValuesFromMCParticle(), AliCFVertexingHF2Prong::GetGeneratedValuesFromMCParticle(), AliCFVertexingHFCascade::GetGeneratedValuesFromMCParticle(), AliV0ReaderV1::GetHelixCenter(), AliAnaInsideClusterInvariantMass::GetMCPrimaryKine(), AliAnalysisTaskFilteredTree::GetMCTrueTrackMult(), AliAnalysisTaskEmcalHfeTagging::GetNumberOfPairs(), AliFlowAnalysisWithNestedLoops::GetPointersForRAD(), AliCFVertexingHF3Prong::GetRecoValuesFromCandidate(), AliAnalysisTaskSED0MassCutVarFDSub::GetTrueImpactParameter(), AliAnalysisTaskSED0MassNonPromptFraction::GetTrueImpactParameter(), AliAnalysisTaskSED0Mass::GetTrueImpactParameter(), AliAnalysisTaskSEDplus::GetTrueImpactParameter(), AliAnalysisTaskSEDStarSpectra::GetTrueImpactParameterD0(), AliVertexingHFUtils::GetTrueImpactParameterDplus(), AliAnalysisTaskSEDs::GetTrueImpactParameterDstoPhiPi(), AliVertexingHFUtils::GetTrueImpactParameterDzero(), AliAnaGeneratorKine::GetXE(), AliPhiMesonHelperTrack::InitializeHelperTrack(), AliFlowTrackSimple::IsDead(), AliHFsubtractBFDcuts::IsInAcceptance(), AliAnaGeneratorKine::IsLeadingAndIsolated(), AliCaloPID::IsTrackMatched(), AliAnalysisTaskSELc2eleLambdafromAODtracks::LocalInit(), AliAnalysisTaskSEXic2eleXifromAODtracks::LocalInit(), AliAnalysisVertexingHF::Make3Prong(), AliAnalysisVertexingHF::Make4Prong(), AliAnalysisTaskSEOmegac2eleOmegafromAODtracks::MakeCascadeHF(), AliAnalysisTaskSELc2pK0sfromAODtracks::MakeCascadeHF(), AliAnalysisTaskSELc2eleLambdafromAODtracks::MakeCascadeHF(), AliAnalysisTaskSEXic2eleXifromAODtracks::MakeCascadeHF(), AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks::MakeCascadeHF3Prong(), AliDisplacedVertexSelectionAD::MeanTime(), AliFlowTrackSimpleCuts::PassesCuts(), AliFlowTrackCuts::PassesCuts(), AliStarTrack::Print(), AliAnalysisTaskFilteredTree::ProcessMCEff(), AliV0ReaderV1::rend(), AliJetEmbeddingTask::Run(), AliAnalysisTaskEmcalJetHadEPpid::Run(), AliAnalysisTaskMuonQA::SelectCharge(), AliAnalysisTaskVnV0::SelectK0s(), AliAnalysisTaskEmcalJetHF::SelectPhotonicElectron(), AliAnalysisTaskCombinHF::SetBayesThres(), SetCentPtCh(), HighPtTracks::AliReducedReconstructedTrack::SetCharge(), AliAnalysisTaskFlowStrange::SetDauITSrefit(), AliAnalysisTaskFlowStrangee::SetMaxChi2perITSCluster(), AliJetModelBaseTask::SetNTracks(), AliAnalysisTaskPIDV0base::SetStoreMotherIndex(), AliFlowEventSimple::TagSubeventsByCharge(), AliAnalysisTaskQASym::UserCreateOutputObjects(), AliAnalysisTaskQAflow::UserExec(), AliAnalysisTaskStudentsCM::UserExec(), AliAnalysisTaskForStudents::UserExec(), AliAnalysisTaskStudentsML::UserExec(), AliAnalysisTaskSEDvsEventShapes::UserExec(), and AliAnalysisTaskSEDvsMultiplicity::UserExec().

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

Definition at line 48 of file MuonTrackingEfficiency.C.

Referenced by GetChamberEfficiency(), and GetDEEfficiency().

TString gObjNameExtension = ""

Definition at line 63 of file MuonTrackingEfficiency.C.

Bool_t moreTrackCandidates = kFALSE

Definition at line 60 of file MuonTrackingEfficiency.C.

Referenced by ComputeTrackingEfficiency().