4 #include "EVENT/LCIO.h"
10 #include <sio/io_device.h>
11 #include <sio/version.h>
25 SIO_DATA( device , &(hit->
_cellID0) , 1 ) ;
27 if( lcFlag.
bitSet( EVENT::LCIO::RCHBIT_ID1 ) || ( SIO_VERSION_MAJOR(vers)==0 && SIO_VERSION_MINOR(vers)==8) ) {
28 SIO_DATA( device , &(hit->
_cellID1) , 1 ) ;
30 SIO_DATA( device , &(hit->
_energy) , 1 ) ;
31 if( vers > SIO_VERSION_ENCODE( 1, 9 ) && lcFlag.
bitSet( EVENT::LCIO::RCHBIT_ENERGY_ERROR )) {
34 if( vers > SIO_VERSION_ENCODE( 1, 2) && lcFlag.
bitSet( EVENT::LCIO::RCHBIT_TIME ) ) {
35 SIO_DATA( device , &(hit->
_time) , 1 ) ;
37 if( lcFlag.
bitSet( EVENT::LCIO::RCHBIT_LONG ) ) {
38 SIO_DATA( device , &hit->
_position[0] , 3 ) ;
40 if( vers > SIO_VERSION_ENCODE( 1, 2) ) {
41 SIO_DATA( device , &(hit->
_type) , 1 ) ;
42 SIO_PNTR( device , &(hit->
_rawHit) ) ;
45 if( vers > SIO_VERSION_ENCODE( 1, 2) ) {
46 if( ! lcFlag.
bitSet( EVENT::LCIO::RCHBIT_NO_PTR ) ) {
47 SIO_PTAG( device , dynamic_cast<const EVENT::CalorimeterHit*>(hit) ) ;
51 if( lcFlag.
bitSet( EVENT::LCIO::RCHBIT_NO_PTR ) ) {
52 SIO_PTAG( device , dynamic_cast<const EVENT::CalorimeterHit*>(hit) ) ;
63 if( lcFlag.
bitSet( EVENT::LCIO::RCHBIT_ID1 ) ) {
67 if( lcFlag.
bitSet( EVENT::LCIO::RCHBIT_ENERGY_ERROR ) ) {
70 if( lcFlag.
bitSet( EVENT::LCIO::RCHBIT_TIME ) ) {
71 SIO_SDATA( device , hit->
getTime() ) ;
73 if( lcFlag.
bitSet( EVENT::LCIO::RCHBIT_LONG ) ) {
76 SIO_SDATA( device , hit->
getType() ) ;
78 SIO_PNTR( device , &rawHit ) ;
79 if( !lcFlag.
bitSet( EVENT::LCIO::RCHBIT_NO_PTR ) ) {
80 SIO_PTAG( device , hit ) ;
The generic object that is held in an LCCollection.
virtual int getCellID0() const =0
Returns the detector specific (geometrical) cell id.
SIOCalHitHandler()
Constructor.
virtual bool bitSet(int index) const
Returns true if bit at given index is set.
virtual float getTime() const =0
Returns the time of the hit in [ns].
virtual LCObject * getRawHit() const =0
The RawCalorimeterHit.
virtual float getEnergyError() const =0
Returns the error of the hit energy in [GeV].
virtual int getCellID1() const =0
Returns the second detector specific (geometrical) cell id.
Interface for all lcio object SIO-handlers, has to be implemented for all event entities (hits...
unsigned int _flag
The collection flag.
virtual const float * getPosition() const =0
Returns the position of the hit in world coordinates.
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.
EVENT::LCObject * _rawHit
Implementation of helper class to create and interpret the 32-bit flag word in LCCollections.
Adding stuff needed for io (friend declarations, etc.)
virtual int getType() const =0
Type of hit.
void write(sio::write_device &device, const EVENT::LCObject *obj) override
Writes lcio objects to an SIO stream.
virtual float getEnergy() const =0
Returns the energy of the hit in [GeV].
The generic calorimeter hit - created from SimCalorimeterHit or RawCalorimeterHit.