Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include <boost/json.hpp>
26 static const std::string top_group =
"cutBookkeeper";
30 #define ADD(NAME, TYPE) \
31 cons.add<TYPE>(#NAME,[](const OriginalAodCounts& c) {return c.NAME;})
32 ADD(nEventsProcessed,
long long);
33 ADD(sumOfWeights,
double);
34 ADD(sumOfWeightsSquared,
double);
41 #define ADD(NAME) {#NAME, counts.NAME}
42 ADD(nEventsProcessed),
44 ADD(sumOfWeightsSquared),
58 static const std::vector<std::string> allowed_streams{
59 "StreamAOD",
"StreamEVGEN",
"StreamEVNT"};
61 const auto&
s = allowed_streams;
62 return cbk.
name() ==
"AllExecutedEvents"
71 const std::string&
name,
72 ISvcLocator* pSvcLocator):
74 m_inputMetaStore(
"StoreGateSvc/InputMetaDataStore",
name)
82 CHECK( incSvc.retrieve() );
84 incSvc->removeListener(
this, IncidentType::BeginInputFile );
85 incSvc->addListener(
this, IncidentType::BeginInputFile, 0,
true );
93 return StatusCode::SUCCESS;
98 return StatusCode::SUCCESS;
105 if (inc.type() != IncidentType::BeginInputFile)
return;
112 if (!rc.isSuccess())
throw std::runtime_error(
113 "could not retrieve CutBookkeepers");
121 "Complete cbk name: " << cbk->
name() <<
125 if (cbk->
cycle() > maxCycle && isGoodBook(*cbk))
128 maxCycle = cbk->
cycle();
132 if (allEvents ==
nullptr)
135 "Could not find AllExecutedEvents CutBookkeeper information.");
136 throw std::runtime_error(
error);
141 if (cbk->
cycle() == maxCycle && isGoodBook(*cbk))
143 static const std::regex re(
"AllExecutedEvents.*_([0-9]+)");
166 throw std::runtime_error(
"could not retrieve " + cbkName);
170 if (cbk->
cycle() == maxCycle && isGoodBook(*cbk))
191 std::optional<H5::Group> h5_cbk;
195 std::optional<boost::json::object> json_cbk;
202 const std::string sysname =
sys.name().empty() ?
"nominal":
sys.name();
207 H5::Group sysgroup(h5_cbk->createGroup(sysname));
212 addCounts(cbk_root[sysname].emplace_object(),
weights);
218 {top_group, *json_cbk}
220 out << jroot << std::endl;
223 return StatusCode::SUCCESS;
unsigned long long nEventsProcessed
int cycle() const
Get the skimming cycle that this CutBookkeeper was running in.
Group
Properties of a chain group.
std::string find(const std::string &s)
return a remapped string
Description of the class that is used to keep track of event counts.
Class to wrap a set of SystematicVariations.
double sumOfEventWeightsSquared() const
Get the sum-of-(event-weights-squared) that this CutBookkeeper has seen.
#define ATH_MSG_VERBOSE(x)
double sumOfWeightsSquared
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
Container that holds the Container of all CutBookkeepers.
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
uint64_t nAcceptedEvents() const
Get the number of accepted events that this CutBookkeeper has seen.
std::string to_string(const DetectorType &type)
double sumOfEventWeights() const
Get the sum-of-event-weights that this CutBookkeeper has seen.
const std::string & name() const
Get the name of this CutBookkeeper.
const std::string & inputStream() const
Get the name of the input-file stream object that was seen by this CutBookkeeper.
const boost::regex re(r_e)
writer
show summary of content
bool match(std::string s1, std::string s2)
match the individual directories of two strings