ATLAS Offline Software
PurityAnalysis.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
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 
34 class PurityAnalysis : public TrackAnalysis {
35 
36 public:
37 
39 
40 public:
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;
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 
75 private:
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 
88 private:
90 
91  std::map<std::string, TH1F*> m_histos;
92 
93  Efficiency1D* m_eff_pt = 0;
94  Efficiency1D* m_eff_ptp = 0;
95  Efficiency1D* m_eff_ptm = 0;
96 
97  Efficiency1D* m_eff_eta = 0;
98  Efficiency1D* m_eff_phi = 0;
99  Efficiency1D* m_eff_z0 = 0;
100  Efficiency1D* m_eff_d0 = 0;
101  Efficiency1D* m_eff_a0 = 0;
102 
103  Efficiency1D* m_purity_pt = 0;
104  Efficiency1D* m_purity_eta = 0;
105  Efficiency1D* m_purity_phi = 0;
106  Efficiency1D* m_purity_z0 = 0;
107  Efficiency1D* m_purity_d0 = 0;
108  Efficiency1D* m_purity_a0 = 0;
109 
110  // Efficiency2D* m_eff_pteta;
111  // Efficiency2D* m_eff_etapt;
112 
113  TH1F* m_hDeltaR = 0;
114 
116  int m_Nreco;
117  int m_Nref;
119 
120  TH1F* m_hchi2 = 0;
121 
123  bool m_print;
124 
125 };
126 
127 
128 
129 inline 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 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TIDA::Associator
Definition: TIDAAssociator.h:24
Track.h
PurityAnalysis::m_purity_pt
Efficiency1D * m_purity_pt
Definition: PurityAnalysis.h:103
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
m_dir
TDirectory & m_dir
The directory we need to return to.
Definition: OutputStreamData.cxx:41
PurityAnalysis::m_eff_phi
Efficiency1D * m_eff_phi
Definition: PurityAnalysis.h:98
TrackAnalysis.h
TrackAnalysis::execute
virtual void execute(const std::vector< TIDA::Track * > &tracks1, const std::vector< TIDA::Track * > &tracks2, TrackAssociator *matcher)=0
Resplot.h
PurityAnalysis::addHistogram
void addHistogram(TH1F *h)
Definition: PurityAnalysis.h:77
PurityAnalysis::m_eff_pt
Efficiency1D * m_eff_pt
Definition: PurityAnalysis.h:93
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
PurityAnalysis::m_purity_phi
Efficiency1D * m_purity_phi
Definition: PurityAnalysis.h:105
TIDDirectory
Definition: TIDDirectory.h:25
TIDDirectory.h
class to keep a directory for each object in a root sort of way, but needed to keep the root objects ...
TrackAnalysis::name
const std::string & name() const
return identifier
Definition: TrackAnalysis.h:52
Efficiency1D
Definition: Efficiency1D.h:19
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Efficiency1D.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
PurityAnalysis::m_purity_eta
Efficiency1D * m_purity_eta
Definition: PurityAnalysis.h:104
beamspotman.n
n
Definition: beamspotman.py:731
PurityAnalysis::m_Nref
int m_Nref
Definition: PurityAnalysis.h:117
TrackAnalysis
Definition: TrackAnalysis.h:32
PurityAnalysis::find
TH1F * find(const std::string &n)
Definition: PurityAnalysis.h:82
PurityAnalysis::m_print
bool m_print
flag to print out the matched tracks etc
Definition: PurityAnalysis.h:123
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PurityAnalysis::setprint
void setprint(bool p)
Definition: PurityAnalysis.h:73
PurityAnalysis::m_eff_ptm
Efficiency1D * m_eff_ptm
Definition: PurityAnalysis.h:95
PurityAnalysis::m_histos
std::map< std::string, TH1F * > m_histos
Definition: PurityAnalysis.h:91
PurityAnalysis::m_eff_eta
Efficiency1D * m_eff_eta
Definition: PurityAnalysis.h:97
operator<<
std::ostream & operator<<(std::ostream &s, const PurityAnalysis &pa)
Definition: PurityAnalysis.h:129
h
PurityAnalysis::~PurityAnalysis
~PurityAnalysis()
Definition: PurityAnalysis.h:47
PurityAnalysis::PurityAnalysis
PurityAnalysis(const std::string &name)
Definition: PurityAnalysis.h:42
PurityAnalysis::m_eff_z0
Efficiency1D * m_eff_z0
Definition: PurityAnalysis.h:99
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
PurityAnalysis::m_Nmatched
int m_Nmatched
Definition: PurityAnalysis.h:118
PurityAnalysis::m_purity_z0
Efficiency1D * m_purity_z0
Definition: PurityAnalysis.h:106
PurityAnalysis::m_eff_ptp
Efficiency1D * m_eff_ptp
Definition: PurityAnalysis.h:94
PurityAnalysis::m_Nreco
int m_Nreco
number of reconstructed tracks
Definition: PurityAnalysis.h:116
PurityAnalysis
Definition: PurityAnalysis.h:34