AliPhysics  aaf9c62 (aaf9c62)
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  Bool_t doVtxNtuple=kFALSE)
15 {
16 
17  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
18  if (!mgr) {
19  ::Error("AddTaskCombinHF", "No analysis manager to connect to.");
20  }
21 
22  //Analysis Task
23  AliRDHFCutsD0toKpi* evselCuts = 0x0;
24 
25  if(filecutName.EqualTo("")){
26  evselCuts=new AliRDHFCutsD0toKpi("EvSelCuts");
27  evselCuts->SetTriggerClass("");
28  evselCuts->SetTriggerMask(trigMask);
29  if(minCent>=0 && minCent<=110 && maxCent>=0 && maxCent<=110){
30  evselCuts->SetUseCentrality(1);
31  evselCuts->SetMinCentrality(minCent);
32  evselCuts->SetMaxCentrality(maxCent);
33  }
34  evselCuts->SetOptPileup(optPileup);
35  if(optPileup==AliRDHFCuts::kRejectPileupEvent){
36  evselCuts->ConfigurePileupCuts(minContPileup,minDzPileup);
37  evselCuts->SetUseMultDepPileupCut(multDepPileup);
38  }
39  else if(optPileup==AliRDHFCuts::kRejectMVPileupEvent){
40  evselCuts->ConfigurePileupCuts(minContPileup,minDzPileup);
41  }
42  evselCuts->SetCutOnzVertexSPD(cutOnZVertexSPD);
43  }else{
44  TFile* filecuts=TFile::Open(filecutName.Data());
45  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
46  AliFatal("Input file with cuts not found");
47  }
48  evselCuts = (AliRDHFCutsD0toKpi*)filecuts->Get(cutObjname.Data());
49  if(!evselCuts){
50  AliFatal("Cut object not found");
51  }
52  }
53  AliAnalysisTaskCheckEvSel *dTask = new AliAnalysisTaskCheckEvSel(readMC,system,evselCuts);
54  dTask->SetCutOnzVertexSPD(cutOnZVertexSPD);
55  dTask->SetEnableVertexNtuple(doVtxNtuple);
56  mgr->AddTask(dTask);
57 
58 
59  // Create containers for input/output
60 
61  TString inname = "cinpEvSelCheck";
62  TString outname = "coutEvSelCheck";
63  TString normname = "coutNorm";
64 
65  inname += suffix.Data();
66  outname += suffix.Data();
67  normname += suffix.Data();
68 
69  AliAnalysisDataContainer *cinput = mgr->CreateContainer(inname,TChain::Class(),
70  AliAnalysisManager::kInputContainer);
71  TString outputfile = AliAnalysisManager::GetCommonFileName();
72  outputfile += ":D2H_CheckEvSel";
73  outputfile += suffix.Data();
74 
75 
76  AliAnalysisDataContainer *coutput = mgr->CreateContainer(outname,TList::Class(),
77  AliAnalysisManager::kOutputContainer,
78  outputfile.Data());
79 
80  AliAnalysisDataContainer *coutputNorm = mgr->CreateContainer(normname,AliNormalizationCounter::Class(),
81  AliAnalysisManager::kOutputContainer,
82  outputfile.Data());
83 
84  mgr->ConnectInput(dTask,0,mgr->GetCommonInputContainer());
85 
86  mgr->ConnectOutput(dTask,1,coutput);
87  mgr->ConnectOutput(dTask,2,coutputNorm);
88 
89 
90  return dTask;
91 }
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
void SetEnableVertexNtuple(Bool_t dontuple)
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_t doVtxNtuple=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