15 #include <TClonesArray.h>
17 #include "AliEmcalTriggerPatchInfo.h"
26 namespace EMCalTriggerPtAnalysis {
32 AliEMCalTriggerPatchAnalysisComponent::AliEMCalTriggerPatchAnalysisComponent() :
34 fSwapOnlineThresholds(kFALSE),
35 fSwapOfflineThresholds(kFALSE)
47 fSwapOnlineThresholds(kFALSE),
48 fSwapOfflineThresholds(kFALSE)
76 const TAxis *patchaxes[6] = {
85 const TAxis *ampaxes[5] = {
86 DefineAxis(
"amplitudeOnline", 5000, 0., 5000.),
87 DefineAxis(
"amplitudeOffline", 5000, 0., 5000.),
93 std::string patchnames[] = {
"Level0",
"JetHigh",
"JetLow",
"GammaHigh",
"GammaLow"};
94 std::string triggermodes[] = {
"Online",
"Offline"};
95 for(std::string * triggerpatch = patchnames; triggerpatch < patchnames +
sizeof(patchnames)/
sizeof(std::string); ++triggerpatch){
96 for(std::string *triggermode = triggermodes; triggermode < triggermodes +
sizeof(triggermodes)/
sizeof(std::string); ++triggermode){
97 if((!strcmp(triggermode->c_str(),
"Offline")) && (!strcmp(triggerpatch->c_str(),
"Level0")))
continue;
98 printf(
"Adding patch for trigger %s in case of %s\n", triggerpatch->c_str(), triggermode->c_str());
99 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");
100 if(strcmp(triggerpatch->c_str(),
"Level0")){
102 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");
119 AliEmcalTriggerPatchInfo *triggerpatch(NULL);
121 while((triggerpatch = dynamic_cast<AliEmcalTriggerPatchInfo *>(patchIter()))){
122 bool isMain = triggerpatch->IsOfflineSimple() ? triggerpatch->IsMainTriggerSimple() : triggerpatch->IsMainTrigger();
123 double triggerpatchinfo[6] = {triggerpatch->GetPatchE(),triggerpatch->GetADCAmpGeVRough(),
124 static_cast<double>(triggerpatch->IsOfflineSimple() ? triggerpatch->GetADCOfflineAmp() : triggerpatch->GetADCAmp()), triggerpatch->GetEtaGeo(),
125 triggerpatch->GetPhiGeo(), isMain ? 1. : 0.};
126 double amplitudeinfo[5] = {triggerpatch->GetADCAmp(), triggerpatch->GetADCOfflineAmp(), triggerpatch->GetEtaGeo(), triggerpatch->GetPhiGeo(), isMain ? 1. : 0.};
127 if(triggerpatch->IsOfflineSimple()){
161 if(triggerpatch->IsLevel0()){
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
virtual void Process(const AliEMCalTriggerEventData *const data)
TAxis * DefineAxis(const char *name, const AliEMCalTriggerBinningDimension *binning)
void FillTHnSparse(const char *name, const double *x, double weight=1.)
void CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Bool_t fSwapOnlineThresholds
Swap trigger thresholds for online patches.
AliEMCalTriggerPatchAnalysisComponent()
AliEMCalHistoContainer * fHistos
Histogram container of the analysis component.
Base class for analysis components in the analysis of EMCAL-triggered events.
virtual void CreateHistos()
Analysis component for EMCAL trigger patches.
const TClonesArray * GetTriggerPatchContainer() const
AliEMCalTriggerBinningDimension * GetBinning(const char *name) const
Bool_t fSwapOfflineThresholds
Swap trigger thresholds for offline patches.
Analysis component for EMCAL trigger patches.
const AliEMCalTriggerBinningComponent * fBinning
Global binning handler.
virtual void CreateHistos()