20 #include <TClonesArray.h>
24 #include "AliEMCALTriggerPatchInfo.h"
33 namespace EMCalTriggerPtAnalysis {
39 AliEMCalTriggerPatchAnalysisComponent::AliEMCalTriggerPatchAnalysisComponent() :
41 fSwapOnlineThresholds(kFALSE),
42 fSwapOfflineThresholds(kFALSE),
43 fWithEventSelection(kFALSE)
56 fSwapOnlineThresholds(kFALSE),
57 fSwapOfflineThresholds(kFALSE),
58 fWithEventSelection(withEventSelection)
86 const TAxis *patchaxes[6] = {
95 const TAxis *ampaxes[5] = {
104 std::map<std::string, std::string> triggerCombinations;
107 std::string patchnames[] = {
"Level0",
"JetHigh",
"JetLow",
"GammaHigh",
"GammaLow"};
108 std::string triggermodes[] = {
"Online",
"Offline"};
109 for(std::string * triggerpatch = patchnames; triggerpatch < patchnames +
sizeof(patchnames)/
sizeof(std::string); ++triggerpatch){
110 for(std::string *triggermode = triggermodes; triggermode < triggermodes +
sizeof(triggermodes)/
sizeof(std::string); ++triggermode){
112 for(std::map<std::string, std::string>::iterator trgiter = triggerCombinations.begin(); trgiter != triggerCombinations.end(); ++trgiter){
113 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());
114 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");
117 if((!strcmp(triggermode->c_str(),
"Offline")) && (!strcmp(triggerpatch->c_str(),
"Level0")))
continue;
118 printf(
"Adding patch for trigger %s in case of %s\n", triggerpatch->c_str(), triggermode->c_str());
119 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");
120 if(strcmp(triggerpatch->c_str(),
"Level0")){
122 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");
140 AliEMCALTriggerPatchInfo *triggerpatch(NULL);
142 while((triggerpatch = dynamic_cast<AliEMCALTriggerPatchInfo *>(patchIter()))){
144 std::vector<std::string> triggernames;
146 for(std::vector<std::string>::iterator trgclassit = triggernames.begin(); trgclassit != triggernames.end(); ++trgclassit){
162 std::vector<TString> triggerclasses;
163 triggerclasses.push_back(
"JetHigh");
164 triggerclasses.push_back(
"JetLow");
165 triggerclasses.push_back(
"GammaHigh");
166 triggerclasses.push_back(
"GammaLow");
167 triggerclasses.push_back(
"Level0");
169 for(std::vector<TString>::iterator trgclassit = triggerclasses.begin(); trgclassit != triggerclasses.end(); ++trgclassit){
171 std::stringstream infohistname;
172 infohistname <<
"PatchInfo" << trgclassit->Data() << (patch->IsOfflineSimple() ?
"Offline" :
"Online");
173 if(eventType.Length()) infohistname << eventType.Data();
175 if((!eventType.Length()) &&(*trgclassit !=
"Level0")){
176 std::stringstream amphistname;
177 amphistname <<
"PatchAmplitude" << trgclassit->Data() << (patch->IsOfflineSimple() ?
"Offline" :
"Online");
190 bool isMain = patch->IsOfflineSimple() ? patch->IsMainTriggerSimple() : patch->IsMainTrigger();
191 double triggerpatchinfo[6] = {patch->GetPatchE(),patch->GetADCAmpGeVRough(),
192 static_cast<double>(patch->IsOfflineSimple() ? patch->GetADCOfflineAmp() : patch->GetADCAmp()), patch->GetEtaGeo(),
193 patch->GetPhiGeo(), isMain ? 1. : 0.};
204 bool isMain = patch->IsOfflineSimple() ? patch->IsMainTriggerSimple() : patch->IsMainTrigger();
205 double amplitudeinfo[5] = {(double)patch->GetADCAmp(), (double)patch->GetADCOfflineAmp(), (double)patch->GetEtaGeo(), (double)patch->GetPhiGeo(), isMain ? 1. : 0.};
221 if(patch->IsOfflineSimple()){
237 if(patch->IsOfflineSimple()){
238 result = ((!fPatchSwapThresholdsOffline && patch->IsJetHighSimple()) || (fPatchSwapThresholdsOffline && patch->IsJetLowSimple()));
240 result = ((!fPatchSwapThresholdsOnline && patch->IsJetHigh()) || (fPatchSwapThresholdsOnline && patch->IsJetLow()));
253 if(patch->IsOfflineSimple()){
254 result = ((!fPatchSwapThresholdsOffline && patch->IsGammaLowSimple()) || (fPatchSwapThresholdsOffline && patch->IsGammaHighSimple()));
256 result = ((!fPatchSwapThresholdsOnline && patch->IsGammaLow()) || (fPatchSwapThresholdsOnline && patch->IsGammaHigh()));
269 if(patch->IsOfflineSimple()){
270 result = ((!fPatchSwapThresholdsOffline && patch->IsGammaHighSimple()) || (fPatchSwapThresholdsOffline && patch->IsGammaLowSimple()));
272 result = ((!fPatchSwapThresholdsOnline && patch->IsGammaHigh()) || (fPatchSwapThresholdsOnline && patch->IsGammaLow()));
284 if(patch->IsLevel0())
return true;
295 const AliEMCALTriggerPatchInfo*
const patch,
TString patchtype)
const {
297 std::unique_ptr<AliEmcalTriggerPatchHandler> myhandler;
303 if(!myhandler.get())
return false;
304 return myhandler->IsOfType(patch);
Bool_t fSwapThresholdsOffline
Swap thresholds for offline patches.
Bool_t fPatchSwapThresholdsOffline
Swap thresholds for offline patches.
Patch handler implementation of the jet low trigger.
Class creating a linear binning, used in the histogram manager.
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.
virtual Bool_t IsOfType(const AliEMCALTriggerPatchInfo *const patch) const
TBinning * GetBinning(const char *name) const
Interface for binnings used by the histogram handler.
Factory class handling the identification of trigger patches as a given type.
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
Patch handler implementation of the level0 trigger.
void FillTriggerInfoHistogram(TString histo, const AliEMCALTriggerPatchInfo *const patch)
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()
THistManager * fHistos
Histogram container of the analysis component.
void FillStandardMonitoring(const AliEMCALTriggerPatchInfo *const patch, TString eventclass="")
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()
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)
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
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
TAxis * DefineAxis(const char *name, const TBinning &binning)
Patch handler implementation of the jet high trigger.