20 #include <TClonesArray.h>
22 #include "AliEMCALTriggerPatchInfo.h"
31 namespace EMCalTriggerPtAnalysis {
37 AliEMCalTriggerPatchAnalysisComponent::AliEMCalTriggerPatchAnalysisComponent() :
39 fSwapOnlineThresholds(kFALSE),
40 fSwapOfflineThresholds(kFALSE),
41 fWithEventSelection(kFALSE)
54 fSwapOnlineThresholds(kFALSE),
55 fSwapOfflineThresholds(kFALSE),
56 fWithEventSelection(withEventSelection)
84 const TAxis *patchaxes[6] = {
93 const TAxis *ampaxes[5] = {
94 DefineAxis(
"amplitudeOnline", 2000, 0., 2100.),
95 DefineAxis(
"amplitudeOffline", 2000, 0., 2100.),
102 std::map<std::string, std::string> triggerCombinations;
105 std::string patchnames[] = {
"Level0",
"JetHigh",
"JetLow",
"GammaHigh",
"GammaLow"};
106 std::string triggermodes[] = {
"Online",
"Offline"};
107 for(std::string * triggerpatch = patchnames; triggerpatch < patchnames +
sizeof(patchnames)/
sizeof(std::string); ++triggerpatch){
108 for(std::string *triggermode = triggermodes; triggermode < triggermodes +
sizeof(triggermodes)/
sizeof(std::string); ++triggermode){
110 for(std::map<std::string, std::string>::iterator trgiter = triggerCombinations.begin(); trgiter != triggerCombinations.end(); ++trgiter){
111 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());
112 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");
115 if((!strcmp(triggermode->c_str(),
"Offline")) && (!strcmp(triggerpatch->c_str(),
"Level0")))
continue;
116 printf(
"Adding patch for trigger %s in case of %s\n", triggerpatch->c_str(), triggermode->c_str());
117 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");
118 if(strcmp(triggerpatch->c_str(),
"Level0")){
120 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");
138 AliEMCALTriggerPatchInfo *triggerpatch(NULL);
140 while((triggerpatch = dynamic_cast<AliEMCALTriggerPatchInfo *>(patchIter()))){
142 std::vector<std::string> triggernames;
144 for(std::vector<std::string>::iterator trgclassit = triggernames.begin(); trgclassit != triggernames.end(); ++trgclassit){
160 std::vector<TString> triggerclasses;
161 triggerclasses.push_back(
"JetHigh");
162 triggerclasses.push_back(
"JetLow");
163 triggerclasses.push_back(
"GammaHigh");
164 triggerclasses.push_back(
"GammaLow");
165 triggerclasses.push_back(
"Level0");
167 for(std::vector<TString>::iterator trgclassit = triggerclasses.begin(); trgclassit != triggerclasses.end(); ++trgclassit){
169 std::stringstream infohistname;
170 infohistname <<
"PatchInfo" << trgclassit->Data() << (patch->IsOfflineSimple() ?
"Offline" :
"Online");
171 if(eventType.Length()) infohistname << eventType.Data();
173 if((!eventType.Length()) &&(*trgclassit !=
"Level0")){
174 std::stringstream amphistname;
175 amphistname <<
"PatchAmplitude" << trgclassit->Data() << (patch->IsOfflineSimple() ?
"Offline" :
"Online");
188 bool isMain = patch->IsOfflineSimple() ? patch->IsMainTriggerSimple() : patch->IsMainTrigger();
189 double triggerpatchinfo[6] = {patch->GetPatchE(),patch->GetADCAmpGeVRough(),
190 static_cast<double>(patch->IsOfflineSimple() ? patch->GetADCOfflineAmp() : patch->GetADCAmp()), patch->GetEtaGeo(),
191 patch->GetPhiGeo(), isMain ? 1. : 0.};
202 bool isMain = patch->IsOfflineSimple() ? patch->IsMainTriggerSimple() : patch->IsMainTrigger();
203 double amplitudeinfo[5] = {(double)patch->GetADCAmp(), (double)patch->GetADCOfflineAmp(), (double)patch->GetEtaGeo(), (double)patch->GetPhiGeo(), isMain ? 1. : 0.};
218 Bool_t result =
false;
219 if(patch->IsOfflineSimple()){
234 Bool_t result =
false;
235 if(patch->IsOfflineSimple()){
236 result = ((!fPatchSwapThresholdsOffline && patch->IsJetHighSimple()) || (fPatchSwapThresholdsOffline && patch->IsJetLowSimple()));
238 result = ((!fPatchSwapThresholdsOnline && patch->IsJetHigh()) || (fPatchSwapThresholdsOnline && patch->IsJetLow()));
250 Bool_t result =
false;
251 if(patch->IsOfflineSimple()){
252 result = ((!fPatchSwapThresholdsOffline && patch->IsGammaLowSimple()) || (fPatchSwapThresholdsOffline && patch->IsGammaHighSimple()));
254 result = ((!fPatchSwapThresholdsOnline && patch->IsGammaLow()) || (fPatchSwapThresholdsOnline && patch->IsGammaHigh()));
266 Bool_t result =
false;
267 if(patch->IsOfflineSimple()){
268 result = ((!fPatchSwapThresholdsOffline && patch->IsGammaHighSimple()) || (fPatchSwapThresholdsOffline && patch->IsGammaLowSimple()));
270 result = ((!fPatchSwapThresholdsOnline && patch->IsGammaHigh()) || (fPatchSwapThresholdsOnline && patch->IsGammaLow()));
282 if(patch->IsLevel0())
return true;
293 const AliEMCALTriggerPatchInfo*
const patch, TString patchtype)
const {
294 Bool_t result =
false;
295 std::auto_ptr<AliEmcalTriggerPatchHandler> myhandler(NULL);
301 if(!myhandler.get())
return false;
302 return myhandler->IsOfType(patch);
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.
void GetMachingTriggerNames(std::vector< std::string > &triggernames) const
virtual void Process(const AliEMCalTriggerEventData *const data)
virtual Bool_t IsOfType(const AliEMCALTriggerPatchInfo *const patch) const
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 FillTriggerInfoHistogram(TString histo, const AliEMCALTriggerPatchInfo *const patch)
void CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
void GetAllTriggerNamesAndTitles(std::map< std::string, std::string > &triggers) const
Patch handler implementation of the gamma low trigger.
virtual Bool_t IsOfType(const AliEMCALTriggerPatchInfo *const patch) const
Bool_t fSwapOnlineThresholds
Swap trigger thresholds for online patches.
AliEMCalTriggerPatchAnalysisComponent()
AliEMCalHistoContainer * fHistos
Histogram container of the analysis component.
void FillStandardMonitoring(const AliEMCALTriggerPatchInfo *const patch, TString eventclass="")
AliEMCalTriggerBinningDimension * GetBinning(const char *name) const
Bool_t IsPatchOfType(const AliEMCALTriggerPatchInfo *const patch, TString patchtype) const
Bool_t fSwapThresholdsOnline
Swap thresholds for online patches.
Base class for analysis components in the analysis of EMCAL-triggered events.
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
Bool_t fSwapOfflineThresholds
Swap trigger thresholds for offline patches.
Bool_t fPatchSwapThresholdsOnline
Swap thresholds for online patches.
Analysis component for EMCAL trigger patches.
Simple event container within the high- track analysis.
Patch handler implementation of the gamma high trigger.
void FillAmplitudeHistogram(TString histo, const AliEMCALTriggerPatchInfo *const patch)
const AliEMCalTriggerBinningComponent * fBinning
Global binning handler.
virtual void CreateHistos()
Event Data used in exchange to the different analysis components.
virtual Bool_t IsOfType(const AliEMCALTriggerPatchInfo *const patch) const
virtual Bool_t IsOfType(const AliEMCALTriggerPatchInfo *const patch) const
Patch handler implementation of the jet high trigger.