AliPhysics  1811c8f (1811c8f)
AddTaskXicPlus2XiPiPifromAODtracks.C
Go to the documentation of this file.
2  Bool_t theMCon=kFALSE,
3  Bool_t writeVariableTree=kTRUE,
4  Bool_t reconstructPrimVert=kFALSE,
5  Int_t nTour=0
6  )
7 
8 {
9 
10  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
11  if (!mgr) {
12  ::Error("AddTaskLc2V0YW", "No analysis manager to connect to.");
13  return NULL;
14  }
15 
16  Bool_t stdcuts=kFALSE;
17  TFile* filecuts;
18  if( finname.EqualTo("") ) {
19  stdcuts=kTRUE;
20  } else {
21  filecuts=TFile::Open(finname.Data());
22  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
23  AliFatal("Input file not found : check your cut object");
24  }
25  }
26 
28  if (stdcuts) RDHFCutsXic2PiPianal->SetStandardCutsPP2010();
29  else RDHFCutsXic2PiPianal = (AliRDHFCutsXicPlustoXiPiPifromAODtracks*)filecuts->Get("XicPlusAnalysisCuts");
30  RDHFCutsXic2PiPianal->SetName("XicPlusAnalysisCuts");
31  RDHFCutsXic2PiPianal->SetMinPtCandidate(2.);
32  RDHFCutsXic2PiPianal->SetMaxPtCandidate(10000.);
33 
34 
35  // mm let's see if everything is ok
36  if (!RDHFCutsXic2PiPianal) {
37  cout << "Specific AliRDHFCutsXic2PiPianal not found\n";
38  return;
39  }
40 
41 
42  //CREATE THE TASK
43 
44  printf("CREATE TASK\n");
45  AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks *task = new AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks("AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks",RDHFCutsXic2PiPianal,writeVariableTree);
46  task->SetMC(theMCon);
47  task->SetDebugLevel(1);
48  task->SetReconstructPrimVert(reconstructPrimVert);
49 
50  mgr->AddTask(task);
51 
52  // Create and connect containers for input/output
53  TString outputfile = AliAnalysisManager::GetCommonFileName();
54  outputfile += ":PWG3_D2H_XicPlus2XiPiPi_";
55  outputfile += nTour;
56 
57  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
58 
59  // ----- output data -----
60  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("chist%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
61  mgr->ConnectOutput(task,1,coutput1);
62  AliAnalysisDataContainer *coutputXic2 = mgr->CreateContainer(Form("XicPlus2XiPiPiCuts%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // cuts
63  mgr->ConnectOutput(task,2,coutputXic2);
64  if (writeVariableTree) {
65  AliAnalysisDataContainer *coutputXic3 = mgr->CreateContainer(Form("XicPlusvariables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
66  mgr->ConnectOutput(task,3,coutputXic3);
67  }else{
68  AliAnalysisDataContainer *coutputXic3 = mgr->CreateContainer(Form("XicPlusAll%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
69  mgr->ConnectOutput(task,3,coutputXic3);
70  }
71 
72  return task;
73 
74 }
void SetMaxPtCandidate(Double_t ptCand=1000.)
Definition: AliRDHFCuts.h:221
int Int_t
Definition: External.C:63
AliAnalysisTaskSEXicPlus2XiPiPifromAODtracks * AddTaskXicPlus2XiPiPifromAODtracks(TString finname="", Bool_t theMCon=kFALSE, Bool_t writeVariableTree=kTRUE, Bool_t reconstructPrimVert=kFALSE, Int_t nTour=0)
virtual void SetStandardCutsPP2010()
Definition: AliRDHFCuts.h:46
void SetMinPtCandidate(Double_t ptCand=-1.)
Definition: AliRDHFCuts.h:220
bool Bool_t
Definition: External.C:53