ATLAS Offline Software
TIDAEvent.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
15 #ifndef TRIGINDETANALYSIS_TIDAEVENT_H
16 #define TRIGINDETANALYSIS_TIDAEVENT_H
17 
18 #include <iostream>
19 #include <vector>
20 #include <string>
21 
24 //#include "TrigInDetTruthEvent/TrigInDetTrackTruthMap.h"
25 
26 
27 #include "TObject.h"
28 
29 
30 
31 namespace TIDA {
32 
33 class Event : public TObject {
34 
35 public:
36 
37  Event();
38 
39  virtual ~Event();
40 
42  void run_number(unsigned r) { m_run_number = r; }
43  void event_number(unsigned long long e) { m_event_number = e; }
44  void lumi_block(unsigned lb) { m_lumi_block = lb; }
45  void time_stamp(unsigned t) { m_time_stamp = t; }
46  void bunch_crossing_id(unsigned b) { m_bunch_crossing_id = b; }
47  void mu(double m) { m_mu = m;}
48 
49  unsigned run_number() const { return m_run_number; }
50  unsigned long long event_number() const { return m_event_number; }
51  unsigned lumi_block() const { return m_lumi_block; }
52  unsigned time_stamp() const { return m_time_stamp; }
53  unsigned bunch_crossing_id() const { return m_bunch_crossing_id; }
54 
57  double mu() const { return m_mu; }
58 
62 
64  unsigned size() const { return m_chains.size(); }
65 
67  void addChain(const std::string& chainname) {
68  m_chains.push_back(TIDA::Chain(chainname));
69  }
70 
71  void addVertex(const TIDA::Vertex& v) {
72  m_vertices.push_back(v);
73  }
74 
75 
76  const std::vector<TIDA::Chain>& chains() const { return m_chains; };
77  std::vector<TIDA::Chain>& chains() { return m_chains; };
78 
79  const TIDA::Chain* chain( const std::string& s ) const;
80 
81  //void setTruthMap(TrigInDetTrackTruthMap truthmap) {
82  // m_truthmap = truthmap;
83  //}
84 
86  void clear() { m_chains.clear(); m_vertices.clear(); }
87 
89  TIDA::Chain& back() { return m_chains.back(); }
90 
91  // iterators
94 
95  std::vector<TIDA::Chain>::const_iterator begin() const { return m_chains.begin(); }
96  std::vector<TIDA::Chain>::const_iterator end() const { return m_chains.end(); }
97 
99  TIDA::Chain& operator[](int i) { return m_chains.at(i); }
100 
101  const std::vector<TIDA::Vertex>& vertices() const { return m_vertices; }
102 
103  std::vector<std::string> chainnames() const;
104 
105  void erase( const std::string& name );
106 
107 
108 private:
109 
110  unsigned m_run_number;
111  unsigned long long m_event_number;
112  unsigned m_lumi_block;
113  unsigned m_time_stamp;
114 
116  double m_mu;
117 
119  std::vector<TIDA::Chain> m_chains;
120 
121  std::vector<TIDA::Vertex> m_vertices;
122 
123  ClassDef(TIDA::Event,4)
124 
125 };
126 
127 }
128 
129 inline std::ostream& operator<<( std::ostream& s, const TIDA::Event& t ) {
130  s << "Event run: " << t.run_number()
131  << "\tevent: " << t.event_number()
132  << "\tlb: " << t.lumi_block()
133  << "\tbc: " << t.bunch_crossing_id()
134  << "\ttime: " << t.time_stamp()
135  << "\tmu: " << t.mu();
136  for ( unsigned i=0 ; i<t.vertices().size() ; i++ ) s << "\n" << t.vertices()[i];
137  for ( unsigned i=0 ; i<t.chains().size() ; i++ ) s << "\n" << t.chains()[i];
138  return s;
139 }
140 
141 
142 #endif // TRIGINDETANALYSIS_TIDAEVENT_H
143 
144 
145 
146 
147 
148 
149 
150 
151 
152 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
operator<<
std::ostream & operator<<(std::ostream &s, const TIDA::Event &t)
Definition: TIDAEvent.h:129
beamspotman.r
def r
Definition: beamspotman.py:676
TIDA::Event::chains
std::vector< TIDA::Chain > & chains()
Definition: TIDAEvent.h:77
TIDA
Test for xAOD.
Definition: Filter_AcceptAll.h:22
TIDA::Event::m_chains
std::vector< TIDA::Chain > m_chains
vertex multiplicity ?
Definition: TIDAEvent.h:119
TIDA::Event::mu
double mu() const
FIXME: what is this ? need a comment describing any not descriptive variable name.
Definition: TIDAEvent.h:57
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TIDA::Event::end
std::vector< TIDA::Chain >::const_iterator end() const
Definition: TIDAEvent.h:96
TIDA::Event::chainnames
std::vector< std::string > chainnames() const
Definition: TIDAEvent.cxx:27
TIDA::Event::bunch_crossing_id
unsigned bunch_crossing_id() const
Definition: TIDAEvent.h:53
TIDA::Event::chain
const TIDA::Chain * chain(const std::string &s) const
Definition: TIDAEvent.cxx:56
TIDA::Event::size
unsigned size() const
vertex multiplicity ?
Definition: TIDAEvent.h:64
TIDAVertex.h
TIDA::Event::m_bunch_crossing_id
unsigned m_bunch_crossing_id
Definition: TIDAEvent.h:115
TIDA::Event::begin
std::vector< TIDA::Chain >::const_iterator begin() const
Definition: TIDAEvent.h:95
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TIDA::Event::begin
std::vector< TIDA::Chain >::iterator begin()
Definition: TIDAEvent.h:92
TIDA::Event
Definition: TIDAEvent.h:33
TIDA::Event::lumi_block
void lumi_block(unsigned lb)
Definition: TIDAEvent.h:44
TIDA::Event::m_vertices
std::vector< TIDA::Vertex > m_vertices
Definition: TIDAEvent.h:121
TIDA::Event::chains
const std::vector< TIDA::Chain > & chains() const
Definition: TIDAEvent.h:76
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TIDA::Event::time_stamp
unsigned time_stamp() const
Definition: TIDAEvent.h:52
TIDA::Event::m_lumi_block
unsigned m_lumi_block
Definition: TIDAEvent.h:112
TIDA::Event::addChain
void addChain(const std::string &chainname)
methods to add and access chains
Definition: TIDAEvent.h:67
TIDA::Event::time_stamp
void time_stamp(unsigned t)
Definition: TIDAEvent.h:45
python.BunchSpacingUtils.lb
lb
Definition: BunchSpacingUtils.py:88
TIDA::Event::vertices
const std::vector< TIDA::Vertex > & vertices() const
Definition: TIDAEvent.h:101
TIDA::Event::event_number
unsigned long long event_number() const
Definition: TIDAEvent.h:50
TIDA::Event::back
TIDA::Chain & back()
get the last chain from the vector
Definition: TIDAEvent.h:89
lumiFormat.i
int i
Definition: lumiFormat.py:92
TIDA::Event::event_number
void event_number(unsigned long long e)
Definition: TIDAEvent.h:43
TIDA::Event::m_time_stamp
unsigned m_time_stamp
Definition: TIDAEvent.h:113
TIDA::Event::m_event_number
unsigned long long m_event_number
Definition: TIDAEvent.h:111
TIDA::Event::run_number
unsigned run_number() const
Definition: TIDAEvent.h:49
TIDA::Event::m_mu
double m_mu
Definition: TIDAEvent.h:116
TIDA::Event::operator[]
TIDA::Chain & operator[](int i)
vector operator
Definition: TIDAEvent.h:99
TIDA::Event::~Event
virtual ~Event()
Definition: TIDAEvent.cxx:25
TIDA::Vertex
Definition: TIDAVertex.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TIDA::Event::Event
Event()
TIDA::Chain
Definition: TIDAChain.h:28
TIDA::Event::end
std::vector< TIDA::Chain >::iterator end()
Definition: TIDAEvent.h:93
TIDA::Event::addVertex
void addVertex(const TIDA::Vertex &v)
Definition: TIDAEvent.h:71
TIDA::Event::clear
void clear()
clear the event
Definition: TIDAEvent.h:86
TIDA::Event::mu
void mu(double m)
Definition: TIDAEvent.h:47
python.PyAthena.v
v
Definition: PyAthena.py:157
TIDA::Event::lumi_block
unsigned lumi_block() const
Definition: TIDAEvent.h:51
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TIDA::Event::erase
void erase(const std::string &name)
Definition: TIDAEvent.cxx:35
TIDAChain.h
chain container, contains rois
TIDA::Event::m_run_number
unsigned m_run_number
Definition: TIDAEvent.h:110
TIDA::Event::bunch_crossing_id
void bunch_crossing_id(unsigned b)
Definition: TIDAEvent.h:46
TIDA::Event::run_number
void run_number(unsigned r)
accessors
Definition: TIDAEvent.h:42