BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
EventType.h
Go to the documentation of this file.
1/***************************************************************************
2 EventInfo Package
3 -----------------------------------------
4 Copyright (C) 2000 by ATLAS Collaboration
5 ***************************************************************************/
6
7//<doc><file> $Id: EventType.h,v 1.1.1.1 2007/04/25 11:46:57 zoujh Exp $
8//<version> $Name: HltDataTypes-01-01-03 $
9
10#ifndef EVENTINFO_EVENTTYPE_H
11# define EVENTINFO_EVENTTYPE_H 1
12
13//<<<<<< INCLUDES >>>>>>
14
15#include <vector>
16#include <string>
17
18//<<<<<< PUBLIC DEFINES >>>>>>
19//<<<<<< PUBLIC CONSTANTS >>>>>>
20//<<<<<< PUBLIC TYPES >>>>>>
21//<<<<<< PUBLIC VARIABLES >>>>>>
22//<<<<<< PUBLIC FUNCTIONS >>>>>>
23//<<<<<< CLASS DECLARATIONS >>>>>>
24
25/**
26 ** class EventType
27 **
28 ** This class represents the "type of event" where the type is given
29 ** by one or more "characteristics".
30 **
31 ** Standard characteristics:
32 ** -------------------------
33 **
34 ** IS_SIMULATION // false means IS_DATA
35 ** IS_TESTBEAM // false means IS_FROM_ATLAS_DET
36 ** IS_CALIBRATION // false means IS_PHYSICS
37 **
38 ** Since an event may have MORE than one characteristic, a testbeam
39 ** simulation event would respond true to first two of the above
40 ** characteristics, whereas an offline simulation event would
41 ** respond true to ONLY IS_SIMULATION.
42 **
43 ** These are set with:
44 **
45 ** void add_type (EventTypeCode type_code);
46 **
47 ** where the possible EventTypeCode's are provided as constants,
48 ** e.g.:
49 **
50 ** static const EventTypeCode IS_SIMULATION;
51 **
52 ** Thus, one would set IS_SIMULATION by:
53 **
54 ** an_event_type.set_type_bit(EventType::IS_SIMULATION);
55 **
56 **
57 ** User-defined characteristics:
58 ** -----------------------------
59 **
60 ** There is a possible to set and get a "user-defined"
61 ** characteristic in terms of a string:
62 **
63 ** void add_type (const string& user_type);
64 ** const string& user_type (void) const;
65 **
66 **
67 ** Access to the full set of characteristics:
68 ** ------------------------------------------
69 **
70 ** This is possible via:
71 **
72 ** BitMaskIterator bit_mask_begin (void) const;
73 ** BitMaskIterator bit_mask_end (void) const;
74 **
75 **
76 ** Implementation details:
77 ** -----------------------
78 **
79 ** The full set of characteristics is provided by static
80 ** constants. One may add new event characteristics BOTH by adding
81 ** more static constants AND by providing the cooresponding new
82 ** boolean methods.
83 **/
84class EventType {
85public:
86
87 // public typedefs:
88 typedef std::vector<bool> BitMask;
89 typedef BitMask::const_iterator BitMaskIterator;
90 typedef BitMask::size_type EventTypeCode;
91 typedef std::pair<std::string,std::string> NameTagPair;
92 typedef std::vector<NameTagPair> NameTagPairVec;
93
94 EventType();
95 virtual ~EventType();
96
97 // Set characteristics:
98 void add_type (EventTypeCode type_code);
99 void set_user_type (const std::string& user_type);
100 void set_detdescr_tags(const NameTagPairVec& pairs);
101
102 // Tests for standard characteristics
103 bool test (EventTypeCode type_code) const;
104
105 // Access to user type
106 const std::string& user_type (void) const;
107
108 // Access DetDescr tags
110
111
112 // The set of possible characteristic codes:
113 static const EventTypeCode IS_SIMULATION; // false: IS_DATA
114 static const EventTypeCode IS_TESTBEAM; // false: IS_FROM_ATLAS_DET
115 static const EventTypeCode IS_CALIBRATION; // false: IS_PHYSICS
116
117
118 // Access to full set of standard characteristics
119 BitMaskIterator bit_mask_begin (void) const;
120 BitMaskIterator bit_mask_end (void) const;
121
122private:
123 BitMask m_bit_mask;
124 std::string m_user_type;
125};
126
127
128//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
129//<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
130
131#endif // EVENTINFO_EVENTTYPE_H
std::string test
void get_detdescr_tags(NameTagPairVec &pairs)
Definition EventType.cxx:93
std::pair< std::string, std::string > NameTagPair
Definition EventType.h:91
std::vector< NameTagPair > NameTagPairVec
Definition EventType.h:92
static const EventTypeCode IS_CALIBRATION
Definition EventType.h:115
void set_detdescr_tags(const NameTagPairVec &pairs)
Definition EventType.cxx:51
BitMask::const_iterator BitMaskIterator
Definition EventType.h:89
void set_user_type(const std::string &user_type)
Definition EventType.cxx:45
std::vector< bool > BitMask
Definition EventType.h:88
const std::string & user_type(void) const
Definition EventType.cxx:77
BitMaskIterator bit_mask_end(void) const
virtual ~EventType()
Definition EventType.cxx:33
static const EventTypeCode IS_SIMULATION
Definition EventType.h:113
BitMaskIterator bit_mask_begin(void) const
void add_type(EventTypeCode type_code)
Definition EventType.cxx:38
static const EventTypeCode IS_TESTBEAM
Definition EventType.h:114
BitMask::size_type EventTypeCode
Definition EventType.h:90