5 modified files
lcio/src/cpp/include/RIO
diff -u -r1.1.2.3 -r1.1.2.4
--- RIOLCCollectionHandler.h 20 Nov 2009 15:28:50 -0000 1.1.2.3
+++ RIOLCCollectionHandler.h 27 Nov 2009 16:04:41 -0000 1.1.2.4
@@ -57,7 +57,9 @@
_emptyCol = new IMPL::LCCollectionVec( type ) ;
+#ifdef DEBUG
std::cout << " RIOLCCollectionHandler( " << name << ", " << tree << ")" << std::endl ;
+#endif
//_tv = 0 ; //IMPL::LCCollectionVec ; // new std::vector<T*> ;
_tv = _emptyCol ; // new IMPL::LCCollectionVec( type ) ;
@@ -72,7 +74,9 @@
_br->SetAddress( &_tv ) ;
+#ifdef DEBUG
std::cout << " set branch address " << _br->GetName() << " to " << &_tv << std::endl ;
+#endif
} else {
@@ -182,12 +186,17 @@
// evt->addCollection( col , _name ) ;
+#ifdef DEBUG
std::cout << " reading from branch " << _br->GetName() << " entry " << entryID << std::endl ;
+#endif
- int nbyte = _br->GetEntry( entryID );
+ int nbyte = 0 ;
+ nbyte = _br->GetEntry( entryID );
+#ifdef DEBUG
std::cout << " read " << nbyte << " bytes from branch : " << _name << " of type " << _type << std::endl ;
+#endif
try{
lcio/src/cpp/src/IOIMPL
diff -u -r1.3.2.3 -r1.3.2.4
--- LCFactory.cc 18 Sep 2009 09:33:39 -0000 1.3.2.3
+++ LCFactory.cc 27 Nov 2009 16:04:41 -0000 1.3.2.4
@@ -40,29 +40,11 @@
return new IOIMPL::WriterDecorator ;
-
- // switch(_writerType ) {
- // case 'r':
- // return new RIO::RIOWriter ;
- // break ;
- // default :
- // return new SIO::SIOWriter ;
- // }
-
}
LCReader * LCFactory::createLCReader(int lcReaderFlag) {
return new IOIMPL::ReaderDecorator ;
-
-// switch(_readerType ) {
-// case 'r':
-// return new RIO::RIOReader( lcReaderFlag );
-// break;
-// default :
-// return new SIO::SIOReader( lcReaderFlag ) ;
-// }
-
}
lcio/src/cpp/src/IOIMPL
diff -u -r1.1.2.1 -r1.1.2.2
--- ReaderDecorator.cc 18 Sep 2009 09:33:39 -0000 1.1.2.1
+++ ReaderDecorator.cc 27 Nov 2009 16:04:41 -0000 1.1.2.2
@@ -20,7 +20,8 @@
_rdr = new RIO::RIOReader(_lcReaderFlag ) ;
}
- else if( filename.rfind( SIO::LCSIO::FILE_EXTENSION ) + strlen( SIO::LCSIO::FILE_EXTENSION ) == filename.length() ) {
+ else if( filename.rfind( SIO::LCSIO::FILE_EXTENSION )
+ + strlen( SIO::LCSIO::FILE_EXTENSION ) == filename.length() ) {
_rdr = new SIO::SIOReader(_lcReaderFlag ) ;
}
lcio/src/cpp/src/RIO
diff -u -r1.1.2.6 -r1.1.2.7
--- RIOReader.cc 20 Nov 2009 15:28:51 -0000 1.1.2.6
+++ RIOReader.cc 27 Nov 2009 16:04:42 -0000 1.1.2.7
@@ -32,7 +32,7 @@
namespace RIO {
-#define DEBUG 1
+//#define DEBUG 1
@@ -51,7 +51,7 @@
#else
#endif
- _evtImpl = new IMPL::LCEventImpl ;
+ // _evtImpl = new IMPL::LCEventImpl ;
LCIOExceptionHandler::createInstance() ;
}
@@ -59,9 +59,10 @@
RIOReader::~RIOReader(){
-
- // delete _evtP ;
- // delete _runP ;
+ // clean up branch handlers
+ for( BranchHandlerMap::iterator it=_branches.begin() ; it!=_branches.end() ; ++it){
+ delete it->second ;
+ }
}
@@ -237,23 +238,12 @@
// const LCParameters& params = col->getParameters() ;
// std::string typeName = col->getTypeName() ;
- std::string typeName("YetUnknown") ;
+ std::string typeName("YetUnknown") ;
- std::cout << " registering collection " << *name << " of " << typeName << std::endl ;
-
- // //FIXME: these should be held by a singleton handler manager (registry)
- // if( typeName == LCIO::MCPARTICLE ){
- // _branches.push_back( new RIO::RIOLCCollectionHandler<EVENT::MCParticle>(name->c_str() ,_tree) ) ;
- // }
- // if( typeName == LCIO::SIMCALORIMETERHIT ){
- // _branches.push_back( new RIO::RIOLCCollectionHandler<EVENT::SimCalorimeterHit>(name->c_str() ,_tree) ) ;
- // }
- // if( typeName == LCIO::SIMTRACKERHIT ){
- // _branches.push_back( new RIO::RIOLCCollectionHandler<EVENT::SimTrackerHit>(name->c_str() ,_tree) ) ;
- // }
- // // ToDo: add all other LCIO types ....
+#ifdef DEBUG
+ std::cout << " registering collection " << *name << " of " << typeName << std::endl ;
+#endif
-
// if( *name == "MCParticlesSkimmed" )
// if( *name == "PandoraPFOs" )
@@ -293,7 +283,8 @@
Long64_t tentry = _tree->LoadTree( _entry );
- int nbyte = br->GetEntry(tentry);
+ int nbyte=0 ;
+ nbyte = br->GetEntry(tentry);
if( tentry < 0 ){
@@ -313,34 +304,12 @@
+#ifdef DEBUG
+
typedef std::vector< std::string > StrVec ;
const StrVec& strVec = *( _evtImpl->getCollectionNames() ) ;
- // for( StrVec::const_iterator name = strVec.begin() ; name != strVec.end() ; name++){
-
- // RIOBranchHandler* bHan = _branches[ *name ] ;
-
- // if( bHan ) {
-
- // //_evtImpl->removeCollection( *name ) ;
- // bHan->fromBranch( _evtImpl, tentry ) ;
-
- // } else {
-
- // std::cout << "WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl
- // << " no handler for collection " << *name << " found - collection is not read !!! " << std::endl
- // << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl ;
-
-
- // }
-
-
- // std::cout << " collection: " << *name << std::endl ;
- // }
-
-
-#ifdef DEBUG
std::cout << " >>>>>>>>> tentry : " << tentry
<< " _entry " << _entry
<< " eventnum " << _evtImpl->getEventNumber()
lcio/src/cpp/src/RIO
diff -u -r1.1.2.6 -r1.1.2.7
--- RIOWriter.cc 26 Nov 2009 13:35:04 -0000 1.1.2.6
+++ RIOWriter.cc 27 Nov 2009 16:04:42 -0000 1.1.2.7
@@ -45,10 +45,6 @@
// file needs
-#ifdef DEBUG
-#else
-#endif
-
LCIOExceptionHandler::createInstance() ;
}
@@ -217,8 +213,10 @@
for( StrVec::const_iterator name = strVec->begin() ; name != strVec->end() ; name++){
LCCollection* col = evt->getCollection( *name ) ;
std::string typeName = col->getTypeName() ;
- std::cout << " registering collection " << *name << " of " << typeName << std::endl ;
+#ifdef DEBUG
+ std::cout << " registering collection " << *name << " of " << typeName << std::endl ;
+#endif
// if( *name != "RecoMCTruthLink" )
// if( *name == "PandoraPFOs" )
_branches[ *name ] = new RIO::RIOLCCollectionHandler( *name, typeName, _tree) ;
CVSspam 0.2.8