From 35503c927e973662a55f07eb55d5f59985ad3ba3 Mon Sep 17 00:00:00 2001 From: Savannah Rose Shively <savannah.rose.shively@cern.ch> Date: Fri, 2 Oct 2020 19:06:31 +0200 Subject: [PATCH] sg fix --- .../SimHitExample/src/SimHitAlg.cxx | 31 ++++++++++++++----- .../SimHitExample/src/SimHitAlg.h | 7 ++++- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx index fc396381..b8da7e60 100644 --- a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx +++ b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.cxx @@ -24,11 +24,23 @@ StatusCode SimHitAlg::initialize() // initialize data handle keys ATH_CHECK( m_mcEventKey.initialize() ); ATH_CHECK( m_faserSiHitKey.initialize() ); - ATH_CHECK( m_scintHitKey.initialize() ); + + //Sav things + ATH_CHECK( m_preshowerHitKey.initialize() ); + ATH_CHECK( m_triggerHitKey.initialize() ); + ATH_CHECK( m_vetoHitKey.initialize() ); + ATH_MSG_INFO( "Using GenEvent collection with key " << m_mcEventKey.key()); ATH_MSG_INFO( "Using Faser SiHit collection with key " << m_faserSiHitKey.key()); - ATH_MSG_INFO( "Using ScintHit collection with key " << m_scintHitKey.key()); + + ATH_MSG_INFO( "Using ScintHit collection with key " << m_preshowerHitKey.key()); + ATH_MSG_INFO( "Using ScintHit collection with key " << m_triggerHitKey.key()); + ATH_MSG_INFO( "Using ScintHit collection with key " << m_vetoHitKey.key()); + + return StatusCode::SUCCESS; + + } StatusCode SimHitAlg::execute() @@ -41,8 +53,13 @@ StatusCode SimHitAlg::execute() SG::ReadHandle<FaserSiHitCollection> h_siHits(m_faserSiHitKey); ATH_MSG_INFO("Read FaserSiHitCollection with " << h_siHits->size() << " hits"); - SG::ReadHandle<ScintHitCollection> h_scintHits(m_scintHitKey); - ATH_MSG_INFO("Read ScintHitCollection with " << h_scintHits->size() << " hits"); + SG::ReadHandle<ScintHitCollection> h_preshowerHits(m_preshowerHitKey); + ATH_MSG_INFO("Read ScintHitCollection with " << h_preshowerHits->size() << " hits"); + SG::ReadHandle<ScintHitCollection> h_triggerHits(m_triggerHitKey); + ATH_MSG_INFO("Read ScintHitCollection with " << h_triggerHits->size() << " hits"); + SG::ReadHandle<ScintHitCollection> h_vetoHits(m_vetoHitKey); + ATH_MSG_INFO("Read ScintHitCollection with " << h_vetoHits->size() << " hits"); + // Since we have no pile-up, there should always be a single GenEvent in the container const HepMC::GenEvent* ev = (*h_mcEvents)[0]; @@ -76,7 +93,7 @@ StatusCode SimHitAlg::execute() - if (h_scintHits->size()!=0){ + /*if (h_scintHits->size()!=0){ for (const ScintHit& hit : *h_scintHits) { hit.print(); @@ -89,10 +106,10 @@ StatusCode SimHitAlg::execute() else { m_moduleSide2->Fill( hit.getModule(), hit.getRow()); - }*/ + }// } - } + }*/ return StatusCode::SUCCESS; } diff --git a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h index 3c5929ce..2683ec99 100644 --- a/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h +++ b/Control/CalypsoExample/SimHitExample/src/SimHitAlg.h @@ -32,5 +32,10 @@ class SimHitAlg : public AthHistogramAlgorithm // Note the key names ("GEN_EVENT" or "SCT_Hits") are Gaudi properties and can be configured at run-time SG::ReadHandleKey<McEventCollection> m_mcEventKey { this, "McEventCollection", "GEN_EVENT" }; SG::ReadHandleKey<FaserSiHitCollection> m_faserSiHitKey { this, "FaserSiHitCollection", "SCT_Hits" }; - SG::ReadHandleKey<ScintHitCollection> m_scintHitKey { this, "ScintHitCollection", "Scint_Hits" }; + + //PreshowerHits, TriggerHits, VetoHits Sav new stuff + SG::ReadHandleKey<ScintHitCollection> m_scintHitKey { this, "ScintHitCollection", "Scint_Hits" }; //template. remove later + SG::ReadHandleKey<ScintHitCollection> m_preshowerHitKey { this, "ScintHitCollection", "PreshowerHits" }; + SG::ReadHandleKey<ScintHitCollection> m_triggerHitKey { this, "ScintHitCollection", "TriggerHits" }; + SG::ReadHandleKey<ScintHitCollection> m_vetoHitKey { this, "ScintHitCollection", "VetoHits" }; }; \ No newline at end of file -- GitLab