Commit c8bf0642 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'master-ATR-20930' into 'master'

Switch PrescalingEmulationTool to use event context for timestamp (ATR-20930)

Closes ATR-20930

See merge request !30518
parents 3d037b52 87dbe584
......@@ -21,9 +21,6 @@ PrescalingEmulationTool::PrescalingEmulationTool( const std::string& type,
PrescalingEmulationTool::~PrescalingEmulationTool() { }
StatusCode PrescalingEmulationTool::initialize() {
CHECK( m_eventInfo.initialize( not m_eventInfo.key().empty() ) );
for ( const std::string& confElement: m_prescalingConfig ) {
std::string chainName( confElement, 0, confElement.find(':') );
std::string psValue( confElement, confElement.find(':')+1 );
......@@ -41,15 +38,9 @@ StatusCode PrescalingEmulationTool::prescaleChains( const EventContext& ctx,
// obtain CTP time
remainActive.reserve( initialyActive.size() );
size_t seed = initialyActive[0].numeric();
if ( not m_eventInfo.key().empty() ) {
auto handle = SG::makeHandle( m_eventInfo, ctx );
const xAOD::EventInfo* event = handle.cptr();
// not sure we should mimick something we had before, will not be abel to reproduce it exactly anyways
seed = event->timeStamp() ^ event->timeStampNSOffset();
}
// create the seed from the event time
size_t seed = ctx.eventID().time_stamp() ^ ctx.eventID().time_stamp_ns_offset();
CLHEP::HepRandomEngine* engine = m_RNGEngines.getEngine( ctx );
engine->setSeed( seed, 0 );
for ( auto ch: initialyActive ) {
......
......@@ -43,7 +43,6 @@ public:
private:
PrescalingEmulationTool();
SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo{ this, "EventInfo", "EventInfo", "EventInfo object, source of CTP time used to reseed the RNG" };
Gaudi::Property<bool> m_keepUnknownChains{ this, "KeepUnknownChains", true, "If True then chains for which prescaling information is not set are kept" };
Gaudi::Property< std::vector<std::string> > m_prescalingConfig{ this, "Prescales", {}, "The prescaling info in the form: \"chainName:PSValue\"" };
ATHRNG::RNGWrapper m_RNGEngines;
......
......@@ -237,7 +237,6 @@ def generateL1DecoderAndChains():
L1UnpackingSeq = parOR("L1UnpackingSeq")
l1Decoder = L1Decoder( RoIBResult="", L1TriggerResult="" )
l1Decoder.prescaler.EventInfo=""
l1Decoder.L1DecoderSummaryKey = "L1DecoderSummary"
ctpUnpacker = CTPUnpackingEmulationTool( ForceEnableAllChains=False , InputFilename="ctp.dat" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment