#include <EventWithHistory.h>
Public Member Functions | |
long long | absoluteBX (const unsigned int ev1) const |
long long | absoluteBX () const |
long long | absoluteBXinCycle (const unsigned int ev1, const int bx0) const |
long long | absoluteBXinCycle (const int bx0) const |
int | add (const EventWithHistory &he, const int idepth) |
int | add (const TinyEvent &he, const int idepth) |
const int | bx () const |
long long | deltaBX (const unsigned int ev2, const unsigned int ev1) const |
long long | deltaBX () const |
long long | deltaBX (const unsigned int ev1) const |
long long | deltaBX (const TinyEvent &se) const |
long long | deltaBXinCycle (const int bx0) const |
long long | deltaBXinCycle (const unsigned int ev2, const unsigned int ev1, const int bx0) const |
long long | deltaBXinCycle (const unsigned int ev1, const int bx0) const |
long long | deltaBXinCycle (const TinyEvent &se, const int bx0) const |
unsigned int | depth () const |
const unsigned int | event () const |
EventWithHistory (const TinyEvent &se) | |
EventWithHistory (const unsigned int event, const unsigned int orbit, const int bx) | |
EventWithHistory () | |
EventWithHistory (const std::vector< edm::EventAuxiliary > &he) | |
EventWithHistory (const edm::Event &event) | |
EventWithHistory (const edm::Event &event, const L1AcceptBunchCrossingCollection &l11bcc, const long long orbitoffset=0, const int bxoffset=0) | |
EventWithHistory (const EventWithHistory &he) | |
EventWithHistory (const unsigned int event, const int orbit, const int bx) | |
const TinyEvent * | get (const unsigned int ev) const |
bool | isFutureHistory () const |
EventWithHistory & | operator= (const EventWithHistory &he) |
int | operator== (const EventWithHistory &other) const |
const unsigned int | orbit () const |
Private Attributes | |
std::vector< TinyEvent > | _prevse |
Definition at line 16 of file EventWithHistory.h.
EventWithHistory::EventWithHistory | ( | ) |
Definition at line 8 of file EventWithHistory.cc.
EventWithHistory::EventWithHistory | ( | const TinyEvent & | se | ) | [explicit] |
Definition at line 10 of file EventWithHistory.cc.
EventWithHistory::EventWithHistory | ( | const unsigned int | event, |
const int | orbit, | ||
const int | bx | ||
) | [explicit] |
EventWithHistory::EventWithHistory | ( | const unsigned int | event, |
const unsigned int | orbit, | ||
const int | bx | ||
) | [explicit] |
EventWithHistory::EventWithHistory | ( | const edm::Event & | event | ) | [explicit] |
Definition at line 18 of file EventWithHistory.cc.
EventWithHistory::EventWithHistory | ( | const std::vector< edm::EventAuxiliary > & | he | ) |
Definition at line 21 of file EventWithHistory.cc.
References _prevse.
EventWithHistory::EventWithHistory | ( | const edm::Event & | event, |
const L1AcceptBunchCrossingCollection & | l11bcc, | ||
const long long | orbitoffset = 0 , |
||
const int | bxoffset = 0 |
||
) |
Definition at line 31 of file EventWithHistory.cc.
References _prevse, cmsDriverOptions::counter, deltaBX(), edm::EventID::event(), edm::EventBase::id(), and operator=().
: TinyEvent(), _prevse() { std::map<int,TinyEvent> tmpmap; for(L1AcceptBunchCrossingCollection::const_iterator l1abc=l1abcc.begin();l1abc!=l1abcc.end();++l1abc) { if(event.id().event() > (unsigned int)(-1*l1abc->l1AcceptOffset()) ) { unsigned int evnumb = event.id().event()+l1abc->l1AcceptOffset(); if(orbitoffset < (long long)l1abc->orbitNumber()) { unsigned int neworbit = l1abc->orbitNumber() - orbitoffset; int newbx = l1abc->bunchCrossing() - bxoffset; while(newbx > 3563) { ++neworbit; newbx -= 3564; } while(newbx < 0) { --neworbit; newbx += 3564; } if(l1abc->eventType()!=0) { TinyEvent tmpse(evnumb,neworbit,newbx); tmpmap[l1abc->l1AcceptOffset()]=tmpse; } else { edm::LogWarning("L1AcceptBunchCrossingNoType") << "L1AcceptBunchCrossing with no type found: "; for(L1AcceptBunchCrossingCollection::const_iterator debu=l1abcc.begin();debu!=l1abcc.end();++debu) { edm::LogPrint("L1AcceptBunchCrossingNoType") << *debu; } } } else { edm::LogError("L1AcceptBunchCrossingOffsetTooLarge") << " Too large orbit offset " << orbitoffset << " " << l1abc->orbitNumber(); } } else { edm::LogInfo("L1AcceptBunchCrossingNegativeEvent") << "L1AcceptBunchCrossing with negative event: "; for(L1AcceptBunchCrossingCollection::const_iterator debu=l1abcc.begin();debu!=l1abcc.end();++debu) { edm::LogVerbatim("L1AcceptBunchCrossingNegativeEvent") << *debu; } } } // look for the event itself if(tmpmap.find(0)!=tmpmap.end()) { TinyEvent::operator=(tmpmap[0]); // loop on the rest of the map and stop when it is missing // check that the events are in the right order and break if not int counter=-1; while(tmpmap.find(counter)!=tmpmap.end()) { if(tmpmap[counter+1].deltaBX(tmpmap[counter]) > 0) { _prevse.push_back(tmpmap[counter]); --counter; } else { edm::LogWarning("L1AcceptBunchCrossingNotInOrder") << "L1AcceptBunchCrossing not in order: "; for(L1AcceptBunchCrossingCollection::const_iterator debu=l1abcc.begin();debu!=l1abcc.end();++debu) { edm::LogPrint("L1AcceptBunchCrossingNotInOrder") << *debu; } break; } } } else { TinyEvent::operator=(event); edm::LogWarning("L1AcceptBunchCrossingNoCollection") << " L1AcceptBunchCrossing with offset=0 not found " << " likely L1ABCCollection is empty "; } }
EventWithHistory::EventWithHistory | ( | const EventWithHistory & | he | ) |
Definition at line 110 of file EventWithHistory.cc.
long long EventWithHistory::absoluteBX | ( | const unsigned int | ev1 | ) | const |
Definition at line 225 of file EventWithHistory.cc.
References _prevse, and absoluteBX().
Referenced by EventWithHistoryFilter::is_selected().
{ if(ev1==0) return TinyEvent::absoluteBX(); if(ev1<=_prevse.size()) return _prevse[ev1-1].absoluteBX(); return -1; }
long long EventWithHistory::absoluteBX | ( | ) | const |
Reimplemented from TinyEvent.
Definition at line 234 of file EventWithHistory.cc.
Referenced by absoluteBX().
{ return TinyEvent::absoluteBX(); }
long long EventWithHistory::absoluteBXinCycle | ( | const unsigned int | ev1, |
const int | bx0 | ||
) | const |
Definition at line 240 of file EventWithHistory.cc.
References _prevse.
Referenced by absoluteBXinCycle(), and EventWithHistoryFilter::is_selected().
{ if(ev1==0) return TinyEvent::absoluteBXinCycle(bx0); if(ev1<=_prevse.size()) return _prevse[ev1-1].absoluteBXinCycle(bx0); return -1; }
long long EventWithHistory::absoluteBXinCycle | ( | const int | bx0 | ) | const |
Reimplemented from TinyEvent.
Definition at line 249 of file EventWithHistory.cc.
References absoluteBXinCycle().
{ return TinyEvent::absoluteBXinCycle(bx0); }
int EventWithHistory::add | ( | const TinyEvent & | he, |
const int | idepth | ||
) |
Definition at line 150 of file EventWithHistory.cc.
References _prevse, abs, depth(), isFutureHistory(), and TinyEvent::isNextOf().
{ bool isfuture = (idepth <0); const unsigned int adepth = abs(idepth); // protect against the possibility of filling with past and future history if( depth()>0 && ((isfuture && !isFutureHistory()) || (!isfuture && isFutureHistory()))) return 0; if(adepth==0) return 0; if(_prevse.size()>= adepth) return 0; if(_prevse.size()==0) { if((!isfuture && isNextOf(se)) || (isfuture && se.isNextOf(*this))) { _prevse.push_back(se); return 1; } else { return 0; } } else { if((!isfuture && _prevse[_prevse.size()-1].isNextOf(se)) || (isfuture && se.isNextOf(_prevse[_prevse.size()-1]))) { _prevse.push_back(se); return 1; } else { return 0; } } return 0; }
int EventWithHistory::add | ( | const EventWithHistory & | he, |
const int | idepth | ||
) |
Definition at line 140 of file EventWithHistory.cc.
const int EventWithHistory::bx | ( | ) | const |
Definition at line 185 of file EventWithHistory.cc.
References TinyEvent::_bx.
{ return TinyEvent::_bx; }
long long EventWithHistory::deltaBX | ( | const unsigned int | ev2, |
const unsigned int | ev1 | ||
) | const |
Definition at line 203 of file EventWithHistory.cc.
References _prevse, and deltaBX().
Referenced by EventWithHistoryFilter::is_selected().
{ if(ev2==ev1) return 0; if(ev2<ev1 && ev1<=_prevse.size()) { if(ev2==0) return TinyEvent::deltaBX(_prevse[ev1-1]); return _prevse[ev2-1].deltaBX(_prevse[ev1-1]); } return -1; }
long long EventWithHistory::deltaBX | ( | const unsigned int | ev1 | ) | const |
Definition at line 215 of file EventWithHistory.cc.
References deltaBX().
{ return deltaBX(0,ev1); }
long long EventWithHistory::deltaBX | ( | ) | const |
Definition at line 217 of file EventWithHistory.cc.
Referenced by deltaBX(), and EventWithHistory().
{ return deltaBX(0,1); }
long long EventWithHistory::deltaBX | ( | const TinyEvent & | se | ) | const |
Reimplemented from TinyEvent.
Definition at line 219 of file EventWithHistory.cc.
References deltaBX().
{ return TinyEvent::deltaBX(se); }
long long EventWithHistory::deltaBXinCycle | ( | const int | bx0 | ) | const |
Definition at line 274 of file EventWithHistory.cc.
References deltaBXinCycle().
{ return deltaBXinCycle(0,1,bx0); }
long long EventWithHistory::deltaBXinCycle | ( | const TinyEvent & | se, |
const int | bx0 | ||
) | const |
Reimplemented from TinyEvent.
Definition at line 278 of file EventWithHistory.cc.
References deltaBXinCycle().
{ return TinyEvent::deltaBXinCycle(se,bx0); }
long long EventWithHistory::deltaBXinCycle | ( | const unsigned int | ev2, |
const unsigned int | ev1, | ||
const int | bx0 | ||
) | const |
Definition at line 255 of file EventWithHistory.cc.
References _prevse.
Referenced by deltaBXinCycle(), and EventWithHistoryFilter::is_selected().
{ if(ev2==ev1 && ev1<=_prevse.size()) { if(ev2==0) return TinyEvent::deltaBXinCycle(*this,bx0); return _prevse[ev2-1].deltaBXinCycle(_prevse[ev1-1],bx0); } if(ev2<ev1 && ev1<=_prevse.size()) { if(ev2==0) return TinyEvent::deltaBXinCycle(_prevse[ev1-1],bx0); return _prevse[ev2-1].deltaBXinCycle(_prevse[ev1-1],bx0); } return -1; }
long long EventWithHistory::deltaBXinCycle | ( | const unsigned int | ev1, |
const int | bx0 | ||
) | const |
Definition at line 270 of file EventWithHistory.cc.
References deltaBXinCycle().
{ return deltaBXinCycle(0,ev1,bx0); }
unsigned int EventWithHistory::depth | ( | ) | const |
Definition at line 195 of file EventWithHistory.cc.
References _prevse.
Referenced by add(), EventWithHistoryFilter::is_selected(), isFutureHistory(), and operator==().
{ return _prevse.size(); }
const unsigned int EventWithHistory::event | ( | ) | const |
Definition at line 183 of file EventWithHistory.cc.
References TinyEvent::_event.
{ return TinyEvent::_event; }
const TinyEvent * EventWithHistory::get | ( | const unsigned int | ev | ) | const |
Definition at line 187 of file EventWithHistory.cc.
References _prevse.
bool EventWithHistory::isFutureHistory | ( | ) | const |
Definition at line 197 of file EventWithHistory.cc.
References _prevse, depth(), and TinyEvent::isNextOf().
Referenced by add().
EventWithHistory & EventWithHistory::operator= | ( | const EventWithHistory & | he | ) |
Definition at line 112 of file EventWithHistory.cc.
References _prevse.
Referenced by EventWithHistory().
{ if(this != &he) { TinyEvent::operator=(he); _prevse = he._prevse; } return *this; }
int EventWithHistory::operator== | ( | const EventWithHistory & | other | ) | const |
Definition at line 123 of file EventWithHistory.cc.
const unsigned int EventWithHistory::orbit | ( | ) | const |
Definition at line 184 of file EventWithHistory.cc.
References TinyEvent::_orbit.
{ return TinyEvent::_orbit; }
std::vector<TinyEvent> EventWithHistory::_prevse [private] |
Definition at line 64 of file EventWithHistory.h.
Referenced by absoluteBX(), absoluteBXinCycle(), add(), deltaBX(), deltaBXinCycle(), depth(), EventWithHistory(), get(), isFutureHistory(), operator=(), and operator==().