slicPandora/src
diff -u -r1.9 -r1.10
--- CalorimeterHitProcessor.cpp 8 Jun 2010 22:57:47 -0000 1.9
+++ CalorimeterHitProcessor.cpp 15 Jun 2010 23:28:12 -0000 1.10
@@ -1,4 +1,4 @@
-// $Id: CalorimeterHitProcessor.cpp,v 1.9 2010/06/08 22:57:47 jeremy Exp $
+// $Id: CalorimeterHitProcessor.cpp,v 1.10 2010/06/15 23:28:12 jeremy Exp $
#include "CalorimeterHitProcessor.h"
@@ -35,7 +35,18 @@
PandoraApi::GeometryParameters::SubDetectorParameters* subdet = geom->getSubDetectorFromType(calType);
DetectorGeometry::ExtraSubDetectorParameters* xsubdet = geom->getExtraSubDetectorParametersFromType(calType);
- const LCCollection* caloHits = event->getCollection(*iter);
+ const LCCollection* caloHits;
+
+ // Check again if collection exists. If not, could be okay so skip and move on.
+ try
+ {
+ caloHits = event->getCollection(*iter);
+ }
+ catch (...)
+ {
+ continue;
+ }
+
int nhits = caloHits->getNumberOfElements();
#ifdef CALO_PARAMS_DEBUG
slicPandora/src
diff -u -r1.16 -r1.17
--- SimCalorimeterHitProcessor.cpp 10 Jun 2010 19:11:19 -0000 1.16
+++ SimCalorimeterHitProcessor.cpp 15 Jun 2010 23:28:12 -0000 1.17
@@ -65,6 +65,8 @@
continue;
}
+ LCCollection* calHits = new LCCollectionVec(EVENT::LCIO::CALORIMETERHIT);
+
PandoraApi::GeometryParameters::SubDetectorParameters* subdet = geom->getSubDetectorFromType((*iter));
std::string subdetName = (*iter);
const DetectorGeometry::ExtraSubDetectorParameters& xsubdet = subdetExtras->find(subdetName)->second;
@@ -79,8 +81,18 @@
const std::string& collectionName = xsubdet.m_collection;
IDDecoder* decoder = xsubdet.m_decoder;
- LCCollection* simCalHits = event->getCollection(collectionName);
- LCCollection* calHits = new LCCollectionVec(EVENT::LCIO::CALORIMETERHIT);
+ LCCollection* simCalHits = 0;
+
+ // Try to fetch the collection by name from the input LCIO file and skip if doesn't exist.
+ try
+ {
+ simCalHits = event->getCollection(collectionName);
+ }
+ // FIXME Could be some other problem than collection not found.
+ catch (...)
+ {
+ continue;
+ }
// Set correct flags for output collection.
int flag = 1 << EVENT::LCIO::RCHBIT_LONG; // position