ATLAS Offline Software
Loading...
Searching...
No Matches
PurityAnalysis.h
Go to the documentation of this file.
1/* emacs: this is -*- c++ -*- */
10
11
12#ifndef ANALYSIS_PURITYANALYSIS_H
13#define ANALYSIS_PURITYANALYSIS_H
14
15#include <iostream>
16#include <vector>
17#include <map>
18
23
24// #include "TrigInDetAnalysis/Efficiency2D.h"
25
26#include "Resplot.h"
27
28
29#include "TH1F.h"
30#include "TH2F.h"
31
32
33
35
36public:
37
39
40public:
41
42 PurityAnalysis( const std::string& name ) :
43 TrackAnalysis( name ), m_Nreco(0), m_Nref(0), m_Nmatched(0), m_print(false) {
44 std::cout << "PurityAnalysis::PurityAnalysis() " << TrackAnalysis::name() << std::endl;
45 }
46
48 std::cout << "PurityAnalysis::~PurityAnalysis() " << name() << std::endl;
49 std::map<std::string, TH1F*>::iterator hitr=m_histos.begin();
50 std::map<std::string, TH1F*>::iterator hend=m_histos.end();
51 for ( ; hitr!=hend ; ++hitr ) delete hitr->second;
52
55
56 for ( int i=4 ; i-- ; ) { delete heff[i]; delete hpurity[i]; }
57
58 delete m_eff_ptp;
59 delete m_eff_ptm;
60
61 }
62
63
64
65 virtual void initialise();
66
67 virtual void execute(const std::vector<TIDA::Track*>& reftracks,
68 const std::vector<TIDA::Track*>& testtracks,
69 TrackAssociator* matcher );
70
71 virtual void finalise();
72
73 void setprint(bool p) { m_print=p; }
74
75private:
76
77 void addHistogram( TH1F* h ) {
78 std::string name = h->GetName();
79 m_histos.insert( std::map<std::string, TH1F*>::value_type( name, h) );
80 }
81
82 TH1F* find( const std::string& n ) {
83 std::map<std::string, TH1F*>::iterator hmitr = m_histos.find(n);
84 if ( hmitr!=m_histos.end() ) return hmitr->second;
85 else return 0;
86 }
87
88private:
90
91 std::map<std::string, TH1F*> m_histos;
92
96
102
109
110 // Efficiency2D* m_eff_pteta;
111 // Efficiency2D* m_eff_etapt;
112
113 TH1F* m_hDeltaR = 0;
114
119
120 TH1F* m_hchi2 = 0;
121
124
125};
126
127
128
129inline std::ostream& operator<<( std::ostream& s, const PurityAnalysis& pa ) {
130 return s << pa.name();
131}
132
133
134
135
136
137#endif // ANALYSIS_PURITYANALYSIS_H
138
139
140
141
142
143
144
145
146
147
std::ostream & operator<<(std::ostream &s, const PurityAnalysis &pa)
TIDA::Associator< TIDA::Track > TrackAssociator
Header file for AthHistogramAlgorithm.
std::map< std::string, TH1F * > m_histos
void addHistogram(TH1F *h)
bool m_print
flag to print out the matched tracks etc
Efficiency1D * m_eff_ptp
Efficiency1D * m_eff_d0
Efficiency1D * m_eff_ptm
TH1F * find(const std::string &n)
int m_Nreco
number of reconstructed tracks
PurityAnalysis(const std::string &name)
void setprint(bool p)
Efficiency1D * m_purity_a0
virtual void initialise()
book all the histograms
virtual void finalise()
calculate the efficiencies and write them out with all the histograms
TIDDirectory * m_dir
Efficiency1D * m_purity_eta
Efficiency1D * m_eff_a0
Efficiency1D * m_eff_eta
Efficiency1D * m_purity_z0
Efficiency1D * m_purity_pt
Efficiency1D * m_eff_pt
Efficiency1D * m_purity_d0
Efficiency1D * m_purity_phi
virtual void execute(const std::vector< TIDA::Track * > &reftracks, const std::vector< TIDA::Track * > &testtracks, TrackAssociator *matcher)
fill all the histograms - matched histograms, efficiencies etc
Efficiency1D * m_eff_phi
Efficiency1D * m_eff_z0
virtual void execute(const std::vector< TIDA::Track * > &tracks1, const std::vector< TIDA::Track * > &tracks2, TrackAssociator *matcher)=0
const std::string & name() const
return identifier
TrackAnalysis(const std::string &name)
the beam test parts are not really usable in a multithreaded environment