9 #include <EVENT/LCEvent.h> 10 #include <EVENT/LCRunHeader.h> 28 auto store = std::make_shared<EventStore>() ;
29 store->setEvent( event ) ;
31 auto evtn =
event->getEventNumber() ;
32 auto runn =
event->getRunNumber() ;
33 unsigned char * c = (
unsigned char *) &evtn ;
35 c = (
unsigned char *) &runn ;
37 store->setUID( uid ) ;
46 auto header = std::make_shared<RunHeader>() ;
47 header->setRunNumber( rhdr->getRunNumber() ) ;
48 header->setDetectorName( rhdr->getDetectorName() ) ;
49 header->setDescription( rhdr->getDescription() ) ;
50 auto subdets = rhdr->getActiveSubdetectors() ;
51 header->setParameter(
"ActiveSubdetectors", *subdets ) ;
52 auto &lcparams = rhdr->parameters() ;
53 EVENT::StringVec intKeys, floatKeys, strKeys ;
54 lcparams.getIntKeys( intKeys ) ;
55 lcparams.getFloatKeys( floatKeys ) ;
56 lcparams.getStringKeys( strKeys ) ;
57 header->setParameter(
"LCIntKeys", intKeys ) ;
58 header->setParameter(
"LCFloatKeys", floatKeys ) ;
59 header->setParameter(
"LCStrKeys", strKeys ) ;
60 for(
auto key : intKeys ) {
61 EVENT::IntVec values ;
62 lcparams.getIntVals( key, values ) ;
63 header->setParameter( key, values ) ;
65 for(
auto key : intKeys ) {
66 EVENT::FloatVec values ;
67 lcparams.getFloatVals( key, values ) ;
68 header->setParameter( key, values ) ;
70 for(
auto key : intKeys ) {
71 EVENT::StringVec values ;
72 lcparams.getStringVals( key, values ) ;
73 header->setParameter( key, values ) ;
EventFunction _onEventRead
Callback function on event read.
void processEvent(std::shared_ptr< EVENT::LCEvent > event) override
unsigned jenkins_hash(unsigned char *k, unsigned length, unsigned initval)
std::function< void(std::shared_ptr< RunHeader >)> RunHeaderFunction
std::function< void(std::shared_ptr< EventStore >)> EventFunction
void onEventRead(EventFunction func)
Set the callback function to process on event read.
RunHeaderFunction _onRunHeaderRead
Callback function on run info read.
void onRunHeaderRead(RunHeaderFunction func)
Set the callback function to process on run info read.
void processRunHeader(std::shared_ptr< EVENT::LCRunHeader > rhdr) override