]>
Commit | Line | Data |
---|---|---|
9de87858 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
4d1a3169 | 15 | /* |
9de87858 | 16 | * Base class for anaysis components. Inheriting classes have to implement the |
17 | * functions CreateHistos and Process. | |
4d1a3169 | 18 | * |
9de87858 | 19 | * Author: Markus Fasel |
4d1a3169 | 20 | */ |
d824c93c | 21 | #include <TAxis.h> |
9de87858 | 22 | #include "AliEMCalTriggerTracksAnalysisComponent.h" |
08f5b3a3 | 23 | #include "AliEMCalTriggerBinningComponent.h" |
24 | #include "AliEMCalTriggerAnaTriggerDecision.h" | |
4d1a3169 | 25 | |
9de87858 | 26 | ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerTracksAnalysisComponent) |
4d1a3169 | 27 | |
28 | namespace EMCalTriggerPtAnalysis { | |
29 | ||
5b1df951 | 30 | //______________________________________________________________________________ |
9de87858 | 31 | AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent() : |
5b1df951 | 32 | TNamed(), |
9de87858 | 33 | fHistos(NULL), |
5b1df951 | 34 | fBinning(NULL), |
d824c93c | 35 | fKineCuts(NULL), |
36 | fTriggerDecision(NULL) | |
9de87858 | 37 | { |
38 | /* | |
5b1df951 | 39 | * Dummy (I/O) constructor |
9de87858 | 40 | */ |
4d1a3169 | 41 | } |
42 | ||
5b1df951 | 43 | //______________________________________________________________________________ |
44 | AliEMCalTriggerTracksAnalysisComponent::~AliEMCalTriggerTracksAnalysisComponent() { | |
45 | /* | |
46 | * Release histogram container | |
47 | */ | |
48 | if(fHistos) delete fHistos; | |
49 | } | |
50 | ||
51 | //______________________________________________________________________________ | |
52 | AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent(const char* name) : | |
53 | TNamed(name,""), | |
54 | fHistos(NULL), | |
55 | fBinning(NULL), | |
d824c93c | 56 | fKineCuts(NULL), |
57 | fTriggerDecision(NULL) | |
5b1df951 | 58 | { |
59 | /* | |
60 | * Main constructor, to be called by the user | |
61 | * | |
62 | * @param name: component name | |
63 | */ | |
64 | } | |
65 | ||
66 | //______________________________________________________________________________ | |
67 | void AliEMCalTriggerTracksAnalysisComponent::CreateHistos() { | |
68 | /* | |
69 | * Create Container for histograms. Inheriting classes overwrite this method, in which they call | |
70 | * this and add the histograms of their choise. | |
71 | */ | |
72 | fHistos = new AliEMCalHistoContainer(Form("Histos%s", GetName())); | |
73 | fHistos->ReleaseOwner(); | |
74 | } | |
75 | ||
d824c93c | 76 | //______________________________________________________________________________ |
77 | TAxis* AliEMCalTriggerTracksAnalysisComponent::DefineAxis(const char* name, const AliEMCalTriggerBinningDimension* binning) { | |
78 | /* | |
79 | * Create and define axis | |
80 | * | |
81 | * @param name: Name of the axis | |
82 | * @param binning: binning information | |
83 | * @return: the new axis | |
84 | */ | |
85 | TAxis *result = new TAxis(binning->GetNumberOfBins(), binning->GetBinLimits()); | |
86 | result->SetName(name); | |
87 | return result; | |
88 | } | |
89 | ||
90 | //______________________________________________________________________________ | |
91 | TAxis* AliEMCalTriggerTracksAnalysisComponent::DefineAxis(const char* name, int nbins, double min, double max) { | |
92 | /* | |
93 | * Create and define axis | |
94 | * | |
95 | * @param name: Name of the axis | |
96 | * @param nbins: number of bins | |
97 | * @param min: min. range | |
98 | * @param max: max. range | |
99 | * @return: the new axis | |
100 | */ | |
101 | TAxis *result = new TAxis(nbins, min, max); | |
102 | result->SetName(name); | |
103 | return result; | |
104 | } | |
105 | ||
106 | //______________________________________________________________________________ | |
107 | void AliEMCalTriggerTracksAnalysisComponent::GetMachingTriggerNames(std::vector<std::string>& triggernames, Bool_t usePatches) { | |
108 | /* | |
109 | * Get a set of names of trigger strings that is matching with the trigger decision. | |
110 | * | |
111 | * @param triggernames: output container for selected trigger names | |
112 | * @param usePatches: determines whether we use the trigger decision from patches | |
113 | */ | |
114 | triggernames.clear(); | |
115 | if(!fTriggerDecision) return; | |
116 | if(fTriggerDecision->IsMinBias()) triggernames.push_back("MinBias"); | |
117 | if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCJHigh, usePatches)){ | |
118 | triggernames.push_back("EMCJHigh"); | |
119 | if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCGHigh, usePatches)) | |
120 | triggernames.push_back("EMCHighBoth"); | |
121 | else | |
122 | triggernames.push_back("EMCHighJetOnly"); | |
123 | } | |
124 | if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCJLow, usePatches)){ | |
125 | triggernames.push_back("EMCJLow"); | |
126 | if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCGLow, usePatches)) | |
127 | triggernames.push_back("EMCLowBoth"); | |
128 | else | |
129 | triggernames.push_back("EMCLowJetOnly"); | |
130 | } | |
131 | if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCGHigh, usePatches)){ | |
132 | triggernames.push_back("EMCGHigh"); | |
133 | if(!fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCJHigh, usePatches)) | |
134 | triggernames.push_back("EMCHighGammaOnly"); | |
135 | } | |
136 | if(fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCGLow, usePatches)){ | |
137 | triggernames.push_back("EMCGLow"); | |
138 | if(!fTriggerDecision->IsTriggered(AliEMCalTriggerAnaTriggerDecision::kTAEMCJLow, usePatches)) | |
139 | triggernames.push_back("EMCLowGammaOnly"); | |
140 | } | |
141 | } | |
142 | ||
4d1a3169 | 143 | } /* namespace EMCalTriggerPtAnalysis */ |
5b1df951 | 144 |