|
ATLAS Offline Software
|
Go to the documentation of this file.
27 m_headerResult.resize(IndNumOfFixedBit);
28 m_headerResult[IndHLTResultClassVersion] = m_HLTResultClassVersion;
31 setLvl1Id(0xffffffff);
34 setHLTStatus(HLT::FATAL);
36 setLvlConverterStatus(HLT::FATAL);
38 setPassThrough(
false);
42 setNumOfSatisfiedSigs(0);
44 setErrorCoordinates(0, 0xffffffff);
46 setCreatedOutsideHLT(
true);
48 setHLTResultTruncated(
false);
54 m_chainsResult{rhs.m_chainsResult},
55 m_navigationResult{rhs.m_navigationResult},
56 m_navigationResult_DSonly{rhs.m_navigationResult_DSonly},
57 m_extras{rhs.m_extras},
58 m_id_name{rhs.m_id_name},
59 m_id_name_DSonly{rhs.m_id_name_DSonly},
60 m_modID_id_name{rhs.m_modID_id_name},
61 m_navigationResultCuts{rhs.m_navigationResultCuts},
62 m_navigationResultCuts_DSonly{rhs.m_navigationResultCuts_DSonly},
63 m_extraData{rhs.m_extraData ?
new HLTExtraData{*rhs.m_extraData} :
nullptr}
88 for (std::map<
unsigned int,
std::set<std::pair<CLID, std::string> > >::const_iterator map_it =
m_modID_id_name.begin();
90 mod_ids.push_back((*map_it).first);
95 std::vector<unsigned int> mod_ids;
96 for (std::map<
unsigned int,
std::set<std::pair<CLID, std::string> > >::const_iterator map_it =
m_modID_id_name.begin();
98 mod_ids.push_back((*map_it).first);
138 const std::vector<uint32_t>& indivisible,
139 unsigned int umax_size,
143 auto size_indivisible = indivisible.size();
144 auto size_needed = data_size + size_indivisible + (
first ? 0 : 1);
149 if(truncating && size_needed > umax_size)
153 output[data_size++] = size_indivisible;
158 data_size += size_indivisible;
173 const std::vector<uint32_t>& nav,
174 const std::vector<std::pair<unsigned, unsigned>>& boundaries)
177 for(
const auto& bpair : boundaries)
179 assert(bpair.first < nav.size());
180 assert(bpair.second >= bpair.first);
181 assert(bpair.second <= nav.size());
184 nav_begin + bpair.second,
186 data_size += bpair.second - bpair.first;
195 find_cuts(
const std::set<std::pair<CLID, std::string>>& collections,
196 const std::vector<std::pair<CLID, std::string>>& idname_include,
197 const std::vector<std::pair<CLID, std::string>>& idname_exclude,
198 std::vector<unsigned int>
cuts,
199 std::vector<std::pair<unsigned int, unsigned int>>&
out)
201 for(
const auto& coll : collections)
225 unsigned add_collection_to_size(
unsigned current_size,
226 const std::pair<unsigned, unsigned>& pair)
228 return current_size + pair.second - pair.first;
236 calc_colls_size(
const std::vector<std::pair<unsigned, unsigned>>& boundaries)
239 add_collection_to_size);
246 auto cuts_dsonly =
CutPairs{{0, m_navigationResultCuts_DSonly.at(1)}};
251 auto modid_coll_it = m_modID_id_name.find(mod_id);
252 if(modid_coll_it !=
std::end(m_modID_id_name))
254 const auto& collections = modid_coll_it->second;
255 find_cuts(collections,
258 m_navigationResultCuts_DSonly,
260 find_cuts(collections,
263 m_navigationResultCuts,
267 return std::make_pair(cuts_dsonly, cuts_reg);
273 static constexpr
auto num_size_words = 3
u;
279 unsigned int umax_size,
280 bool truncating)
const
282 auto calc_size_needed = [data_size](
unsigned int nav_size)
283 {
return nav_size + data_size + 1; };
286 auto is_within_size = [umax_size, &calc_size_needed](
unsigned int cut)
287 {
return calc_size_needed(
cut) <= umax_size; };
291 if(
static_cast<unsigned int>(data_size) < umax_size)
294 auto cut_nav_size = tot_nav_size;
297 if(truncating && calc_size_needed(tot_nav_size) > umax_size)
303 endnav -= tot_nav_size - cut_nav_size;
310 output[data_size++] = cut_nav_size;
312 data_size += cut_nav_size;
323 unsigned int umax_size,
324 unsigned int nav_size,
326 bool truncating)
const
328 if(nav_size + data_size < umax_size)
330 output[data_size++] = nav_size;
331 auto index_for_size_in_nav_preamble = data_size + 1;
337 output[index_for_size_in_nav_preamble] = nav_size;
348 if(
static_cast<unsigned int>(data_size) < umax_size)
360 unsigned int estimated_size)
365 auto umax_size =
static_cast<unsigned int>(max_size);
368 truncating = max_size >= 0 && estimated_size > umax_size;
379 unsigned int umax_size,
380 bool truncating)
const
391 unsigned int umax_size,
392 unsigned int nav_size,
394 bool truncating)
const
396 if(
static_cast<unsigned int>(data_size) < umax_size)
401 &&
static_cast<unsigned int>(data_size) < umax_size)
416 bool truncating{
false};
419 max_size, estim_size) &&
421 max_size, truncating);
431 bool truncating{
false};
433 auto navsize = calc_colls_size(dscuts.first) + calc_colls_size(dscuts.second);
448 const unsigned int mod_id)
453 auto ret =
serialize(aux, data_size, -1, mod_id);
454 auto uptr = std::unique_ptr<uint32_t[]>{aux};
456 output.reserve(data_size);
466 const unsigned int mod_id)
488 if (data_size == 0 )
return false;
489 std::vector<uint32_t> rawResult(&
source[0], &
source[data_size]);
507 rawIndNumOfFixedBit = 12;
511 std::cerr <<
"HLTResult::unpackFromStorable has noticed a class version mismatch and does not know how to translate: raw data version " << raw[0] <<
" current class version " <<
m_HLTResultClassVersion << std::endl;
519 raw.begin()+rawIndNumOfFixedBit);
524 if ( raw.size() == rawIndNumOfFixedBit )
533 bool truncation =
false;
535 if ( readEnd > raw.size() ){
536 readEnd = raw.size();
557 readEnd =
offset + sizeOfNavigation;
558 if (readEnd > raw.size()) {
559 readEnd = raw.size();
568 raw.begin()+readEnd);
577 offset += sizeOfNavigation;
582 if (
offset < raw.size()) {
583 sizeOfExtras = raw[
offset++];
589 readEnd =
offset + sizeOfExtras;
590 if (readEnd > raw.size()) {
591 readEnd = raw.size();
599 raw.begin()+readEnd);
617 std::vector<unsigned int> sizes;
HLTResult & operator=(HLTResult rhs)
unified assignement operator
@ NAV_ERROR
suspected Navigation error
@ NO_LVL1_ITEMS
in the LVL1 result delivered to LVL2 none of LVL1 items are present, that means no seeding informatio...
std::vector< uint32_t > m_extras
extra storeage (which can be used to store some operational infos)
bool serialize_regular(uint32_t *&output, int &data_size, int max_size)
bool serialize_bootstrap(uint32_t *&output, int &data_size, bool &truncating, int max_size, unsigned int estimated_size)
bool deserialize(const std::vector< uint32_t > &source)
GenericResult::deserialize( const std::vector<uint32_t>& source )
std::string find(const std::string &s)
return a remapped string
std::pair< CutPairs, CutPairs > CutPairVecs
std::map< unsigned int, std::set< std::pair< CLID, std::string > > > m_modID_id_name
@ WRONG_HLT_RESULT
error while unpacking HLT reult (happnes at EF when LVL2 result is unpacked)
@ ABORT_EVENT
if things went wrong severely, event corruption suspected
@ ABORT_JOB
if things go really wrong, i.e.
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
HLTExtraData * m_extraData
object for m_extras deserialization (on demand)
@ NO_LVL2_CHAINS
in the LVL2 result unpacked at EF no active LVL2 chains are present, that means no seeding informatio...
@ NO_HLT_RESULT
no HLT result is present (means that LVL2 result was not delivered to EF)
friend void swap(HLTResult &lhs, HLTResult &rhs)
virtual bool error() const
problems during processing
@ IndConfigPrescalesKey
configuration key for prescales
void swap(HLTExtraData &, HLTExtraData &)
@ u
Enums for curvilinear frames.
std::vector< uint32_t > m_chainsResult
storege of serialized chains
@ IndNumOfFixedBit
total number of fixed bits
std::vector< uint32_t > m_navigationResult_DSonly
storage of navigation (serialized also) for DataScouting
ErrorCode getLvlConverterStatus() const
overall hlt status: if StatusCode::isFailure(), event should be discarded from physics stream (and,...
bool serialize(std::vector< uint32_t > &output, const unsigned int mod_id)
std::vector< std::pair< unsigned int, unsigned int > > CutPairs
std::vector< unsigned int > listOfModIDs() const
return the rob module ID vector
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
bool serialize_DS(uint32_t *&output, int &data_size, int max_size, unsigned int mod_id)
@ IndConfigSuperMasterKey
configuration key for the menu
bool isHLTResultTruncated() const
is serialized HLTResult truncated
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
virtual uint32_t error_bits() const
bit flags to explain problems during processing
std::vector< std::pair< CLID, std::string > > m_id_name
HLT::HLTResult is sumarising result of trigger decision evaluation (online/offline) It contains basic...
std::vector< std::pair< CLID, std::string > > m_id_name_DSonly
unsigned int estimateSize() const
Estimate the size this HLTResult would ocuppy once serialized.
void setConfigSuperMasterKey(uint32_t key)
sets the key of the menu which was used to trigger this event
bool isEmpty() const
true if result is empty
bool serialize_navigation_DS(uint32_t *output, int &data_size, unsigned int umax_size, unsigned int nav_size, const CutPairVecs &dscuts, bool truncating) const
std::vector< uint32_t > m_navigationResult
storage of navigation (serialized also)
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.
@ TIMEOUT
the timeout occured
bool serialize_body_DS(uint32_t *output, int &data_size, unsigned int max_size, unsigned int nav_size, const CutPairVecs &dscuts, bool truncating) const
@ ABORT_CHAIN
if things went wrong but it is not severe, other unrelated chains will continue
ErrorCode getHLTStatus() const
overall hlt status: if StatusCode::isFailure(), event should be discarded from physics stream (and,...
std::vector< unsigned int > m_navigationResultCuts
@ CONTINUE
if all is OK the processing should be continued
static unsigned int calc_total_size_DS(unsigned int ds_nav_size)
Calculate the size of a DS result, given the size of its navigation.
std::vector< uint32_t > m_headerResult
the full payload, and sub-payloads
void setConfigPrescalesKey(uint32_t key)
sets the key of the prescales config which was used to trigger this event
std::vector< unsigned int > partSizes() const
unsigned int size() const
uint32_t getConfigPrescalesKey() const
gets the key of the prescales config which was used to trigger this event
bool unpackFromStorable(const std::vector< uint32_t > &raw)
split the rawResult vector into rawPartialResult's
uint32_t getConfigSuperMasterKey() const
gets the key of the menu which was used to trigger this event
HLTExtraData & getExtraData()
@ IndHLTResultClassVersion
bool serialize_navigation_reg(uint32_t *output, int &data_size, unsigned int umax_size, bool truncating) const
std::vector< unsigned int > m_navigationResultCuts_DSonly
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
static const uint32_t m_HLTResultClassVersion
the version of this HLTResult class
CutPairVecs findDSCuts(unsigned int) const
Find the pairs of cut points that mark the boundaries of DS collections for the given module id.
void setHLTResultTruncated(bool truncated)
bool serialize_body_regular(uint32_t *output, int &data_size, unsigned int umax_size, bool truncating) const