]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/ChargedHadrons/dNdPt/macros/AddTask_dNdPt_PbPbAOD.C
modified dNdPt/AlidNdPtAnalysisPbPbAOD.{h,cxx}:
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / dNdPt / macros / AddTask_dNdPt_PbPbAOD.C
1 AlidNdPtAnalysisPbPbAOD *AddTask_dNdPt_PbPbAOD( UInt_t uTriggerMask = AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral , 
2                                                 Double_t dNCrossedRowsTPC = 120, 
3                                                 char *contName = "dNdPtPbPbAOD")
4 {
5   // Creates, configures and attaches to the train a cascades check task.
6   // Get the pointer to the existing analysis manager via the static access method.
7   //==============================================================================
8   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9   if (!mgr) {
10     ::Error("AddTask_dNdPt_PbPbAOD", "No analysis manager to connect to.");
11     return NULL;
12   }   
13   
14   // Check the analysis type using the event handlers connected to the analysis manager.
15   //==============================================================================
16   if (!mgr->GetInputEventHandler()) {
17     ::Error("AddTask_dNdPt_PbPbAOD", "This task requires an input event handler");
18     return NULL;
19   }   
20   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
21   
22   // Create and configure the task
23   AlidNdPtAnalysisPbPbAOD *task = new AlidNdPtAnalysisPbPbAOD("dNdPtPbPbAOD");
24   //   UInt_t triggerMask = AliVEvent::kMB;
25   //   triggerMask |= AliVEvent::kCentral;
26   //   triggerMask |= AliVEvent::kSemiCentral;
27   
28   task->SelectCollisionCandidates(uTriggerMask);
29   
30   task->SetCutMinNCrossedRowsTPC(dNCrossedRowsTPC);
31   
32   ::Info("AddTask_dNdPt_PbPbAOD",Form("CrossedRowCut set to %.0f", task->GetCutMinNCrossedRowsTPC()));
33   
34   mgr->AddTask(task);
35   
36   AliAnalysisDataContainer *coutput = mgr->CreateContainer(Form("%s", contName), TList::Class(),  AliAnalysisManager::kOutputContainer, Form("%s:dNdPtHistos", mgr->GetCommonFileName()));
37   
38   mgr->ConnectInput( task, 0, mgr->GetCommonInputContainer());
39   mgr->ConnectOutput(task, 1, coutput);
40   
41   return task;
42 }