AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskDs.C
Go to the documentation of this file.
1 AliAnalysisTaskSEDs *AddTaskDs(Int_t system=0/*0=pp,1=PbPb*/,
2  Int_t storeNtuple=0,Bool_t storeNsparse=kFALSE,Bool_t storeNsparseDplus=kFALSE,Bool_t readMC=kFALSE,
3  TString filename="", TString postname="", Bool_t doCutVarHistos = kFALSE, Int_t AODProtection = 1,
4  Bool_t fillNTrklAxis = kFALSE, Int_t fillCentrAxis = 0,
5  Bool_t useRotBkg=kFALSE, Bool_t useBkgFromPhiSB=kFALSE, Bool_t useCutV0multTPCout=kFALSE,
6  Bool_t storeNsparseImpPar = kFALSE)
7 {
8  //
9  // Test macro for the AliAnalysisTaskSE for Ds candidates
10 
11  //Invariant mass histogram and
12  // association with MC truth (using MC info in AOD)
13  // Origin: R. Bala, bala@to.infn.it
14  // Modified for Ds meson: G.M. Innocenti innocent@to.infn.it
15  // Get the pointer to the existing analysis manager via the static access method.
16  //==============================================================================
17 
18  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
19  if (!mgr) {
20  ::Error("AddTaskDs", "No analysis manager to connect to.");
21  }
22 
23  Bool_t stdcuts=kFALSE;
24  TFile* filecuts;
25  if( filename.EqualTo("") ) {
26  stdcuts=kTRUE;
27  } else {
28  filecuts=TFile::Open(filename.Data());
29  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
30  AliFatal("Cut object not found: analysis will not start!\n");
31  }
32  else printf("Cut object correctly found\n");
33  }
34 
35  //Analysis Task
36 
37  AliRDHFCutsDstoKKpi* analysiscuts=new AliRDHFCutsDstoKKpi();
38 
39  if(stdcuts) {
40  if(system==0) {
41  printf("Cut object not found: standard pp cut object used\n");
42  analysiscuts->SetStandardCutsPP2010();
43  }
44  else AliFatal("Standard cut object not available for PbPb: analysis will not start!\n");
45  }
46  else analysiscuts = (AliRDHFCutsDstoKKpi*)filecuts->Get("AnalysisCuts");
47 
48  AliAnalysisTaskSEDs *dsTask = new AliAnalysisTaskSEDs("DsAnalysis",analysiscuts,storeNtuple);
49 
50  dsTask->SetReadMC(readMC);
51  //dsTask->SetDoLikeSign(kTRUE);
52  //dsTask->SetUseTPCpid(kTRUE);
53  //dsTask->SetUseTOFpid(kTRUE);
54  dsTask->SetDebugLevel(0);
55  dsTask->SetUseSelectionBit(kTRUE);
56  //dsTask->SetMassLimits(0.2);
57  dsTask->SetFillNSparse(storeNsparse);
58  dsTask->SetFillNSparseDplus(storeNsparseDplus);
59  dsTask->SetFillNSparseImpPar(storeNsparseImpPar);
60  dsTask->SetAODMismatchProtection(AODProtection);
61  dsTask->SetDoCutVarHistos(doCutVarHistos);
62  dsTask->SetUseRotBkg(useRotBkg);
63  dsTask->SetUseBkgFromPhiSB(useBkgFromPhiSB);
64  dsTask->SetUseCutV0multVsTPCout(useCutV0multTPCout);
65  dsTask->SetSystem(system);
66  dsTask->SetFillTracklets(fillNTrklAxis);
67  dsTask->SetFillCentralityAxis(fillCentrAxis);
68  mgr->AddTask(dsTask);
69 
70  // Create containers for input/output
71  TString name="cinputDs";
72  name+=postname;
73  AliAnalysisDataContainer *cinputDs = mgr->CreateContainer(name,TChain::Class(),
74  AliAnalysisManager::kInputContainer);
75  TString outputfile = AliAnalysisManager::GetCommonFileName();
76  outputfile += ":PWG3_D2H_InvMassDs";
77  outputfile+=postname;
78 
79  name="coutputDsCuts"; name+=postname;
80  AliAnalysisDataContainer *coutputDsCuts = mgr->CreateContainer(name,TList::Class(),
81  AliAnalysisManager::kOutputContainer,
82  outputfile.Data());
83 
84  name="coutputDs"; name+=postname;
85  AliAnalysisDataContainer *coutputDs = mgr->CreateContainer(name,TList::Class(),
86  AliAnalysisManager::kOutputContainer,
87  outputfile.Data());
88  name="coutputDsNorm"; name+=postname;
89  AliAnalysisDataContainer *coutputDsNorm = mgr->CreateContainer(name,AliNormalizationCounter::Class(),
90  AliAnalysisManager::kOutputContainer,
91  outputfile.Data());
92 
93  name="coutputDs2"; name+=postname;
94  if(storeNtuple){
95  AliAnalysisDataContainer *coutputDs2 = mgr->CreateContainer(name,TNtuple::Class(),
96  AliAnalysisManager::kOutputContainer,
97  outputfile.Data());
98  coutputDs2->SetSpecialOutput();
99  }
100 
101  mgr->ConnectInput(dsTask,0,mgr->GetCommonInputContainer());
102 
103  mgr->ConnectOutput(dsTask,1,coutputDs);
104 
105  mgr->ConnectOutput(dsTask,2,coutputDsCuts);
106 
107  mgr->ConnectOutput(dsTask,3,coutputDsNorm);
108 
109  if(storeNtuple){
110  mgr->ConnectOutput(dsTask,4,coutputDs2);
111  }
112 
113  return dsTask;
114 }
const char * filename
Definition: TestFCM.C:1
void SetFillNSparseDplus(Bool_t fill=kTRUE)
void SetUseRotBkg(Bool_t flag=kFALSE)
void SetUseSelectionBit(Bool_t opt=kFALSE)
void SetSystem(Int_t system)
void SetFillCentralityAxis(Int_t flag=0)
AliAnalysisTaskSEDs * AddTaskDs(Int_t system=0, Int_t storeNtuple=0, Bool_t storeNsparse=kFALSE, Bool_t storeNsparseDplus=kFALSE, Bool_t readMC=kFALSE, TString filename="", TString postname="", Bool_t doCutVarHistos=kFALSE, Int_t AODProtection=1, Bool_t fillNTrklAxis=kFALSE, Int_t fillCentrAxis=0, Bool_t useRotBkg=kFALSE, Bool_t useBkgFromPhiSB=kFALSE, Bool_t useCutV0multTPCout=kFALSE, Bool_t storeNsparseImpPar=kFALSE)
Definition: AddTaskDs.C:1
int Int_t
Definition: External.C:63
virtual void SetStandardCutsPP2010()
void SetFillTracklets(Bool_t flag)
void SetFillNSparseImpPar(Bool_t fill=kTRUE)
void SetUseBkgFromPhiSB(Bool_t flag=kFALSE)
void SetReadMC(Bool_t readMC=kTRUE)
void SetUseCutV0multVsTPCout(Bool_t flag)
void SetFillNSparse(Bool_t fill=kTRUE)
void SetDoCutVarHistos(Bool_t opt=kTRUE)
bool Bool_t
Definition: External.C:53
void SetAODMismatchProtection(Int_t opt=1)