1 #ifndef Framework_EPStates_h
2 #define Framework_EPStates_h
17 #include "boost/statechart/event.hpp"
18 #include "boost/statechart/state_machine.hpp"
19 #include <boost/statechart/state.hpp>
20 #include <boost/statechart/transition.hpp>
21 #include <boost/mpl/list.hpp>
22 #include <boost/statechart/custom_reaction.hpp>
25 namespace sc = boost::statechart;
26 namespace mpl = boost::mpl;
29 class IEventProcessor;
32 namespace statemachine {
91 class Machine :
public sc::state_machine<Machine, Starting>
124 sc::transition<Event, Error>,
125 sc::transition<Lumi, Error>,
126 sc::transition<Run, Error>,
127 sc::transition<File, HandleFiles, Machine, &Machine::startingNewLoop>,
128 sc::transition<Stop, EndingLoop, Machine, &Machine::startingNewLoop>,
142 sc::transition<Event, Error>,
143 sc::transition<Lumi, Error>,
144 sc::transition<Run, Error>,
145 sc::transition<File, Error>,
146 sc::transition<Stop, EndingLoop>,
149 void closeFiles(
bool cleaningUpAfterException);
163 sc::transition<Restart, Starting, Machine, &Machine::rewindAndPrepareForNextLoop>,
174 Error(my_context ctx);
190 sc::transition<Run, HandleRuns>,
206 sc::transition<Run, HandleRuns>,
219 sc::transition<Run, HandleRuns>,
240 typedef sc::transition<File, NewInputAndOutputFiles>
reactions;
247 void endRun(
Run const&
run,
bool cleaningUpAfterException);
268 sc::transition<Lumi, HandleLumis>,
269 sc::custom_reaction<Run>,
286 sc::custom_reaction<Run>,
301 sc::custom_reaction<Run>,
302 sc::custom_reaction<File>,
339 typedef sc::transition<Run, NewRun, HandleRuns, &HandleRuns::finalizeRun>
reactions;
360 sc::transition<Event, HandleEvent>,
361 sc::custom_reaction<Lumi>,
376 sc::transition<Event, HandleEvent>,
377 sc::custom_reaction<Lumi>,
392 sc::transition<Event, HandleEvent>,
393 sc::transition<Lumi, AnotherLumi>,
411 sc::custom_reaction<Run>,
426 sc::custom_reaction<Run>,
427 sc::custom_reaction<Lumi>,
445 sc::transition<Event, HandleEvent>,
446 sc::custom_reaction<Lumi>,
mpl::list< sc::transition< Event, HandleEvent >, sc::custom_reaction< Lumi >, sc::custom_reaction< File > > reactions
HandleEvent(my_context ctx)
sc::result react(File const &file)
edm::IEventProcessor & ep_
FirstFile(my_context ctx)
edm::IEventProcessor * ep_
sc::transition< Run, NewRun, HandleRuns,&HandleRuns::finalizeRun > reactions
void endRun(Run const &run, bool cleaningUpAfterException)
HandleFiles(my_context ctx)
HandleLumis(my_context ctx)
edm::IEventProcessor & ep_
bool currentLumiEmpty() const
edm::IEventProcessor & ep_
FileMode fileMode() const
mpl::list< sc::transition< Lumi, HandleLumis >, sc::custom_reaction< Run >, sc::custom_reaction< File > > reactions
edm::ProcessHistoryID const & processHistoryID() const
edm::ProcessHistoryID processHistoryID_
edm::IEventProcessor & ep_
sc::result react(File const &file)
sc::result react(Lumi const &lumi)
ContinueLumi(my_context ctx)
void closeFiles(bool cleaningUpAfterException)
edm::IEventProcessor & ep_
mpl::list< sc::custom_reaction< Run >, sc::custom_reaction< File >, sc::transition< Lumi, HandleLumis > > reactions
mpl::list< sc::transition< Restart, Starting, Machine,&Machine::rewindAndPrepareForNextLoop >, sc::custom_reaction< Stop > > reactions
void readAndProcessEvent()
edm::IEventProcessor & ep_
void startingNewLoop(File const &file)
FirstLumi(my_context ctx)
bool operator!=(Run const &rh) const
EmptyRunLumiMode emptyRunLumiMode_
edm::IEventProcessor & ep() const
bool beginRunCalled() const
HandleRuns(my_context ctx)
edm::IEventProcessor & ep_
EndingLoop(my_context ctx)
ContinueRun2(my_context ctx)
LumiID const & currentLumi() const
mpl::list< sc::transition< Event, HandleEvent >, sc::custom_reaction< Lumi >, sc::custom_reaction< File > > reactions
bool operator==(Run const &rh) const
sc::transition< Stop, EndingLoop > reactions
sc::result react(Run const &run)
Run const & currentRun() const
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
mpl::list< sc::transition< Event, HandleEvent >, sc::custom_reaction< Lumi >, sc::custom_reaction< File > > reactions
mpl::list< sc::transition< Event, Error >, sc::transition< Lumi, Error >, sc::transition< Run, Error >, sc::transition< File, Error >, sc::transition< Stop, EndingLoop >, sc::transition< Restart, Error > > reactions
ContinueRun1(my_context ctx)
edm::IEventProcessor & ep_
edm::IEventProcessor & ep_
AnotherLumi(my_context ctx)
sc::result react(Lumi const &lumi)
void finalizeLumi(bool cleaningUpAfterException)
mpl::list< sc::transition< Event, HandleEvent >, sc::transition< Lumi, AnotherLumi >, sc::custom_reaction< File > > reactions
void finalizeRun(Run const &)
bool shouldWeCloseOutput()
Machine(edm::IEventProcessor *ep, FileMode fileMode, EmptyRunLumiMode emptyRunLumiMode)
void rewindAndPrepareForNextLoop(Restart const &restart)
sc::result react(Lumi const &lumi)
sc::result react(Stop const &)
mpl::list< sc::custom_reaction< Run >, sc::custom_reaction< Lumi >, sc::custom_reaction< File > > reactions
edm::IEventProcessor & ep_
void beginRun(Run const &run)
mpl::list< sc::transition< Run, HandleRuns >, sc::custom_reaction< File > > reactions
mpl::list< sc::transition< Event, Error >, sc::transition< Lumi, Error >, sc::transition< Run, Error >, sc::transition< File, HandleFiles, Machine,&Machine::startingNewLoop >, sc::transition< Stop, EndingLoop, Machine,&Machine::startingNewLoop >, sc::transition< Restart, Error > > reactions
edm::ProcessHistoryID const & processHistoryID() const
Run(edm::ProcessHistoryID const &phid, int runNumber)
sc::result react(Run const &run)
void beginRunIfNotDoneAlready()
sc::result react(Run const &run)
sc::transition< File, NewInputAndOutputFiles > reactions
EmptyRunLumiMode emptyRunLumiMode() const
edm::ProcessHistoryID processHistoryID_
LumiID(edm::ProcessHistoryID const &phid, int run, int lumi)
bool runException() const
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 list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run