From a757456b0e70d48b4761104e5a19ad56181b1691 Mon Sep 17 00:00:00 2001 From: lintao <lintao@ihep.ac.cn> Date: Wed, 6 Nov 2024 10:08:21 +0800 Subject: [PATCH] Gen: Rename namespace. --- Generator/src/GenAlgo.cpp | 2 +- Generator/src/GenAlgo.h | 1 - Generator/src/GenEvent.cpp | 2 +- Generator/src/GenEvent.h | 6 +++--- Generator/src/GenPrinter.cpp | 2 +- Generator/src/GenPrinter.h | 4 +--- Generator/src/GenReader.h | 2 +- Generator/src/GtBeamBackgroundTool.cpp | 2 +- Generator/src/GtBeamBackgroundTool.h | 2 +- Generator/src/GtGunTool.cpp | 2 +- Generator/src/GtGunTool.h | 2 +- Generator/src/HepMCRdr.cpp | 2 +- Generator/src/HepMCRdr.h | 2 +- Generator/src/HepevtRdr.cpp | 2 +- Generator/src/HepevtRdr.h | 2 +- Generator/src/IGenTool.h | 2 +- Generator/src/SLCIORdr.cpp | 2 +- Generator/src/SLCIORdr.h | 2 +- Generator/src/StdHepRdr.cpp | 2 +- Generator/src/StdHepRdr.h | 2 +- 20 files changed, 21 insertions(+), 24 deletions(-) diff --git a/Generator/src/GenAlgo.cpp b/Generator/src/GenAlgo.cpp index 2d8ec897..c4a444d8 100644 --- a/Generator/src/GenAlgo.cpp +++ b/Generator/src/GenAlgo.cpp @@ -43,7 +43,7 @@ StatusCode GenAlgo::execute() { m_evtid++; auto mcCol = m_hdl.createAndPut(); - MyHepMC::GenEvent m_event(*mcCol); + Gen::GenEvent m_event(*mcCol); for(auto gentool: m_genTools) { if (gentool->mutate(m_event)) {} diff --git a/Generator/src/GenAlgo.h b/Generator/src/GenAlgo.h index 2fa42bfa..d69bf016 100644 --- a/Generator/src/GenAlgo.h +++ b/Generator/src/GenAlgo.h @@ -35,7 +35,6 @@ private: int m_evtid; int m_evtMax; - //MyHepMC::GenEvent m_event; DataHandle<edm4hep::MCParticleCollection> m_hdl{"MCParticleGen", Gaudi::DataHandle::Writer, this}; diff --git a/Generator/src/GenEvent.cpp b/Generator/src/GenEvent.cpp index 8d8c2542..7a6df735 100644 --- a/Generator/src/GenEvent.cpp +++ b/Generator/src/GenEvent.cpp @@ -3,7 +3,7 @@ // using namespace std; -namespace MyHepMC{ +namespace Gen { //GenEvent::GenEvent(){ GenEvent::GenEvent(edm4hep::MCParticleCollection& mcCol) diff --git a/Generator/src/GenEvent.h b/Generator/src/GenEvent.h index fd1dbe55..b6121343 100644 --- a/Generator/src/GenEvent.h +++ b/Generator/src/GenEvent.h @@ -1,11 +1,11 @@ #ifndef GenEvent_h #define GenEvent_h 1 -#include "edm4hep/MCParticleCollection.h"//plico +#include "edm4hep/MCParticleCollection.h" -namespace MyHepMC { +namespace Gen { -class GenEvent{ +class GenEvent { public: //GenEvent(); GenEvent(edm4hep::MCParticleCollection& mcCol); diff --git a/Generator/src/GenPrinter.cpp b/Generator/src/GenPrinter.cpp index 359f26de..bf8597d6 100644 --- a/Generator/src/GenPrinter.cpp +++ b/Generator/src/GenPrinter.cpp @@ -3,7 +3,7 @@ DECLARE_COMPONENT(GenPrinter) -bool GenPrinter::mutate(MyHepMC::GenEvent& event){ +bool GenPrinter::mutate(Gen::GenEvent& event){ auto msglevel = msgLevel(); // only print when current msglevel is MSG::DEBUG/VERBOSE diff --git a/Generator/src/GenPrinter.h b/Generator/src/GenPrinter.h index bf532003..fe33f108 100644 --- a/Generator/src/GenPrinter.h +++ b/Generator/src/GenPrinter.h @@ -5,8 +5,6 @@ #include "GenEvent.h" #include "IGenTool.h" -using namespace std; - class GenPrinter: public extends<AlgTool, IGenTool> { public: using extends::extends; @@ -17,7 +15,7 @@ public: public: bool configure_gentool() override; - bool mutate(MyHepMC::GenEvent& event) override; + bool mutate(Gen::GenEvent& event) override; bool finish() override; }; diff --git a/Generator/src/GenReader.h b/Generator/src/GenReader.h index affb3824..32c613b7 100644 --- a/Generator/src/GenReader.h +++ b/Generator/src/GenReader.h @@ -13,7 +13,7 @@ class GenReader: virtual public IGenTool{ public: virtual ~GenReader() = 0; virtual bool configure_gentool()=0; - virtual bool mutate(MyHepMC::GenEvent& event)=0; + virtual bool mutate(Gen::GenEvent& event)=0; virtual bool finish()=0; virtual bool isEnd()=0; diff --git a/Generator/src/GtBeamBackgroundTool.cpp b/Generator/src/GtBeamBackgroundTool.cpp index cd8a3727..3c7fc305 100644 --- a/Generator/src/GtBeamBackgroundTool.cpp +++ b/Generator/src/GtBeamBackgroundTool.cpp @@ -57,7 +57,7 @@ StatusCode GtBeamBackgroundTool::finalize() { } -bool GtBeamBackgroundTool::mutate(MyHepMC::GenEvent& event) { +bool GtBeamBackgroundTool::mutate(Gen::GenEvent& event) { if (m_beaminputs.empty()) { return false; } diff --git a/Generator/src/GtBeamBackgroundTool.h b/Generator/src/GtBeamBackgroundTool.h index 40a6ce66..c91533e7 100644 --- a/Generator/src/GtBeamBackgroundTool.h +++ b/Generator/src/GtBeamBackgroundTool.h @@ -42,7 +42,7 @@ public: StatusCode finalize() override; // IGenTool - bool mutate(MyHepMC::GenEvent& event) override; + bool mutate(Gen::GenEvent& event) override; bool finish() override; bool configure_gentool() override; diff --git a/Generator/src/GtGunTool.cpp b/Generator/src/GtGunTool.cpp index 48697c0b..ad747984 100644 --- a/Generator/src/GtGunTool.cpp +++ b/Generator/src/GtGunTool.cpp @@ -114,7 +114,7 @@ GtGunTool::finalize() { } bool -GtGunTool::mutate(MyHepMC::GenEvent& event) { +GtGunTool::mutate(Gen::GenEvent& event) { TDatabasePDG* db_pdg = TDatabasePDG::Instance(); diff --git a/Generator/src/GtGunTool.h b/Generator/src/GtGunTool.h index 0f3f7716..bc1fcd58 100644 --- a/Generator/src/GtGunTool.h +++ b/Generator/src/GtGunTool.h @@ -26,7 +26,7 @@ public: StatusCode finalize() override; // IGenTool - bool mutate(MyHepMC::GenEvent& event) override; + bool mutate(Gen::GenEvent& event) override; bool finish() override; bool configure_gentool() override; diff --git a/Generator/src/HepMCRdr.cpp b/Generator/src/HepMCRdr.cpp index 5e5c9e5d..a0458043 100644 --- a/Generator/src/HepMCRdr.cpp +++ b/Generator/src/HepMCRdr.cpp @@ -28,7 +28,7 @@ HepMCRdr::~HepMCRdr(){ delete ascii_in; } -bool HepMCRdr::mutate(MyHepMC::GenEvent& event){ +bool HepMCRdr::mutate(Gen::GenEvent& event){ ++m_processed_event; HepMC::GenEvent* evt = ascii_in->read_next_event(); diff --git a/Generator/src/HepMCRdr.h b/Generator/src/HepMCRdr.h index 43a9d05b..0614991c 100644 --- a/Generator/src/HepMCRdr.h +++ b/Generator/src/HepMCRdr.h @@ -20,7 +20,7 @@ class HepMCRdr: public extends<AlgTool, GenReader> { StatusCode finalize() override; bool configure_gentool(); - bool mutate(MyHepMC::GenEvent& event); + bool mutate(Gen::GenEvent& event); bool finish(); bool isEnd(); diff --git a/Generator/src/HepevtRdr.cpp b/Generator/src/HepevtRdr.cpp index bfa94508..be2d1438 100644 --- a/Generator/src/HepevtRdr.cpp +++ b/Generator/src/HepevtRdr.cpp @@ -85,7 +85,7 @@ bool HepevtRdr::configure_gentool(){ return true; } -bool HepevtRdr::mutate(MyHepMC::GenEvent& event){ +bool HepevtRdr::mutate(Gen::GenEvent& event){ ++m_processed_event; LCCollectionVec* mc_vec = m_hepevt_rdr->readEvent(); if(mc_vec==nullptr) return false; diff --git a/Generator/src/HepevtRdr.h b/Generator/src/HepevtRdr.h index a9db8690..edde1c95 100644 --- a/Generator/src/HepevtRdr.h +++ b/Generator/src/HepevtRdr.h @@ -20,7 +20,7 @@ class HepevtRdr: public extends<AlgTool, GenReader> { StatusCode finalize() override; bool configure_gentool(); - bool mutate(MyHepMC::GenEvent& event); + bool mutate(Gen::GenEvent& event); bool finish(); bool isEnd(); diff --git a/Generator/src/IGenTool.h b/Generator/src/IGenTool.h index ef43bc74..88be6bdd 100644 --- a/Generator/src/IGenTool.h +++ b/Generator/src/IGenTool.h @@ -15,7 +15,7 @@ class IGenTool: virtual public IAlgTool { public: - virtual bool mutate(MyHepMC::GenEvent& event)=0; + virtual bool mutate(Gen::GenEvent& event)=0; virtual bool finish()=0; virtual bool configure_gentool()=0; virtual ~IGenTool(); diff --git a/Generator/src/SLCIORdr.cpp b/Generator/src/SLCIORdr.cpp index 7478f340..036b03e0 100644 --- a/Generator/src/SLCIORdr.cpp +++ b/Generator/src/SLCIORdr.cpp @@ -34,7 +34,7 @@ SLCIORdr::~SLCIORdr(){ delete m_slcio_rdr; } -bool SLCIORdr::mutate(MyHepMC::GenEvent& event){ +bool SLCIORdr::mutate(Gen::GenEvent& event){ ++m_processed_event; IMPL::LCCollectionVec* lcMCVec = new IMPL::LCCollectionVec(LCIO::MCPARTICLE); EVENT::LCEvent *lcEvent = m_slcio_rdr->readNextEvent(LCIO::UPDATE); diff --git a/Generator/src/SLCIORdr.h b/Generator/src/SLCIORdr.h index 7640d078..48a01a46 100644 --- a/Generator/src/SLCIORdr.h +++ b/Generator/src/SLCIORdr.h @@ -27,7 +27,7 @@ class SLCIORdr: public extends<AlgTool, GenReader> { StatusCode finalize() override; bool configure_gentool() override; - bool mutate(MyHepMC::GenEvent& event) override; + bool mutate(Gen::GenEvent& event) override; bool finish() override; bool isEnd() override; diff --git a/Generator/src/StdHepRdr.cpp b/Generator/src/StdHepRdr.cpp index 756c124a..ee2570f6 100644 --- a/Generator/src/StdHepRdr.cpp +++ b/Generator/src/StdHepRdr.cpp @@ -30,7 +30,7 @@ StdHepRdr::~StdHepRdr(){ delete m_stdhep_rdr; } -bool StdHepRdr::mutate(MyHepMC::GenEvent& event){ +bool StdHepRdr::mutate(Gen::GenEvent& event){ ++m_processed_event; if(isEnd()) return false; LCCollectionVec* mc_vec = m_stdhep_rdr->readEvent(); diff --git a/Generator/src/StdHepRdr.h b/Generator/src/StdHepRdr.h index b9e555c9..7e1f2196 100644 --- a/Generator/src/StdHepRdr.h +++ b/Generator/src/StdHepRdr.h @@ -24,7 +24,7 @@ public: StatusCode finalize() override; bool configure_gentool() override; - bool mutate(MyHepMC::GenEvent& event) override; + bool mutate(Gen::GenEvent& event) override; bool finish() override; bool isEnd() override; -- GitLab