AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AddTaskEMCALTriggerQA.C
Go to the documentation of this file.
1 
10 AliAnalysisTaskEMCALTriggerQA * AddTaskEMCALTriggerQA(Bool_t kSimulation = kFALSE, TString outputFile = "", )
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  ::Error("AddTaskEMCALTriggerQA", "No analysis manager to connect to.");
17  return NULL;
18  }
19 
20  // Check the analysis type using the event handlers connected to the analysis manager.
21  //==============================================================================
22  if (!mgr->GetInputEventHandler()) {
23  ::Error("AddTaskEMCALTriggerQA", "This task requires an input event handler");
24  return NULL;
25  }
26 
27  AliAnalysisTaskEMCALTriggerQA * qatrigger = new AliAnalysisTaskEMCALTriggerQA("QAEMCALTrigger");
28 
29  // Configuration
30 
31  Bool_t kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
32 
33  if(kUseKinematics) kSimulation = kTRUE;
34 
35  if(kSimulation) qatrigger->SwitchOnMCData();
36  else qatrigger->SwitchOffMCData();
37 
38  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
39 
40  if(inputDataType.Contains("AOD")) qatrigger->SwitchOffV0SignalHistograms();
41  else qatrigger->SwitchOnV0SignalHistograms();
42 
43  // Define the input/output containers
44 
45  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
46 
47  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
48 
49  AliAnalysisDataContainer *coutput = 0;
50  if(outputFile.Length()==0)
51  coutput = mgr->CreateContainer("EMCALQATrigger", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EMCALQATrigger",outputFile.Data()));
52  else
53  coutput = mgr->CreateContainer("EMCALQATrigger", TList::Class(), AliAnalysisManager::kOutputContainer, outputFile.Data());
54 
55  mgr->AddTask(qatrigger);
56  mgr->ConnectInput (qatrigger, 0, cinput1);
57  mgr->ConnectOutput (qatrigger, 1, coutput);
58 
59  return qatrigger;
60 }
AliAnalysisTaskEMCALTriggerQA * AddTaskEMCALTriggerQA(Bool_t kSimulation=kFALSE, TString outputFile="",)
Bool_t kSimulation
Declare the analysis simulation.
Fill histograms with basic QA information for EMCAL offline trigger.
Bool_t kUseKinematics
Use the MC information.