1 #ifndef Framework_EPStates_h 2 #define Framework_EPStates_h 19 #include "boost/statechart/event.hpp" 20 #include "boost/statechart/state_machine.hpp" 21 #include <boost/statechart/state.hpp> 22 #include <boost/statechart/transition.hpp> 23 #include <boost/mpl/list.hpp> 24 #include <boost/statechart/custom_reaction.hpp> 27 namespace sc = boost::statechart;
28 namespace mpl = boost::mpl;
31 class IEventProcessor;
93 class Machine :
public sc::state_machine<Machine, Starting>
105 void startingNewLoop(
File const&
file);
106 void startingNewLoop(
Stop const& stop);
107 void rewindAndPrepareForNextLoop(
Restart const& restart);
120 class Starting :
public sc::state<Starting, Machine>
127 sc::transition<Event, Error>,
128 sc::transition<Lumi, Error>,
129 sc::transition<Run, Error>,
130 sc::transition<File, HandleFiles, Machine, &Machine::startingNewLoop>,
131 sc::transition<Stop, EndingLoop, Machine, &Machine::startingNewLoop>,
137 class HandleFiles :
public sc::state<HandleFiles, Machine, FirstFile>
145 sc::transition<Event, Error>,
146 sc::transition<Lumi, Error>,
147 sc::transition<Run, Error>,
148 sc::transition<File, Error>,
149 sc::transition<Stop, EndingLoop>,
152 void closeFiles(
bool cleaningUpAfterException);
153 void goToNewInputFile();
154 bool shouldWeCloseOutput();
166 sc::transition<Restart, Starting, Machine, &Machine::rewindAndPrepareForNextLoop>,
174 class Error :
public sc::state<Error, Machine>
177 Error(my_context ctx);
186 class FirstFile :
public sc::state<FirstFile, HandleFiles>
193 sc::transition<Run, HandleRuns>,
209 sc::transition<Run, HandleRuns>,
222 sc::transition<Run, HandleRuns>,
229 void goToNewInputAndOutputFiles();
236 class HandleRuns :
public sc::state<HandleRuns, HandleFiles, NewRun>
243 typedef sc::transition<File, NewInputAndOutputFiles>
reactions;
245 bool beginRunCalled()
const;
246 Run const& currentRun()
const;
247 bool runException()
const;
248 void setupCurrentRun();
249 void beginRun(
Run const&
run);
250 void endRun(
Run const&
run,
bool cleaningUpAfterException);
251 void finalizeRun(
Run const&);
252 void finalizeRun(
bool cleaningUpAfterException);
253 void beginRunIfNotDoneAlready();
264 class NewRun :
public sc::state<NewRun, HandleRuns>
271 sc::transition<Lumi, HandleLumis>,
272 sc::custom_reaction<Run>,
286 bool checkInvariant();
289 sc::custom_reaction<Run>,
301 bool checkInvariant();
304 sc::custom_reaction<Run>,
305 sc::custom_reaction<File>,
316 class HandleLumis :
public sc::state<HandleLumis, HandleRuns, FirstLumi>
334 bool checkInvariant();
336 LumiID const& currentLumi()
const;
337 bool currentLumiEmpty()
const;
338 void setupCurrentLumi();
339 void finalizeLumi(
bool cleaningUpAfterException);
340 void markLumiNonEmpty();
342 typedef sc::transition<Run, NewRun, HandleRuns, &HandleRuns::finalizeRun>
reactions;
355 class FirstLumi :
public sc::state<FirstLumi, HandleLumis>
360 bool checkInvariant();
363 sc::transition<Event, HandleEvent>,
364 sc::custom_reaction<Lumi>,
376 bool checkInvariant();
379 sc::transition<Event, HandleEvent>,
380 sc::custom_reaction<Lumi>,
392 bool checkInvariant();
395 sc::transition<Event, HandleEvent>,
396 sc::transition<Lumi, AnotherLumi>,
400 void readAndProcessEvent();
411 bool checkInvariant();
414 sc::custom_reaction<Run>,
426 bool checkInvariant();
429 sc::custom_reaction<Run>,
430 sc::custom_reaction<Lumi>,
445 bool checkInvariant();
448 sc::transition<Event, HandleEvent>,
449 sc::custom_reaction<Lumi>,
mpl::list< sc::transition< Event, HandleEvent >, sc::custom_reaction< Lumi >, sc::custom_reaction< File > > reactions
static const char runNumber_[]
edm::IEventProcessor & ep_
sc::transition< Run, NewRun, HandleRuns,&HandleRuns::finalizeRun > reactions
edm::IEventProcessor & ep_
edm::IEventProcessor & ep_
mpl::list< sc::transition< Lumi, HandleLumis >, sc::custom_reaction< Run >, sc::custom_reaction< File > > reactions
edm::ProcessHistoryID const & processHistoryID() const
edm::LuminosityBlockNumber_t lumi() const
edm::ProcessHistoryID processHistoryID_
edm::IEventProcessor & ep_
edm::IEventProcessor & ep_
mpl::list< sc::custom_reaction< Run >, sc::custom_reaction< File >, sc::transition< Lumi, HandleLumis > > reactions
unsigned int LuminosityBlockNumber_t
edm::LuminosityBlockNumber_t id_
mpl::list< sc::transition< Restart, Starting, Machine,&Machine::rewindAndPrepareForNextLoop >, sc::custom_reaction< Stop > > reactions
edm::IEventProcessor & ep_
bool operator!=(Run const &rh) const
EmptyRunLumiMode emptyRunLumiMode_
edm::LuminosityBlockNumber_t id() const
edm::IEventProcessor & ep_
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
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
edm::IEventProcessor & ep_
edm::IEventProcessor & ep_
mpl::list< sc::transition< Event, HandleEvent >, sc::transition< Lumi, AnotherLumi >, sc::custom_reaction< File > > reactions
edm::RunNumber_t runNumber_
edm::RunNumber_t run() const
mpl::list< sc::custom_reaction< Run >, sc::custom_reaction< Lumi >, sc::custom_reaction< File > > reactions
edm::IEventProcessor & ep_
edm::RunNumber_t runNumber() const
mpl::list< sc::transition< Run, HandleRuns >, sc::custom_reaction< File > > reactions
edm::LuminosityBlockNumber_t lumi_
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
sc::transition< File, NewInputAndOutputFiles > reactions
edm::propagate_const< edm::IEventProcessor * > ep_
edm::ProcessHistoryID processHistoryID_
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