AliPhysics  63e47e1 (63e47e1)
AddTaskDStarJets.C
Go to the documentation of this file.
1 //DEFINITION OF A FEW CONSTANTS
2 const Int_t chargeFrCorr = 20;
3 //----------------------------------------------------
4 
6 {
7 
8  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9  if (!mgr) {
10  ::Error("AddTaskDStarJets2", "No analysis manager to connect to.");
11  return NULL;
12  }
13 
14  TFile* filecuts=TFile::Open("DStartoKpipiCuts.root");
15  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
16  cout<<"Input file not found: exit"<<endl;
17  return NULL;
18  }
19 
20  AliRDHFCutsDStartoKpipi* RDHFDStartoKpipi=new AliRDHFCutsDStartoKpipi();
21  RDHFDStartoKpipi = (AliRDHFCutsDStartoKpipi*)filecuts->Get("DStartoKpipiCuts");
22  RDHFDStartoKpipi->SetName("DStartoKpipiCuts");
23 
24  // mm let's see if everything is ok
25  if(!RDHFDStartoKpipi){
26  cout<<"Specific AliRDHFCuts not found"<<endl;
27  return NULL;
28  }
29 
30  //CREATE THE TASK
31  printf("CREATE TASK\n");
32  // create the task
33  AliAnalysisTaskSEDStarJets *task = new AliAnalysisTaskSEDStarJets("AliAnalysisTaskSEDStarJets",RDHFDStartoKpipi);
34  task->SetMC(theMCon);
36 
37  // Create and connect containers for input/output
38  TString outputfile = AliAnalysisManager::GetCommonFileName();
39  outputfile += ":PWG3_D2H_DStarJet";
40 
41  // ------ input data ------
42  AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
43 
44  // ----- output data -----
45 
46  // output TH1I for event counting
47  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("charmJetCorr", TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
48  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("cuts",AliRDHFCutsDStartoKpipi::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //cuts
49  mgr->AddTask(task);
50 
51  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
52  mgr->ConnectOutput(task,1,coutput1);
53  mgr->ConnectOutput(task,2,coutput2);
54 
55  return task ;
56 }
57 
const Int_t chargeFrCorr
AliAnalysisTaskSEDStarJets * AddTaskDStarJets(Bool_t theMCon=kTRUE)
int Int_t
Definition: External.C:63
void SetMC(Bool_t theMCon)
set MC usage
void SetChargeFractionCorrection(Int_t chargeFrCorr)
correction for UA1 cone algorithm
bool Bool_t
Definition: External.C:53