AliPhysics  cc5d4fb (cc5d4fb)
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  evselCuts->SetCutOnzVertexSPD(cutOnZVertexSPD);
40  }else{
41  TFile* filecuts=TFile::Open(filecutName.Data());
42  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
43  AliFatal("Input file with cuts not found");
44  }
45  evselCuts = (AliRDHFCutsD0toKpi*)filecuts->Get(cutObjname.Data());
46  if(!evselCuts){
47  AliFatal("Cut object not found");
48  }
49  }
50  AliAnalysisTaskCheckEvSel *dTask = new AliAnalysisTaskCheckEvSel(readMC,system,evselCuts);
51  dTask->SetCutOnzVertexSPD(cutOnZVertexSPD);
52  dTask->SetEnableVertexNtuple(doVtxNtuple);
53  mgr->AddTask(dTask);
54 
55 
56  // Create containers for input/output
57 
58  TString inname = "cinpEvSelCheck";
59  TString outname = "coutEvSelCheck";
60  TString normname = "coutNorm";
61 
62  inname += suffix.Data();
63  outname += suffix.Data();
64  normname += suffix.Data();
65 
66  AliAnalysisDataContainer *cinput = mgr->CreateContainer(inname,TChain::Class(),
67  AliAnalysisManager::kInputContainer);
68  TString outputfile = AliAnalysisManager::GetCommonFileName();
69  outputfile += ":D2H_CheckEvSel";
70  outputfile += suffix.Data();
71 
72 
73  AliAnalysisDataContainer *coutput = mgr->CreateContainer(outname,TList::Class(),
74  AliAnalysisManager::kOutputContainer,
75  outputfile.Data());
76 
77  AliAnalysisDataContainer *coutputNorm = mgr->CreateContainer(normname,AliNormalizationCounter::Class(),
78  AliAnalysisManager::kOutputContainer,
79  outputfile.Data());
80 
81  mgr->ConnectInput(dTask,0,mgr->GetCommonInputContainer());
82 
83  mgr->ConnectOutput(dTask,1,coutput);
84  mgr->ConnectOutput(dTask,2,coutputNorm);
85 
86 
87  return dTask;
88 }
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
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)
void SetMaxCentrality(Float_t maxCentrality=100.)
Definition: AliRDHFCuts.h:52
void SetEnableVertexNtuple(Bool_t dontuple)
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