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