AliPhysics  5a28df1 (5a28df1)
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 cosBXY=-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->SetCosXYBCut(cosBXY);
139  task->SetdlBCut(dlB);
140  task->SetNdlXYBCut(NdlBXY);
141  task->SetTopomaticD(TopomaticD);
142  task->SetTopomaticpi(Topomaticpi);
143  task->SetcosoaDpi(cosoaDpi);
144 
145  mgr->AddTask(task);
146 
147 
148 
149  // Create and connect containers for input/output
150 
151  usercomment = "_" + usercomment;
152 
153  TString outputfile = AliAnalysisManager::GetCommonFileName();
154 
155  outputfile += ":PWG3_D2H_B0piDplus";
156  outputfile += usercomment;
157 
158 
159  // ------ input data ------
160  TString input = "cinputB0";
161  //input += usercomment;
162  TString output1 = "Integrated";
163  output1 += usercomment;
164  TString output2 = "pTbin";
165  output2 += usercomment;
166  TString output3 = "coutputB0Norm";
167  output3 += usercomment;
168  TString output4 = "cuts";
169  output4 += usercomment;
170  //AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
171 
172  AliAnalysisDataContainer *cinput0 = mgr->CreateContainer(input,TChain::Class(),
173 
174  AliAnalysisManager::kInputContainer);
175 
176  // ----- output data -----
177 
178  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(output1,TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
179 
180  AliAnalysisDataContainer *coutputBin = mgr->CreateContainer(output2,TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
181 
182  AliAnalysisDataContainer *coutputB0Norm = mgr->CreateContainer(output3,AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data());
183 
184  AliAnalysisDataContainer *coutputCuts = mgr->CreateContainer(output4,AliRDHFCutsDplustoKpipi::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //cuts
185 
186 
187 
188  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
189 
190  mgr->ConnectOutput(task,1,coutput1);
191 
192  mgr->ConnectOutput(task,2,coutputBin);
193 
194  mgr->ConnectOutput(task,3,coutputB0Norm);
195 
196  mgr->ConnectOutput(task,4,coutputCuts);
197 
198 
199  return task;
200 
201 }
202 
203 
204 
double Double_t
Definition: External.C:58
void SetUseAOD049(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:210
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)
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 cosBXY=-999., Double_t dlB=0., Double_t NdlBXY=0., Double_t TopomaticD=999., Double_t Topomaticpi=999., Double_t cosoaDpi=-999.)
const Bool_t anaType
bool Bool_t
Definition: External.C:53
void SetTriggerClass(TString trclass0, TString trclass1="")
Definition: AliRDHFCuts.h:197
void SetOptPileup(Int_t opt=0)
Definition: AliRDHFCuts.h:223
void SetTopomaticCutOnDDaughters(Double_t TopoCut)
void SetTriggerMask(ULong64_t mask=0)
Definition: AliRDHFCuts.h:67