1 / 8

MuoProcessor

MuoProcessor. Decouple data and processor Decouple data and framework processors more general only one processor for all muon software Preferably, put all processors in one package circular dependencies!. edm::Event. MC data. Digi data. Unp. data. Data. Data-processors. MuoProcessor.

randi
Télécharger la présentation

MuoProcessor

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MuoProcessor • Decouple data and processor • Decouple data and framework • processors more general • only one processor for all muon software • Preferably, put all processors in one package • circular dependencies! Onne Peters, NIKHEF

  2. edm::Event MC data Digi data Unp. data Data Data-processors MuoProcessor Data-users muo_segment L3 Onne Peters, NIKHEF

  3. Dependencies Reconstructor class dummy MuoProcessor unpack_evt edm identifiers muon_index simpp framework muon_geometry CLHEP d0om rcp muo_digi Onne Peters, NIKHEF

  4. // MuoProcessor.hpp // This is the implementation with a template for the return type // and a template for the data type #include "util/Data.hpp" #include <iostream> namespace Muon { template< class From, class To > class MuoProcessor { public: static To* processData(From& unProcData); }; } // namespace Muon Onne Peters, NIKHEF

  5. // MuoDigiProcessor.cpp // This is the implementation with a template for the return type // and a template for the data type for a MuoDigiChunk #include "MuoProcessor_T2/MuoProcessor.hpp" #include <iostream> using namespace Muon; using namespace std; MuoDigiChunk* MuoProcessor<Event, MuoDigiChunk>::processData(Event& event) { cout << "Processing an Event to a MuoDigiChunk" << endl; MuoDigiChunk *chunk = new MuoDigiChunk(); return chunk; }; MuoDigiChunk* MuoProcessor<UnpDataChunk,MuoDigiChunk >::processData(UnpDataChunk& unpdatachunk) { cout << "Processing an UnpDataChunk to a MuoDigiChunk" << endl; MuoDigiChunk *chunk = new MuoDigiChunk(); return chunk; }; MuoDigiChunk* MuoProcessor<MuoDigiChunk, MuoDigiChunk>::processData(MuoDigiChunk& muodigichunk) { cout << "Processing a MuoDigiChunk to a MuoDigiChunk ?????” << endl; return &muodigichunk; } Onne Peters, NIKHEF

  6. // MuoDigiProcessor.cpp // This is the implementation with a template for the return type // and a template for the data type for a MuoDigiChunk #include "MuoProcessor_T2/MuoProcessor.hpp" #include <iostream> using namespace Muon; using namespace std; UnpDataChunk* MuoProcessor<Event, UnpDataChunk>::processData(Event& event) { cout << "Processing an Event to a UnpDataChunk" << endl; UnpDataChunk *chunk = new UnpDataChunk(); return chunk; }; UnpDataChunk* MuoProcessor<UnpDataChunk, UnpDataChunk>::processData(UnpDataChunk& unpdatachunk) { cout << "Processing an UnpDataChunk to a UnpDataChunk ?????" << endl; return &unpdatachunk; }; UnpDataChunk* MuoProcessor<MuoDigiChunk, UnpDataChunk>::processData(MuoDigiChunk& muodigichunk) { cout << "Processing a MuoDigiChunk to a UnpDataChunk " << endl; UnpDataChunk *chunk = new UnpDataChunk(); return chunk; } Onne Peters, NIKHEF

  7. How to use it #include “MuoProcessor/MuoProcessor.hpp” Result processEvent( Event &evt ) { UnpDataChunk *chunk; chunk = MuoProcessor<Event, UnpDataChunk >:: processData(evt); // Do something with the chunk return Result::success; } Onne Peters, NIKHEF

  8. If a certain processor is not implemented, linker will give an error • Easy to implement new data types • Requires no change of source! • Easy to use • Only have to include header MuoProcessor.hpp • Processors can be in different packages • Not preferable Onne Peters, NIKHEF

More Related