ATLAS Offline Software
EventType.h
Go to the documentation of this file.
1 // dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5  */
6 
7 #ifndef EVENTINFO_EVENTTYPE_H
8 # define EVENTINFO_EVENTTYPE_H 1
9 
23 #include <vector>
24 #include <string>
25 #include <stdint.h>
26 
92 class EventType {
93 public:
95 
96  typedef unsigned int number_type;
97  typedef std::vector<bool> BitMask;
98  typedef BitMask::const_iterator BitMaskIterator;
99  typedef BitMask::size_type EventTypeCode;
100  typedef std::pair<std::string, std::string> NameTagPair;
101  typedef std::vector<NameTagPair> NameTagPairVec;
103 
105 
106  EventType();
107  virtual ~EventType();
108 
109  EventType(const EventType&) = default;
110  EventType(EventType&&) = default;
111  EventType& operator=(const EventType&) = default;
114 
116  bool operator < (const EventType& rhs) const;
117 
119 
120  bool test(EventTypeCode type_code) const;
122 
124  std::string typeToString() const;
125 
127  std::string user_type(void) const;
128 
130  const std::string& user_type_raw(void) const;
131 
134 
136  std::string get_detdescr_tags() const;
137 
141 
143  uint64_t mc_event_number() const;
144 
146  float mc_event_weight(unsigned int iweight = 0) const;
147 
149  unsigned int n_mc_event_weights() const;
150 
152 
154 
157 
160 
164 
166 
167  BitMaskIterator bit_mask_begin(void) const;
168  BitMaskIterator bit_mask_end(void) const;
169  const BitMask& bit_mask() const;
171 
173 
174  void add_type(EventTypeCode type_code);
176 
178  void set_user_type(const std::string& user_type);
179 
182 
185 
187  void set_mc_event_weight(float weight,
188  unsigned int iweight = 0,
189  unsigned int nWeightsMax = 0);
190 
193  void reset_detdescr_tags();
194 
196 private:
198  std::string m_user_type;
199  std::vector<float> m_mc_event_weights;
202 };
203 
204 
205 #endif // EVENTINFO_EVENTTYPE_H
EventType::user_type
std::string user_type(void) const
Access to user type.
Definition: EventType.cxx:94
EventType::EventType
EventType()
Definition: EventType.cxx:24
EventType::add_type
void add_type(EventTypeCode type_code)
Add a new event type.
Definition: EventType.cxx:51
EventType::BitMask
std::vector< bool > BitMask
Definition: EventType.h:97
EventType::EventTypeCode
BitMask::size_type EventTypeCode
Definition: EventType.h:99
EventType::set_mc_channel_number
void set_mc_channel_number(number_type chan)
Add in the MC generator channel number (aka gen run number)
Definition: EventType.cxx:197
EventType
This class represents the "type of event" where the type is given by one or more "characteristics".
Definition: EventType.h:92
EventType::m_user_type
std::string m_user_type
Definition: EventType.h:198
EventType::EventType
EventType(const EventType &)=default
EventType::operator=
EventType & operator=(const EventType &)=default
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
EventType::m_mc_event_number
uint64_t m_mc_event_number
Definition: EventType.h:201
EventType::mc_event_weight
float mc_event_weight(unsigned int iweight=0) const
Access to MC weight.
Definition: EventType.cxx:175
EventType::operator=
EventType & operator=(EventType &&)=default
EventType::mc_channel_number
number_type mc_channel_number() const
Access to the MC generator channel number (was used as run number for generator events)
Definition: EventType.cxx:165
EventType::number_type
unsigned int number_type
Definition: EventType.h:96
python.CreateTierZeroArgdict.pairs
pairs
Definition: CreateTierZeroArgdict.py:201
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:190
EventType::EventType
EventType(EventType &&)=default
EventType::m_mc_channel_number
number_type m_mc_channel_number
Definition: EventType.h:200
EventType::NameTagPair
std::pair< std::string, std::string > NameTagPair
Definition: EventType.h:100
EventType::NameTagPairVec
std::vector< NameTagPair > NameTagPairVec
Definition: EventType.h:101
EventType::operator<
bool operator<(const EventType &rhs) const
Less than comparision needed to create e.g. set<EventType>
Definition: EventType.cxx:37
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
EventType::IS_CALIBRATION
static const EventTypeCode IS_CALIBRATION
true: IS_CALIBRATION, false: IS_PHYSICS
Definition: EventType.h:162
EventType::get_detdescr_tags
std::string get_detdescr_tags() const
Access DetDescr tags as a single string.
Definition: EventType.cxx:151
EventType::m_mc_event_weights
std::vector< float > m_mc_event_weights
Definition: EventType.h:199
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
EventType::IS_SIMULATION
static const EventTypeCode IS_SIMULATION
true: IS_SIMULATION, false: IS_DATA
Definition: EventType.h:156
EventType::set_mc_event_weight
void set_mc_event_weight(float weight, unsigned int iweight=0, unsigned int nWeightsMax=0)
Add in MC weight. For more than 1 weight, add with iweight > 0.
Definition: EventType.cxx:207
EventType::IS_TESTBEAM
static const EventTypeCode IS_TESTBEAM
true: IS_TESTBEAM, false: IS_FROM_ATLAS_DET
Definition: EventType.h:159
EventType::set_mc_event_number
void set_mc_event_number(uint64_t evt)
Add in the MC generator event number.
Definition: EventType.cxx:202
EventType::set_user_type
void set_user_type(const std::string &user_type)
Add user (string) type.
Definition: EventType.cxx:57
EventType::mc_event_number
uint64_t mc_event_number() const
Access to the MC generator event number.
Definition: EventType.cxx:170
EventType::test
bool test(EventTypeCode type_code) const
Tests for standard characteristics.
Definition: EventType.cxx:62
EventType::m_bit_mask
BitMask m_bit_mask
Definition: EventType.h:197
EventType::n_mc_event_weights
unsigned int n_mc_event_weights() const
Total number of MC weights.
Definition: EventType.cxx:214
EventType::bit_mask_begin
BitMaskIterator bit_mask_begin(void) const
Definition: EventType.cxx:182
EventType::reset_detdescr_tags
void reset_detdescr_tags()
Reset DetDescr tags - to remove them from old EventInfo objects being read in.
Definition: EventType.cxx:219
EventType::~EventType
virtual ~EventType()
Definition: EventType.cxx:32
EventType::bit_mask_end
BitMaskIterator bit_mask_end(void) const
Definition: EventType.cxx:187
EventType::typeToString
std::string typeToString() const
Access to standard characteristics in string for - for print out.
Definition: EventType.cxx:69
EventType::user_type_raw
const std::string & user_type_raw(void) const
Access to user type.
Definition: EventType.cxx:108
EventType::BitMaskIterator
BitMask::const_iterator BitMaskIterator
Definition: EventType.h:98
EventType::bit_mask
const BitMask & bit_mask() const
Definition: EventType.cxx:192