20 #include <TClonesArray.h>
22 #include "AliEmcalTriggerPatchInfo.h"
31 namespace EMCalTriggerPtAnalysis {
37 AliEMCalTriggerPatchAnalysisComponent::AliEMCalTriggerPatchAnalysisComponent() :
39 fSwapOnlineThresholds(kFALSE),
40 fSwapOfflineThresholds(kFALSE),
41 fWithEventSelection(kFALSE),
55 fSwapOnlineThresholds(kFALSE),
56 fSwapOfflineThresholds(kFALSE),
57 fWithEventSelection(withEventSelection),
86 const TAxis *patchaxes[6] = {
95 const TAxis *ampaxes[5] = {
96 DefineAxis(
"amplitudeOnline", 2000, 0., 2100.),
97 DefineAxis(
"amplitudeOffline", 2000, 0., 2100.),
104 std::map<std::string, std::string> triggerCombinations;
105 const char *triggernames[11] = {
"MinBias",
"EMCJHigh",
"EMCJLow",
"EMCGHigh",
106 "EMCGLow",
"EMCHighBoth",
"EMCHighGammaOnly",
"EMCHighJetOnly",
107 "EMCLowBoth",
"EMCLowGammaOnly",
"EMCLowJetOnly"};
109 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[0],
"min. bias events"));
110 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[1],
"jet-triggered events (high threshold)"));
111 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[2],
"jet-triggered events (low threshold)"));
112 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[3],
"gamma-triggered events (high threshold)"));
113 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[4],
"gamma-triggered events (low threshold)"));
114 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[5],
"jet and gamma triggered events (high threshold)"));
115 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[6],
"exclusively gamma-triggered events (high threshold)"));
116 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[7],
"exclusively jet-triggered events (high threshold)"));
117 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[8],
"jet and gamma triggered events (low threshold)"));
118 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[9],
"exclusively gamma-triggered events (low threshold)"));
119 triggerCombinations.insert(std::pair<std::string,std::string>(triggernames[10],
"exclusively-triggered events (low threshold)"));
121 std::string patchnames[] = {
"Level0",
"JetHigh",
"JetLow",
"GammaHigh",
"GammaLow"};
122 std::string triggermodes[] = {
"Online",
"Offline"};
123 for(std::string * triggerpatch = patchnames; triggerpatch < patchnames +
sizeof(patchnames)/
sizeof(std::string); ++triggerpatch){
124 for(std::string *triggermode = triggermodes; triggermode < triggermodes +
sizeof(triggermodes)/
sizeof(std::string); ++triggermode){
126 for(std::map<std::string, std::string>::iterator trgiter = triggerCombinations.begin(); trgiter != triggerCombinations.end(); ++trgiter){
127 printf(
"Adding patch for trigger %s in case of %s for event selection %s\n", triggerpatch->c_str(), triggermode->c_str(), trgiter->second.c_str());
128 fHistos->
CreateTHnSparse(Form(
"PatchInfo%s%s%s", triggerpatch->c_str(), triggermode->c_str(), trgiter->first.c_str()), Form(
"Patch energy for %s %s trigger patches", triggerpatch->c_str(), triggermode->c_str()), 6, patchaxes,
"s");
131 if((!strcmp(triggermode->c_str(),
"Offline")) && (!strcmp(triggerpatch->c_str(),
"Level0")))
continue;
132 printf(
"Adding patch for trigger %s in case of %s\n", triggerpatch->c_str(), triggermode->c_str());
133 fHistos->
CreateTHnSparse(Form(
"PatchInfo%s%s", triggerpatch->c_str(), triggermode->c_str()), Form(
"Patch energy for %s %s trigger patches", triggerpatch->c_str(), triggermode->c_str()), 6, patchaxes,
"s");
134 if(strcmp(triggerpatch->c_str(),
"Level0")){
136 fHistos->
CreateTHnSparse(Form(
"PatchAmplitude%s%s", triggerpatch->c_str(), triggermode->c_str()), Form(
"Patch amplitudes for %s %s trigger patches", triggerpatch->c_str(), triggermode->c_str()), 5, ampaxes,
"s");
154 AliEmcalTriggerPatchInfo *triggerpatch(NULL);
156 while((triggerpatch = dynamic_cast<AliEmcalTriggerPatchInfo *>(patchIter()))){
158 std::vector<std::string> triggernames;
160 for(std::vector<std::string>::iterator trgclassit = triggernames.begin(); trgclassit != triggernames.end(); ++trgclassit){
176 std::vector<TString> triggerclasses;
177 triggerclasses.push_back(
"JetHigh");
178 triggerclasses.push_back(
"JetLow");
179 triggerclasses.push_back(
"GammaHigh");
180 triggerclasses.push_back(
"GammaLow");
181 triggerclasses.push_back(
"Level0");
183 for(std::vector<TString>::iterator trgclassit = triggerclasses.begin(); trgclassit != triggerclasses.end(); ++trgclassit){
185 std::stringstream infohistname;
186 infohistname <<
"PatchInfo" << trgclassit->Data() << (patch->IsOfflineSimple() ?
"Offline" :
"Online");
187 if(eventType.Length()) infohistname << eventType.Data();
189 if((!eventType.Length()) &&(*trgclassit !=
"Level0")){
190 std::stringstream amphistname;
191 amphistname <<
"PatchAmplitude" << trgclassit->Data() << (patch->IsOfflineSimple() ?
"Offline" :
"Online");
204 bool isMain = patch->IsOfflineSimple() ? patch->IsMainTriggerSimple() : patch->IsMainTrigger();
205 double triggerpatchinfo[6] = {patch->GetPatchE(),patch->GetADCAmpGeVRough(),
206 static_cast<double>(patch->IsOfflineSimple() ? patch->GetADCOfflineAmp() : patch->GetADCAmp()), patch->GetEtaGeo(),
207 patch->GetPhiGeo(), isMain ? 1. : 0.};
218 bool isMain = patch->IsOfflineSimple() ? patch->IsMainTriggerSimple() : patch->IsMainTrigger();
219 double amplitudeinfo[5] = {(double)patch->GetADCAmp(), (double)patch->GetADCOfflineAmp(), (double)patch->GetEtaGeo(), (double)patch->GetPhiGeo(), isMain ? 1. : 0.};
234 Bool_t result =
false;
235 if(patch->IsOfflineSimple()){
250 Bool_t result =
false;
251 if(patch->IsOfflineSimple()){
252 result = ((!fPatchSwapThresholdsOffline && patch->IsJetHighSimple()) || (fPatchSwapThresholdsOffline && patch->IsJetLowSimple()));
254 result = ((!fPatchSwapThresholdsOnline && patch->IsJetHigh()) || (fPatchSwapThresholdsOnline && patch->IsJetLow()));
266 Bool_t result =
false;
267 if(patch->IsOfflineSimple()){
268 result = ((!fPatchSwapThresholdsOffline && patch->IsGammaLowSimple()) || (fPatchSwapThresholdsOffline && patch->IsGammaHighSimple()));
270 result = ((!fPatchSwapThresholdsOnline && patch->IsGammaLow()) || (fPatchSwapThresholdsOnline && patch->IsGammaHigh()));
282 Bool_t result =
false;
283 if(patch->IsOfflineSimple()){
284 result = ((!fPatchSwapThresholdsOffline && patch->IsGammaHighSimple()) || (fPatchSwapThresholdsOffline && patch->IsGammaLowSimple()));
286 result = ((!fPatchSwapThresholdsOnline && patch->IsGammaHigh()) || (fPatchSwapThresholdsOnline && patch->IsGammaLow()));
298 if(patch->IsLevel0())
return true;
309 const AliEmcalTriggerPatchInfo*
const patch, TString patchtype)
const {
310 Bool_t result =
false;
311 std::auto_ptr<AliEmcalTriggerPatchHandler> myhandler(NULL);
317 if(!myhandler.get())
return false;
318 return myhandler->IsOfType(patch);
virtual Bool_t IsOfType(const AliEmcalTriggerPatchInfo *const patch) const
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Bool_t fSwapThresholdsOffline
Swap thresholds for offline patches.
Bool_t fPatchSwapThresholdsOffline
Swap thresholds for offline patches.
Patch handler implementation of the jet low trigger.
virtual Bool_t IsOfType(const AliEmcalTriggerPatchInfo *const patch) const
virtual void Process(const AliEMCalTriggerEventData *const data)
void FillAmplitudeHistogram(TString histo, const AliEmcalTriggerPatchInfo *const patch)
void GetMachingTriggerNames(std::vector< std::string > &triggernames, ETriggerMethod_t usePatches)
Bool_t fWithEventSelection
Define whether patches are analysed with event selection.
TAxis * DefineAxis(const char *name, const AliEMCalTriggerBinningDimension *binning)
virtual Bool_t IsOfType(const AliEmcalTriggerPatchInfo *const patch) const
Factory class handling the identification of trigger patches as a given type.
void FillTHnSparse(const char *name, const double *x, double weight=1.)
Patch handler implementation of the level0 trigger.
void CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Patch handler implementation of the gamma low trigger.
Bool_t fSwapOnlineThresholds
Swap trigger thresholds for online patches.
AliEMCalTriggerPatchAnalysisComponent()
AliEMCalHistoContainer * fHistos
Histogram container of the analysis component.
AliEMCalTriggerBinningDimension * GetBinning(const char *name) const
ETriggerMethod_t fTriggerMethod
Trigger method used for event selection.
void FillTriggerInfoHistogram(TString histo, const AliEmcalTriggerPatchInfo *const patch)
Bool_t fSwapThresholdsOnline
Swap thresholds for online patches.
Base class for analysis components in the analysis of EMCAL-triggered events.
virtual Bool_t IsOfType(const AliEmcalTriggerPatchInfo *const patch) const
Bool_t IsPatchOfType(const AliEmcalTriggerPatchInfo *const patch, TString patchtype) const
virtual void CreateHistos()
Binning definition for a certain dimension.
Declaration of the classes AliEMCalTriggerBinningComponent and AliEMCalTriggerBinningDimension.
Analysis component for EMCAL trigger patches.
const TClonesArray * GetTriggerPatchContainer() const
void FillStandardMonitoring(const AliEmcalTriggerPatchInfo *const patch, TString eventclass="")
Bool_t fSwapOfflineThresholds
Swap trigger thresholds for offline patches.
Bool_t fPatchSwapThresholdsOnline
Swap thresholds for online patches.
Analysis component for EMCAL trigger patches.
Patch handler implementation of the gamma high trigger.
const AliEMCalTriggerBinningComponent * fBinning
Global binning handler.
virtual Bool_t IsOfType(const AliEmcalTriggerPatchInfo *const patch) const
virtual void CreateHistos()
Patch handler implementation of the jet high trigger.