ATLAS Offline Software
Loading...
Searching...
No Matches
TrackAnalysis.h
Go to the documentation of this file.
1/* emacs: this is -*- c++ -*- */
10
11
12#ifndef TIDA_TRACKANALYSIS_H
13#define TIDA_TRACKANALYSIS_H
14
15#include <iostream>
16#include <vector>
17#include <string>
18#include <map>
19
20
28
29#include "TH1.h"
30
31
33
34public:
35
38 TrackAnalysis( const std::string& name ) :
39 m_name(name),
42 m_event(0), m_roi(0)
43 { }
44
45 virtual ~TrackAnalysis() { }
46
47 // no copy allowed/necessary
48 TrackAnalysis(const TrackAnalysis&) = delete;
50
52 const std::string& name() const { return m_name; }
53
55 virtual void initialise() = 0;
56
57 virtual void execute( const std::vector<TIDA::Track*>& tracks1,
58 const std::vector<TIDA::Track*>& tracks2,
59 TrackAssociator* matcher ) = 0;
60
61 virtual void execute( const std::vector<TIDA::Track*>& tracks1,
62 const std::vector<TIDA::Track*>& tracks2,
63 TrackAssociator* matcher,
64 TrigObjectMatcher* /* objects */ ) {
65 execute( tracks1, tracks2, matcher );
66 }
67
68 virtual void execute( const std::vector<TIDA::Track*>& ,
69 const std::vector<TIDA::Track*>& ,
71 const TIDA::Event* ) { }
72
73 virtual void execute( const std::vector<TIDA::Track*>& tracks1,
74 const std::vector<TIDA::Track*>& tracks2,
75 TrackAssociator* matcher,
76 const TIDA::Event* event,
77 double* ) {
78 execute( tracks1, tracks2, matcher, event );
79 }
80
81 virtual void execute( const std::vector<TIDA::Track*>& ,
82 const std::vector<TIDA::Track*>& ,
84 const TIDA::Event* ,
85 double* ,
87
88
89 virtual void execute_vtx( const std::vector<TIDA::Vertex*>& ,
90 const std::vector<TIDA::Vertex*>& ,
91 const TIDA::Event* =0 ) { }
92
93
94 virtual void finalise() = 0;
95
96 // histogram map access - add a histogram
97 void addHistogram( TH1* h ) {
98 std::string name = h->GetName();
99 m_histos.insert( std::map<std::string, TH1*>::value_type( name, h) );
100 }
101
103 const std::map<std::string, TH1*>& getHistograms() const { return m_histos; }
104
105 std::map<std::string, TH1*>::const_iterator begin() const { return m_histos.begin(); }
106 std::map<std::string, TH1*>::const_iterator end() const { return m_histos.end(); }
107
109 void setBeamRef( double x, double y, double z=0 ) { m_xBeamReference = x; m_yBeamReference = y; m_zBeamReference = z; }
110 void setBeamTest( double x, double y, double z=0 ) { m_xBeamTest = x; m_yBeamTest = y; m_zBeamTest = z; }
111
112 void setBeamRef( const std::vector<double>& v ) {
113 if ( v.size()>0 ) m_xBeamReference = v[0];
114 if ( v.size()>1 ) m_yBeamReference = v[1];
115 if ( v.size()>2 ) m_zBeamReference = v[2];
116 }
117
118 void setBeamTest( const std::vector<double>& v ) {
119 if ( v.size()>0 ) m_xBeamTest = v[0];
120 if ( v.size()>1 ) m_yBeamTest = v[1];
121 if ( v.size()>2 ) m_zBeamTest = v[2];
122 }
123
124 double beamRefx() const { return m_xBeamReference; }
125 double beamRefy() const { return m_yBeamReference; }
126 double beamRefz() const { return m_zBeamReference; }
127
128 double beamTestx() const { return m_xBeamTest; }
129 double beamTesty() const { return m_yBeamTest; }
130 double beamTestz() const { return m_zBeamTest; }
131
132
134
135 const TIDA::Event* event() const { return m_event; }
137
138 const TIDARoiDescriptor* roi() const { return m_roi; }
140
141protected:
142
145 std::string m_name;
146
149 std::map<std::string, TH1*> m_histos;
150
156
161
163
166
167};
168
169
170inline std::ostream& operator<<(std::ostream& s, const TrackAnalysis& ta) {
171 return s << ta.name();
172}
173
174
175#endif // TIDA_TRACKANALYSIS_H
176
177
178
179
180
181
182
183
184
185
Basic event class to contain a vector of chains for trigger analysis.
Generic storage container - to contain objects wrapped as Features.
std::ostream & operator<<(std::ostream &s, const TrackAnalysis &ta)
TIDA::Associator< TIDA::Track > TrackAssociator
#define y
#define x
#define z
Header file for AthHistogramAlgorithm.
Describes the Region of Ineterest geometry It has basically 8 parameters.
std::map< std::string, TH1 * >::const_iterator end() const
void setBeamTest(const std::vector< double > &v)
TIDA::FeatureStore & store()
double beamRefy() const
virtual void execute(const std::vector< TIDA::Track * > &, const std::vector< TIDA::Track * > &, TrackAssociator *, const TIDA::Event *)
double m_yBeamReference
TrackAnalysis(const TrackAnalysis &)=delete
const std::map< std::string, TH1 * > & getHistograms() const
access the histograms
double beamRefx() const
double m_xBeamReference
beamline positions reference sample
void addHistogram(TH1 *h)
void setBeamRef(const std::vector< double > &v)
virtual void execute(const std::vector< TIDA::Track * > &tracks1, const std::vector< TIDA::Track * > &tracks2, TrackAssociator *matcher)=0
void setroi(TIDARoiDescriptor *r)
TIDARoiDescriptor * m_roi
void setBeamTest(double x, double y, double z=0)
std::string m_name
identifier of the of the analysis - also used for the root directory into which the histograms are pu...
void setBeamRef(double x, double y, double z=0)
set the beamline positions
virtual void execute(const std::vector< TIDA::Track * > &, const std::vector< TIDA::Track * > &, TrackAssociator *, const TIDA::Event *, double *, TIDARoiDescriptor *)
virtual ~TrackAnalysis()
const TIDA::Event * event() const
virtual void execute(const std::vector< TIDA::Track * > &tracks1, const std::vector< TIDA::Track * > &tracks2, TrackAssociator *matcher, TrigObjectMatcher *)
const std::string & name() const
return identifier
TrackAnalysis & operator=(const TrackAnalysis &)=delete
double m_zBeamReference
virtual void execute(const std::vector< TIDA::Track * > &tracks1, const std::vector< TIDA::Track * > &tracks2, TrackAssociator *matcher, const TIDA::Event *event, double *)
TIDA::FeatureStore m_store
virtual void finalise()=0
double m_xBeamTest
test sample
TIDA::Event * m_event
std::map< std::string, TH1 * >::const_iterator begin() const
double beamTestz() const
TrackAnalysis(const std::string &name)
the beam test parts are not really usable in a multithreaded environment
double beamTesty() const
double beamRefz() const
void setevent(TIDA::Event *e)
double beamTestx() const
virtual void execute_vtx(const std::vector< TIDA::Vertex * > &, const std::vector< TIDA::Vertex * > &, const TIDA::Event *=0)
const TIDARoiDescriptor * roi() const
virtual void initialise()=0
standard operation interface
std::map< std::string, TH1 * > m_histos
lookup table for the histograms by name - does this need to be in the base class?
int r
Definition globals.cxx:22