Modified macros for lego_train and K* systematic checks
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Dec 2012 13:58:27 +0000 (13:58 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Dec 2012 13:58:27 +0000 (13:58 +0000)
PWGLF/RESONANCES/macros/lego_train/AddAMRsn.C
PWGLF/RESONANCES/macros/lego_train/AddRsnDaughterCutsKStarNsigma.C
PWGLF/RESONANCES/macros/lego_train/AddRsnPairsKStar.C
PWGLF/RESONANCES/macros/lego_train/AddRsnPairsPhi.C
PWGLF/RESONANCES/macros/lego_train/AddRsnTask.C
PWGLF/RESONANCES/macros/lego_train/AddRsnTaskTrain.C
PWGLF/RESONANCES/macros/lego_train/RsnPrivateTrainBaseSettings.C
PWGLF/RESONANCES/macros/lego_train/RsnQualityCut.C
PWGLF/RESONANCES/macros/lego_train/RsnTrainCommonSettings.C
PWGLF/RESONANCES/macros/lego_train/RunALICE.C

index f07ccb1..a5cbf45 100644 (file)
@@ -10,7 +10,7 @@ Bool_t AddAMRsnTrain(TString analysisSource = "proof", TString analysisMode = "t
    TString legoTrainPath = "$ALICE_ROOT/PWGLF/RESONANCES/macros/lego_train";
 //   legoTrainPath = "/home/mvala/git/AliRsn/PWGLF/RESONANCES/macros/lego_train";
    AliAnalysisManager::SetGlobalStr("RsnLegoTrainPath",legoTrainPath.Data());
-   
+
    AliAnalysisManager *mrg = AliAnalysisManager::GetAnalysisManager();
 
    TString rsnBaseSettings = "Rsn_pp";
@@ -33,22 +33,22 @@ Bool_t AddAMRsnTrain(TString analysisSource = "proof", TString analysisMode = "t
    rsnCutStr="PhiNsigma:KTPCnsig30";
 
    if ((rsnCutStr.IsNull())&&(!postfix.IsNull())) {
-     rsnCutStr = "PhiNsigma:";
-     rsnCutStr.Append(postfix.Data());
+      rsnCutStr = "PhiNsigma:";
+      rsnCutStr.Append(postfix.Data());
    }
 
    // Rsn Quality Cut
    TString rsnQualityCutStr = "";
 //   rsnQualityCutStr = "pp_LHC11a_p4_120";
 //   rsnQualityCutStr = "pp_LHC11a_p4_70";
-   
+
 
    TString extraMacro = "";
    TString extraMacroArgs = "";
 //   extraMacro = "RsnTrainSettingsExtra.C";
 //   extraMacroArgs = "10.0,10,1,1,1,1,1,1,1";
 //   extraMacroArgs = "10, 5, 5, -1, 1, 0, 1, 1, 1";
-   
+
    input.ToLower();
    inputMC.ToLower();
    Bool_t useMC = !inputMC.CompareTo("mc");
@@ -112,7 +112,7 @@ Bool_t AddAMRsnTrain(TString analysisSource = "proof", TString analysisMode = "t
             if (!RsnLoadMacro("AddPIDResponseInputHandler.C")) return kFALSE;
             AddPIDResponseInputHandler(multiInputHandler,useMC);
          } else {
-               Printf("Adding PIDResponse task ...");
+            Printf("Adding PIDResponse task ...");
             gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
             AddTaskPIDResponse(useMC);
          }
index 23338ca..b43c129 100644 (file)
@@ -28,6 +28,13 @@ Int_t AddRsnDaughterCutsKStarNsigma(AliPID::EParticleType type1,AliPID::EParticl
    Double_t nSigmaTOF_K=3.0;
    Double_t etaRange=0.8;
 
+   //defaults
+   Double_t trackPtMin=0.15;
+   Double_t trackPtMax=1.e20;
+   Int_t NclTPC=70;
+   Char_t DCAxyFormula[100]="0.0182+0.035/pt^1.01";
+   Bool_t useTrackPtCut=kFALSE;
+
    Bool_t useTPC_Pi=kFALSE;
    Bool_t useTOF_Pi=kFALSE;
    Bool_t useTPC_K=kFALSE;
@@ -87,6 +94,37 @@ Int_t AddRsnDaughterCutsKStarNsigma(AliPID::EParticleType type1,AliPID::EParticl
       useEta = kTRUE;
    }
 
+   if (opt.Contains("trackPt")) {
+      useTrackPtCut = kTRUE;
+      if (opt.Contains("trackPtMin015")) trackPtMin = 0.15;
+      if (opt.Contains("trackPtMin02")) trackPtMin = 0.2;
+      if (opt.Contains("trackPtMin05")) trackPtMin = 0.5;
+      if (opt.Contains("trackPtMin06")) trackPtMin = 0.6;
+
+      if (opt.Contains("trackPtMax18")) trackPtMax = 1.8;
+      if (opt.Contains("trackPtMax20")) trackPtMax = 2.0;
+      if (opt.Contains("trackPtMax25")) trackPtMax = 2.5;
+   }
+
+   Bool_t useNclTPC = kFALSE;
+   if (opt.Contains("NclTPC")) {
+      if (opt.Contains("NclTPC70")) NclTPC=70;
+      if (opt.Contains("NclTPC75")) NclTPC=75;
+      if (opt.Contains("NclTPC80")) NclTPC=80;
+      if (opt.Contains("NclTPC85")) NclTPC=85;
+      if (opt.Contains("NclTPC90")) NclTPC=90;
+      if (opt.Contains("NclTPC100")) NclTPC=100;
+      useNclTPC = kTRUE;
+   }
+
+   Bool_t useDCAxy = kFALSE;
+   if (opt.Contains("DCAxy")) {
+      if (opt.Contains("DCAxyFormula7s")) sprintf(DCAxyFormula,"0.0182+0.035/pt^1.01");
+      if (opt.Contains("DCAxyFormula6s")) sprintf(DCAxyFormula,"0.0156+0.03/pt^1.01");
+      if (opt.Contains("DCAxyFormula5s")) sprintf(DCAxyFormula,"0.013+0.025/pt^1.01");
+      useDCAxy = kTRUE;
+   }
+
    // KAON SETTINGS =======================================
    TString scheme="";
    TString cutname = "K_Kstar";
@@ -96,8 +134,10 @@ Int_t AddRsnDaughterCutsKStarNsigma(AliPID::EParticleType type1,AliPID::EParticl
    AliRsnCutTrackQuality *qualityCutK = new AliRsnCutTrackQuality("cutQuatityK");
    if (useCommonQualityCut>=0) {
       qualityCutK->SetAODTestFilterBit(useCommonQualityCut);
+      if(useDCAxy) {qualityCutK->SetCheckOnlyFilterBit(kFALSE); qualityCutK->SetDCARPtFormula(DCAxyFormula);}
    } else {
       qualityCutK->SetDefaults2010();
+      if(useDCAxy) qualityCutK->SetDCARPtFormula(DCAxyFormula);
    }
    cutsK->AddCut(qualityCutK);
    if (!scheme.IsNull()) scheme += "&";
@@ -127,6 +167,30 @@ Int_t AddRsnDaughterCutsKStarNsigma(AliPID::EParticleType type1,AliPID::EParticl
       if (!scheme.IsNull()) scheme += "&";
       scheme += cutEtaK->GetName();
    }
+
+   if (useTrackPtCut) {
+      Printf("Adding K Pt min=%.3f max=%.3f ...",trackPtMin,trackPtMax);
+      AliRsnValueDaughter *valTrackPtK = new AliRsnValueDaughter(Form("val%sTrackPt%s",AliPID::ParticleName(type2),opt.Data()),AliRsnValueDaughter::kPt);
+
+      AliRsnCutValue *cutTrackPtK = new AliRsnCutValue(Form("cut%sTrackPt%s",AliPID::ParticleName(type2),opt.Data()),trackPtMin,trackPtMax);
+      cutTrackPtK->SetTargetType(AliRsnTarget::kDaughter);
+      cutTrackPtK->SetValueObj(valTrackPtK);
+      cutsK->AddCut(cutTrackPtK);
+      if (!scheme.IsNull()) scheme += "&";
+      scheme += cutTrackPtK->GetName();
+   }
+
+   if (useNclTPC) {
+      Printf("Adding NclTPC >= %i",NclTPC);
+      AliRsnValueDaughter *valNclTPCK = new AliRsnValueDaughter(Form("val%sNclTPC%s",AliPID::ParticleName(type2),opt.Data()),AliRsnValueDaughter::kNTPCclusters);
+      AliRsnCutValue *cutNclTPCK = new AliRsnCutValue(Form("cut%sNclTPC%s",AliPID::ParticleName(type2),opt.Data()),NclTPC,1000.);
+      cutNclTPCK->SetTargetType(AliRsnTarget::kDaughter);
+      cutNclTPCK->SetValueObj(valNclTPCK);
+      cutsK->AddCut(cutNclTPCK);
+      if (!scheme.IsNull()) scheme += "&";
+      scheme += cutNclTPCK->GetName();
+   }
+
    if (usePDG) {
       AliRsnCutPID *cutPDGK = new AliRsnCutPID(Form("cut%sPDG%s",AliPID::ParticleName(type2),opt.Data()),type2,0.0,kTRUE);
       cutsK->AddCut(cutPDGK);
@@ -149,8 +213,10 @@ Int_t AddRsnDaughterCutsKStarNsigma(AliPID::EParticleType type1,AliPID::EParticl
    AliRsnCutTrackQuality *qualityCutPi = new AliRsnCutTrackQuality("cutQuatityPi");
    if (useCommonQualityCut>=0) {
       qualityCutPi->SetAODTestFilterBit(useCommonQualityCut);
+      if(useDCAxy) {qualityCutPi->SetCheckOnlyFilterBit(kFALSE); qualityCutPi->SetDCARPtFormula(DCAxyFormula);}
    } else {
       qualityCutPi->SetDefaults2010();
+      if(useDCAxy) qualityCutPi->SetDCARPtFormula(DCAxyFormula);
    }
    cutsP->AddCut(qualityCutPi);
    if (!scheme.IsNull()) scheme += "&";
@@ -178,6 +244,29 @@ Int_t AddRsnDaughterCutsKStarNsigma(AliPID::EParticleType type1,AliPID::EParticl
       if (!scheme.IsNull()) scheme += "&";
       scheme += cutEtaP->GetName();
    }
+
+   if (useTrackPtCut) {
+      Printf("Adding Pi Pt min=%.3f max=%.3f ...",trackPtMin,trackPtMax);
+      AliRsnValueDaughter *valTrackPtP = new AliRsnValueDaughter(Form("val%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kPt);
+
+      AliRsnCutValue *cutTrackPtP = new AliRsnCutValue(Form("cut%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),trackPtMin,trackPtMax);
+      cutTrackPtP->SetTargetType(AliRsnTarget::kDaughter);
+      cutTrackPtP->SetValueObj(valTrackPtP);
+      cutsP->AddCut(cutTrackPtP);
+      if (!scheme.IsNull()) scheme += "&";
+      scheme += cutTrackPtP->GetName();
+   }
+
+   if (useNclTPC) {
+      Printf("Adding NclTPC Pi >= %i",NclTPC);
+      AliRsnValueDaughter *valNclTPCP = new AliRsnValueDaughter(Form("val%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kNTPCclusters);
+      AliRsnCutValue *cutNclTPCP = new AliRsnCutValue(Form("cut%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),NclTPC,1000.);
+      cutNclTPCP->SetTargetType(AliRsnTarget::kDaughter);
+      cutNclTPCP->SetValueObj(valNclTPCP);
+      cutsP->AddCut(cutNclTPCP);
+      if (!scheme.IsNull()) scheme += "&";
+      scheme += cutNclTPCP->GetName();
+   }
    if (usePDG) {
       AliRsnCutPID *cutPDGP = new AliRsnCutPID(Form("cut%sPDG%s",AliPID::ParticleName(type1),opt.Data()),type1,0.0,kTRUE);
       cutsP->AddCut(cutPDGP);
@@ -205,7 +294,7 @@ Int_t AddRsnDaughterCutsKStarNsigma(AliPID::EParticleType type1,AliPID::EParticl
       }
    } else {
       AliRsnDaughterSelector *sel = rsnIH->GetSelector();
-//       sel->SetLabelCheck(kFALSE);
+      //       sel->SetLabelCheck(kFALSE);
       sel->Add(cutsP, kTRUE);
       sel->Add(cutsK, kTRUE);
    }
index e81b39d..a397a52 100644 (file)
@@ -97,9 +97,9 @@ void AddPairOutputMiniKStar(AliAnalysisTaskSE *task,Bool_t isMC,Bool_t isMixing,
    Int_t nIM   = 90; Double_t minIM   = 0.6, maxIM =  1.5;
    Int_t nRes   = 200; Double_t minRes   = -0.02, maxRes =  0.02;
    Int_t nEta   = 400; Double_t minEta   = -0.5, maxEta =  0.5;
-   Int_t nY   = 16; Double_t minY   = -0.8, maxY =  0.8;
+   Int_t nY   = 32; Double_t minY   = -0.8, maxY =  0.8;
    Int_t nPt   = 120; Double_t minPt   = 0.0, maxPt = 12.0;
-   Int_t nCent = 100; Double_t minCent = 0.0, maxCent = 100.0;
+   Int_t nCent = 20; Double_t minCent = 0.0, maxCent = 100.0;
    //
    // -- Create all needed outputs -----------------------------------------------------------------
    //
index 61d8695..289204e 100644 (file)
@@ -41,7 +41,7 @@ void AddPairOutputPhi(AliRsnLoopPair *pair)
    Int_t isFullOutput = AliRsnTrainManager::GetGlobalInt("RsnOutputFull",valid);
    Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);
    Int_t useRapidity = AliRsnTrainManager::GetGlobalInt("RsnUseRapidity",valid);
-   
+
    // axes
    AliRsnValuePair *axisIM = new AliRsnValuePair("IM", AliRsnValuePair::kInvMass);
    AliRsnValuePair *axisPt = new AliRsnValuePair("PT", AliRsnValuePair::kPt);
index 3c451bf..fe70d41 100644 (file)
@@ -98,7 +98,7 @@ void AddEventMixingSettings(AliAnalysisTaskSE *task) {
    Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);
    Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);
    Int_t mixNum = AliRsnTrainManager::GetGlobalInt("RsnNumMix",valid);
-   
+
    Double_t mixDiffMult = AliRsnTrainManager::GetGlobalInt("RsnMixDiffMult",valid);
    Double_t mixDiffVz = AliRsnTrainManager::GetGlobalInt("RsnMixDiffVz",valid);
    Double_t mixDiffAngle = AliRsnTrainManager::GetGlobalInt("RsnMixDiffAngle",valid);
@@ -112,12 +112,12 @@ void AddEventMixingSettings(AliAnalysisTaskSE *task) {
          taskRsn->UseCentrality("V0M");
       }
       if (mixDiffMult>0.0) taskRsn->SetMaxDiffMult(mixDiffMult);
-            
+
       // set mixing
       taskRsn->UseContinuousMix();
       //task->UseBinnedMix();
       taskRsn->SetNMix(mixNum);
-      
+
       if (mixDiffVz>0.0) taskRsn->SetMaxDiffVz(mixDiffVz);
       if (mixDiffAngle>0.0) taskRsn->SetMaxDiffAngle(mixDiffAngle);
       // 30.0 * TMath::DegToRad()
index 3f6559f..b404adc 100644 (file)
@@ -27,24 +27,24 @@ AliAnalysisTask *AddRsnTaskTrain(const char *commonStr,const char *rsnStr,const
    //pp_LHC11_p4_120
 
 
-   if (!RsnLoadMacroTrain("RsnTrainCommonSettings.C")) return kFALSE; 
+   if (!RsnLoadMacroTrain("RsnTrainCommonSettings.C")) return kFALSE;
    if (!extraMacro.IsNull()) {
       if (!RsnLoadMacroTrain(extraMacro.Data())) return kFALSE;
    }
    RsnTrainCommonSettings(commonStr,rsnStr,extraMacro,extraMacroArgs);
-   
+
    rsnMgr->Print();
 
    if (!RsnLoadMacroTrain("AddRsnTask.C")) return kFALSE;
-   
+
    // Generate Rsn Analysisa Task
-   AliAnalysisTask* task = AddRsnTask(rsnStr,rsnCutStr,"");
-   
+   AliAnalysisTask *task = AddRsnTask(rsnStr,rsnCutStr,"");
+
    // deleting AliRsnTrainManager to reset all previous settings
    delete rsnMgr;
-   
+
    return task;
-   
+
 }
 
 Bool_t RsnLoadMacroTrain(TString macro,TString path="") {
index c8c4a3c..e7f18aa 100644 (file)
@@ -4,7 +4,7 @@ TList *RsnPrivateTrainBaseSettings() {
    TString legoTrainPath = AliAnalysisManager::GetGlobalStr("RsnLegoTrainPath",valid);
    Int_t usePhysSel        = -1;
 //   usePhysSel              = AliVEvent::kMB;
-   
+
    Int_t usePIDResponseTask      = 1;
    Int_t useCentralityTask       = 0;
    Int_t useEventPlaneTask       = 1;
index 372e302..2b4f8d2 100644 (file)
@@ -3,7 +3,7 @@ AliESDtrackCuts *RsnQualityCut(TString cut="pp_LHC11_p4_120") {
 
    // For RSN analysis, we select Primaries
    Bool_t selPrimaries = kTRUE;
-   
+
    Printf("RsnQualityCut : %s",cut.Data());
    AliESDtrackCuts *esdTrackCuts = 0;
    if (cut.Contains("pp_LHC11a_p4")) {
index a1c5294..5ae975e 100644 (file)
@@ -49,12 +49,12 @@ void RsnTrainCommonSettings(TString type,TString rsnPart,TString extraMacro="",T
    AliRsnTrainManager::SetGlobalInt("RsnUseMCMomentum",0,kFALSE);
    AliRsnTrainManager::SetGlobalInt("RsnUseMCMonitoring",0,kFALSE);
    AliRsnTrainManager::SetGlobalInt("RsnUseAOD049Patch",0,kFALSE);
-   
+
    AliRsnTrainManager::SetGlobalDbl("RsnMixDiffMult",10.0,kFALSE);
    AliRsnTrainManager::SetGlobalDbl("RsnMixDiffVz",1.0,kFALSE);
    AliRsnTrainManager::SetGlobalDbl("RsnMixDiffAngle",-1.0,kFALSE);
-            
-   
+
+
    // expert options (don't change)
    AliRsnTrainManager::SetGlobalInt("RsnMixPrintRefresh",-1,kFALSE);
 
index 73a6f54..e99ed1a 100644 (file)
@@ -9,7 +9,7 @@ Bool_t RunALICE(TString anSrc = "grid",
                 Bool_t useMultiHandler=kFALSE,
                 TString alirsnlitesrc ="$ALICE_ROOT",
                 TString alirsnlitetasks =""
-                ) {
+               ) {
 
    // some init work
    anSrc.ToLower(); anMode.ToLower(); input.ToLower(); inputMC.ToLower();
@@ -87,8 +87,8 @@ Int_t LoadLibsBase(TString alirsnlitesrc) {
 
 Bool_t CreateInputHandlers(TString input,TString inputMC,Bool_t useAODOut=kFALSE,Bool_t useMultiHandler=kTRUE) {
 
-       input.ToLower();
-       inputMC.ToLower();
+   input.ToLower();
+   inputMC.ToLower();
 
    Bool_t useMC = !inputMC.CompareTo("mc");
 
@@ -99,7 +99,7 @@ Bool_t CreateInputHandlers(TString input,TString inputMC,Bool_t useAODOut=kFALSE
    if (useMultiHandler) {
       AliMultiInputEventHandler *inputHandler = new AliMultiInputEventHandler();
       if (!input.CompareTo("esd")) {
-       Printf("Adding ESD Input Handler ...");
+         Printf("Adding ESD Input Handler ...");
          inputHandler->AddInputEventHandler(new AliESDInputHandler());
          if (useMC) inputHandler->AddInputEventHandler(new AliMCEventHandler());
       } else if (!input.CompareTo("aod")) {