ATLAS Offline Software
Loading...
Searching...
No Matches
ConfAnalysis.h
Go to the documentation of this file.
1/* emacs: this is -*- c++ -*- */
10
11
12#ifndef ANALYSIS_CONFANALYSIS_H
13#define ANALYSIS_CONFANALYSIS_H
14
15#include <iostream>
16#include <vector>
17#include <map>
18
26
29
30
31#include "Resplot.h"
32
33
34#include "TH1F.h"
35#include "TH2F.h"
36// #include "Reflex/Reflex.h"
37
38// using namespace ROOT::Reflex;
39
40
41inline const std::string clean( std::string s) {
42 std::replace(s.begin(), s.end(), ':', '_');
43 std::replace(s.begin(), s.end(), ';', '_');
44 return s;
45}
46
47
48class ConfAnalysis : public TrackAnalysis {
49
51
52public:
53
54 ConfAnalysis( const std::string& name, const ChainString& config, TagNProbe* TnP_tool=0 ) :
57 {
58 m_hphivsDd0res[0]=0;
59 m_hphivsDd0res[1]=0;
60 m_hphivsDd0res[2]=0;
61 m_hphivsDa0res[0]=0;
62 m_hphivsDa0res[1]=0;
63 m_hphivsDa0res[2]=0;
64 std::cout << "ConfAnalysis::ConfAnalysis() " << TrackAnalysis::name() << " ..." << std::endl;
65 setTnPtool( TnP_tool );
66 }
67
69 // std::cout << "ConfAnalysis::~ConfAnalysis() " << name() << std::endl;
70 std::map<std::string, TH1F*>::iterator hitr=m_histos.begin();
71 std::map<std::string, TH1F*>::iterator hend=m_histos.end();
72 for ( ; hitr!=hend ; ++hitr ) delete hitr->second;
73 //2D histograms
74 std::map<std::string, TH2F*>::iterator hitr2D=m_histos2D.begin();
75 std::map<std::string, TH2F*>::iterator hend2D=m_histos2D.end();
76 for ( ; hitr2D!=hend2D ; ++hitr2D ) delete hitr2D->second;
77 // tag and probe object
78 if ( m_TnP_tool ) delete m_TnP_tool;
79 }
80
81 virtual void initialise();
82 virtual void initialiseInternal();
83
84 virtual void execute(const std::vector<TIDA::Track*>& reftracks,
85 const std::vector<TIDA::Track*>& testtracks,
86 TrackAssociator* matcher,
87 TrigObjectMatcher* objects );
88
89 virtual void execute(const std::vector<TIDA::Track*>& reftracks,
90 const std::vector<TIDA::Track*>& testtracks,
91 TrackAssociator* matcher ) {
92 execute( reftracks, testtracks, matcher, (TrigObjectMatcher*)0 );
93 }
94
95 virtual void execute(const std::vector<TIDA::Track*>& reftracks,
96 const std::vector<TIDA::Track*>& testtracks,
97 TrackAssociator* matcher,
98 const TIDA::Event* ) {
99 execute( reftracks, testtracks, matcher, (TrigObjectMatcher*)0 );
100 }
101
102
103#if 0
104 virtual void execute(const std::vector<TIDA::Track*>& reftracks,
105 const std::vector<TIDA::Track*>& testtracks,
106 TrackAssociator* matcher,
108#endif
109
110 virtual void finalise();
111
112 void setprint(bool p) { m_print=p; }
113
115
117
118 const ChainString& config() const { return m_config; }
119
120 // methods for tag and probe invariant mass plots
121
122 void setTnPtool(TagNProbe* TnP_tool) { m_TnP_tool = TnP_tool; }
123
124 virtual TagNProbe* getTnPtool() { return m_TnP_tool; }
125
126 virtual TH1F* getHist_invmass() { return m_invmass; }
127
128 virtual TH1F* getHist_invmassObj() { return m_invmassObj; }
129
130private:
131
132 void addHistogram( TH1F* h ) {
133 std::string name = h->GetName();
134 m_histos.insert( std::map<std::string, TH1F*>::value_type( name, h) );
135 }
136 void addHistogram2D( TH2F* h ) {
137 std::string name = h->GetName();
138 m_histos2D.insert( std::map<std::string, TH2F*>::value_type( name, h) );
139 }
140
141 TH1F* find( const std::string& n ) {
142 std::map<std::string, TH1F*>::iterator hmitr = m_histos.find(n);
143 if ( hmitr!=m_histos.end() ) return hmitr->second;
144 else return 0;
145 }
146
147 TH2F* find2D( const std::string& n ) {
148 std::map<std::string, TH2F*>::iterator hmitr = m_histos2D.find(n);
149 if ( hmitr!=m_histos2D.end() ) return hmitr->second;
150 else return 0;
151 }
152
153private:
154
156
158
159 std::map<std::string, TH1F*> m_histos;
160 std::map<std::string, TH2F*> m_histos2D;
161
162 // tag and probe invariant mass histograms
163 TH1F* m_invmass = 0;
164 TH1F* m_invmassObj = 0;
165
166 // tag and probe object
168
171
172
176
182
186
193
194#if 0
195 TH2F* m_h2;
196 TH2F* m_h2m;
197 TH2F* m_h2r;
198#endif
199
203
206
210
214
218
221
222 // TH2F* hnpix_v_sct;
223 // TH2F* hnpix_v_sct_rec;
224 // TH2F* hnpix_v_sct_match;
225
226 TH1F* m_hDeltaR = 0;
227
229 int m_Nreco = 0;
230 int m_Nref = 0;
231 int m_Nmatched = 0;
232
237
240
243
247
251
252 Resplot* m_rnpix_d0 = 0; // new
253 Resplot* m_rnsct_d0 = 0; // new
254 Resplot* m_rntrt_d0 = 0; // new
255
259
262
263 Resplot* m_rnpixh_d0 = 0; // new
264 Resplot* m_rnscth_d0 = 0; // new
265
266 Resplot* m_rnsi_pt = 0; // new
267 Resplot* m_rnsih_pt = 0; // new
268
269 Resplot* m_rnsi_eta = 0; // new
270 Resplot* m_rnsih_eta = 0; // new
271
272 Resplot* m_rnsi_d0 = 0; // new
273 Resplot* m_rnsih_d0 = 0; // new
274
275 Resplot* m_rnbl_d0 = 0; // new
276 Resplot* m_rnblh_d0 = 0; // new
277
281
286
290
294
297
298 std::vector<Resplot*> m_res;
299
300 std::vector<Resplot*> m_retares;
301 std::vector<Resplot*> m_rphires;
302 std::vector<Resplot*> m_rzedres;
303 std::vector<Resplot*> m_rzedthetares;
304 std::vector<Resplot*> m_riptres;
305 std::vector<Resplot*> m_rptres;
306 std::vector<Resplot*> m_rd0res;
307 std::vector<Resplot*> m_rDd0res;
308 std::vector<Resplot*> m_rDa0res;
309 std::vector<Resplot*> m_rDz0res;
310
312
315
316 // std::vector<Resplot*> rd0res_95;
317 // std::vector<Resplot*> rd0res_rms;
318
319 std::vector<Resplot*> m_retaresPull;
320 std::vector<Resplot*> m_rphiresPull;
321 std::vector<Resplot*> m_rzedresPull;
322 std::vector<Resplot*> m_riptresPull;
323 std::vector<Resplot*> m_rptresPull;
324 std::vector<Resplot*> m_rd0resPull;
325
328
331
333
335
336 std::map<int, int> m_rmap;
337
339
340 TH1F* m_n_vtx_tracks = 0;
343
344 TH1F* m_n_vtx = 0;
346 TH1F* m_mu = 0;
348
350
353
355
359
361 TH1F* m_etovpt_raw = 0;
362 TH1F* m_etovpt = 0;
364
365 TH1F* m_et = 0;
367
369 bool m_print = false;
370
372
373 bool m_initialised = false;
375
378};
379
380
381
382inline std::ostream& operator<<( std::ostream& s, const ConfAnalysis& ca ) {
383 return s << ca.name();
384}
385
386
387
388
389
390#endif // ANALYSIS_CONFANALYSIS_H
391
392
393
394
395
396
397
398
399
400
std::ostream & operator<<(std::ostream &s, const ConfAnalysis &ca)
const std::string clean(std::string s)
emacs: this is -*- c++ -*-
TIDA::Associator< TIDA::Track > TrackAssociator
Header file for AthHistogramAlgorithm.
Efficiency1D * m_eff_roi_deta
TH1F * m_n_vtx_tracks
Resplot * m_rnsih_pt
Resplot * m_rChi2prob_rec
Resplot * m_h2r
Efficiency1D * m_eff_ptp
Efficiency1D * m_eff_phi
Resplot * m_deltaR_v_eta
Efficiency1D * m_purity_phi
Resplot * m_rnpix_d0
Resplot * m_rnscth_pt
Resplot * m_rRoi_dzed_vs_eta
Resplot * m_rntrt_d0
Resplot * m_rnpix_eta_rec
Resplot * m_rnsih_eta
Resplot * m_rnsct_pt_rec
Efficiency1D * m_eff_vs_ntracks2
Resplot * m_rnsct_d0_rec
Resplot * m_rntrt_eta_rec
Efficiency1D * m_eff_vs_mu
Resplot * m_rnscth_pt_rec
ConfAnalysis(const std::string &name, const ChainString &config, TagNProbe *TnP_tool=0)
Efficiency1D * m_eff_a0
Efficiency1D * m_purity_a0
void setRoi(const TIDARoiDescriptor *roi)
Resplot * m_rnpixh_pt_rec
TH1F * m_etovpt_raw
electron specific ET/PT related stuff
Efficiency1D * m_eff_vs_lb
Resplot * m_rnsihit_eta
Resplot * m_rzedreslb
ChainString m_config
Resplot * m_h2a0
Efficiency1D * m_purity_pt
std::map< std::string, TH2F * > m_histos2D
Resplot * m_rnsct_phi_rec
Efficiency1D * m_eff_vs_nvtx
Efficiency2D * m_eff_eta_vs_pt
std::vector< Resplot * > m_retaresPull
Resplot * m_h2m
int m_Nreco
number of reconstructed tracks
virtual TH1F * getHist_invmass()
std::vector< Resplot * > m_rd0resPull
Resplot * m_deltaR_v_pt
TH1F * m_hphivsDd0res[3]
Resplot * m_rChi2_rec
virtual void execute(const std::vector< TIDA::Track * > &reftracks, const std::vector< TIDA::Track * > &testtracks, TrackAssociator *matcher, const TIDA::Event *)
void addHistogram(TH1F *h)
Resplot * m_rnpix_lb
std::vector< Resplot * > m_rptres
Resplot * m_rnpix_pt_bad
Resplot * m_rnpix_d0_rec
TH1F * find(const std::string &n)
Resplot * m_rntrt_pt_bad
Efficiency1D * m_eff_vs_ntracks
bool m_initialiseFirstEvent
Efficiency1D * m_eff_vs_etovpt
virtual void execute(const std::vector< TIDA::Track * > &reftracks, const std::vector< TIDA::Track * > &testtracks, TrackAssociator *matcher, TrigObjectMatcher *objects)
const ChainString & config() const
Resplot * m_rnblh_d0
Resplot * m_rnpix_eta
Efficiency1D * m_eff_eta
virtual TagNProbe * getTnPtool()
Resplot * m_rChi2dof
TagNProbe * m_TnP_tool
Resplot * m_rnsct_eta
Resplot * m_rChi2
std::vector< Resplot * > m_rDz0res
void setTnPtool(TagNProbe *TnP_tool)
const TIDARoiDescriptor * m_roi
virtual void execute(const std::vector< TIDA::Track * > &reftracks, const std::vector< TIDA::Track * > &testtracks, TrackAssociator *matcher)
Resplot * m_rnbl_d0
TH1F * m_invmassObj
std::vector< Resplot * > m_rzedthetares
void setprint(bool p)
Resplot * m_rnpix_phi_rec
Efficiency1D * m_eff_vs_mult
virtual void initialise()
book all the histograms
Resplot * m_rChi2prob
Resplot * m_rnsi_eta
Resplot * m_rnsihit_eta_rec
Resplot * m_rnsct_lb_rec
Efficiency1D * m_eff_roi_dphi
Resplot * m_rnsct_phi
Efficiency1D * m_eff_roi_dR
Resplot * m_rntrt_phi_rec
virtual TH1F * getHist_invmassObj()
std::vector< Resplot * > m_rptresPull
std::vector< Resplot * > m_res
Resplot * m_rnpix_lb_rec
Resplot * m_rd0_vs_phi
beam spot dependent
Resplot * m_rDChi2dof
Resplot * m_rntrt_eta
Resplot * m_rnsct_vs_npix_rec
void addHistogram2D(TH2F *h)
Resplot * m_rChi2dof_rec
TH1F * m_hphivsDa0res[3]
Efficiency1D * m_purity_d0
Efficiency1D * m_eff_pt
std::vector< Resplot * > m_rd0res
Resplot * m_rnsct_pt_bad
Efficiency1D * m_eff_vs_et
Resplot * m_rnsct_eta_rec
Resplot * m_rChi2prob_bad
std::vector< Resplot * > m_retares
Resplot * m_rnsct_lb
Resplot * m_rnpixh_d0
Resplot * m_rnsi_pt
Efficiency1D * m_eff_z0
Resplot * m_rnsih_d0
Resplot * m_rChi2d_vs_Chi2d
Resplot * m_rntrt_pt
Efficiency2D * m_eff_d0_vs_pt
Resplot * m_rd0_vs_phi_rec
virtual void finalise()
calculate the efficiencies and write them out with all the histograms
std::vector< Resplot * > m_riptres
Resplot * m_z_vs_lb
Resplot * m_rntrt_d0_rec
Resplot * m_rnscth_d0
Resplot * m_rnpixh_pt
Efficiency1D * m_purity_eta
std::vector< Resplot * > m_rzedresPull
std::vector< Resplot * > m_riptresPull
Resplot * m_rnpix_phi
Resplot * m_rChi2_bad
Resplot * m_rnpix_pt_rec
std::map< int, int > m_rmap
Resplot * m_rnsct_d0
std::vector< Resplot * > m_rphires
Resplot * m_rChi2dof_bad
std::vector< Resplot * > m_rphiresPull
Resplot * m_h2a0r
virtual void initialiseInternal()
Resplot * m_h2
Resplot * m_rzedlb_rec
Resplot * m_rntrt_phi
Resplot * m_rnsi_d0
std::map< std::string, TH1F * > m_histos
void initialiseFirstEvent(bool b=true)
bool m_print
flag to print out the matched tracks etc
Resplot * m_rzedlb
Resplot * m_rnpix_pt
Resplot * m_rntrt_pt_rec
TH2F * find2D(const std::string &n)
Resplot * m_rRoi_dphi_vs_eta
Resplot * m_rRoi_deta_vs_eta
Residuals.
TIDDirectory * m_dir
std::vector< Resplot * > m_rzedres
Efficiency1D * m_eff_d0
Resplot * m_rnsct_pt
std::vector< Resplot * > m_rDa0res
Efficiency1D * m_purity_z0
std::vector< Resplot * > m_rDd0res
Efficiency1D * m_eff_ptm
Resplot * m_rnsct_vs_npix
Describes the Region of Ineterest geometry It has basically 8 parameters.
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
const TIDARoiDescriptor * roi() const