AliPhysics  master (3d17d9d)
AddTaskHFSystPID.C
Go to the documentation of this file.
2  bool readMC = false,
3  TString trigClass = "",
4  unsigned long long trigMask = AliVEvent::kINT7,
5  TString outputSuffix = "_ppMB_kINT7",
6  float nsigmafortag = 0.02,
7  double fracdownsampl = 1.,
8  double ptmaxdownsampl = 0.,
9  double centmin = 0.,
10  double centmax = 100.,
12  AliESDtrackCuts::ITSClusterRequirement SPDreq = AliESDtrackCuts::kAny,
13  int nClsTPC = 50,
14  bool useITSrefit=true,
15  bool useTPCrefit=true) {
16 
17  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
18  if (!mgr) {
19  ::Error("AliAnalysisTaskSEHFSystPID", "No analysis manager found.");
20  return 0;
21  }
22  if (!mgr->GetInputEventHandler()) {
23  ::Error("AliAnalysisTaskSEHFSystPID", "This task requires an input event handler");
24  return NULL;
25  }
26 
27  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
28  if(type.Contains("ESD")){
29  ::Error("AliAnalysisTaskSEHFSystPID", "This task requires to run on AOD");
30  return NULL;
31  }
32 
33  AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts();
34  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
35  if(useTPCrefit)
36  esdTrackCuts->SetRequireTPCRefit(kTRUE);
37  if(useITSrefit)
38  esdTrackCuts->SetRequireITSRefit(kTRUE);
39  esdTrackCuts->SetMinNClustersTPC(nClsTPC);
40  esdTrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
41  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,SPDreq);
42  esdTrackCuts->SetMinDCAToVertexXY(0.);
43  esdTrackCuts->SetMaxDCAToVertexZ(2.5);
44  esdTrackCuts->SetPtRange(0.,1.e10);
45 
46  //========= Add task for standard analysis to the ANALYSIS manager ====
47  AliAnalysisTaskSEHFSystPID *task = new AliAnalysisTaskSEHFSystPID("SystNsigmaPIDtask",system);
48  task->SetReadMC(readMC);
49  task->SetTriggerInfo(trigClass.Data(),trigMask);
50  task->SetESDtrackCuts(esdTrackCuts);
51  task->SetNsigmaForKaonTagging(nsigmafortag);
52  if(fracdownsampl<1.)task->EnableDownSampling(fracdownsampl,ptmaxdownsampl);
53  task->SetCentralityEstimator(estim);
54  task->SetCentralityLimits(centmin,centmax);
55  mgr->AddTask(task);
56 
57  TString outputfile = AliAnalysisManager::GetCommonFileName();
58  outputfile += Form(":PWGHF_D2H_SystNsigmaPID%s",outputSuffix.Data());
59 
60  //define input container
61  AliAnalysisDataContainer *cinput = mgr->CreateContainer("cinputPID",TChain::Class(),AliAnalysisManager::kInputContainer);
62  //define output containers
63  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("coutputPIDhistos%s",outputSuffix.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
64  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(Form("coutputPIDtree%s",outputSuffix.Data()),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
65 
66  //connect containers
67  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
68  mgr->ConnectOutput (task, 1, coutput1);
69  mgr->ConnectOutput (task, 2, coutput2);
70  return task;
71 }
void SetCentralityLimits(int mincent, int maxcent)
void SetTriggerInfo(TString trigClass, unsigned long long mask=0)
void SetCentralityEstimator(int centest=kCentV0M)
AliAnalysisTaskSEHFSystPID * AddTaskHFSystPID(int system=0, bool readMC=false, TString trigClass="", unsigned long long trigMask=AliVEvent::kINT7, TString outputSuffix="_ppMB_kINT7", float nsigmafortag=0.02, double fracdownsampl=1., double ptmaxdownsampl=0., double centmin=0., double centmax=100., int estim=AliAnalysisTaskSEHFSystPID::kCentOff, AliESDtrackCuts::ITSClusterRequirement SPDreq=AliESDtrackCuts::kAny, int nClsTPC=50, bool useITSrefit=true, bool useTPCrefit=true)
void SetESDtrackCuts(AliESDtrackCuts *trackCuts)
void SetNsigmaForKaonTagging(float nsigmamax=0.02)
const Float_t centmax
void EnableDownSampling(double fractokeep=0.1, double ptmax=1.5, int opt=0)