AliPhysics  251aa1e (251aa1e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CorrectSpectraMultiMCBG.C File Reference
#include "TList.h"
#include "TFile.h"
#include "TStyle.h"
#include "TH1F.h"
#include "TH2F.h"
#include "THnSparse.h"
#include "TLegend.h"
#include "TSystem.h"
#include "TMath.h"
#include "TCanvas.h"
#include "TLatex.h"
#include "TF1.h"
#include "TLine.h"
#include "TArrayD.h"
#include "TGraphErrors.h"
#include "SaveCanvas.h"
#include <TROOT.h>
Include dependency graph for CorrectSpectraMultiMCBG.C:

Go to the source code of this file.

Classes

struct  _MyGuard
 

Macros

#define MyPrint(L, F,...)   _MyPrint(L,F, ## __VA_ARGS__)
 
#define MyGuard(L, F,...)   _MyGuard _guard(L,F, ## __VA_ARGS__)
 

Enumerations

enum  { kNormShapeDist, kNormShapeDPhi, kNormShapes }
 
enum  { kSclWghMean, kSclIntegral, kSclTypes }
 
enum  { kBitNormPerEvent =1<<14 }
 
enum  {
  kDummyBin, kEvTot0, kEvTot, kOneUnit,
  kNWorkers, kCentVar, kDPhi, kDTht,
  kNStd, kPhiShift, kThtS2, kThtCW,
  kPhiOvl, kZEtaOvl, kNoOvl, kPhiRot,
  kInjScl, kEtaMin, kEtaMax, kZVMin,
  kZVMax, kDPiSCut, kNStdCut, kMCV0Scale,
  kBinEntries = 50, kEvInMltBin = 0, kEvProcData, kEvProcInj,
  kEvProcRot, kEvProcMix, kEntriesPerBin = 10
}
 
enum  {
  kSigCorr, kMCPrim, kRawDtCut, kSignalEst,
  kSignalEstMC, kBgEst, k1MBeta, k1MBetaMC,
  k1MBetaMCscl, kAlpha, kAlphaMC, kBgMC,
  kBgRescFc, kDataDist, kBgDist, kBgMCDist,
  kZvDist, kZvMCDistNS, kZvDistCorr, kZvEff,
  kMCShift =20, kNHistos =kMCShift+kMCShift
}
 

Functions

void _MyPrint (UShort_t lvl, const char *fmt,...)
 
void Incr ()
 
void Decr ()
 
void PrintAndPause (TCanvas *c, const TString &what, Bool_t wait)
 
void CorrectSpectraMultiMCBG (const char *flNameData, const char *flNameMC, const char *unique="", int maxBins=10, Bool_t waitForUser=false, const char *bgType="Comb")
 
Bool_t PrepareHistos (int bin, TList *lst, TList *lisMC, Bool_t isMC)
 
void ProcessHistos (int bin)
 
TH1NormalizeBg (TH1 *dataH, TH1 *bgH, double &scl, double &scle)
 
TObjectFindObject (int bin, const char *nameH, const TList *lst, Bool_t normPerEvent=kTRUE)
 
TListLoadList (const char *flName, const char *addPref, const char *nameL="clist")
 
void GetRatE (double x, double xe, double y, double ye, double &rat, double &rate)
 
Int_t CheckStat (const TList *lst, const char *dtType)
 
void Integrate (TH1 *hist, double xmn, double xmx, double &val, double &err)
 
void CropHisto (TH1 *histo, int b00, int b01, int b10=-1, int b11=-1)
 
void CropHisto (TH1 *histo, double b00, double b01, double b10=-1, double b11=-1)
 
void GetRealMinMax (TH1 *h, double &vmn, double &vmx)
 
const char * HName (const char *prefix, const char *htype)
 
TH1ProjNorm (TH2 *hEtaZ, TH1 *hZv, const char *name="_px", Int_t firstbin=0, Int_t lastbin=-1)
 
TH1ProjectWghMean (TH2 *hEtaZ, const char *name="_px", Int_t firstbin=0, Int_t lastbin=-1, double rejOutliers=6.)
 
void CorrectForZV (TH2 *hEtaZ, TH1 *hZv)
 
void KillBadBins (TH2 *histo, double mn=-1e50, double mx=1e50)
 
void PlotResults (Bool_t waitForUser)
 
void PlotDNDEta (int bin)
 
void PlotAlphaBeta (int bin)
 
void PlotSpecies ()
 
void PrintH (TH2 *h, Int_t prec=2)
 
void PrintH (TH1 *h, Int_t prec=2)
 
TH1CopyAdd (TH1 *h, const char *name, const char *title, TObjArray *col, Int_t location, Int_t shift)
 

Variables

const char kHStatName [] ="hStat"
 
double kEps = 1e-6
 
double kdPhiBgTailMin = 0.1
 
double kdPhiBgTailMax = 0.3
 
double kWDistBgTailMin = 5.
 
double kWDistBgTailMax = 25.
 
double kdPhiSgCut =-1
 
double kWDistSgCut =-1
 
const char * figDir = "corrFig"
 
const char * resDir = "corrRes"
 
Bool_t use1mBeta = true
 
TString useBgType = "Comb"
 
Int_t useShapeType = kNormShapeDist
 
Int_t useMCLB = 2
 
Double_t scaleBG = 1.3
 
Int_t useScaleType = kSclIntegral
 
Bool_t useZbinWAv = kFALSE
 
Bool_t normToMB = kTRUE
 
const double kEtaFitRange = 0.5
 
Double_t minAlpha = 0.
 
Double_t maxAlpha = 2.5
 
UShort_t fgDebug = 1
 
Int_t nCentBins = -1
 
TListlistDt =0
 
TListlistMC =0
 
TObjArray resArr
 
TObjArray resDnDeta
 
char outStr [1000]
 
char outTitle [1000]
 
TString uniqueName =""
 
TArrayD dNdEta
 
TArrayD dNdEtaErr
 
TCanvas * canvFin =0
 
Bool_t creatDnDEtaCMacro = kTRUE
 
Bool_t creatAlphaBetaCMacro = kTRUE
 
Bool_t creatSpeciesCMacro = kTRUE
 

Macro Definition Documentation

Enumeration Type Documentation

anonymous enum
Enumerator
kNormShapeDist 
kNormShapeDPhi 
kNormShapes 

Definition at line 38 of file CorrectSpectraMultiMCBG.C.

anonymous enum
Enumerator
kSclWghMean 
kSclIntegral 
kSclTypes 

Definition at line 42 of file CorrectSpectraMultiMCBG.C.

anonymous enum
Enumerator
kBitNormPerEvent 

Definition at line 64 of file CorrectSpectraMultiMCBG.C.

anonymous enum
Enumerator
kDummyBin 
kEvTot0 
kEvTot 
kOneUnit 
kNWorkers 
kCentVar 
kDPhi 
kDTht 
kNStd 
kPhiShift 
kThtS2 
kThtCW 
kPhiOvl 
kZEtaOvl 
kNoOvl 
kPhiRot 
kInjScl 
kEtaMin 
kEtaMax 
kZVMin 
kZVMax 
kDPiSCut 
kNStdCut 
kMCV0Scale 
kBinEntries 
kEvInMltBin 
kEvProcData 
kEvProcInj 
kEvProcRot 
kEvProcMix 
kEntriesPerBin 

Definition at line 66 of file CorrectSpectraMultiMCBG.C.

anonymous enum
Enumerator
kSigCorr 
kMCPrim 
kRawDtCut 
kSignalEst 
kSignalEstMC 
kBgEst 
k1MBeta 
k1MBetaMC 
k1MBetaMCscl 
kAlpha 
kAlphaMC 
kBgMC 
kBgRescFc 
kDataDist 
kBgDist 
kBgMCDist 
kZvDist 
kZvMCDistNS 
kZvDistCorr 
kZvEff 
kMCShift 
kNHistos 

Definition at line 106 of file CorrectSpectraMultiMCBG.C.

Function Documentation

void _MyPrint ( UShort_t  lvl,
const char *  fmt,
  ... 
)

Definition at line 112 of file CorrectSpectraMultiMCBG.C.

Int_t CheckStat ( const TList lst,
const char *  dtType 
)

Definition at line 1765 of file CorrectSpectraMultiMCBG.C.

TH1* CopyAdd ( TH1 h,
const char *  name,
const char *  title,
TObjArray col,
Int_t  location,
Int_t  shift 
)

Definition at line 291 of file CorrectSpectraMultiMCBG.C.

Referenced by PrepareHistos().

void CorrectForZV ( TH2 hEtaZ,
TH1 hZv 
)

Definition at line 1810 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), and ProcessHistos().

void CorrectSpectraMultiMCBG ( const char *  flNameData,
const char *  flNameMC,
const char *  unique = "",
int  maxBins = 10,
Bool_t  waitForUser = false,
const char *  bgType = "Comb" 
)

Definition at line 198 of file CorrectSpectraMultiMCBG.C.

Referenced by Final().

void CropHisto ( TH1 histo,
int  b00,
int  b01,
int  b10 = -1,
int  b11 = -1 
)

Definition at line 1463 of file CorrectSpectraMultiMCBG.C.

Referenced by CropHisto().

void CropHisto ( TH1 histo,
double  b00,
double  b01,
double  b10 = -1,
double  b11 = -1 
)

Definition at line 1510 of file CorrectSpectraMultiMCBG.C.

void Decr ( )

Definition at line 125 of file CorrectSpectraMultiMCBG.C.

Referenced by _MyGuard::~_MyGuard().

TObject * FindObject ( int  bin,
const char *  nameH,
const TList lst,
Bool_t  normPerEvent = kTRUE 
)

Definition at line 1615 of file CorrectSpectraMultiMCBG.C.

Referenced by AliAnalysisTaskFlowStrangee::AcceptAAEvent(), AliAnalysisTaskFlowStrange::AddCandidates(), AliAnalysisTaskFlowStrangee::AddCandidates(), AliAnalysisTaskFlowStrange::ChargeParticles(), AliAnalysisTaskFlowStrangee::ChargeParticles(), CheckStat(), CompilationEvSelection(), CompilationTrackSelection(), AliAnalysisTaskFlowStrange::ComputeChi2VZERO(), AliAnalysisTaskFlowStrangee::ComputeChi2VZERO(), AliAnalysisTaskFlowStrange::ComputeDecayVn(), AliAnalysisTaskFlowStrangee::ComputeDecayVn(), AliAnalysisTaskFlowStrange::ComputeTrackVn(), AliAnalysisTaskFlowStrangee::ComputeTrackVn(), AliAnaCaloTrackCorrBaseClass::ConnectInputOutputAODBranches(), CorrectSpectraMultiMCBG(), AliAnalysisTaskFlowStrange::Exec(), AliAnalysisTaskFlowStrangee::Exec(), AliAnalysisTaskFlowStrange::FillMakeQSpy(), AliAnalysisTaskFlowStrangee::FillMakeQSpy(), AliAnalysisTaskFlowStrange::FillVZEQA(), AliAnalysisTaskFlowStrangee::FillVZEQA(), AliAnaCaloTrackCorrBaseClass::GetAODBranch(), GetFileAndList(), GetObject(), AliEmcalList::IsLastMergeLevel(), LoadD0toKpiHistos(), LoadDplusHistos(), LoadDsHistos(), LoadDstarD0piHistos(), AliAnalysisTaskFlowStrange::MakeQTPC(), AliAnalysisTaskFlowStrangee::MakeQTPC(), AliAnalysisTaskFlowStrange::MakeQVZE(), AliAnalysisTaskFlowStrangee::MakeQVZE(), AliAnalysisTaskFlowStrange::MakeToyEvent(), AliAnalysisTaskFlowStrangee::MakeToyEvent(), AliEmcalList::Merge(), AliAnalysisHelperJetTasks::MergeOutput(), AliAnalysisTaskFlowStrange::MyUserExec(), AliAnalysisTaskFlowStrangee::MyUserExec(), AliAnalysisTaskFlowStrange::PassesRFPTPCCuts(), AliAnalysisTaskFlowStrangee::PassesRFPTPCCuts(), PlotDNDEta(), PlotResults(), PlotSpecies(), PrepareHistos(), AliAnalysisTaskFlowCascade::ReadFromAODv0(), AliAnalysisTaskFlowStrange::ReadFromAODv0(), AliAnalysisTaskFlowStrangee::ReadFromAODv0(), AliAnalysisTaskFlowStrange::ReadFromESD(), AliAnalysisTaskFlowStrangee::ReadFromESD(), AliAnalysisTaskFlowCascade::ReadFromESDv0(), AliMTRChEffAnalysis::RecoverEfficiency(), AliAnalysisTaskFlowStrange::RunTerminateAgain(), AliAnalysisTaskFlowStrangee::RunTerminateAgain(), AliAnalysisTaskPIDconfig::SetPIDPurityFunctions(), AliFlowTrackCuts::SetTPCTOFNsigmaPIDPurityFunctions(), AliAnalysisTaskFlowStrange::UserExec(), AliAnalysisTaskFlowStrangee::UserExec(), and AliAnalysisTaskFlowCascade::UserExec().

void GetRatE ( double  x,
double  xe,
double  y,
double  ye,
double &  rat,
double &  rate 
)

Definition at line 1724 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), and PrepareHistos().

void GetRealMinMax ( TH1 h,
double &  vmn,
double &  vmx 
)

Definition at line 1780 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotAlphaBeta().

const char * HName ( const char *  prefix,
const char *  htype 
)

Definition at line 1756 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), and PrepareHistos().

void Incr ( )

Definition at line 124 of file CorrectSpectraMultiMCBG.C.

Referenced by _MyGuard::_MyGuard().

void Integrate ( TH1 hist,
double  xmn,
double  xmx,
double &  val,
double &  err 
)

Definition at line 1735 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), and PrepareHistos().

void KillBadBins ( TH2 histo,
double  mn = -1e50,
double  mx = 1e50 
)

Definition at line 2046 of file CorrectSpectraMultiMCBG.C.

Referenced by ProcessHistos().

TList * LoadList ( const char *  flName,
const char *  addPref,
const char *  nameL = "clist" 
)

Definition at line 1688 of file CorrectSpectraMultiMCBG.C.

Referenced by CorrectSpectraMultiMCBG().

TH1 * NormalizeBg ( TH1 dataH,
TH1 bgH,
double &  scl,
double &  scle 
)

Definition at line 1527 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), and PrepareHistos().

void PlotAlphaBeta ( int  bin)

if (p) p->SetX1NDC(0.85);

Definition at line 1241 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotResults().

void PlotDNDEta ( int  bin)

!!RS

Definition at line 853 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotResults().

void PlotResults ( Bool_t  waitForUser)

Definition at line 760 of file CorrectSpectraMultiMCBG.C.

Referenced by CorrectSpectraMultiMCBG().

void PlotSpecies ( )

Definition at line 1340 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotResults().

Bool_t PrepareHistos ( int  bin,
TList lst,
TList lisMC,
Bool_t  isMC 
)

Definition at line 305 of file CorrectSpectraMultiMCBG.C.

Referenced by CorrectSpectraMultiMCBG().

void PrintAndPause ( TCanvas *  c,
const TString what,
Bool_t  wait 
)

Definition at line 149 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotResults().

void PrintH ( TH2 h,
Int_t  prec = 2 
)

Definition at line 2065 of file CorrectSpectraMultiMCBG.C.

void PrintH ( TH1 h,
Int_t  prec = 2 
)

Definition at line 2079 of file CorrectSpectraMultiMCBG.C.

void ProcessHistos ( int  bin)

Definition at line 633 of file CorrectSpectraMultiMCBG.C.

Referenced by CorrectSpectraMultiMCBG().

TH1 * ProjectWghMean ( TH2 hEtaZ,
const char *  name = "_px",
Int_t  firstbin = 0,
Int_t  lastbin = -1,
double  rejOutliers = 6. 
)

Definition at line 1933 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), and ProcessHistos().

TH1 * ProjNorm ( TH2 hEtaZ,
TH1 hZv,
const char *  name = "_px",
Int_t  firstbin = 0,
Int_t  lastbin = -1 
)

Definition at line 1846 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), and ProcessHistos().

Variable Documentation

TCanvas* canvFin =0

Definition at line 192 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotAlphaBeta(), PlotDNDEta(), PlotResults(), and PlotSpecies().

Bool_t creatAlphaBetaCMacro = kTRUE

Definition at line 195 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotAlphaBeta().

Bool_t creatDnDEtaCMacro = kTRUE

Definition at line 194 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta().

Bool_t creatSpeciesCMacro = kTRUE

Definition at line 196 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotSpecies().

TArrayD dNdEta

Definition at line 191 of file CorrectSpectraMultiMCBG.C.

TArrayD dNdEtaErr

Definition at line 191 of file CorrectSpectraMultiMCBG.C.

UShort_t fgDebug = 1

Definition at line 111 of file CorrectSpectraMultiMCBG.C.

Referenced by _MyPrint(), and AliJetFlowTools::ResetAliUnfolding().

const char* figDir = "corrFig"

Definition at line 47 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotAlphaBeta(), PlotDNDEta(), PlotResults(), and PlotSpecies().

double kdPhiBgTailMax = 0.3

Definition at line 30 of file CorrectSpectraMultiMCBG.C.

Referenced by NormalizeBg(), PlotDNDEta(), PlotResults(), and PrepareHistos().

double kdPhiBgTailMin = 0.1
double kdPhiSgCut =-1
double kEps = 1e-6
const double kEtaFitRange = 0.5

Definition at line 59 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), and ProcessHistos().

const char kHStatName[] ="hStat"
double kWDistBgTailMax = 25.

Definition at line 33 of file CorrectSpectraMultiMCBG.C.

Referenced by NormalizeBg(), PlotDNDEta(), PlotResults(), and PrepareHistos().

double kWDistBgTailMin = 5.
double kWDistSgCut =-1
TList* listDt =0

Definition at line 185 of file CorrectSpectraMultiMCBG.C.

TList * listMC =0

Definition at line 185 of file CorrectSpectraMultiMCBG.C.

Referenced by CorrectSpectraMultiMCBG(), PlotDNDEta(), and PlotSpecies().

Double_t maxAlpha = 2.5

Definition at line 62 of file CorrectSpectraMultiMCBG.C.

Referenced by ProcessHistos().

Double_t minAlpha = 0.

Definition at line 61 of file CorrectSpectraMultiMCBG.C.

Referenced by ProcessHistos().

Bool_t normToMB = kTRUE

Definition at line 58 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), PrepareHistos(), and ProcessHistos().

char outStr[1000]
char outTitle[1000]

Definition at line 188 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotAlphaBeta(), PlotDNDEta(), and PlotResults().

TObjArray resArr

Definition at line 186 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotAlphaBeta(), PlotDNDEta(), PrepareHistos(), and ProcessHistos().

const char* resDir = "corrRes"

Definition at line 48 of file CorrectSpectraMultiMCBG.C.

Referenced by CorrectSpectraMultiMCBG(), and ExtractELoss().

TObjArray resDnDeta

Definition at line 186 of file CorrectSpectraMultiMCBG.C.

Double_t scaleBG = 1.3

Definition at line 54 of file CorrectSpectraMultiMCBG.C.

Referenced by PrepareHistos().

TString uniqueName =""

Definition at line 189 of file CorrectSpectraMultiMCBG.C.

Referenced by CorrectSpectraMultiMCBG(), PlotDNDEta(), and PlotResults().

Bool_t use1mBeta = true
TString useBgType = "Comb"

Definition at line 50 of file CorrectSpectraMultiMCBG.C.

Int_t useMCLB = 2

Definition at line 53 of file CorrectSpectraMultiMCBG.C.

Int_t useScaleType = kSclIntegral

Definition at line 55 of file CorrectSpectraMultiMCBG.C.

Referenced by NormalizeBg().

Bool_t useZbinWAv = kFALSE

Definition at line 56 of file CorrectSpectraMultiMCBG.C.

Referenced by PlotDNDEta(), and ProcessHistos().