slicPandora/src
diff -u -r1.21 -r1.22
--- SimCalorimeterHitProcessor.cpp 6 Oct 2010 12:48:26 -0000 1.21
+++ SimCalorimeterHitProcessor.cpp 26 Oct 2010 08:44:10 -0000 1.22
@@ -114,8 +114,14 @@
int nSimHits = simCalHits->getNumberOfElements();
for (int i = 0; i < nSimHits; i++)
{
+ // std::cout << "simhit " << i << " nsimhits " << nSimHits << std::endl;
// Get the SimCalorimeterHit to be converted.
SimCalorimeterHit* simCalHit = dynamic_cast<SimCalorimeterHit*> (simCalHits->getElementAt(i));
+ if (!simCalHit)
+ {
+ std::cout << "simcalhit " << i << " is NULL" << std::endl;
+ exit(210);
+ }
float timeCont = simCalHit->getTimeCont(0);
float rawEnergy = simCalHit->getEnergy();
@@ -151,11 +157,22 @@
PandoraApi::GeometryParameters::LayerParameters layerParams = (*layerList)[layer];
// Get the extra layer parameters for this layer (sampling).
- DetectorGeometry::ExtraLayerParameters xlayerParams = xsubdet.m_extraLayerParams[layer];
+ float samplingFrac = 0.f;
+ try
+ {
+ DetectorGeometry::ExtraLayerParameters xlayerParams = xsubdet.m_extraLayerParams.at(layer);
+ // Get the sampling fraction for this layer.
+ // TODO: Separate EM + HAD sampling fractions.
+ samplingFrac = xlayerParams.m_samplingFraction.Get();
+ }
+ catch(...)
+ {
+ std::cout << "no layer #" << layer << " existing in detector " << subdetName << std::endl;
+ throw;
+ }
+
+
- // Get the sampling fraction for this layer.
- // TODO: Separate EM + HAD sampling fractions.
- float samplingFrac = xlayerParams.m_samplingFraction.Get();
// Copy SimCalorimeterHit information into CalorimeterHit.
calHit->setEnergy(simCalHit->getEnergy() / samplingFrac);