20 #include <TClonesArray.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");
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");
218 Bool_t result =
false;
234 Bool_t result =
false;
238 result = ((!fPatchSwapThresholdsOnline && patch->
IsJetHigh()) || (fPatchSwapThresholdsOnline && patch->
IsJetLow()));
250 Bool_t result =
false;
254 result = ((!fPatchSwapThresholdsOnline && patch->
IsGammaLow()) || (fPatchSwapThresholdsOnline && patch->
IsGammaHigh()));
266 Bool_t result =
false;
270 result = ((!fPatchSwapThresholdsOnline && patch->
IsGammaHigh()) || (fPatchSwapThresholdsOnline && patch->
IsGammaLow()));
294 Bool_t result =
false;
295 std::auto_ptr<AliEmcalTriggerPatchHandler> myhandler(NULL);
301 if(!myhandler.get())
return false;
302 return myhandler->IsOfType(patch);
virtual Bool_t IsOfType(const AliEmcalTriggerPatchInfo *const patch) const
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Bool_t IsGammaHighSimple() const
Bool_t fSwapThresholdsOffline
Swap thresholds for offline patches.
Bool_t fPatchSwapThresholdsOffline
Swap thresholds for offline patches.
Patch handler implementation of the jet low trigger.
Bool_t IsJetHighSimple() const
void GetMachingTriggerNames(std::vector< std::string > &triggernames) const
Double_t GetADCAmpGeVRough() const
virtual Bool_t IsOfType(const AliEmcalTriggerPatchInfo *const patch) const
Double_t GetEtaGeo() const
virtual void Process(const AliEMCalTriggerEventData *const data)
void FillAmplitudeHistogram(TString histo, const AliEmcalTriggerPatchInfo *const patch)
Bool_t IsGammaLow() 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 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.
Main data structure storing all relevant information of EMCAL/DCAL trigger patches.
Bool_t fSwapOnlineThresholds
Swap trigger thresholds for online patches.
AliEMCalTriggerPatchAnalysisComponent()
Bool_t IsMainTrigger() const
Bool_t IsGammaHigh() const
AliEMCalHistoContainer * fHistos
Histogram container of the analysis component.
Bool_t IsMainTriggerSimple() const
Double_t GetPatchE() const
AliEMCalTriggerBinningDimension * GetBinning(const char *name) const
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.
Int_t GetADCOfflineAmp() const
Bool_t fPatchSwapThresholdsOnline
Swap thresholds for online patches.
Double_t GetPhiGeo() const
Bool_t IsGammaLowSimple() const
Class to make array of trigger patch objects in AOD/ESD events.
Analysis component for EMCAL trigger patches.
Simple event container within the high- track analysis.
Patch handler implementation of the gamma high trigger.
Bool_t IsJetLowSimple() const
const AliEMCalTriggerBinningComponent * fBinning
Global binning handler.
virtual Bool_t IsOfType(const AliEmcalTriggerPatchInfo *const patch) const
virtual void CreateHistos()
Event Data used in exchange to the different analysis components.
Patch handler implementation of the jet high trigger.
Bool_t IsOfflineSimple() const