Skip to content
Snippets Groups Projects
Commit 03397b0a authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'fixEvtNumbering' into 'master'

Fix evt and run numbering

See merge request !47069
parents d05984ea 2104fed8
No related branches found
No related tags found
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!47069Fix evt and run numbering
......@@ -67,8 +67,8 @@ topSequence.NSWL1Simulation.DoNtuple=True
topSequence.NSWL1Simulation.PadTdsTool.DoNtuple=True
topSequence.NSWL1Simulation.PadTriggerTool.DoNtuple=True
topSequence.NSWL1Simulation.StripTdsTool.DoNtuple=True
topSequence.NSWL1Simulation.StripClusterTool.DoNtuple=True
topSequence.NSWL1Simulation.StripSegmentTool.DoNtuple=True
topSequence.NSWL1Simulation.StripClusterTool.DoNtuple=False
topSequence.NSWL1Simulation.StripSegmentTool.DoNtuple=False
#useful for validation of geometry and offline analyses
topSequence.NSWL1Simulation.PadTriggerLookupTool.DumpSectorGeometry=False
......
......@@ -5,11 +5,6 @@
// Athena/Gaudi includes
#include "GaudiKernel/ITHistSvc.h"
//Event info includes
#include "EventInfo/EventInfo.h"
#include "EventInfo/EventID.h"
// root includes
#include "TTree.h"
// Local includes
......@@ -63,6 +58,7 @@ namespace NSWL1 {
ATH_MSG_DEBUG( "initialize " << name() );
ATH_CHECK( m_trigRdoContainer.initialize() );
ATH_CHECK( m_xaodevtKey.initialize() );
ATH_CHECK( m_eventInfoKey.initialize() );
// Create an register the ntuple if requested, add branch for event and run number
if ( m_doNtuple ) {
ITHistSvc* tHistSvc;
......@@ -70,6 +66,7 @@ namespace NSWL1 {
char ntuple_name[40];
memset(ntuple_name,'\0',40*sizeof(char));
sprintf(ntuple_name,"%sTree",name().c_str());
m_current_evt = 0, m_current_run = 0;
// create Ntuple and the branches
m_tree = new TTree(ntuple_name, "Ntuple of NSWL1Simulation");
......@@ -113,7 +110,7 @@ namespace NSWL1 {
ATH_MSG_DEBUG("start " << name() );
if(m_doNtuple){
for ( auto& mon : m_monitors ) {
ATH_CHECK(mon->bookHists());
ATH_CHECK(mon->bookHists());
}
}
return StatusCode::SUCCESS;
......@@ -122,9 +119,15 @@ namespace NSWL1 {
StatusCode NSWL1Simulation::execute() {
SG::ReadHandle<xAOD::EventInfo> evt(m_xaodevtKey);
CHECK(evt.isValid());
m_current_run = evt->runNumber();
m_current_evt = evt->eventNumber();
if (evt.isValid()) {
m_current_run = evt->runNumber();
m_current_evt = evt->eventNumber();
} else {
SG::ReadHandle<EventInfo> eventInfo (m_eventInfoKey);
if(eventInfo->event_ID()->event_number() == 0 && m_current_evt == 0) ATH_MSG_DEBUG("Start " << name());
else ++m_current_evt;
m_current_run = eventInfo->event_ID()->run_number();
}
std::vector<std::shared_ptr<PadData>> pads;
std::vector<std::unique_ptr<PadTrigger>> padTriggers;
......@@ -138,7 +141,7 @@ namespace NSWL1 {
ATH_CHECK( m_pad_trigger_lookup->lookup_pad_triggers(pads, padTriggers) );
}
else{
ATH_CHECK( m_pad_trigger->compute_pad_triggers(pads, padTriggers) );
ATH_CHECK( m_pad_trigger->compute_pad_triggers(pads, padTriggers) );
}
ATH_CHECK( m_strip_tds->gather_strip_data(strips,padTriggers) );
......@@ -160,7 +163,7 @@ namespace NSWL1 {
}
if(m_doNtuple){
for ( auto& mon : m_monitors) {
ATH_CHECK(mon->fillHists());
ATH_CHECK(mon->fillHists());
}
if (m_tree) m_tree->Fill();
}
......@@ -180,7 +183,6 @@ namespace NSWL1 {
}
}
}
return StatusCode::SUCCESS;
}
......@@ -189,7 +191,7 @@ namespace NSWL1 {
ATH_MSG_DEBUG( "finalize" << name() );
if(m_doNtuple){
for ( auto& mon : m_monitors ) {
ATH_CHECK(mon->finalHists());
ATH_CHECK(mon->finalHists());
}
}
return StatusCode::SUCCESS;
......
......@@ -26,6 +26,8 @@
#include "TrigT1NSWSimTools/PadTriggerAdapter.h"
#include "xAODEventInfo/EventInfo.h"
#include "EventInfo/EventInfo.h"
#include "EventInfo/EventID.h"
// Forward includes
class StoreGateSvc;
......@@ -100,6 +102,7 @@ namespace NSWL1 {
protected:
SG::ReadHandleKey<xAOD::EventInfo> m_xaodevtKey{this,"xAODEventInfoKey","EventInfo","Key of xAOD::EventInfo"};
SG::ReadHandleKey<EventInfo> m_eventInfoKey{this,"EventInfoKey","McEventInfo","Key of RDO EventInfo"};
SG::WriteHandleKey<Muon::NSW_TrigRawDataContainer> m_trigRdoContainer;
SG::WriteHandleKey<Muon::NSW_PadTriggerDataContainer> m_padTriggerRdoKey;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment