AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AddTaskLc2V0bachpA_TMVA_KF_ON_OnlyHIJINGBkg.C
Go to the documentation of this file.
2  Bool_t theMCon=kTRUE,
3  Bool_t onTheFly=kFALSE){
4 
5  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
6  if (!mgr) {
7  ::Error("AddTaskLc2V0bachelor", "No analysis manager to connect to.");
8  return NULL;
9  }
10 
11  // cuts are stored in a TFile generated by makeTFile4CutsLc2V0bachelor.C in ./macros/
12  // set there the cuts!!!!!
13 
14  Bool_t stdcuts=kFALSE;
15  TFile* filecuts;
16  if( finname.EqualTo("") ) {
17  stdcuts=kTRUE;
18  } else {
19  filecuts=TFile::Open(finname.Data());
20  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
21  AliFatal("Input file not found : check your cut object");
22  }
23  }
24 
25  AliRDHFCutsLctoV0* RDHFCutsLctoV0anal = new AliRDHFCutsLctoV0();
26  if (stdcuts) RDHFCutsLctoV0anal->SetStandardCutsPP2010();
27  else RDHFCutsLctoV0anal = (AliRDHFCutsLctoV0*)filecuts->Get("LctoV0AnalysisCuts");
28  RDHFCutsLctoV0anal->SetName("LctoV0AnalysisCuts");
29  RDHFCutsLctoV0anal->SetMinPtCandidate(-1.);
30  RDHFCutsLctoV0anal->SetMaxPtCandidate(10000.);
31 
32 
33  // mm let's see if everything is ok
34  if (!RDHFCutsLctoV0anal) {
35  cout << "Specific AliRDHFCutsLctoV0 not found\n";
36  return;
37  }
38 
39 
40  //CREATE THE TASK
41 
42  printf("CREATE TASK\n");
43  AliAnalysisTaskSELc2V0bachelorTMVA *task = new AliAnalysisTaskSELc2V0bachelorTMVA("AliAnalysisTaskSELc2V0bachelorTMVA", RDHFCutsLctoV0anal, onTheFly);
44  task->SetIspA(kTRUE);
45  task->SetMC(theMCon);
46  task->SetK0sAnalysis(kTRUE);
47  task->SetDebugLevel(0);
48  task->SetCallKFVertexing(kTRUE);
49  task->SetKeepingKeepingOnlyHIJINGBkg(kTRUE);
50  mgr->AddTask(task);
51 
52  // Create and connect containers for input/output
53  TString outputfile = AliAnalysisManager::GetCommonFileName();
54  outputfile += ":PWG3_D2H_Lc2pK0S";
55 
56  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
57  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("treeList"),TList::Class(),AliAnalysisManager::kOutputContainer,"Lc2K0Sp_tree_pA.root"); // trees
58 
59  mgr->ConnectOutput(task, 1, coutput1);
60 
61  AliAnalysisDataContainer *coutputLc2 = mgr->CreateContainer(Form("Lc2pK0Scounter"),AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer,"Lc2K0Sp_tree_pA.root"); //counter
62  mgr->ConnectOutput(task, 2, coutputLc2);
63 
64  AliAnalysisDataContainer *coutputLc3 = mgr->CreateContainer(Form("Lc2pK0SCuts"),TList::Class(),AliAnalysisManager::kOutputContainer,"Lc2K0Sp_tree_pA.root"); // cuts
65  mgr->ConnectOutput(task, 3, coutputLc3);
66 
67  AliAnalysisDataContainer *coutput4 = mgr->CreateContainer(Form("treeSgn"),TTree::Class(),AliAnalysisManager::kOutputContainer,"Lc2K0Sp_tree_pA.root"); // trees
68 
69  mgr->ConnectOutput(task, 4, coutput4);
70 
71  AliAnalysisDataContainer *coutput5 = mgr->CreateContainer(Form("treeBkg"),TTree::Class(),AliAnalysisManager::kOutputContainer,"Lc2K0Sp_tree_pA.root"); // trees
72 
73  mgr->ConnectOutput(task, 5, coutput5);
74 
75  AliAnalysisDataContainer *coutput6 = mgr->CreateContainer(Form("listHistoKF"), TList::Class(), AliAnalysisManager::kOutputContainer,"Lc2K0Sp_tree_pA.root"); // trees
76 
77  mgr->ConnectOutput(task, 6, coutput6);
78 
79 
80  return task;
81 
82 }
virtual void SetStandardCutsPP2010()
AliAnalysisTaskSELc2V0bachelorTMVA * AddTaskLc2V0bachpA_TMVA_KF_ON_OnlyHIJINGBkg(TString finname="Lc2V0bachelorCuts.root", Bool_t theMCon=kTRUE, Bool_t onTheFly=kFALSE)
void SetMaxPtCandidate(Double_t ptCand=1000.)
Definition: AliRDHFCuts.h:216
void SetMinPtCandidate(Double_t ptCand=-1.)
Definition: AliRDHFCuts.h:215