Update TPC pid 2011
authorrbailhac <Raphaelle.Bailhache@cern.ch>
Tue, 15 Jul 2014 15:29:21 +0000 (17:29 +0200)
committerrbailhac <Raphaelle.Bailhache@cern.ch>
Tue, 15 Jul 2014 15:29:21 +0000 (17:29 +0200)
PWGHF/hfe/AliHFEpidQAmanager.h
PWGHF/hfe/AliHFEtpcPIDqa.cxx
PWGHF/hfe/macros/AddTaskHFEFlowTPCTOFEPSP.C
PWGHF/hfe/macros/configs/PbPb/CentCorrMapsTPC.root [new file with mode: 0644]
PWGHF/hfe/macros/configs/PbPb/ConfigHFE_FLOW_TOFTPC.C
PWGHF/hfe/macros/configs/PbPb/EtaCorrMapsTPC.root

index ba53e7c..c267e30 100644 (file)
@@ -53,11 +53,20 @@ class AliHFEpidQAmanager : public TObject{
     TList *MakeList(const Char_t *name);
     void SetHighResolutionHistos() { SetBit(kHighResolutionHistos, kTRUE); };
     Bool_t HasHighResolutionHistos() const { return TestBit(kHighResolutionHistos); }
+    void SetMidResolutionHistos() { SetBit(kMidResolutionHistos, kTRUE); };
+    Bool_t HasMidResolutionHistos() const { return TestBit(kMidResolutionHistos); }
+    void SetHighResolutionEtaHistos() { SetBit(kHighResolutionEtaHistos, kTRUE); };
+    Bool_t HasHighResolutionEtaHistos() const { return TestBit(kHighResolutionEtaHistos); }
+    void SetFillMultiplicity() { SetBit(kFillMultiplicity, kTRUE); };
+    Bool_t HasFillMultiplicity() const { return TestBit(kFillMultiplicity); }
 
   protected:
     enum{
       kIsOwner = BIT(14),
-      kHighResolutionHistos = BIT(15)
+      kHighResolutionHistos = BIT(15),
+      kMidResolutionHistos = BIT(16),
+      kHighResolutionEtaHistos = BIT(17),
+      kFillMultiplicity = BIT(18)
     };
     Bool_t IsOwner() const { return TestBit(kIsOwner); }
     void SetOwner() { SetBit(kIsOwner, kTRUE); }
@@ -68,6 +77,6 @@ class AliHFEpidQAmanager : public TObject{
     AliHFEdetPIDqa *fDetPIDqa[AliHFEpid::kNdetectorPID]; //! Detector PID QA objects
     AliHFEpidBase *fDetPID[AliHFEpid::kNdetectorPID];    //  Detector PID objects
 
-  ClassDef(AliHFEpidQAmanager, 0)
+  ClassDef(AliHFEpidQAmanager, 1)
 };
 #endif
index ac6dff7..aa97342 100644 (file)
@@ -32,6 +32,7 @@
 #include <THnSparse.h>
 #include <TString.h>
 
+#include "AliAODEvent.h"
 #include "AliAODTrack.h"
 #include "AliESDtrack.h"
 #include "AliLog.h"
@@ -181,11 +182,10 @@ void AliHFEtpcPIDqa::Initialize(){
   fHistos = new AliHFEcollection("tpcqahistos", "Collection of TPC QA histograms");
 
   // Make common binning
-  const Int_t kNdim = 6;
+  const Int_t kNdim = 7;
   const Int_t kPIDbins = AliPID::kSPECIES + 1;
   const Int_t kSteps = 2;
   const Int_t kCentralityBins = 11;
-  const Int_t kEtabins=18;
   const Double_t kMinPID = -1;
   const Double_t kMinP = 0.;
   const Double_t kMaxPID = (Double_t)AliPID::kSPECIES;
@@ -197,17 +197,20 @@ void AliHFEtpcPIDqa::Initialize(){
   Int_t kPbins = fQAmanager->HasHighResolutionHistos() ? 1000 : 100;
   Int_t kDedxbins = fQAmanager->HasHighResolutionHistos() ? 400 : 200;
   Int_t kSigmaBins = fQAmanager->HasHighResolutionHistos() ? 1400 : 240;
+  kSigmaBins = fQAmanager->HasMidResolutionHistos() ? 400 : kSigmaBins;
+  Int_t kEtabins = fQAmanager->HasHighResolutionEtaHistos() ? 27 : 18;
+
   // 1st histogram: TPC dEdx: (species, p, dEdx, step)
-  Int_t nBinsdEdx[kNdim] = {kPIDbins, kPbins, kDedxbins, kSteps, kCentralityBins, kEtabins};
-  Double_t mindEdx[kNdim] =  {kMinPID, kMinP, 0., 0., 0., kMinEta};
-  Double_t maxdEdx[kNdim] =  {kMaxPID, kMaxP, 200, 2., 11., kMaxEta};
-  fHistos->CreateTHnSparse("tpcDedx", "TPC signal; species; p [GeV/c]; TPC signal [a.u.]; Selection Step; Centrality; Eta", kNdim, nBinsdEdx, mindEdx, maxdEdx);
+  Int_t nBinsdEdx[kNdim] = {kPIDbins, kPbins, kDedxbins, kSteps, kCentralityBins, kEtabins, 50};
+  Double_t mindEdx[kNdim] =  {kMinPID, kMinP, 20., 0., 0., kMinEta, 0};
+  Double_t maxdEdx[kNdim] =  {kMaxPID, kMaxP, 160, 2., 11., kMaxEta, 2000};
+  fHistos->CreateTHnSparse("tpcDedx", "TPC signal; species; p [GeV/c]; TPC signal [a.u.]; Selection Step; Centrality; Eta; pVx contrib", kNdim, nBinsdEdx, mindEdx, maxdEdx);
+  
   // 2nd histogram: TPC sigmas: (species, p nsigma, step)
-  Int_t nBinsSigma[kNdim] = {kPIDbins, kPbins, kSigmaBins, kSteps, kCentralityBins, kEtabins};
-  Double_t minSigma[kNdim] = {kMinPID, kMinP, -12., 0., 0., kMinEta};
-  Double_t maxSigma[kNdim] = {kMaxPID, kMaxP, 12., 2., 11., kMaxEta};
-  fHistos->CreateTHnSparse("tpcnSigma", "TPC signal; species; p [GeV/c]; TPC signal [a.u.]; Selection Step; Centrality; Eta", kNdim, nBinsSigma, minSigma, maxSigma);
+  Int_t nBinsSigma[kNdim] = {kPIDbins, kPbins, kSigmaBins, kSteps, kCentralityBins, kEtabins, 50};
+  Double_t minSigma[kNdim] = {kMinPID, kMinP, -12., 0., 0., kMinEta, 0};
+  Double_t maxSigma[kNdim] = {kMaxPID, kMaxP, 12., 2., 11., kMaxEta, 2000};
+  fHistos->CreateTHnSparse("tpcnSigma", "TPC signal; species; p [GeV/c]; TPC signal [a.u.]; Selection Step; Centrality; Eta; pVx contrib", kNdim, nBinsSigma, minSigma, maxSigma);
 
   // General TPC QA
 }
@@ -232,6 +235,7 @@ void AliHFEtpcPIDqa::ProcessTrack(const AliHFEpidObject *track, AliHFEdetPIDqa::
   contentSignal[3] = step;
   contentSignal[4] = centrality;
   contentSignal[5] = GetEta(track->GetRecTrack(), anatype);
+  contentSignal[6] = fQAmanager->HasFillMultiplicity() ? track->GetMultiplicity() : 0;
   fHistos->Fill("tpcDedx", contentSignal);
 
   contentSignal[2] = pidResponse ? pidResponse->NumberOfSigmasTPC(track->GetRecTrack(), AliPID::kElectron) : -100.; 
index f7c2a1c..c889bc4 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTask *AddTaskHFEFlowTPCTOFEPSP(UInt_t trigger=131073,Int_t aodfilter=16,Bool_t scalarProduct=kFALSE,Bool_t cutPileup=kFALSE,Int_t tpcCls=110, Double_t tpcClsr=60, Int_t tpcClspid=80, Int_t itsCls=4, Int_t pixellayer=2, Double_t dcaxy=100,Double_t dcaz=200, Double_t tofsig=30., Double_t tpceff=50., Int_t vzero=1, Int_t debuglevel=2, Double_t etarange=80, Bool_t ptbinsmall=kFALSE, Double_t ITSclustersback=0, Double_t minTPCback=-2.0, Double_t maxTPCback=5.0){
+AliAnalysisTask *AddTaskHFEFlowTPCTOFEPSP(UInt_t trigger=131073,Int_t aodfilter=16,Bool_t scalarProduct=kFALSE,Bool_t cutPileup=kFALSE,Int_t tpcCls=110, Double_t tpcClsr=60, Int_t tpcClspid=80, Int_t itsCls=4, Int_t pixellayer=2, Double_t dcaxy=100,Double_t dcaz=200, Double_t tofsig=30., Double_t tpceff=50., Int_t vzero=1, Int_t debuglevel=2, Double_t etarange=80, Bool_t withetacorrection=kFALSE, Bool_t withmultcorrection=kFALSE, Double_t ITSclustersback=0, Double_t minTPCback=-2.0, Double_t maxTPCback=5.0){
 
   //
   // Define TPC cut for 2011 data
@@ -62,7 +62,7 @@ AliAnalysisTask *AddTaskHFEFlowTPCTOFEPSP(UInt_t trigger=131073,Int_t aodfilter=
   }
 
   // Name
-  TString appendixx(TString::Format("t%df%ds%dp%dTPC%dr%dp%dITS%dPi%dDCAr%dz%dTOF%dTPCe%dV%dD%der%dbin%di%dt%dt%d",(Int_t)trigger,aodfilter,(Int_t)scalarProduct,(Int_t)cutPileup,tpcCls,(Int_t)tpcClsr,tpcClspid,itsCls,(Int_t) pixellayer,(Int_t) dcaxy,(Int_t)dcaz,(Int_t) tofsig,(Int_t)tpceff,vzero,debuglevel,(Int_t)(etarange*0.1),(Int_t)ptbinsmall,(Int_t)ITSclustersback,(Int_t)(minTPCback*10.0),(Int_t)(maxTPCback*10.0)));
+  TString appendixx(TString::Format("t%df%ds%dp%dTPC%dr%dp%dITS%dPi%dDCAr%dz%dTOF%dTPCe%dV%dD%der%dbin%di%dt%dt%d",(Int_t)trigger,aodfilter,(Int_t)scalarProduct,(Int_t)cutPileup,tpcCls,(Int_t)tpcClsr,tpcClspid,itsCls,(Int_t) pixellayer,(Int_t) dcaxy,(Int_t)dcaz,(Int_t) tofsig,(Int_t)tpceff,vzero,debuglevel,(Int_t)(etarange*0.1),(Int_t)withetacorrection,(Int_t)withmultcorrection,(Int_t)ITSclustersback,(Int_t)(minTPCback*10.0),(Int_t)(maxTPCback*10.0)));
   //TString appendixx("tpctofv2");
   
 
@@ -75,8 +75,7 @@ AliAnalysisTask *AddTaskHFEFlowTPCTOFEPSP(UInt_t trigger=131073,Int_t aodfilter=
   
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
-  AliAnalysisTaskFlowTPCTOFEPSP *task = ConfigHFE_FLOW_TOFTPC(kFALSE,appendixx,trigger,aodfilter,scalarProduct,cutPileup,tpcCls, tpcClsr, tpcClspid, itsCls, pixellayer, dcaxy, dcaz,tofsig,&tpcdedx[0],vzero,debuglevel,etarange,kFALSE,ITSclustersback,minTPCback,maxTPCback);  
-
+  AliAnalysisTaskFlowTPCTOFEPSP *task = ConfigHFE_FLOW_TOFTPC(kFALSE,appendixx,trigger,aodfilter,scalarProduct,cutPileup,tpcCls, tpcClsr, tpcClspid, itsCls, pixellayer, dcaxy, dcaz,tofsig,&tpcdedx[0],vzero,debuglevel,etarange,withetacorrection,withmultcorrection,ITSclustersback,minTPCback,maxTPCback);  
   
   task->SetNbBinsCentralityQCumulant(4);
   //task->SetBinCentralityLess(0,0.0);
@@ -133,16 +132,6 @@ AliAnalysisTask *AddTaskHFEFlowTPCTOFEPSP(UInt_t trigger=131073,Int_t aodfilter=
     
   } 
 
-  if(ptbinsmall){
-   
-    Int_t nBinsPt = 33;
-    Double_t binLimPt[34] = {0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2,
-                            1.3, 1.4, 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3.,3.25, 3.5, 3.75, 4.,4.25,4.5,4.75,5.,5.25,5.5,5.75,6.};
-    task.SetPtBinning(nBinsPt, binLimPt);
-  
-  } 
-
-
   task->SetHFEVZEROEventPlane(0x0);
   //AliLog::SetClassDebugLevel("AliAnalysisTaskHFEFlow",3);
 
diff --git a/PWGHF/hfe/macros/configs/PbPb/CentCorrMapsTPC.root b/PWGHF/hfe/macros/configs/PbPb/CentCorrMapsTPC.root
new file mode 100644 (file)
index 0000000..778b025
Binary files /dev/null and b/PWGHF/hfe/macros/configs/PbPb/CentCorrMapsTPC.root differ
index 6520231..4458ffc 100644 (file)
@@ -1,6 +1,30 @@
+TF1* GetCentralityCorrection(TString listname="LHC11h"){
+  
+  TString etaMap="$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/CentCorrMapsTPC.root";
+  
+  if (gSystem->AccessPathName(gSystem->ExpandPathName(etaMap.Data()))){
+    Error("ConfigHFEpbpb","Eta map not found: %s",etaMap.Data());
+    return 0;
+  }
+  
+  TFile f(etaMap.Data());
+  if (!f.IsOpen()) return 0;
+  gROOT->cd();
+  TList *keys=f.GetListOfKeys();
+  
+  for (Int_t i=0; i<keys->GetEntries(); ++i){
+    TString kName=keys->At(i)->GetName();
+    TPRegexp reg(kName);
+    if (reg.MatchB(listname)){
+      printf("Using Eta Correction Function: %s\n",kName.Data());
+      return (TF1*)f.Get(kName.Data());
+    }
+  }
+  return 0;
+}
 TF1* GetEtaCorrection(TString listname="LHC11h"){
   
-  TString etaMap="$ALICE_ROOT/PWGDQ/dielectron/files/EtaCorrMaps.root";
+  TString etaMap="$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/EtaCorrMapsTPC.root";
   
   if (gSystem->AccessPathName(gSystem->ExpandPathName(etaMap.Data()))){
     Error("ConfigHFEpbpb","Eta map not found: %s",etaMap.Data());
@@ -89,8 +113,7 @@ Double_t Contamination_40_50(const Double_t *x, const Double_t *par)
 
   
 }
-
-AliAnalysisTaskFlowTPCTOFEPSP* ConfigHFE_FLOW_TOFTPC(Bool_t useMC, TString appendix,UInt_t trigger,Int_t aodfilter=-1,Bool_t scalarProduct=kFALSE,Bool_t cutPileup=kTRUE,Int_t tpcCls=110, Double_t tpcClsr=60.,Int_t tpcClspid=80, Int_t itsCls=4, Int_t pixellayer=2, Double_t dcaxy=100., Double_t dcaz=200.,  Double_t tofsig=30., Double_t *tpcdedx=NULL, Int_t vzero=1, Int_t debuglevel=0, Double_t etarange=80, Bool_t withetacorrection=kFALSE, Double_t ITSclustersback=0,Double_t minTPCback=-2.0,Double_t maxTPCback=5.0)
+AliAnalysisTaskFlowTPCTOFEPSP* ConfigHFE_FLOW_TOFTPC(Bool_t useMC, TString appendix,UInt_t trigger,Int_t aodfilter=-1,Bool_t scalarProduct=kFALSE,Bool_t cutPileup=kTRUE,Int_t tpcCls=110, Double_t tpcClsr=60.,Int_t tpcClspid=80, Int_t itsCls=4, Int_t pixellayer=2, Double_t dcaxy=100., Double_t dcaz=200.,  Double_t tofsig=30., Double_t *tpcdedx=NULL, Int_t vzero=1, Int_t debuglevel=0, Double_t etarange=80, Bool_t withetacorrection=kFALSE, Bool_t withmultcorrection=kFALSE, Double_t ITSclustersback=0,Double_t minTPCback=-2.0,Double_t maxTPCback=5.0)
 {
   //
   // HFE flow task 
@@ -122,6 +145,7 @@ AliAnalysisTaskFlowTPCTOFEPSP* ConfigHFE_FLOW_TOFTPC(Bool_t useMC, TString appen
   printf("Debug level %d\n",debuglevel);
   printf("Etarange %f\n",etarange*0.01);
   printf("TPC dE/dx Eta correction %d\n",withetacorrection);
+  printf("TPC dE/dx multiplicity correction %d\n",withmultcorrection);
   printf("Number of ITS back clusters %d\n",(Int_t)ITSclustersback);
   printf("Min TPC back %f\n",minTPCback);
   printf("Max TPC back %f\n",maxTPCback);
@@ -170,7 +194,9 @@ AliAnalysisTaskFlowTPCTOFEPSP* ConfigHFE_FLOW_TOFTPC(Bool_t useMC, TString appen
   AliAnalysisTaskFlowTPCTOFEPSP *task = new AliAnalysisTaskFlowTPCTOFEPSP(Form("HFE_%s", appendix.Data()));
   task->SelectCollisionCandidates(trigger); 
   task->SetDebugLevel(1);
-  task->GetPIDQAManager()->SetHighResolutionHistos();
+  task->GetPIDQAManager()->SetHighResolutionEtaHistos();
+  task->GetPIDQAManager()->SetMidResolutionHistos();
+  task->GetPIDQAManager()->SetFillMultiplicity();
   task->SetHFECuts(hfecuts);
   task->SetHFEBackgroundCuts(hfeBackgroundCuts);
   if(aodfilter > 0) {
@@ -206,9 +232,21 @@ AliAnalysisTaskFlowTPCTOFEPSP* ConfigHFE_FLOW_TOFTPC(Bool_t useMC, TString appen
   if(useMC) pid->SetHasMCData(kTRUE);
   pid->AddDetector("TOF", 0);
   pid->AddDetector("TPC", 1);
-
-  if(withetacorrection) {
-    // Apply eta correction
+  
+  if(withetacorrection || withmultcorrection) {
+    AliHFEpidTPC *tpcpid = pid->GetDetPID(AliHFEpid::kTPCpid);
+    TF1 *etaCorr = GetEtaCorrection();
+    if(etaCorr && withetacorrection){
+      tpcpid->SetEtaCorrection(etaCorr);
+      printf("TPC dE/dx Eta correction %p\n",etaCorr);
+    }
+    TF1 *centCorr = GetCentralityCorrection();
+    if(centCorr && withmultcorrection){
+      tpcpid->SetCentralityCorrection(centCorr);
+      printf("TPC dE/dx multiplicity correction %p\n",centCorr);
+    }
+  }
     AliHFEpidTPC *tpcpid = pid->GetDetPID(AliHFEpid::kTPCpid);
     TF1 *etacorrection = GetEtaCorrection();
     if(etacorrection) tpcpid->SetEtaCorrection(etacorrection);
index 1c81655..050d6ce 100755 (executable)
Binary files a/PWGHF/hfe/macros/configs/PbPb/EtaCorrMapsTPC.root and b/PWGHF/hfe/macros/configs/PbPb/EtaCorrMapsTPC.root differ