AliPhysics  2c8507d (2c8507d)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #include <THistManager.h>
20 
26 
30 
31 namespace EMCalTriggerPtAnalysis {
32 
36 AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent() :
37  TNamed(),
38  fHistos(NULL),
39  fTriggerClassManager(NULL),
40  fBinning(NULL),
41  fKineCuts(NULL),
42  fWeightHandler(NULL),
43  fComponentDebugLevel(0)
44 {
45 }
46 
51  if(fHistos) delete fHistos;
52 }
53 
59  TNamed(name,""),
60  fHistos(NULL),
61  fTriggerClassManager(NULL),
62  fBinning(NULL),
63  fKineCuts(NULL),
64  fWeightHandler(NULL),
65  fComponentDebugLevel(0)
66 {
67 }
68 
74  fHistos = new THistManager(Form("Histos%s", GetName()));
76 }
77 
86  TAxis *result = new TAxis(binning->GetNumberOfBins(), binning->GetBinLimits());
87  result->SetName(name);
88  return result;
89 }
90 
99 TAxis* AliEMCalTriggerTracksAnalysisComponent::DefineAxis(const char* name, int nbins, double min, double max) {
100  TAxis *result = new TAxis(nbins, min, max);
101  result->SetName(name);
102  return result;
103 }
104 
110 void AliEMCalTriggerTracksAnalysisComponent::GetMachingTriggerNames(std::vector<std::string>& triggernames) const {
111  triggernames.clear();
112  if(!fTriggerClassManager) throw TriggerManagerNotFoundException(this->IsA()->GetName());
113  for(TIter trgiter = TIter(fTriggerClassManager->GetSelectedTriggerClasses()).Begin(); trgiter != TIter::End(); ++ trgiter){
114  triggernames.push_back((static_cast<AliEMCalTriggerAnaTriggerClass *>(*trgiter))->GetName());
115  }
116 }
117 
123 void AliEMCalTriggerTracksAnalysisComponent::GetAllTriggerNamesAndTitles(std::map<std::string, std::string> &triggers) const {
124  triggers.clear();
125  if(!fTriggerClassManager) {
126  throw TriggerManagerNotFoundException(this->IsA()->GetName());
127  }
128  for(TIter trgiter = TIter(fTriggerClassManager->GetAllTriggerClasses()).Begin(); trgiter != TIter::End(); ++ trgiter){
129  AliEMCalTriggerAnaTriggerClass *trgcls = static_cast<AliEMCalTriggerAnaTriggerClass *>(*trgiter);
130  triggers.insert(std::pair<std::string, std::string>(trgcls->GetName(), trgcls->GetTitle()));
131  }
132 }
133 
140  const std::vector<std::string>& triggernames, const std::string& componentName) const {
141 
142  std::cout << componentName << ", Triggers found: " << std::endl;
143  std::cout << "==========================================" << std::endl;
144  if(!triggernames.size()) return;
145  std::vector<std::string>::const_iterator trgiter = triggernames.begin();
146  std::cout << trgiter->c_str();
147  trgiter++;
148  while(trgiter != triggernames.end()){
149  std::cout << ", " << trgiter->c_str();
150  trgiter++;
151  }
152  std::cout << std::endl;
153 }
154 
155 } /* namespace EMCalTriggerPtAnalysis */
156 
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)
Declaration of a management class for trigger classes.
void GetAllTriggerNamesAndTitles(std::map< std::string, std::string > &triggers) const
void ReleaseOwner()
Definition: THistManager.h:180
THistManager * 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.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Container class for histograms for the high- charged particle analysis.
Definition: THistManager.h:43
const Int_t nbins
Definition of a trigger class.
Exception class for events with missing trigger configuration handler.