4 #include "EVENT/LCIO.h"
11 #include <sio/io_device.h>
12 #include <sio/version.h>
27 if( vers > SIO_VERSION_ENCODE( 1, 51) ) {
28 SIO_DATA( device , &(hit->_cellID0) , 1 ) ;
29 if( lcFlag.
bitSet( EVENT::LCIO::RTHBIT_ID1 ) ){
30 SIO_DATA( device , &(hit->_cellID1) , 1 ) ;
33 if( vers > SIO_VERSION_ENCODE( 1, 2) ){
34 SIO_DATA( device , &(hit->_type) , 1 ) ;
36 SIO_DATA( device , hit->_pos , 3 ) ;
39 hit->setCovMatrix( cov ) ;
40 SIO_DATA( device , &(hit->_EDep) , 1 ) ;
41 if( vers > SIO_VERSION_ENCODE( 1, 12 ) ) {
42 SIO_DATA( device , &(hit->_EDepError) , 1 ) ;
44 SIO_DATA( device , &(hit->_time) , 1 ) ;
45 if( vers > SIO_VERSION_ENCODE( 1, 11 ) ) {
46 SIO_DATA( device , &(hit->_quality) , 1 ) ;
48 int numberOfRawHits = 1 ;
49 if( vers > SIO_VERSION_ENCODE( 1, 2 ) ) {
50 SIO_DATA( device , &numberOfRawHits , 1 ) ;
52 hit->_rawHits.resize( numberOfRawHits ) ;
54 for(
int i=0 ; i<numberOfRawHits ; i++ ) {
55 SIO_PNTR( device , &(hit->_rawHits[i] ) ) ;
57 SIO_PTAG( device , dynamic_cast<const EVENT::TrackerHit*>(hit) ) ;
65 SIO_SDATA( device, hit->getCellID0() ) ;
66 if( lcFlag.
bitSet( EVENT::LCIO::RTHBIT_ID1 ) ){
67 SIO_SDATA( device, hit->getCellID1() ) ;
69 SIO_SDATA( device , hit->getType() ) ;
70 SIO_DATA( device, hit->getPosition() , 3 ) ;
71 auto cov = hit->getCovMatrix() ;
72 for(
unsigned int i=0 ; i<cov.size() ; i++ ) {
73 SIO_SDATA( device, cov[i] ) ;
75 SIO_SDATA( device, hit->getEDep() ) ;
76 SIO_SDATA( device, hit->getEDepError() ) ;
77 SIO_SDATA( device, hit->getTime() ) ;
78 SIO_SDATA( device, hit->getQuality() ) ;
80 int nrawhits = rawHits.
size() ;
81 SIO_SDATA( device, nrawhits ) ;
82 for(
unsigned int i=0; i < rawHits.size() ; i++){
83 SIO_PNTR( device , &(rawHits[i]) ) ;
86 SIO_PTAG( device , hit ) ;
The generic object that is held in an LCCollection.
A generic tracker hit to be used by pattern recognition.
SIOTrackerHitHandler()
Constructor.
virtual bool bitSet(int index) const
Returns true if bit at given index is set.
void write(sio::write_device &device, const EVENT::LCObject *obj) override
Writes lcio objects to an SIO stream.
EVENT::LCObject * create() const override
Factory method to create an object of the type of the collection.
void read(sio::read_device &device, EVENT::LCObject *objP, sio::version_type vers) override
Reads lcio objects from an SIO stream.
Interface for all lcio object SIO-handlers, has to be implemented for all event entities (hits...
unsigned int _flag
The collection flag.
Implementation of helper class to create and interpret the 32-bit flag word in LCCollections.
Adding stuff needed for io (friend declarations, etc.)