AliPhysics  cf1a5e2 (cf1a5e2)
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 <TBinning.h>
20 #include <THistManager.h>
21 
27 
31 
32 namespace EMCalTriggerPtAnalysis {
33 
37 AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent() :
38  TNamed(),
39  fHistos(NULL),
40  fTriggerClassManager(NULL),
41  fBinning(NULL),
42  fKineCuts(NULL),
43  fWeightHandler(NULL),
44  fComponentDebugLevel(0)
45 {
46 }
47 
52  if(fHistos) delete fHistos;
53 }
54 
60  TNamed(name,""),
61  fHistos(NULL),
63  fBinning(NULL),
64  fKineCuts(NULL),
65  fWeightHandler(NULL),
67 {
68 }
69 
75  fHistos = new THistManager(Form("Histos%s", GetName()));
77 }
78 
87  TArrayD binedges;
88  binning.CreateBinEdges(binedges);
89  TAxis *result = new TAxis(binedges.GetSize() - 1, binedges.GetArray());
90  result->SetName(name);
91  return result;
92 }
93 
99 void AliEMCalTriggerTracksAnalysisComponent::GetMachingTriggerNames(std::vector<std::string>& triggernames) const {
100  triggernames.clear();
101  if(!fTriggerClassManager) throw TriggerManagerNotFoundException(this->IsA()->GetName());
102  for(TIter trgiter = TIter(fTriggerClassManager->GetSelectedTriggerClasses()).Begin(); trgiter != TIter::End(); ++ trgiter){
103  triggernames.push_back((static_cast<AliEMCalTriggerAnaTriggerClass *>(*trgiter))->GetName());
104  }
105 }
106 
112 void AliEMCalTriggerTracksAnalysisComponent::GetAllTriggerNamesAndTitles(std::map<std::string, std::string> &triggers) const {
113  triggers.clear();
114  if(!fTriggerClassManager) {
115  throw TriggerManagerNotFoundException(this->IsA()->GetName());
116  }
117  for(TIter trgiter = TIter(fTriggerClassManager->GetAllTriggerClasses()).Begin(); trgiter != TIter::End(); ++ trgiter){
118  AliEMCalTriggerAnaTriggerClass *trgcls = static_cast<AliEMCalTriggerAnaTriggerClass *>(*trgiter);
119  triggers.insert(std::pair<std::string, std::string>(trgcls->GetName(), trgcls->GetTitle()));
120  }
121 }
122 
129  const std::vector<std::string>& triggernames, const std::string& componentName) const {
130 
131  std::cout << componentName << ", Triggers found: " << std::endl;
132  std::cout << "==========================================" << std::endl;
133  if(!triggernames.size()) return;
134  std::vector<std::string>::const_iterator trgiter = triggernames.begin();
135  std::cout << trgiter->c_str();
136  trgiter++;
137  while(trgiter != triggernames.end()){
138  std::cout << ", " << trgiter->c_str();
139  trgiter++;
140  }
141  std::cout << std::endl;
142 }
143 
144 } /* namespace EMCalTriggerPtAnalysis */
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
const AliEMCalTriggerWeightHandler * fWeightHandler
Event weight handler.
virtual void CreateBinEdges(TArrayD &binedges) const =0
Interface for binnings used by the histogram handler.
Definition: TBinning.h:21
Declaration of a management class for trigger classes.
void GetAllTriggerNamesAndTitles(std::map< std::string, std::string > &triggers) const
void ReleaseOwner()
Definition: THistManager.h:254
THistManager * fHistos
Histogram container of the analysis component.
const AliEMCalTriggerAnaClassManager * fTriggerClassManager
Global trigger class manager.
const AliEMCalTriggerKineCuts * fKineCuts
Kinematical cuts for tracks and particle selection.
Base class for analysis components in the analysis of EMCAL-triggered events.
Analysis of high- tracks in triggered events.
Container class for histograms.
Definition: THistManager.h:99
Definition of a trigger class.
Exception class for events with missing trigger configuration handler.
const AliEMCalTriggerBinningComponent * fBinning
Global binning handler.