AliPhysics  5b5fbb3 (5b5fbb3)
AddTaskEMCALTriggerQA.C
Go to the documentation of this file.
1 
12 {
13  // Get the pointer to the existing analysis manager via the static access method.
14  //==============================================================================
15  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
16  if (!mgr)
17  {
18  ::Error("AddTaskEMCALTriggerQA", "No analysis manager to connect to.");
19  return NULL;
20  }
21 
22  // Check the analysis type using the event handlers connected to the analysis manager.
23  //==============================================================================
24  if (!mgr->GetInputEventHandler())
25  {
26  ::Error("AddTaskEMCALTriggerQA", "This task requires an input event handler");
27  return NULL;
28  }
29 
30  TString taskName = "QAEMCALTrigger";
31 
33 
34  // Configuration
35 
36  Bool_t kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
37 
38  if(kUseKinematics) kSimulation = kTRUE;
39 
40  if(kSimulation) qatrigger->SwitchOnMCData();
41  else qatrigger->SwitchOffMCData();
42 
43  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
44 
45  if(inputDataType.Contains("AOD")) qatrigger->SwitchOffV0SignalHistograms();
46  else qatrigger->SwitchOnV0SignalHistograms();
47 
48  // Define the input/output containers
49 
51 
52  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
53 
54  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
55 
56  printf("*** Task Name %s; Output file name: %s ***\n",taskName.Data(),outputFile.Data());
57 
58  AliAnalysisDataContainer *coutput = mgr->CreateContainer(Form("%s",taskName.Data()),
59  TList::Class(), AliAnalysisManager::kOutputContainer,
60  Form("%s",outputFile.Data()));
61 
62  mgr->AddTask(qatrigger);
63  mgr->ConnectInput (qatrigger, 0, cinput1);
64  mgr->ConnectOutput (qatrigger, 1, coutput);
65 
66  return qatrigger;
67 }
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.