AliPhysics  ff07904 (ff07904)
AddTaskForwardMult.C
Go to the documentation of this file.
1 
43  ULong_t runNo=0,
44  UShort_t sys=0,
45  UShort_t sNN=0,
46  Short_t field=0,
47  const char* config="ForwardAODConfig.C",
48  const char* corrs=0,
49  const char* dead=0)
50 {
51  // --- Load libraries ----------------------------------------------
52  gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
53 
54  // --- Get analysis manager ----------------------------------------
55  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
56  if (!mgr) {
57  Error("AddTaskForwardMult", "No analysis manager to connect to.");
58  return 0;
59  }
60 
61  // --- Make the task and add it to the manager ---------------------
63  if (mc) task = new AliForwardMCMultiplicityTask("Forward");
64  else task = new AliForwardMultiplicityTask("Forward");
65  task->Configure(config);
66 
67  // --- Possible set extra dead channels ----------------------------
68  if (dead && dead[0] != '\0') task->GetESDFixer().AddDead(dead);
69 
70  // --- Set alternative corrections path ----------------------------
72  if (corrs && corrs[0] != '\0') cm.SetPrefix(corrs);
73 
74  // --- Do a local initialisation with assumed values ---------------
75  if (sys > 0 && sNN > 0) {
80  // what ^= AliForwardCorrectionManager::kAcceptance;
81  if (!cm.Init(runNo, sys,sNN,field,mc,false,what))
82  Fatal("AddTaskForwardMult", "Failed to initialize corrections");
83  }
84 
85  // --- Make the output container and connect it --------------------
86  task->Connect(0,0);
87 
88  return task;
89 }
90 
108  Float_t energy=0,
109  Float_t bfield=0)
110 {
111  // --- Load libraries ----------------------------------------------
112  gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
113 
114  // --- Deduce parameters -------------------------------------------
115  TString t(type);
116  Bool_t mc = t.Contains("MC", TString::kIgnoreCase);
120 
121  return AddTaskForwardMult(mc, sys, sNN, field);
122 }
123 //
124 // EOF
125 //
static Short_t ParseMagneticField(Float_t field)
AliAnalysisTask * AddTaskForwardMult(Bool_t mc, ULong_t runNo=0, UShort_t sys=0, UShort_t sNN=0, Short_t field=0, const char *config="ForwardAODConfig.C", const char *corrs=0, const char *dead=0)
virtual void SetPrefix(const TString &prefix)
void AddDead(UShort_t d, Char_t r, UShort_t s, UShort_t t)
virtual Bool_t Connect(const char *sumFile=0, const char *resFile=0)
static UShort_t ParseCenterOfMassEnergy(UShort_t sys, Float_t cms)
virtual AliFMDESDFixer & GetESDFixer()=0
energy
Definition: HFPtSpectrum.C:44
char Char_t
Definition: External.C:18
Bool_t Init(ULong_t runNumber, UShort_t collisionSystem, UShort_t cmsNN, Short_t field, Bool_t mc=false, Bool_t satelliteCollisions=false, UInt_t what=kDefault, Bool_t force=false)
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
virtual Bool_t Configure(const char *macro="-default-")
unsigned long ULong_t
Definition: External.C:38
short Short_t
Definition: External.C:23
static UShort_t ParseCollisionSystem(const char *sys)
unsigned short UShort_t
Definition: External.C:28
bool Bool_t
Definition: External.C:53
static AliForwardCorrectionManager & Instance()