AliPhysics  vAN-20150630 (513c479)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliEMCalTriggerTracksAnalysisComponent.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 #include <iostream>
16 
17 #include <TAxis.h>
18 #include <TClass.h>
19 
25 
29 
30 namespace EMCalTriggerPtAnalysis {
31 
35 AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent() :
36  TNamed(),
37  fHistos(NULL),
38  fTriggerClassManager(NULL),
39  fBinning(NULL),
40  fKineCuts(NULL),
41  fWeightHandler(NULL),
42  fComponentDebugLevel(0)
43 {
44 }
45 
50  if(fHistos) delete fHistos;
51 }
52 
58  TNamed(name,""),
59  fHistos(NULL),
60  fTriggerClassManager(NULL),
61  fBinning(NULL),
62  fKineCuts(NULL),
63  fWeightHandler(NULL),
64  fComponentDebugLevel(0)
65 {
66 }
67 
73  fHistos = new AliEMCalHistoContainer(Form("Histos%s", GetName()));
75 }
76 
85  TAxis *result = new TAxis(binning->GetNumberOfBins(), binning->GetBinLimits());
86  result->SetName(name);
87  return result;
88 }
89 
98 TAxis* AliEMCalTriggerTracksAnalysisComponent::DefineAxis(const char* name, int nbins, double min, double max) {
99  TAxis *result = new TAxis(nbins, min, max);
100  result->SetName(name);
101  return result;
102 }
103 
109 void AliEMCalTriggerTracksAnalysisComponent::GetMachingTriggerNames(std::vector<std::string>& triggernames) const {
110  triggernames.clear();
111  if(!fTriggerClassManager) throw TriggerManagerNotFoundException(this->IsA()->GetName());
112  for(TIter trgiter = TIter(fTriggerClassManager->GetSelectedTriggerClasses()).Begin(); trgiter != TIter::End(); ++ trgiter){
113  triggernames.push_back((static_cast<AliEMCalTriggerAnaTriggerClass *>(*trgiter))->GetName());
114  }
115 }
116 
122 void AliEMCalTriggerTracksAnalysisComponent::GetAllTriggerNamesAndTitles(std::map<std::string, std::string> &triggers) const {
123  triggers.clear();
124  if(!fTriggerClassManager) {
125  throw TriggerManagerNotFoundException(this->IsA()->GetName());
126  }
127  for(TIter trgiter = TIter(fTriggerClassManager->GetAllTriggerClasses()).Begin(); trgiter != TIter::End(); ++ trgiter){
128  AliEMCalTriggerAnaTriggerClass *trgcls = static_cast<AliEMCalTriggerAnaTriggerClass *>(*trgiter);
129  triggers.insert(std::pair<std::string, std::string>(trgcls->GetName(), trgcls->GetTitle()));
130  }
131 }
132 
139  const std::vector<std::string>& triggernames, const std::string& componentName) const {
140 
141  std::cout << componentName << ", Triggers found: " << std::endl;
142  std::cout << "==========================================" << std::endl;
143  if(!triggernames.size()) return;
144  std::vector<std::string>::const_iterator trgiter = triggernames.begin();
145  std::cout << trgiter->c_str();
146  trgiter++;
147  while(trgiter != triggernames.end()){
148  std::cout << ", " << trgiter->c_str();
149  trgiter++;
150  }
151  std::cout << std::endl;
152 }
153 
154 } /* namespace EMCalTriggerPtAnalysis */
155 
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Declaration of class AliEMCalTriggerAnaTriggerDecision, a container for trigger decision in EMCAL-tri...
Base class for analysis components.
void PrintTriggerNames(const std::vector< std::string > &, const std::string &componentName) const
void GetMachingTriggerNames(std::vector< std::string > &triggernames) const
TAxis * DefineAxis(const char *name, const AliEMCalTriggerBinningDimension *binning)
Container class for histograms for the high- charged particle analysis.
Declaration of a management class for trigger classes.
void GetAllTriggerNamesAndTitles(std::map< std::string, std::string > &triggers) const
AliEMCalHistoContainer * fHistos
Histogram container of the analysis component.
const AliEMCalTriggerAnaClassManager * fTriggerClassManager
Global trigger class manager.
Base class for analysis components in the analysis of EMCAL-triggered events.
Declaration of the classes AliEMCalTriggerBinningComponent and AliEMCalTriggerBinningDimension.
Definition of a trigger class.
Exception class for events with missing trigger configuration handler.