1 /**************************************************************************
2 * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 * Base class for anaysis components. Inheriting classes have to implement the
17 * functions CreateHistos and Process.
19 * Author: Markus Fasel
23 #include "AliEMCalTriggerAnaTriggerDecision.h"
24 #include "AliEMCalTriggerBinningComponent.h"
25 #include "AliEMCalTriggerTracksAnalysisComponent.h"
27 ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerTracksAnalysisComponent)
29 namespace EMCalTriggerPtAnalysis {
31 //______________________________________________________________________________
32 AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent() :
37 fTriggerDecision(NULL)
40 * Dummy (I/O) constructor
44 //______________________________________________________________________________
45 AliEMCalTriggerTracksAnalysisComponent::~AliEMCalTriggerTracksAnalysisComponent() {
47 * Release histogram container
49 if(fHistos) delete fHistos;
52 //______________________________________________________________________________
53 AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent(const char* name) :
58 fTriggerDecision(NULL)
61 * Main constructor, to be called by the user
63 * @param name: component name
67 //______________________________________________________________________________
68 void AliEMCalTriggerTracksAnalysisComponent::CreateHistos() {
70 * Create Container for histograms. Inheriting classes overwrite this method, in which they call
71 * this and add the histograms of their choise.
73 fHistos = new AliEMCalHistoContainer(Form("Histos%s", GetName()));
74 fHistos->ReleaseOwner();
77 //______________________________________________________________________________
78 TAxis* AliEMCalTriggerTracksAnalysisComponent::DefineAxis(const char* name, const AliEMCalTriggerBinningDimension* binning) {
80 * Create and define axis
82 * @param name: Name of the axis
83 * @param binning: binning information
84 * @return: the new axis
86 TAxis *result = new TAxis(binning->GetNumberOfBins(), binning->GetBinLimits());
87 result->SetName(name);
91 //______________________________________________________________________________
92 TAxis* AliEMCalTriggerTracksAnalysisComponent::DefineAxis(const char* name, int nbins, double min, double max) {
94 * Create and define axis
96 * @param name: Name of the axis
97 * @param nbins: number of bins
98 * @param min: min. range
99 * @param max: max. range
100 * @return: the new axis
102 TAxis *result = new TAxis(nbins, min, max);
103 result->SetName(name);
107 //______________________________________________________________________________
108 void AliEMCalTriggerTracksAnalysisComponent::GetMachingTriggerNames(std::vector<std::string>& triggernames, Bool_t usePatches) {
110 * Get a set of names of trigger strings that is matching with the trigger decision.
112 * @param triggernames: output container for selected trigger names
113 * @param usePatches: determines whether we use the trigger decision from patches
115 triggernames.clear();
116 if(!fTriggerDecision) return;
117 if(fTriggerDecision->IsMinBias()) triggernames.push_back("MinBias");
118 if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCJHigh, usePatches)){
119 triggernames.push_back("EMCJHigh");
120 if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCGHigh, usePatches))
121 triggernames.push_back("EMCHighBoth");
123 triggernames.push_back("EMCHighJetOnly");
125 if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCJLow, usePatches)){
126 triggernames.push_back("EMCJLow");
127 if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCGLow, usePatches))
128 triggernames.push_back("EMCLowBoth");
130 triggernames.push_back("EMCLowJetOnly");
132 if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCGHigh, usePatches)){
133 triggernames.push_back("EMCGHigh");
134 if(!fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCJHigh, usePatches))
135 triggernames.push_back("EMCHighGammaOnly");
137 if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCGLow, usePatches)){
138 triggernames.push_back("EMCGLow");
139 if(!fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCJLow, usePatches))
140 triggernames.push_back("EMCLowGammaOnly");
144 } /* namespace EMCalTriggerPtAnalysis */