AliPhysics  95775ff (95775ff)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskB0Dminuspi.C
Go to the documentation of this file.
1 //if like define a different number of signal for TPC PID
2 
3 //by default the task is anyway computing 1, 2 and 3 sigmas
4 
5 const Bool_t theRareOn = kTRUE;
6 
7 const Bool_t anaType = 1;//0 HD; 1 UU;
8 
9 const Bool_t doImp = kFALSE;// imp par studies
10 
11 //----------------------------------------------------
12 
13 
14 
16 
17  Float_t minC=0, Float_t maxC=100,
18 
19  TString cutsfile="", TString usercomment = "username",
20 
21  Bool_t theMCon=kFALSE, Double_t TopomaticDdaughter=0.,Double_t pTD=0.,Double_t pTpi=0.,Double_t prodd0=999., Double_t cosB=-999.,Double_t dlB=0.,Double_t NdlBXY=0., Double_t TopomaticD=999.,Double_t Topomaticpi=999., Double_t cosoaDpi=-999.)
22 
23 {
24 
25 
26 
27  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
28 
29  if (!mgr) {
30 
31  ::Error("AddTaskB0Dminuspi", "No analysis manager to connect to.");
32 
33  return NULL;
34 
35  }
36 
37 
38 
39  // cuts are stored in a TFile generated by makeTFile4CutsB0toDminuspi.C in ./macros/
40 
41  // set there the cuts!!!!!
42 
43  Bool_t stdcuts=kFALSE;
44  // Bool_t stdcuts=kTRUE;
45 
46  TFile* filecuts;
47  if( cutsfile.EqualTo("") ) {
48  stdcuts=kTRUE;
49  } else {
50  filecuts=TFile::Open(cutsfile.Data());
51  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
52  //AliFatal("Input file not found : check your cut object");
53  Error("Input file not found : check your cut object");
54  }
55  }
56 
57 
58 
59  AliRDHFCutsDplustoKpipi* RDHFB0toDminuspi=new AliRDHFCutsDplustoKpipi();
60 
61 
62 
63  if(stdcuts) {
64 
65  if(system==0){
66  RDHFB0toDminuspi->SetStandardCutsPP2010();
67  // RDHFB0toDminuspi->SetUseCentrality(kFALSE);
68 
69 
70  }
71  else if(system==1) {
72 
73  RDHFB0toDminuspi->SetStandardCutsPbPb2010();
74 
75  RDHFB0toDminuspi->SetMinCentrality(minC);
76 
77  RDHFB0toDminuspi->SetMinCentrality(maxC);
78 
79  RDHFB0toDminuspi->SetUseAOD049(kTRUE);
80 
81  RDHFB0toDminuspi->SetUseCentrality(AliRDHFCuts::kCentV0M);
82 
83  }
84 
85  }
86 
87  else RDHFB0toDminuspi = (AliRDHFCutsDplustoKpipi*)filecuts->Get("AnalysisCuts");
88 
89  // RDHFB0toDminuspi->SetName("AnalysisCuts");
90 
91 
92  if(theMCon==kFALSE){
93 
95  RDHFB0toDminuspi->SetTriggerMask(AliVEvent::kINT7);
96  RDHFB0toDminuspi->SetTriggerClass("");
97  }
98 
99  // RDHFB0toDminuspi->SetUseCentrality(kFALSE);
100 
101 
102  // mm let's see if everything is ok
103 
104  if(!RDHFB0toDminuspi){
105 
106  cout<<"Specific AliRDHFCuts not found"<<endl;
107 
108  return;
109 
110  }
111 
112 
113 
114  //CREATE THE TASK
115 
116  printf("CREATE TASK\n");
117 
118  // create the task
119 
120  AliAnalysisTaskSEB0toDminuspi *task = new AliAnalysisTaskSEB0toDminuspi("AliAnalysisTaskSEB0toDminuspi",RDHFB0toDminuspi);
121 
122 
123  task->SetReadMC(theMCon);
124  task->SetDebugLevel(2);
125 
126  // task->SetDplusMassLimit(1.845,1.895);
127  // task->SetBMassLimits(4.5,6.5);
128 
129 
130  //SetCut on inverted topomatic cut for D mesons
131  task->SetTopomaticCutOnDDaughters(TopomaticDdaughter);
132 
133  //Set B 2prong cuts
134  task->SetDpTCut(pTD);
135  task->SetpipTCut(pTpi);
136  task->Setprodd0Cut(prodd0);
137  task->SetCosBCut(cosB);
138  task->SetdlBCut(dlB);
139  task->SetNdlXYBCut(NdlBXY);
140  task->SetTopomaticD(TopomaticD);
141  task->SetTopomaticpi(Topomaticpi);
142  task->SetcosoaDpi(cosoaDpi);
143 
144  mgr->AddTask(task);
145 
146 
147 
148  // Create and connect containers for input/output
149 
150  usercomment = "_" + usercomment;
151 
152  TString outputfile = AliAnalysisManager::GetCommonFileName();
153 
154  outputfile += ":PWG3_D2H_B0piDplus";
155  outputfile += usercomment;
156 
157 
158  // ------ input data ------
159  TString input = "cinputB0";
160  //input += usercomment;
161  TString output1 = "Integrated";
162  output1 += usercomment;
163  TString output2 = "pTbin";
164  output2 += usercomment;
165  TString output3 = "coutputB0Norm";
166  output3 += usercomment;
167  TString output4 = "cuts";
168  output4 += usercomment;
169  //AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
170 
171  AliAnalysisDataContainer *cinput0 = mgr->CreateContainer(input,TChain::Class(),
172 
173  AliAnalysisManager::kInputContainer);
174 
175  // ----- output data -----
176 
177  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(output1,TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
178 
179  AliAnalysisDataContainer *coutputBin = mgr->CreateContainer(output2,TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
180 
181  AliAnalysisDataContainer *coutputB0Norm = mgr->CreateContainer(output3,AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data());
182 
183  AliAnalysisDataContainer *coutputCuts = mgr->CreateContainer(output4,AliRDHFCutsDplustoKpipi::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //cuts
184 
185 
186 
187  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
188 
189  mgr->ConnectOutput(task,1,coutput1);
190 
191  mgr->ConnectOutput(task,2,coutputBin);
192 
193  mgr->ConnectOutput(task,3,coutputB0Norm);
194 
195  mgr->ConnectOutput(task,4,coutputCuts);
196 
197 
198  return task;
199 
200 }
201 
202 
203 
double Double_t
Definition: External.C:58
void SetUseAOD049(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:207
AliAnalysisTaskSEB0toDminuspi * AddTaskB0Dminuspi(Int_t system=0, Float_t minC=0, Float_t maxC=100, TString cutsfile="", TString usercomment="username", Bool_t theMCon=kFALSE, Double_t TopomaticDdaughter=0., Double_t pTD=0., Double_t pTpi=0., Double_t prodd0=999., Double_t cosB=-999., Double_t dlB=0., Double_t NdlBXY=0., Double_t TopomaticD=999., Double_t Topomaticpi=999., Double_t cosoaDpi=-999.)
void SetUseCentrality(Int_t flag=1)
Class for cuts on AOD reconstructed D+->Kpipi.
int Int_t
Definition: External.C:63
void SetMinCentrality(Float_t minCentrality=0.)
Definition: AliRDHFCuts.h:51
const Bool_t doImp
float Float_t
Definition: External.C:68
const Bool_t theRareOn
void SetTopomaticpi(Double_t Topomaticpi)
const Bool_t anaType
bool Bool_t
Definition: External.C:53
void SetTriggerClass(TString trclass0, TString trclass1="")
Definition: AliRDHFCuts.h:194
void SetOptPileup(Int_t opt=0)
Definition: AliRDHFCuts.h:220
void SetTopomaticCutOnDDaughters(Double_t TopoCut)
void SetTriggerMask(ULong64_t mask=0)
Definition: AliRDHFCuts.h:64