Update
authorrbailhac <rbailhac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Jun 2012 18:57:58 +0000 (18:57 +0000)
committerrbailhac <rbailhac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Jun 2012 18:57:58 +0000 (18:57 +0000)
PWGHF/hfe/macros/AddTaskHFEtpctof.C
PWGHF/hfe/macros/configs/PbPb/ConfigHFEpbpb.C

index d5e91e6..4f61b27 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTask *AddTaskHFEtpctof(Bool_t beauty=kTRUE, Int_t tpcCls=110,  Int_t tpcClsPID = 70, Double_t tpcClsRatio = 0.6, Double_t tpcClShared = 0.1, Int_t itsCls=4, Double_t itsChi2PerClusters=36., Double_t dcaxy=1.0, Double_t dcaz=2.0, Double_t tofs=3., Double_t ipSig=3.0, Bool_t syst = kFALSE, Int_t itspixelcut=AliHFEextraCuts::kBoth, Float_t prodlow=0., Float_t prodhigh=100., Int_t addflag=0.){
+AliAnalysisTask *AddTaskHFEtpctof(Bool_t beauty=kTRUE, Int_t tpcCls=110,  Int_t tpcClsPID = 70, Double_t tpcClsRatio = 0.6, Double_t tpcClShared = 0.1, Int_t itsCls=4, Double_t itsChi2PerClusters=36., Double_t dcaxy=1.0, Double_t dcaz=2.0, Double_t tofs=3., Double_t ipSig=3.0, Bool_t syst = kFALSE, Int_t itspixelcut=AliHFEextraCuts::kBoth, Float_t prodlow=0., Float_t prodhigh=100., Int_t addflag=0.,Int_t etacor){
 
   // libraries in case
   gSystem->Load("libANALYSIS.so");
@@ -7,13 +7,13 @@ AliAnalysisTask *AddTaskHFEtpctof(Bool_t beauty=kTRUE, Int_t tpcCls=110,  Int_t
 
   //set config file name
   TString configFile("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFEpbpb.C");
-  //TString configFile("/d/alice12/bailhache/AliRootInstallations/18_05_2012/AliRoot/PWGHF/hfe/macros/configs/PbPb/ConfigHFEpbpb.C");
+  //TString configFile("/d/alice12/bailhache/AliRootInstallations/07_06_2012/AliRoot/PWGHF/hfe/macros/configs/PbPb/ConfigHFEpbpb.C");
   TString checkconfig="ConfigHFEpbpb";
   if (!gROOT->GetListOfGlobalFunctions()->FindObject(checkconfig.Data()))
     gROOT->LoadMacro(configFile.Data());
 
-  TString appendix(TString::Format("TPC%dpid%dClShared%dratio%dITS%dITSChi%dITScut%dDCAr%dz%dIP%dTOF%dProdlow%dProdhigh%daddflag%i",
-                                  tpcCls,tpcClsPID,(Int_t)(tpcClShared*100),(Int_t)(tpcClsRatio*100),itsCls,(Int_t)itsChi2PerClusters,itspixelcut,(Int_t)dcaxy,(Int_t)dcaz,(Int_t)ipSig,(Int_t)(tofs*10),(Int_t)prodlow,(Int_t)prodhigh,addflag));
+  TString appendix(TString::Format("TPC%dpid%dClShared%dratio%dITS%dITSChi%dITScut%dDCAr%dz%dIP%dTOF%dProdlow%dProdhigh%daddflag%ietacor%i",
+                                  tpcCls,tpcClsPID,(Int_t)(tpcClShared*100),(Int_t)(tpcClsRatio*100),itsCls,(Int_t)itsChi2PerClusters,itspixelcut,(Int_t)dcaxy,(Int_t)dcaz,(Int_t)ipSig,(Int_t)(tofs*10),(Int_t)prodlow,(Int_t)prodhigh,addflag,etacor));
   printf("appendix %s\n", appendix.Data());
   
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -27,7 +27,7 @@ AliAnalysisTask *AddTaskHFEtpctof(Bool_t beauty=kTRUE, Int_t tpcCls=110,  Int_t
   TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
 
   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
-  AliAnalysisTaskHFE *task = ConfigHFEpbpb(kFALSE,beauty,tpcCls,tpcClsPID,tpcClsRatio,tpcClShared,itsCls,itsChi2PerClusters,dcaxy,dcaz,tofs,ipSig,itspixelcut,appendix,prodlow,prodhigh,addflag);  
+  AliAnalysisTaskHFE *task = ConfigHFEpbpb(kFALSE,beauty,tpcCls,tpcClsPID,tpcClsRatio,tpcClShared,itsCls,itsChi2PerClusters,dcaxy,dcaz,tofs,ipSig,itspixelcut,appendix,prodlow,prodhigh,addflag,0,etacor);  
 
   if (inputDataType == "AOD"){
     task->SetFillNoCuts(kTRUE);
index 063a078..0235549 100644 (file)
@@ -1,10 +1,37 @@
+TF1* GetEtaCorrection(){
+  TString list=gSystem->Getenv("LIST");
+
+  TString etaMap="$TRAIN_ROOT/PWGDQ/dielectron/files/EtaCorrMaps.root";
+  
+  if (gSystem->AccessPathName(gSystem->ExpandPathName(etaMap.Data()))){
+    Error("ConfigPbPb2010_Cent","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(list)){
+      printf("Using Eta Correction Function: %s\n",kName.Data());
+      return (TF1*)f.Get(kName.Data());
+    }
+  }
+  return 0;
+}
+
+
 AliAnalysisTaskHFE* ConfigHFEpbpb(Bool_t useMC=kFALSE, Bool_t beauty=kFALSE,
                                  UChar_t TPCcl=70, UChar_t TPCclPID = 80, 
                                  Double_t TPCclRatio = 0.6, Double_t TPCclshared = 1.1,
                                  UChar_t ITScl=3,  Double_t ITSchi2perclusters=99999999.,
                                   Double_t dcaxy=1.0, Double_t dcaz=2.0,
                                  Double_t TOFs=3.,Double_t IpSig=3., Int_t itspixelcut=AliHFEextraCuts::kFirst, TString appendix,
-                                 Float_t prodlow=0., Float_t prodhigh=100., Int_t addflag=0., Int_t ptbin=0,
+                                 Float_t prodlow=0., Float_t prodhigh=100., Int_t addflag=0., Int_t ptbin=0, Int_t etacor=0,
                                  Int_t nondefaultcentr=0, Float_t* arraycentr=NULL,
                                  Double_t* tpcdEdxcut=NULL,Double_t tpcu=3.0){
   //
@@ -120,6 +147,12 @@ AliAnalysisTaskHFE* ConfigHFEpbpb(Bool_t useMC=kFALSE, Bool_t beauty=kFALSE,
     // 30-40% 0.44
     Double_t paramsTPCdEdxcut[12] ={0.0, 0.0, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
     if((nondefaultcentr!=0) && tpcdEdxcut) memcpy(paramsTPCdEdxcut,tpcdEdxcut,sizeof(paramsTPCdEdxcut));
+
+    if(etacor==1&&nondefaultcentr==0)
+      {
+        Double_t tpcdEdxcutetacor[12]={-0.08, 0.016, 0.12,0.22,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3};
+       memcpy(paramsTPCdEdxcut,tpcdEdxcutetacor,sizeof(paramsTPCdEdxcut));
+      }
     
     char *cutmodel;
     cutmodel="pol0";
@@ -132,6 +165,15 @@ AliAnalysisTaskHFE* ConfigHFEpbpb(Bool_t useMC=kFALSE, Bool_t beauty=kFALSE,
        pid->ConfigureTPCcentralityCut(a,cutmodel,tpcparam,tpcu);
     }
 
+    if(etacor==1)
+      { 
+       // Apply eta correction
+       AliHFEpidTPC *tpcpid = pid->GetDetPID(AliHFEpid::kTPCpid);
+       TF1 *etacorrection = GetEtaCorrection();
+       if(etacorrection) tpcpid->SetEtaCorrection(etacorrection);
+       
+      }
+
   }
   pid->ConfigureTOF(TOFs);