CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TinyEvent.h
Go to the documentation of this file.
1 #ifndef DPGanalysis_SiStripTools_TinyEvent_H
2 #define DPGanalysis_SiStripTools_TinyEvent_H
3 
4 #include <vector>
5 
6 namespace edm {
7  class Event;
8  class EventAuxiliary;
9 }
10 
11 //class EventIdWithBX;
12 
13 struct TinyEvent {
14 
15  TinyEvent():_event(0), _orbit(0), _bx(0) { }
16 
17  explicit TinyEvent(const unsigned int event,const int orbit,const int bx):
18  _event(event), _orbit(orbit<0 ? 0 : orbit ), _bx(bx<0 ? 0 : bx) { }
19 
20  explicit TinyEvent(const unsigned int event,const unsigned int orbit,const int bx):
21  _event(event), _orbit(orbit), _bx(bx<0 ? 0 : bx) { }
22 
23  TinyEvent(const TinyEvent& se):
24  _event(se._event), _orbit(se._orbit), _bx(se._bx) { }
25 
26  TinyEvent(const edm::Event& event);
27  TinyEvent(const edm::EventAuxiliary& eaux);
28 
30 
31  if(this != &se) {
32  _event = se._event;
33  _orbit = se._orbit;
34  _bx = se._bx;
35  }
36 
37  return *this;
38 
39  }
40 
41  int operator<(const TinyEvent& other) const {
42  return _event < other._event;
43  }
44 
45  int operator==(const TinyEvent& other) const {
46  return (_event == other._event) &&
47  (_orbit == other._orbit) &&
48  (_bx == other._bx) ;
49  }
50 
51  int isNextOf(const TinyEvent& se) const {
52 
53  return (se._event>0) && ((se._event + 1) == _event);
54 
55  }
56 
57  long long absoluteBX() const {
58 
59  return (long long)_orbit * 3564 + _bx;
60 
61  }
62 
63  long long absoluteBXinCycle(const int bx0) const {
64 
65  return (absoluteBX()-bx0);
66 
67  }
68 
69  long long deltaBX(const TinyEvent& se) const {
70 
71  int sign = 1;
72  if(se._event > _event) sign = -1;
73 
74  long long dorb = (int)(_orbit) - (int)(se._orbit);
75  return (dorb*3564 + (int)_bx - (int)se._bx) * sign;
76 
77  }
78 
79  long long deltaBXinCycle(const TinyEvent& se, const int bx0) const {
80 
81  long long dbx = deltaBX(se);
82 
83  return dbx+(69 + se.absoluteBX() -bx0%70 )%70; // I could use: dbx+(69+se.absoluteBXinCycle(bx0))%70
84 
85  }
86 
87  unsigned int _event;
88  unsigned int _orbit;
89  unsigned int _bx;
90 
91 };
92 
93 typedef std::vector<TinyEvent> TinyEventCollection;
94 
95 #endif // DPGanalysis_SiStripTools_TinyEvent_H
long long absoluteBXinCycle(const int bx0) const
Definition: TinyEvent.h:63
int operator<(const TinyEvent &other) const
Definition: TinyEvent.h:41
unsigned int _bx
Definition: TinyEvent.h:89
std::vector< TinyEvent > TinyEventCollection
Definition: TinyEvent.h:93
TinyEvent(const TinyEvent &se)
Definition: TinyEvent.h:23
TinyEvent(const unsigned int event, const unsigned int orbit, const int bx)
Definition: TinyEvent.h:20
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
TinyEvent & operator=(const TinyEvent &se)
Definition: TinyEvent.h:29
long long absoluteBX() const
Definition: TinyEvent.h:57
long long deltaBX(const TinyEvent &se) const
Definition: TinyEvent.h:69
int isNextOf(const TinyEvent &se) const
Definition: TinyEvent.h:51
string bx
Definition: rpc-layouts.py:13
unsigned int _event
Definition: TinyEvent.h:87
unsigned int _orbit
Definition: TinyEvent.h:88
int operator==(const TinyEvent &other) const
Definition: TinyEvent.h:45
TinyEvent()
Definition: TinyEvent.h:15
long long deltaBXinCycle(const TinyEvent &se, const int bx0) const
Definition: TinyEvent.h:79
TinyEvent(const unsigned int event, const int orbit, const int bx)
Definition: TinyEvent.h:17