#include <EPStates.h>
Classes | |
class | LumiID |
Public Types | |
typedef sc::transition< Run, NewRun, HandleRuns,&HandleRuns::finalizeRun > | reactions |
Public Member Functions | |
bool | checkInvariant () |
LumiID const & | currentLumi () const |
bool | currentLumiEmpty () const |
void | exit () |
void | finalizeLumi (bool cleaningUpAfterException) |
HandleLumis (my_context ctx) | |
void | markLumiNonEmpty () |
void | setupCurrentLumi () |
~HandleLumis () | |
Private Attributes | |
LumiID | currentLumi_ |
bool | currentLumiEmpty_ |
edm::IEventProcessor & | ep_ |
bool | exitCalled_ |
bool | lumiException_ |
Definition at line 315 of file EPStates.h.
typedef sc::transition<Run, NewRun, HandleRuns, &HandleRuns::finalizeRun> statemachine::HandleLumis::reactions |
Definition at line 341 of file EPStates.h.
statemachine::HandleLumis::HandleLumis | ( | my_context | ctx | ) |
Definition at line 369 of file EPStates.cc.
References checkInvariant().
: my_base(ctx), ep_(context<Machine>().ep()), exitCalled_(false), currentLumiEmpty_(true), currentLumi_(InvalidLumiID), lumiException_(false) { checkInvariant(); }
statemachine::HandleLumis::~HandleLumis | ( | ) |
Definition at line 388 of file EPStates.cc.
References checkInvariant(), ep_, exitCalled_, finalizeLumi(), lumiException_, python::rootplot::argparse::message, edm::IEventProcessor::setExceptionMessageLumis(), and AlCaHLTBitMon_QueryRunRegistry::string.
{ if(!exitCalled_) { try { checkInvariant(); if(!lumiException_ && !context<HandleRuns>().runException()) { finalizeLumi(true); } } catch(...) { std::string message("Another exception was caught while trying to clean up lumis after the primary fatal exception."); ep_.setExceptionMessageLumis(message); } } }
bool statemachine::HandleLumis::checkInvariant | ( | ) |
Definition at line 403 of file EPStates.cc.
Referenced by exit(), HandleLumis(), and ~HandleLumis().
{ assert(context<HandleRuns>().currentRun() != INVALID_RUN); return true; }
HandleLumis::LumiID const & statemachine::HandleLumis::currentLumi | ( | ) | const |
Definition at line 408 of file EPStates.cc.
References currentLumi_.
Referenced by finalizeLumi(), markLumiNonEmpty(), and setupCurrentLumi().
{ return currentLumi_; }
bool statemachine::HandleLumis::currentLumiEmpty | ( | ) | const |
Definition at line 410 of file EPStates.cc.
References currentLumiEmpty_.
{ return currentLumiEmpty_; }
void statemachine::HandleLumis::exit | ( | ) |
Definition at line 379 of file EPStates.cc.
References edm::IEventProcessor::alreadyHandlingException(), checkInvariant(), ep_, exitCalled_, finalizeLumi(), and lumiException_.
{ if(ep_.alreadyHandlingException()) return; exitCalled_ = true; checkInvariant(); if(!lumiException_ && !context<HandleRuns>().runException()) { finalizeLumi(false); } }
void statemachine::HandleLumis::finalizeLumi | ( | bool | cleaningUpAfterException | ) |
Definition at line 429 of file EPStates.cc.
References currentLumi(), currentLumi_, currentLumiEmpty_, edm::IEventProcessor::deleteLumiFromCache(), edm::IEventProcessor::endLumi(), ep_, statemachine::handleEmptyRunsAndLumis, fjr2json::lumi, lumiException_, DTTTrigCorrFirst::run, and edm::IEventProcessor::writeLumi().
Referenced by exit(), and ~HandleLumis().
{ lumiException_ = true; if(!currentLumiEmpty_ || context<Machine>().emptyRunLumiMode() == handleEmptyRunsAndLumis) { ep_.endLumi(currentLumi().processHistoryID(), currentLumi().run(), currentLumi().lumi(), cleaningUpAfterException); } ep_.writeLumi(currentLumi().processHistoryID(), currentLumi().run(), currentLumi().lumi()); ep_.deleteLumiFromCache(currentLumi().processHistoryID(), currentLumi().run(), currentLumi().lumi()); currentLumi_ = InvalidLumiID; lumiException_ = false; }
void statemachine::HandleLumis::markLumiNonEmpty | ( | ) |
Definition at line 445 of file EPStates.cc.
References edm::IEventProcessor::beginLumi(), currentLumi(), currentLumiEmpty_, ep_, statemachine::handleEmptyRunsAndLumis, fjr2json::lumi, lumiException_, and DTTTrigCorrFirst::run.
{ if(currentLumiEmpty_) { if(context<Machine>().emptyRunLumiMode() != handleEmptyRunsAndLumis) { lumiException_ = true; ep_.beginLumi(currentLumi().processHistoryID(), currentLumi().run(), currentLumi().lumi()); lumiException_ = false; } currentLumiEmpty_ = false; } }
void statemachine::HandleLumis::setupCurrentLumi | ( | ) |
Definition at line 412 of file EPStates.cc.
References edm::IEventProcessor::beginLumi(), currentLumi(), currentLumi_, currentLumiEmpty_, ep_, statemachine::handleEmptyRunsAndLumis, fjr2json::lumi, lumiException_, statemachine::Run::processHistoryID(), edm::IEventProcessor::readAndCacheLumi(), DTTTrigCorrFirst::run, and statemachine::Run::runNumber().
{ Run const& run = context<HandleRuns>().currentRun(); assert(run != INVALID_RUN); lumiException_ = true; currentLumi_ = HandleLumis::LumiID(run.processHistoryID(), run.runNumber(), ep_.readAndCacheLumi()); if(context<Machine>().emptyRunLumiMode() == handleEmptyRunsAndLumis) { assert(context<HandleRuns>().beginRunCalled()); ep_.beginLumi(currentLumi().processHistoryID(), currentLumi().run(), currentLumi().lumi()); } lumiException_ = false; currentLumiEmpty_ = true; }
Definition at line 347 of file EPStates.h.
Referenced by currentLumi(), finalizeLumi(), and setupCurrentLumi().
bool statemachine::HandleLumis::currentLumiEmpty_ [private] |
Definition at line 346 of file EPStates.h.
Referenced by currentLumiEmpty(), finalizeLumi(), markLumiNonEmpty(), and setupCurrentLumi().
Definition at line 344 of file EPStates.h.
Referenced by exit(), finalizeLumi(), markLumiNonEmpty(), setupCurrentLumi(), and ~HandleLumis().
bool statemachine::HandleLumis::exitCalled_ [private] |
Definition at line 345 of file EPStates.h.
Referenced by exit(), and ~HandleLumis().
bool statemachine::HandleLumis::lumiException_ [private] |
Definition at line 348 of file EPStates.h.
Referenced by exit(), finalizeLumi(), markLumiNonEmpty(), setupCurrentLumi(), and ~HandleLumis().