diff --git a/Examples/options/LCIO_read.py b/Examples/options/LCIO_read.py index 0a3a9428b4cfeacecbf831e4f1137edc2a3d4e33..372754e269fd92a66bd47f1c6e51038f211c2ac1 100644 --- a/Examples/options/LCIO_read.py +++ b/Examples/options/LCIO_read.py @@ -7,9 +7,12 @@ dsvc = LCIODataSvc("EventDataSvc", input="/cefs/data/FullSim/CEPC240/CEPC_v4/hig from Configurables import PlcioReadAlg alg = PlcioReadAlg("PlcioReadAlg") +alg.InputCol.Path = "MCParticle" +alg.HeaderCol.Path = "EventHeader" from Configurables import LCIOInput lcioinput = LCIOInput("LCIOReader", collections=[ + "EventHeader", "MCParticle", "COILCollection", "EcalBarrelSiliconCollection", diff --git a/Examples/options/plcio_write.py b/Examples/options/plcio_write.py index e2619218625bf9d1f7e4835e47ba1a22f5defac0..0096c2df8cbcdf2ec6137ce9705ef05bf9d951f8 100644 --- a/Examples/options/plcio_write.py +++ b/Examples/options/plcio_write.py @@ -7,7 +7,7 @@ dsvc = CEPCDataSvc("EventDataSvc") from Configurables import PlcioWriteAlg alg = PlcioWriteAlg("PlcioWriteAlg") -alg.OutputCol.Path = "MCParticleCol" +alg.OutputCol.Path = "MCParticle" from Configurables import PodioOutput out = PodioOutput("out") diff --git a/Examples/src/PlcioTest/PlcioReadAlg.cpp b/Examples/src/PlcioTest/PlcioReadAlg.cpp index 59d420ddb954b976c6814cf7b1177381cdb711fa..5921731c34e09bae568c93124ec786b76fc109a3 100644 --- a/Examples/src/PlcioTest/PlcioReadAlg.cpp +++ b/Examples/src/PlcioTest/PlcioReadAlg.cpp @@ -1,4 +1,5 @@ #include "PlcioReadAlg.h" +#include "plcio/EventHeaderCollection.h" #include "plcio/MCParticleCollection.h" DECLARE_COMPONENT(PlcioReadAlg) @@ -6,7 +7,8 @@ DECLARE_COMPONENT(PlcioReadAlg) PlcioReadAlg::PlcioReadAlg(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { - declareProperty("MCParticleCol", m_hdl, "MCParticle collection (input)"); + declareProperty("HeaderCol", m_headerCol); + declareProperty("InputCol", m_mcParCol, "MCParticle collection (input)"); } StatusCode PlcioReadAlg::initialize() @@ -18,19 +20,21 @@ StatusCode PlcioReadAlg::initialize() StatusCode PlcioReadAlg::execute() { debug() << "begin execute PlcioReadAlg" << endmsg; - auto mcCol = m_hdl.get(); -// debug() << "testing loop..." <<endmsg; + auto headers = m_headerCol.get(); + auto header = headers->at(0); + auto mcCol = m_mcParCol.get(); + + info() << "Run " << header.getRunNumber() << " Event " << header.getEventNumber() << " { "; for ( auto p : *mcCol ) { - debug() << p.getObjectID().index << " : ["; + info() << p.getObjectID().index << " : ["; for ( auto it = p.daughters_begin(), end = p.daughters_end(); it != end; ++it ) { - debug() << " " << it->getObjectID().index; + info() << " " << it->getObjectID().index; } - debug() << " ]; "; + info() << " ]; "; } - debug() << endmsg; + info() << "}" << endmsg; -// debug() << "end execute PlcioReadAlg" << endmsg; return StatusCode::SUCCESS; } diff --git a/Examples/src/PlcioTest/PlcioReadAlg.h b/Examples/src/PlcioTest/PlcioReadAlg.h index 07d0eae4cbec3cb2ef2de756d32fa5671bf90e0b..5b9ec8152abd5d3808d9158cd3930bd9ad240a6f 100644 --- a/Examples/src/PlcioTest/PlcioReadAlg.h +++ b/Examples/src/PlcioTest/PlcioReadAlg.h @@ -5,6 +5,7 @@ #include "GaudiAlg/GaudiAlgorithm.h" namespace plcio { + class EventHeaderCollection; class MCParticleCollection; } @@ -22,7 +23,8 @@ class PlcioReadAlg : public GaudiAlgorithm private : - DataHandle<plcio::MCParticleCollection> m_hdl{"MCParticle", Gaudi::DataHandle::Reader, this}; + DataHandle<plcio::EventHeaderCollection> m_headerCol{"EventHeaderCol", Gaudi::DataHandle::Reader, this}; + DataHandle<plcio::MCParticleCollection> m_mcParCol{"MCParticleCol", Gaudi::DataHandle::Reader, this}; };