AliPhysics  f05a842 (f05a842)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskDStarSpectra.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, Bool_t doDStarVsY=kFALSE)
22 
23 {
24 
25 
26 
27  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
28 
29  if (!mgr) {
30 
31  ::Error("AddTaskDStarSpectra", "No analysis manager to connect to.");
32 
33  return NULL;
34 
35  }
36 
37 
38 
39  // cuts are stored in a TFile generated by makeTFile4CutsDStartoKpipi.C in ./macros/
40 
41  // set there the cuts!!!!!
42 
43  Bool_t stdcuts=kFALSE;
44 
45  TFile* filecuts;
46  if( cutsfile.EqualTo("") ) {
47  stdcuts=kTRUE;
48  } else {
49  filecuts=TFile::Open(cutsfile.Data());
50  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
51  AliFatal("Input file not found : check your cut object");
52  }
53  }
54 
55 
56 
57 
58 
59  AliRDHFCutsDStartoKpipi* RDHFDStartoKpipi=new AliRDHFCutsDStartoKpipi();
60 
61  if(stdcuts) {
62 
63  if(system==0) RDHFDStartoKpipi->SetStandardCutsPP2010();
64 
65  else if(system==1) {
66 
67  RDHFDStartoKpipi->SetStandardCutsPbPb2010();
68 
69  RDHFDStartoKpipi->SetMinCentrality(minC);
70 
71  RDHFDStartoKpipi->SetMinCentrality(maxC);
72 
73  RDHFDStartoKpipi->SetUseAOD049(kTRUE);
74 
75  RDHFDStartoKpipi->SetUseCentrality(AliRDHFCuts::kCentV0M);
76 
77  }
78 
79  }
80 
81  else RDHFDStartoKpipi = (AliRDHFCutsDStartoKpipi*)filecuts->Get("DStartoKpipiCuts");
82 
83  RDHFDStartoKpipi->SetName("DStartoKpipiCuts");
84 
85 
86 
87  // mm let's see if everything is ok
88 
89  if(!RDHFDStartoKpipi){
90 
91  cout<<"Specific AliRDHFCuts not found"<<endl;
92 
93  return;
94 
95  }
96 
97 
98 
99  //CREATE THE TASK
100 
101  printf("CREATE TASK\n");
102 
103  // create the task
104 
105  AliAnalysisTaskSEDStarSpectra *task = new AliAnalysisTaskSEDStarSpectra("AliAnalysisTaskSEDStarSpectra",RDHFDStartoKpipi);
106 
107  task->SetAnalysisType(anaType);
108 
109  task->SetMC(theMCon);
110 
111  task->SetRareSearch(theRareOn);
112 
114 
115  task->SetDebugLevel(0);
116 
117  task->SetDoDStarVsY(doDStarVsY);
118 
119  mgr->AddTask(task);
120 
121 
122 
123  // Create and connect containers for input/output
124 
125  usercomment = "_" + usercomment;
126 
127  TString outputfile = AliAnalysisManager::GetCommonFileName();
128 
129  outputfile += ":PWG3_D2H_DStarSpectra";
130  outputfile += usercomment;
131 
132 
133  // ------ input data ------
134  TString input = "indstar";
135  input += usercomment;
136  TString output1 = "chist1";
137  output1 += usercomment;
138  TString output2 = "DStarAll";
139  output2 += usercomment;
140  TString output3 = "DStarPID";
141  output3 += usercomment;
142  TString output4 = "cuts";
143  output4 += usercomment;
144  TString output5 = "coutputDstarNorm";
145  output5 += usercomment;
146 
147  //AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
148 
149  AliAnalysisDataContainer *cinput0 = mgr->CreateContainer(input,TChain::Class(),
150 
151  AliAnalysisManager::kInputContainer);
152 
153  // ----- output data -----
154 
155  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(output1,TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
156 
157  AliAnalysisDataContainer *coutputDStar1 = mgr->CreateContainer(output2,TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
158 
159  AliAnalysisDataContainer *coutputDStar2 = mgr->CreateContainer(output3,TList::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data());
160 
161  AliAnalysisDataContainer *coutputDStar3 = mgr->CreateContainer(output4,AliRDHFCutsDStartoKpipi::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //cuts
162 
163  AliAnalysisDataContainer *coutputDstarNorm = mgr->CreateContainer(output5,AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data());
164 
165 
166 
167  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
168 
169  mgr->ConnectOutput(task,1,coutput1);
170 
171  mgr->ConnectOutput(task,2,coutputDStar1);
172 
173  mgr->ConnectOutput(task,3,coutputDStar2);
174 
175  mgr->ConnectOutput(task,4,coutputDStar3);
176 
177  mgr->ConnectOutput(task,5,coutputDstarNorm);
178 
179 
180 
181  return task;
182 
183 }
184 
185 
186 
void SetUseAOD049(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:205
void SetUseCentrality(Int_t flag=1)
void SetMC(Bool_t theMCon)
set MC usage
int Int_t
Definition: External.C:63
void SetMinCentrality(Float_t minCentrality=0.)
Definition: AliRDHFCuts.h:51
float Float_t
Definition: External.C:68
void SetDoImpactParameterHistos(Bool_t doImp=kTRUE)
impact par study
const Bool_t doImp
const Bool_t anaType
const Bool_t theRareOn
void SetAnalysisType(Int_t anaType)
set analysis type
void SetRareSearch(Bool_t theRareOn)
set rare mesons
AliAnalysisTaskSEDStarSpectra * AddTaskDStarSpectra(Int_t system=0, Float_t minC=0, Float_t maxC=100, TString cutsfile="", TString usercomment="username", Bool_t theMCon=kFALSE, Bool_t doDStarVsY=kFALSE)
bool Bool_t
Definition: External.C:53