AliPhysics  6cf2591 (6cf2591)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskdNdeta.C
Go to the documentation of this file.
1 
24 AddTaskdNdeta(const char* which = "Forward",
25  const char* config = "dNdetaConfig.C")
26 {
27  // --- Load libraries ----------------------------------------------
28  gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
29 
30  // --- Analysis manager --------------------------------------------
31  AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
32 
33  // --- Check that we have an AOD input handler ---------------------
34  UShort_t aodInput = 0;
35  if (!(aodInput = AliForwardUtil::CheckForAOD()))
36  Fatal("","Cannot proceed without and AOD handler");
37  if (aodInput == 2 &&
38  !AliForwardUtil::CheckForTask("AliForwardMultiplicityBase"))
39  Fatal("","The relevant task wasn't added to the train");
40 
41 
42  // --- Make our object ---------------------------------------------
43  AliBasedNdetaTask* task = 0;
44  TString w(which);
45  if (w.EqualTo("Forward",TString::kIgnoreCase))
46  task = new AliForwarddNdetaTask("Forward");
47  else if (w.EqualTo("Central",TString::kIgnoreCase))
48  task = new AliCentraldNdetaTask("Central");
49  else if (w.EqualTo("MCTruth", TString::kIgnoreCase))
50  task = new AliMCTruthdNdetaTask("MCTruth");
51  else
52  Fatal("AddTaskdNdeta.C", "Unknown dN/deta task: %s", which);
53 
54  // Set-up task using a script
55  task->Configure(config);
56 
57  // Connect to manager
58  task->Connect(0,0);
59 
60  return task;
61 }
62 
63 
64 //________________________________________________________________________
65 //
66 // EOF
67 //
virtual Bool_t Configure(const char *macro="-default-")
AliAnalysisTask * AddTaskdNdeta(const char *which="Forward", const char *config="dNdetaConfig.C")
Definition: AddTaskdNdeta.C:24
virtual Bool_t Connect(const char *sumFile=0, const char *resFile=0)
static UShort_t CheckForAOD()
unsigned short UShort_t
Definition: External.C:28
static Bool_t CheckForTask(const char *clsOrName, Bool_t cls=true)