<commit_before>#include "SIO/SIOSimCalHitHandler.h"

#include "SIO/LCSIO.h"

#include "EVENT/LCIO.h"
#include "EVENT/MCParticle.h"
#include "EVENT/SimCalorimeterHit.h"
#include "IOIMPL/SimCalorimeterHitIOImpl.h"
#include "IMPL/LCFlagImpl.h"

#include "SIO_functions.h"
#include "SIO_block.h"


using namespace EVENT ;
using namespace IMPL ;
using namespace IOIMPL ;


namespace SIO{
    
  unsigned int SIOSimCalHitHandler::read(SIO_stream* stream, 
				      LCObject** objP){
    unsigned int status ; 
	
    // create a new object :
    SimCalorimeterHitIOImpl* hit  = new SimCalorimeterHitIOImpl ;
    *objP = hit ;
	
    SIO_DATA( stream ,  &(hit->_cellID0) , 1  ) ;

    // in v00-08 cellid1 has been stored by default
    if( LCFlagImpl(_flag).bitSet( LCIO::CHBIT_ID1 ) || 

	( SIO_VERSION_MAJOR(_vers)==0 && SIO_VERSION_MINOR(_vers)==8) ){

      SIO_DATA( stream ,  &(hit->_cellID1) , 1  ) ;

    }
    SIO_DATA( stream ,  &(hit->_energy) , 1  ) ;

    if( LCFlagImpl(_flag).bitSet( LCIO::CHBIT_LONG ) ){
      SIO_DATA( stream ,  hit->_position  , 3 ) ;
    }

    // read MCContributions
    int nCon ;
    SIO_DATA( stream ,  &nCon , 1  ) ;

    for(int i=0; i< nCon ; i++){

      MCParticleCont* mcCon = new MCParticleCont ;
      SIO_PNTR( stream , &(mcCon->Particle)  ) ;
      SIO_DATA( stream , &(mcCon->Energy) , 1 ) ;
      SIO_DATA( stream , &(mcCon->Time)   , 1 ) ;
      if( LCFlagImpl(_flag).bitSet( LCIO::CHBIT_STEP ) ){
	SIO_DATA( stream , &(mcCon->PDG)    , 1 ) ;

    if( _vers > SIO_VERSION_ENCODE( 1, 52 ) ){
	SIO_DATA( stream , &(mcCon->StepPosition[0])    , 1 ) ;
	SIO_DATA( stream , &(mcCon->StepPosition[1])    , 1 ) ;
	SIO_DATA( stream , &(mcCon->StepPosition[2])    , 1 ) ;
    }
      }

      hit->_vec.push_back(  mcCon  );
    }

    // read a pointer tag for  reference to calorimeter hits<commit_msg>bug fixed<commit_after>#include "SIO/SIOSimCalHitHandler.h"

#include "SIO/LCSIO.h"

#include "EVENT/LCIO.h"
#include "EVENT/MCParticle.h"
#include "EVENT/SimCalorimeterHit.h"
#include "IOIMPL/SimCalorimeterHitIOImpl.h"
#include "IMPL/LCFlagImpl.h"

#include "SIO_functions.h"
#include "SIO_block.h"


using namespace EVENT ;
using namespace IMPL ;
using namespace IOIMPL ;


namespace SIO{
    
  unsigned int SIOSimCalHitHandler::read(SIO_stream* stream, 
				      LCObject** objP){
    unsigned int status ; 
	
    // create a new object :
    SimCalorimeterHitIOImpl* hit  = new SimCalorimeterHitIOImpl ;
    *objP = hit ;
	
    SIO_DATA( stream ,  &(hit->_cellID0) , 1  ) ;

    // in v00-08 cellid1 has been stored by default
    if( LCFlagImpl(_flag).bitSet( LCIO::CHBIT_ID1 ) || 

	( SIO_VERSION_MAJOR(_vers)==0 && SIO_VERSION_MINOR(_vers)==8) ){

      SIO_DATA( stream ,  &(hit->_cellID1) , 1  ) ;

    }
    SIO_DATA( stream ,  &(hit->_energy) , 1  ) ;

    if( LCFlagImpl(_flag).bitSet( LCIO::CHBIT_LONG ) ){
      SIO_DATA( stream ,  hit->_position  , 3 ) ;
    }

    // read MCContributions
    int nCon ;
    SIO_DATA( stream ,  &nCon , 1  ) ;

    for(int i=0; i< nCon ; i++){

      MCParticleCont* mcCon = new MCParticleCont ;
      SIO_PNTR( stream , &(mcCon->Particle)  ) ;
      SIO_DATA( stream , &(mcCon->Energy) , 1 ) ;
      SIO_DATA( stream , &(mcCon->Time)   , 1 ) ;
	SIO_DATA( stream , &(mcCon->PDG)    , 1 ) ;

    if( _vers > SIO_VERSION_ENCODE( 1, 52 ) ){
        if( LCFlagImpl(_flag).bitSet( LCIO::CHBIT_STEP ) ){
            SIO_DATA( stream , &(mcCon->StepPosition[0])    , 1 ) ;
            SIO_DATA( stream , &(mcCon->StepPosition[1])    , 1 ) ;
            SIO_DATA( stream , &(mcCon->StepPosition[2])    , 1 ) ;
        }
      }

      hit->_vec.push_back(  mcCon  );
    }

    // read a pointer tag for  reference to calorimeter hits
{'fraction_non_alphanumeric': 0.14466254369454154, 'fraction_numerical': 0.015057811239580532, 'mean_word_length': 2.7843336724313326, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2542439', 'n_tokens_mistral': 1508, 'n_tokens_neox': 1429, 'n_words': 286}