AliPhysics  5eaf189 (5eaf189)
AddTaskCheckEvSel.C
Go to the documentation of this file.
2  Int_t system=1,
3  Bool_t readMC=kFALSE,
4  TString filecutName="",
5  TString cutObjname="",
6  ULong64_t trigMask=AliVEvent::kMB |AliVEvent::kINT7,
7  Double_t minCent=0,
8  Double_t maxCent=100,
9  Int_t cutOnZVertexSPD=0,
11  Int_t minContPileup=3,
12  Double_t minDzPileup=0.6,
13  Bool_t multDepPileup=kFALSE)
14 {
15 
16  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
17  if (!mgr) {
18  ::Error("AddTaskCombinHF", "No analysis manager to connect to.");
19  }
20 
21  //Analysis Task
22  AliRDHFCutsD0toKpi* evselCuts = 0x0;
23 
24  if(filecutName.EqualTo("")){
25  evselCuts=new AliRDHFCutsD0toKpi("EvSelCuts");
26  evselCuts->SetTriggerClass("");
27  evselCuts->SetTriggerMask(trigMask);
28  if(minCent>=0 && minCent<=110 && maxCent>=0 && maxCent<=110){
29  evselCuts->SetUseCentrality(1);
30  evselCuts->SetMinCentrality(minCent);
31  evselCuts->SetMaxCentrality(maxCent);
32  }
33  evselCuts->SetOptPileup(optPileup);
34  if(optPileup==AliRDHFCuts::kRejectPileupEvent){
35  evselCuts->ConfigurePileupCuts(minContPileup,minDzPileup);
36  evselCuts->SetUseMultDepPileupCut(multDepPileup);
37  }
38  evselCuts->SetCutOnzVertexSPD(cutOnZVertexSPD);
39  }else{
40  TFile* filecuts=TFile::Open(filecutName.Data());
41  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
42  AliFatal("Input file with cuts not found");
43  }
44  evselCuts = (AliRDHFCutsD0toKpi*)filecuts->Get(cutObjname.Data());
45  if(!evselCuts){
46  AliFatal("Cut object not found");
47  }
48  }
49  AliAnalysisTaskCheckEvSel *dTask = new AliAnalysisTaskCheckEvSel(readMC,system,evselCuts);
50  dTask->SetCutOnzVertexSPD(cutOnZVertexSPD);
51  mgr->AddTask(dTask);
52 
53 
54  // Create containers for input/output
55 
56  TString inname = "cinpEvSelCheck";
57  TString outname = "coutEvSelCheck";
58  TString normname = "coutNorm";
59 
60  inname += suffix.Data();
61  outname += suffix.Data();
62  normname += suffix.Data();
63 
64  AliAnalysisDataContainer *cinput = mgr->CreateContainer(inname,TChain::Class(),
65  AliAnalysisManager::kInputContainer);
66  TString outputfile = AliAnalysisManager::GetCommonFileName();
67  outputfile += ":D2H_CheckEvSel";
68  outputfile += suffix.Data();
69 
70 
71  AliAnalysisDataContainer *coutput = mgr->CreateContainer(outname,TList::Class(),
72  AliAnalysisManager::kOutputContainer,
73  outputfile.Data());
74 
75  AliAnalysisDataContainer *coutputNorm = mgr->CreateContainer(normname,AliNormalizationCounter::Class(),
76  AliAnalysisManager::kOutputContainer,
77  outputfile.Data());
78 
79  mgr->ConnectInput(dTask,0,mgr->GetCommonInputContainer());
80 
81  mgr->ConnectOutput(dTask,1,coutput);
82  mgr->ConnectOutput(dTask,2,coutputNorm);
83 
84 
85  return dTask;
86 }
double Double_t
Definition: External.C:58
void SetUseMultDepPileupCut(Bool_t opt=kTRUE)
Definition: AliRDHFCuts.h:237
void ConfigurePileupCuts(Int_t minContrib=3, Float_t minDz=0.6)
Definition: AliRDHFCuts.h:233
void SetUseCentrality(Int_t flag=1)
void SetCutOnzVertexSPD(Int_t opt)
Definition: AliRDHFCuts.h:193
int Int_t
Definition: External.C:63
void SetMinCentrality(Float_t minCentrality=0.)
Definition: AliRDHFCuts.h:51
void SetMaxCentrality(Float_t maxCentrality=100.)
Definition: AliRDHFCuts.h:52
AliAnalysisTaskCheckEvSel * AddTaskCheckEvSel(TString suffix="", Int_t system=1, Bool_t readMC=kFALSE, TString filecutName="", TString cutObjname="", ULong64_t trigMask=AliVEvent::kMB|AliVEvent::kINT7, Double_t minCent=0, Double_t maxCent=100, Int_t cutOnZVertexSPD=0, Int_t optPileup=AliRDHFCuts::kRejectPileupEvent, Int_t minContPileup=3, Double_t minDzPileup=0.6, Bool_t multDepPileup=kFALSE)
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 SetTriggerMask(ULong64_t mask=0)
Definition: AliRDHFCuts.h:67