ATLAS Offline Software
SigAnalysis.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
12 #ifndef TIDAEXAMPLE_SIGANALYSIS_H
13 #define TIDAEXAMPLE_SIGANALYSIS_H
14 
15 #include <iostream>
16 #include <vector>
17 #include <map>
18 
23 
24 #include "TH1F.h"
25 #include "TH2F.h"
26 
27 
28 class SigAnalysis : public TrackAnalysis {
29 
30 public:
31 
33 
34 public:
35 
36  SigAnalysis( const std::string& name ) : TrackAnalysis( name ), m_Nreco(0), m_print(true), m_icount(0), m_dir(0) {
37  std::cout << "SigAnalysis::SigAnalysis() " << TrackAnalysis::name() << std::endl;
38  }
39 
41  std::cout << "SigAnalysis::~SigAnalysis() " << name() << std::endl;
44  for ( ; hitr!=hend ; hitr++ ) delete hitr->second;
45 
48 
49  for ( int i=4 ; i-- ; ) { delete heff[i]; delete hpurity[i]; }
50 
51  delete m_eff_ptp;
52  delete m_eff_ptm;
53 
54  }
55 
56 
57 
58  virtual void initialise();
59 
60  virtual void execute(const std::vector<TIDA::Track*>& reftracks,
61  const std::vector<TIDA::Track*>& testtracks,
62  TrackAssociator* matcher );
63 
64  virtual void finalise();
65 
66  void setprint(bool p) { m_print=p; }
67 
68 private:
69 
70  void addHistogram( TH1F* h ) {
71  std::string name = h->GetName();
72  m_histos.insert( std::map<std::string, TH1F*>::value_type( name, h) );
73  }
74 
75  TH1F* find( const std::string& n ) {
76  std::map<std::string, TH1F*>::iterator hmitr = m_histos.find(n);
77  if ( hmitr!=m_histos.end() ) return hmitr->second;
78  else return 0;
79  }
80 
81 private:
82 
83  std::map<std::string, TH1F*> m_histos;
84 
85  Efficiency1D* m_eff_pt = nullptr;
86  Efficiency1D* m_eff_ptp = nullptr;
87  Efficiency1D* m_eff_ptm = nullptr;
88 
89  Efficiency1D* m_eff_eta = nullptr;
90  Efficiency1D* m_eff_phi = nullptr;
91  Efficiency1D* m_eff_z0 = nullptr;
92  Efficiency1D* m_eff_d0 = nullptr;
93  Efficiency1D* m_eff_a0 = nullptr;
94 
95  Efficiency1D* m_purity_pt = nullptr;
96  Efficiency1D* m_purity_eta = nullptr;
97  Efficiency1D* m_purity_phi = nullptr;
98  Efficiency1D* m_purity_z0 = nullptr;
99  Efficiency1D* m_purity_d0 = nullptr;
100  Efficiency1D* m_purity_a0 = nullptr;
101 
102 
103  TH2F* m_h2 = nullptr;
104  TH2F* m_h2m = nullptr;
105  TH2F* m_h2r = nullptr;
106 
108  int m_Nreco;
109 
111  bool m_print;
112 
114  int m_icount;
115 
117 
118 };
119 
120 
121 
122 inline std::ostream& operator<<( std::ostream& s, const SigAnalysis& /*_s*/ ) {
123  return s;
124 }
125 
126 
127 
128 
129 
130 #endif // TIDAEXAMPLE_SIGANALYSIS_H
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TIDA::Associator
Definition: TIDAAssociator.h:24
Track.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
SigAnalysis::SigAnalysis
SigAnalysis(const std::string &name)
Definition: SigAnalysis.h:36
TrackAnalysis.h
TrackAnalysis::execute
virtual void execute(const std::vector< TIDA::Track * > &tracks1, const std::vector< TIDA::Track * > &tracks2, TrackAssociator *matcher)=0
SigAnalysis::m_eff_z0
Efficiency1D * m_eff_z0
Definition: SigAnalysis.h:91
SigAnalysis::find
TH1F * find(const std::string &n)
Definition: SigAnalysis.h:75
SigAnalysis::m_purity_phi
Efficiency1D * m_purity_phi
Definition: SigAnalysis.h:97
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
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 ...
SigAnalysis::setprint
void setprint(bool p)
Definition: SigAnalysis.h:66
Efficiency1D
Definition: Efficiency1D.h:19
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Efficiency1D.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
SigAnalysis::m_purity_pt
Efficiency1D * m_purity_pt
Definition: SigAnalysis.h:95
beamspotman.n
n
Definition: beamspotman.py:731
SigAnalysis::m_eff_phi
Efficiency1D * m_eff_phi
Definition: SigAnalysis.h:90
SigAnalysis::m_print
bool m_print
flag to print out the matched tracks etc
Definition: SigAnalysis.h:111
TrackAnalysis
Definition: TrackAnalysis.h:32
TrackAnalysis::name
std::string name() const
return identifier
Definition: TrackAnalysis.h:52
SigAnalysis
Definition: SigAnalysis.h:28
SigAnalysis::m_eff_eta
Efficiency1D * m_eff_eta
Definition: SigAnalysis.h:89
SigAnalysis::m_eff_ptp
Efficiency1D * m_eff_ptp
Definition: SigAnalysis.h:86
SigAnalysis::~SigAnalysis
~SigAnalysis()
Definition: SigAnalysis.h:40
SigAnalysis::m_purity_eta
Efficiency1D * m_purity_eta
Definition: SigAnalysis.h:96
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SigAnalysis::m_histos
std::map< std::string, TH1F * > m_histos
Definition: SigAnalysis.h:83
SigAnalysis::m_icount
int m_icount
Event counter.
Definition: SigAnalysis.h:114
SigAnalysis::m_eff_ptm
Efficiency1D * m_eff_ptm
Definition: SigAnalysis.h:87
h
SigAnalysis::m_purity_z0
Efficiency1D * m_purity_z0
Definition: SigAnalysis.h:98
SigAnalysis::addHistogram
void addHistogram(TH1F *h)
Definition: SigAnalysis.h:70
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
SigAnalysis::m_Nreco
int m_Nreco
number of reconstructed tracks
Definition: SigAnalysis.h:108
SigAnalysis::m_dir
TIDDirectory * m_dir
Definition: SigAnalysis.h:116
operator<<
std::ostream & operator<<(std::ostream &s, const SigAnalysis &)
Definition: SigAnalysis.h:122
SigAnalysis::m_eff_pt
Efficiency1D * m_eff_pt
Definition: SigAnalysis.h:85