20 #include <TClonesArray.h>
23 #include "AliEMCALTriggerPatchInfo.h"
32 namespace EMCalTriggerPtAnalysis {
38 AliEMCalTriggerPatchAnalysisComponent::AliEMCalTriggerPatchAnalysisComponent() :
40 fSwapOnlineThresholds(kFALSE),
41 fSwapOfflineThresholds(kFALSE),
42 fWithEventSelection(kFALSE)
55 fSwapOnlineThresholds(kFALSE),
56 fSwapOfflineThresholds(kFALSE),
57 fWithEventSelection(withEventSelection)
85 const TAxis *patchaxes[6] = {
94 const TAxis *ampaxes[5] = {
95 DefineAxis(
"amplitudeOnline", 2000, 0., 2100.),
96 DefineAxis(
"amplitudeOffline", 2000, 0., 2100.),
103 std::map<std::string, std::string> triggerCombinations;
106 std::string patchnames[] = {
"Level0",
"JetHigh",
"JetLow",
"GammaHigh",
"GammaLow"};
107 std::string triggermodes[] = {
"Online",
"Offline"};
108 for(std::string * triggerpatch = patchnames; triggerpatch < patchnames +
sizeof(patchnames)/
sizeof(std::string); ++triggerpatch){
109 for(std::string *triggermode = triggermodes; triggermode < triggermodes +
sizeof(triggermodes)/
sizeof(std::string); ++triggermode){
111 for(std::map<std::string, std::string>::iterator trgiter = triggerCombinations.begin(); trgiter != triggerCombinations.end(); ++trgiter){
112 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());
113 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");
116 if((!strcmp(triggermode->c_str(),
"Offline")) && (!strcmp(triggerpatch->c_str(),
"Level0")))
continue;
117 printf(
"Adding patch for trigger %s in case of %s\n", triggerpatch->c_str(), triggermode->c_str());
118 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");
119 if(strcmp(triggerpatch->c_str(),
"Level0")){
121 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");
139 AliEMCALTriggerPatchInfo *triggerpatch(NULL);
141 while((triggerpatch = dynamic_cast<AliEMCALTriggerPatchInfo *>(patchIter()))){
143 std::vector<std::string> triggernames;
145 for(std::vector<std::string>::iterator trgclassit = triggernames.begin(); trgclassit != triggernames.end(); ++trgclassit){
161 std::vector<TString> triggerclasses;
162 triggerclasses.push_back(
"JetHigh");
163 triggerclasses.push_back(
"JetLow");
164 triggerclasses.push_back(
"GammaHigh");
165 triggerclasses.push_back(
"GammaLow");
166 triggerclasses.push_back(
"Level0");
168 for(std::vector<TString>::iterator trgclassit = triggerclasses.begin(); trgclassit != triggerclasses.end(); ++trgclassit){
170 std::stringstream infohistname;
171 infohistname <<
"PatchInfo" << trgclassit->Data() << (patch->IsOfflineSimple() ?
"Offline" :
"Online");
172 if(eventType.Length()) infohistname << eventType.Data();
174 if((!eventType.Length()) &&(*trgclassit !=
"Level0")){
175 std::stringstream amphistname;
176 amphistname <<
"PatchAmplitude" << trgclassit->Data() << (patch->IsOfflineSimple() ?
"Offline" :
"Online");
189 bool isMain = patch->IsOfflineSimple() ? patch->IsMainTriggerSimple() : patch->IsMainTrigger();
190 double triggerpatchinfo[6] = {patch->GetPatchE(),patch->GetADCAmpGeVRough(),
191 static_cast<double>(patch->IsOfflineSimple() ? patch->GetADCOfflineAmp() : patch->GetADCAmp()), patch->GetEtaGeo(),
192 patch->GetPhiGeo(), isMain ? 1. : 0.};
203 bool isMain = patch->IsOfflineSimple() ? patch->IsMainTriggerSimple() : patch->IsMainTrigger();
204 double amplitudeinfo[5] = {(double)patch->GetADCAmp(), (double)patch->GetADCOfflineAmp(), (double)patch->GetEtaGeo(), (double)patch->GetPhiGeo(), isMain ? 1. : 0.};
219 Bool_t result =
false;
220 if(patch->IsOfflineSimple()){
235 Bool_t result =
false;
236 if(patch->IsOfflineSimple()){
237 result = ((!fPatchSwapThresholdsOffline && patch->IsJetHighSimple()) || (fPatchSwapThresholdsOffline && patch->IsJetLowSimple()));
239 result = ((!fPatchSwapThresholdsOnline && patch->IsJetHigh()) || (fPatchSwapThresholdsOnline && patch->IsJetLow()));
251 Bool_t result =
false;
252 if(patch->IsOfflineSimple()){
253 result = ((!fPatchSwapThresholdsOffline && patch->IsGammaLowSimple()) || (fPatchSwapThresholdsOffline && patch->IsGammaHighSimple()));
255 result = ((!fPatchSwapThresholdsOnline && patch->IsGammaLow()) || (fPatchSwapThresholdsOnline && patch->IsGammaHigh()));
267 Bool_t result =
false;
268 if(patch->IsOfflineSimple()){
269 result = ((!fPatchSwapThresholdsOffline && patch->IsGammaHighSimple()) || (fPatchSwapThresholdsOffline && patch->IsGammaLowSimple()));
271 result = ((!fPatchSwapThresholdsOnline && patch->IsGammaHigh()) || (fPatchSwapThresholdsOnline && patch->IsGammaLow()));
283 if(patch->IsLevel0())
return true;
294 const AliEMCALTriggerPatchInfo*
const patch, TString patchtype)
const {
295 Bool_t result =
false;
296 std::unique_ptr<AliEmcalTriggerPatchHandler> myhandler;
302 if(!myhandler.get())
return false;
303 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.
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., 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="")
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.
Analysis component for EMCAL trigger patches.
const TClonesArray * GetTriggerPatchContainer() const
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
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="")
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.