4 #include "EVENT/LCIO.h"
12 #include <sio/io_device.h>
13 #include <sio/version.h>
27 SIO_DATA( device , &(hit->_cellID0) , 1 ) ;
29 if( flag.
bitSet( EVENT::LCIO::CHBIT_ID1 ) || ( SIO_VERSION_MAJOR(vers)==0 && SIO_VERSION_MINOR(vers)==8) ) {
30 SIO_DATA( device , &(hit->_cellID1) , 1 ) ;
32 SIO_DATA( device , &(hit->_energy) , 1 ) ;
33 if( flag.
bitSet( EVENT::LCIO::CHBIT_LONG ) ) {
34 SIO_DATA( device , hit->_position , 3 ) ;
38 SIO_DATA( device , &nCon , 1 ) ;
39 hit->_vec.reserve(nCon) ;
40 for(
int i=0; i< nCon ; i++) {
42 SIO_PNTR( device , &(mcCon->Particle) ) ;
43 SIO_DATA( device , &(mcCon->Energy) , 1 ) ;
44 SIO_DATA( device , &(mcCon->Time) , 1 ) ;
45 if( flag.
bitSet( EVENT::LCIO::CHBIT_STEP )) {
46 if( vers > SIO_VERSION_ENCODE( 2, 10 ) ) {
47 SIO_DATA( device , &(mcCon->Length) , 1 ) ;
49 SIO_DATA( device , &(mcCon->PDG) , 1 ) ;
50 if( vers > SIO_VERSION_ENCODE( 1, 51 ) ) {
51 SIO_DATA( device , &(mcCon->StepPosition[0]) , 1 ) ;
52 SIO_DATA( device , &(mcCon->StepPosition[1]) , 1 ) ;
53 SIO_DATA( device , &(mcCon->StepPosition[2]) , 1 ) ;
56 hit->_vec.push_back( mcCon );
59 if( vers > SIO_VERSION_ENCODE( 1, 0) ) {
60 SIO_PTAG( device , dynamic_cast<const EVENT::SimCalorimeterHit*>(hit) ) ;
68 SIO_SDATA( device, hit->getCellID0() ) ;
70 if( flag.bitSet( EVENT::LCIO::CHBIT_ID1 ) ){
71 SIO_SDATA( device, hit->getCellID1() ) ;
73 SIO_SDATA( device, hit->getEnergy() ) ;
74 if( flag.bitSet( EVENT::LCIO::CHBIT_LONG ) ){
75 SIO_DATA( device, hit->getPosition() , 3 ) ;
78 int nMC = hit->getNMCContributions() ;
79 SIO_DATA( device, &nMC , 1 ) ;
80 for(
int i=0; i<nMC ;i++) {
81 auto part = hit->getParticleCont(i) ;
82 SIO_PNTR( device , &part ) ;
83 SIO_SDATA( device, hit->getEnergyCont(i) ) ;
84 SIO_SDATA( device, hit->getTimeCont(i) ) ;
85 if( flag.bitSet( EVENT::LCIO::CHBIT_STEP ) ) {
86 SIO_SDATA( device, hit->getLengthCont(i) ) ;
87 SIO_SDATA( device, hit->getPDGCont(i) ) ;
88 float* sp =
const_cast<float*
> ( hit->getStepPosition(i) ) ;
89 SIO_DATA( device, sp , 3 ) ;
93 SIO_PTAG( device , hit ) ;
The generic object that is held in an LCCollection.
The generic simulated calorimeter hit.
EVENT::LCObject * create() const override
Factory method to create an object of the type of the collection.
virtual bool bitSet(int index) const
Returns true if bit at given index is set.
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.
unsigned int flag() const
Get the collection flag.
void write(sio::write_device &device, const EVENT::LCObject *obj) override
Writes lcio objects to an SIO stream.
Implementation of helper class to create and interpret the 32-bit flag word in LCCollections.
Adding stuff needed for io (friend declarations, etc.)
SIOSimCalHitHandler()
Constructor.