AliPhysics  c7b8e89 (c7b8e89)
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 
6 //----------------------------------------------------
7 
8 
9 
11 
12  Float_t minC=0, Float_t maxC=100,
13 
14  TString cutsfile="", TString usercomment = "username",
15 
16  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.)
17 
18 {
19 
20 
21 const Bool_t theRareOn = kTRUE;
22 
23 const Bool_t anaType = 1;//0 HD; 1 UU;
24 
25 const Bool_t doImp = kFALSE;// imp par studies
26 
27  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
28 
29  if (!mgr) {
30 
31  Printf("ERROR: 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  Printf("ERROR: Input file not found : check your cut object");
54  return NULL;
55  }
56  }
57 
58 
59 
60  AliRDHFCutsDplustoKpipi* RDHFB0toDminuspi;
61 
62 
63 
64  if(stdcuts) {
65  RDHFB0toDminuspi=new AliRDHFCutsDplustoKpipi();
66  if(system==0){
67  RDHFB0toDminuspi->SetStandardCutsPP2010();
68  // RDHFB0toDminuspi->SetUseCentrality(kFALSE);
69 
70 
71  }
72  else if(system==1) {
73 
74  RDHFB0toDminuspi->SetStandardCutsPbPb2010();
75 
76  RDHFB0toDminuspi->SetMinCentrality(minC);
77 
78  RDHFB0toDminuspi->SetMinCentrality(maxC);
79 
80  RDHFB0toDminuspi->SetUseAOD049(kTRUE);
81 
82  RDHFB0toDminuspi->SetUseCentrality(AliRDHFCuts::kCentV0M);
83 
84  }
85 
86  }
87 
88  else RDHFB0toDminuspi = (AliRDHFCutsDplustoKpipi*)filecuts->Get("AnalysisCuts");
89 
90  // RDHFB0toDminuspi->SetName("AnalysisCuts");
91 
92 
93  if(theMCon==kFALSE){
94 
96  RDHFB0toDminuspi->SetTriggerMask(AliVEvent::kINT7);
97  RDHFB0toDminuspi->SetTriggerClass("");
98  }
99 
100  // RDHFB0toDminuspi->SetUseCentrality(kFALSE);
101 
102 
103  // mm let's see if everything is ok
104 
105  if(!RDHFB0toDminuspi){
106 
107  cout<<"Specific AliRDHFCuts not found"<<endl;
108 
109  return NULL;
110 
111  }
112 
113 
114 
115  //CREATE THE TASK
116 
117  printf("CREATE TASK\n");
118 
119  // create the task
120 
121  AliAnalysisTaskSEB0toDminuspi *task = new AliAnalysisTaskSEB0toDminuspi("AliAnalysisTaskSEB0toDminuspi",RDHFB0toDminuspi);
122 
123 
124  task->SetReadMC(theMCon);
125  task->SetDebugLevel(2);
126 
127  // task->SetDplusMassLimit(1.845,1.895);
128  // task->SetBMassLimits(4.5,6.5);
129 
130 
131  //SetCut on inverted topomatic cut for D mesons
132  task->SetTopomaticCutOnDDaughters(TopomaticDdaughter);
133 
134  //Set B 2prong cuts
135  task->SetDpTCut(pTD);
136  task->SetpipTCut(pTpi);
137  task->Setprodd0Cut(prodd0);
138  task->SetCosBCut(cosB);
139  task->SetCosXYBCut(cosBXY);
140  task->SetdlBCut(dlB);
141  task->SetNdlXYBCut(NdlBXY);
142  task->SetTopomaticD(TopomaticD);
143  task->SetTopomaticpi(Topomaticpi);
144  task->SetcosoaDpi(cosoaDpi);
145 
146  mgr->AddTask(task);
147 
148 
149 
150  // Create and connect containers for input/output
151 
152  usercomment = "_" + usercomment;
153 
154  TString outputfile = AliAnalysisManager::GetCommonFileName();
155 
156  outputfile += ":PWG3_D2H_B0piDplus";
157  outputfile += usercomment;
158 
159 
160  // ------ input data ------
161  TString input = "cinputB0";
162  //input += usercomment;
163  TString output1 = "Integrated";
164  output1 += usercomment;
165  TString output2 = "pTbin";
166  output2 += usercomment;
167  TString output3 = "coutputB0Norm";
168  output3 += usercomment;
169  TString output4 = "cuts";
170  output4 += usercomment;
171  //AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
172 
173  AliAnalysisDataContainer *cinput0 = mgr->CreateContainer(input,TChain::Class(),
174 
175  AliAnalysisManager::kInputContainer);
176 
177  // ----- output data -----
178 
179  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(output1,TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
180 
181  AliAnalysisDataContainer *coutputBin = mgr->CreateContainer(output2,TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
182 
183  AliAnalysisDataContainer *coutputB0Norm = mgr->CreateContainer(output3,AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data());
184 
185  AliAnalysisDataContainer *coutputCuts = mgr->CreateContainer(output4,AliRDHFCutsDplustoKpipi::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //cuts
186 
187 
188 
189  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
190 
191  mgr->ConnectOutput(task,1,coutput1);
192 
193  mgr->ConnectOutput(task,2,coutputBin);
194 
195  mgr->ConnectOutput(task,3,coutputB0Norm);
196 
197  mgr->ConnectOutput(task,4,coutputCuts);
198 
199 
200  return task;
201 
202 }
203 
204 
205 
double Double_t
Definition: External.C:58
void SetUseAOD049(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:211
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:52
float Float_t
Definition: External.C:68
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 doImp
const Bool_t anaType
const Bool_t theRareOn
bool Bool_t
Definition: External.C:53
void SetTriggerClass(TString trclass0, TString trclass1="")
Definition: AliRDHFCuts.h:198
void SetOptPileup(Int_t opt=0)
Definition: AliRDHFCuts.h:224
void SetTopomaticCutOnDDaughters(Double_t TopoCut)
void SetTriggerMask(ULong64_t mask=0)
Definition: AliRDHFCuts.h:68