ATLAS Offline Software
|
This class represents the "type of event" where the type is given by one or more "characteristics". More...
#include <EventType.h>
Public Types | |
typedefs | |
typedef unsigned int | number_type |
typedef std::vector< bool > | BitMask |
typedef BitMask::const_iterator | BitMaskIterator |
typedef BitMask::size_type | EventTypeCode |
typedef std::pair< std::string, std::string > | NameTagPair |
typedef std::vector< NameTagPair > | NameTagPairVec |
Public Member Functions | |
structors | |
EventType () | |
virtual | ~EventType () |
bool | operator< (const EventType &rhs) const |
Less than comparision needed to create e.g. set<EventType> More... | |
Accessors | |
bool | test (EventTypeCode type_code) const |
Tests for standard characteristics. More... | |
std::string | typeToString () const |
Access to standard characteristics in string for - for print out. More... | |
std::string | user_type (void) const |
Access to user type. More... | |
const std::string & | user_type_raw (void) const |
Access to user type. More... | |
void | get_detdescr_tags (NameTagPairVec &pairs) const |
Access DetDescr tags. More... | |
std::string | get_detdescr_tags () const |
Access DetDescr tags as a single string. More... | |
number_type | mc_channel_number () const |
Access to the MC generator channel number (was used as run number for generator events) More... | |
uint64_t | mc_event_number () const |
Access to the MC generator event number. More... | |
float | mc_event_weight (unsigned int iweight=0) const |
Access to MC weight. More... | |
unsigned int | n_mc_event_weights () const |
Total number of MC weights. More... | |
Iterator access to full set of standard characteristics | |
BitMaskIterator | bit_mask_begin (void) const |
BitMaskIterator | bit_mask_end (void) const |
const BitMask & | bit_mask () const |
Static Public Attributes | |
The set of possible characteristic codes: | |
static const EventTypeCode | IS_SIMULATION = 0 |
true: IS_SIMULATION, false: IS_DATA More... | |
static const EventTypeCode | IS_TESTBEAM = 1 |
true: IS_TESTBEAM, false: IS_FROM_ATLAS_DET More... | |
static const EventTypeCode | IS_CALIBRATION = 2 |
true: IS_CALIBRATION, false: IS_PHYSICS More... | |
Set characteristics: | |
BitMask | m_bit_mask |
std::string | m_user_type |
std::vector< float > | m_mc_event_weights |
number_type | m_mc_channel_number |
uint64_t | m_mc_event_number |
void | add_type (EventTypeCode type_code) |
Add a new event type. More... | |
void | set_user_type (const std::string &user_type) |
Add user (string) type. More... | |
void | set_mc_channel_number (number_type chan) |
Add in the MC generator channel number (aka gen run number) More... | |
void | set_mc_event_number (uint64_t evt) |
Add in the MC generator event number. More... | |
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. More... | |
void | reset_detdescr_tags () |
Reset DetDescr tags - to remove them from old EventInfo objects being read in. More... | |
This class represents the "type of event" where the type is given by one or more "characteristics".
Standard characteristics:
Since an event may have MORE than one characteristic, a testbeam simulation event would respond true to first two of the above characteristics, whereas an offline simulation event would respond true to ONLY IS_SIMULATION.
These are set with:
void add_type (EventTypeCode type_code);
where the possible EventTypeCode's are provided as constants, e.g.:
static const EventTypeCode IS_SIMULATION;
Thus, one would set IS_SIMULATION by:
an_event_type.set_type_bit(EventType::IS_SIMULATION);
User-defined characteristics:
There is a possible to set and get a "user-defined" characteristic in terms of a string:
void add_type (const string& user_type); const string& user_type (void) const;
Access to the full set of characteristics:
This is possible via:
BitMaskIterator bit_mask_begin (void) const; BitMaskIterator bit_mask_end (void) const;
Implementation details:
The full set of characteristics is provided by static constants. One may add new event characteristics BOTH by adding more static constants AND by providing the corresponding new boolean methods.
Definition at line 92 of file EventType.h.
typedef std::vector<bool> EventType::BitMask |
Definition at line 97 of file EventType.h.
typedef BitMask::const_iterator EventType::BitMaskIterator |
Definition at line 98 of file EventType.h.
typedef BitMask::size_type EventType::EventTypeCode |
Definition at line 99 of file EventType.h.
typedef std::pair<std::string, std::string> EventType::NameTagPair |
Definition at line 100 of file EventType.h.
typedef std::vector<NameTagPair> EventType::NameTagPairVec |
Definition at line 101 of file EventType.h.
typedef unsigned int EventType::number_type |
Definition at line 96 of file EventType.h.
EventType::EventType | ( | ) |
Definition at line 24 of file EventType.cxx.
|
virtual |
Definition at line 32 of file EventType.cxx.
void EventType::add_type | ( | EventTypeCode | type_code | ) |
const EventType::BitMask & EventType::bit_mask | ( | ) | const |
Definition at line 192 of file EventType.cxx.
EventType::BitMaskIterator EventType::bit_mask_begin | ( | void | ) | const |
Definition at line 182 of file EventType.cxx.
EventType::BitMaskIterator EventType::bit_mask_end | ( | void | ) | const |
Definition at line 187 of file EventType.cxx.
std::string EventType::get_detdescr_tags | ( | ) | const |
void EventType::get_detdescr_tags | ( | NameTagPairVec & | pairs | ) | const |
EventType::number_type EventType::mc_channel_number | ( | ) | const |
Access to the MC generator channel number (was used as run number for generator events)
Definition at line 165 of file EventType.cxx.
uint64_t EventType::mc_event_number | ( | ) | const |
Access to the MC generator event number.
Definition at line 170 of file EventType.cxx.
float EventType::mc_event_weight | ( | unsigned int | iweight = 0 | ) | const |
unsigned int EventType::n_mc_event_weights | ( | ) | const |
Total number of MC weights.
Definition at line 214 of file EventType.cxx.
Less than comparision needed to create e.g. set<EventType>
Definition at line 36 of file EventType.cxx.
void EventType::reset_detdescr_tags | ( | ) |
Reset DetDescr tags - to remove them from old EventInfo objects being read in.
Definition at line 219 of file EventType.cxx.
void EventType::set_mc_channel_number | ( | number_type | chan | ) |
Add in the MC generator channel number (aka gen run number)
Definition at line 197 of file EventType.cxx.
void EventType::set_mc_event_number | ( | uint64_t | evt | ) |
Add in the MC generator event number.
Definition at line 202 of file EventType.cxx.
void EventType::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 at line 207 of file EventType.cxx.
void EventType::set_user_type | ( | const std::string & | user_type | ) |
Add user (string) type.
Definition at line 57 of file EventType.cxx.
bool EventType::test | ( | EventTypeCode | type_code | ) | const |
Tests for standard characteristics.
Definition at line 62 of file EventType.cxx.
std::string EventType::typeToString | ( | ) | const |
Access to standard characteristics in string for - for print out.
Definition at line 69 of file EventType.cxx.
std::string EventType::user_type | ( | void | ) | const |
const std::string & EventType::user_type_raw | ( | void | ) | const |
Access to user type.
Definition at line 108 of file EventType.cxx.
|
static |
true: IS_CALIBRATION, false: IS_PHYSICS
Definition at line 157 of file EventType.h.
|
static |
true: IS_SIMULATION, false: IS_DATA
Definition at line 151 of file EventType.h.
|
static |
true: IS_TESTBEAM, false: IS_FROM_ATLAS_DET
Definition at line 154 of file EventType.h.
|
private |
Definition at line 192 of file EventType.h.
|
private |
Definition at line 195 of file EventType.h.
|
private |
Definition at line 196 of file EventType.h.
|
private |
Definition at line 194 of file EventType.h.
|
private |
Definition at line 193 of file EventType.h.