AliPhysics  e34b7ac (e34b7ac)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskEMCALTriggerQA.C
Go to the documentation of this file.
1 
11 {
12  // Get the pointer to the existing analysis manager via the static access method.
13  //==============================================================================
14  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
15  if (!mgr)
16  {
17  ::Error("AddTaskEMCALTriggerQA", "No analysis manager to connect to.");
18  return NULL;
19  }
20 
21  // Check the analysis type using the event handlers connected to the analysis manager.
22  //==============================================================================
23  if (!mgr->GetInputEventHandler())
24  {
25  ::Error("AddTaskEMCALTriggerQA", "This task requires an input event handler");
26  return NULL;
27  }
28 
29  TString taskName = "QAEMCALTrigger";
30 
32 
33  // Configuration
34 
35  Bool_t kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
36 
37  if(kUseKinematics) kSimulation = kTRUE;
38 
39  if(kSimulation) qatrigger->SwitchOnMCData();
40  else qatrigger->SwitchOffMCData();
41 
42  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
43 
44  if(inputDataType.Contains("AOD")) qatrigger->SwitchOffV0SignalHistograms();
45  else qatrigger->SwitchOnV0SignalHistograms();
46 
47  // Define the input/output containers
48 
49  qatrigger->GetRecoUtils()->SwitchOnBadChannelsRemoval ();
50 
51  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
52 
53  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
54 
55  printf("*** Task Name %s; Output file name: %s ***\n",taskName.Data(),outputFile.Data());
56 
57  AliAnalysisDataContainer *coutput = mgr->CreateContainer(Form("%s",taskName.Data()),
58  TList::Class(), AliAnalysisManager::kOutputContainer,
59  Form("%s",outputFile.Data()));
60 
61  mgr->AddTask(qatrigger);
62  mgr->ConnectInput (qatrigger, 0, cinput1);
63  mgr->ConnectOutput (qatrigger, 1, coutput);
64 
65  return qatrigger;
66 }
AliAnalysisTaskEMCALTriggerQA * AddTaskEMCALTriggerQA(Bool_t kSimulation=kFALSE, TString outputFile="")
Bool_t kSimulation
Declare the analysis simulation.
bool Bool_t
Definition: External.C:53
Fill histograms with basic QA information for EMCAL offline trigger.
Bool_t kUseKinematics
Use the MC information.