Commit in slicPandora on MAIN
include/DetectorGeometry.h+3-11.9 -> 1.10
src/CalorimeterHitProcessor.cpp+10-31.5 -> 1.6
   /DetectorGeometry.cpp+61.10 -> 1.11
+19-4
3 modified files
introduce separate EM and HAD sampling fractions

slicPandora/include
DetectorGeometry.h 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- DetectorGeometry.h	24 Mar 2010 19:01:20 -0000	1.9
+++ DetectorGeometry.h	19 May 2010 21:42:14 -0000	1.10
@@ -1,4 +1,4 @@
-// $Id: DetectorGeometry.h,v 1.9 2010/03/24 19:01:20 jeremy Exp $
+// $Id: DetectorGeometry.h,v 1.10 2010/05/19 21:42:14 jeremy Exp $
 
 #ifndef DetectorGeometry_h
 #define DetectorGeometry_h 1
@@ -21,6 +21,8 @@
     {
     public:
         pandora::InputFloat m_samplingFraction;
+        pandora::InputFloat m_emSamplingFraction;
+        pandora::InputFloat m_hadSamplingFraction;
         pandora::InputFloat m_cellThickness;
     };
 

slicPandora/src
CalorimeterHitProcessor.cpp 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- CalorimeterHitProcessor.cpp	22 Mar 2010 21:51:32 -0000	1.5
+++ CalorimeterHitProcessor.cpp	19 May 2010 21:42:14 -0000	1.6
@@ -1,4 +1,4 @@
-// $Id: CalorimeterHitProcessor.cpp,v 1.5 2010/03/22 21:51:32 jeremy Exp $
+// $Id: CalorimeterHitProcessor.cpp,v 1.6 2010/05/19 21:42:14 jeremy Exp $
 
 #include "CalorimeterHitProcessor.h"
 
@@ -82,6 +82,13 @@
     PandoraApi::GeometryParameters::LayerParameters layerParams = (*layerList)[layer];
     DetectorGeometry::ExtraLayerParameters xlayerParams = xsubdet->m_extraLayerParams[layer];
 
+    float samplingFraction = xlayerParams.m_samplingFraction.Get();
+    float emSamplingFraction = xlayerParams.m_emSamplingFraction.Get();
+    float hadSamplingFraction = xlayerParams.m_hadSamplingFraction.Get();
+
+    // Recover raw energy to apply EM and HAD sampling fractions.
+    float rawEnergy = hit->getEnergy() * samplingFraction;
+
     // Get the module number.
     int module = decoder->getFieldValue("module", cellId);
 
@@ -102,10 +109,10 @@
     params.m_inputEnergy = hit->getEnergy(); 
 
     // EM energy in GeV.
-    params.m_electromagneticEnergy = hit->getEnergy();
+    params.m_electromagneticEnergy = rawEnergy / emSamplingFraction;
 
     // HAD energy in GeV.
-    params.m_hadronicEnergy = hit->getEnergy();
+    params.m_hadronicEnergy = rawEnergy / hadSamplingFraction;
 
     // MIP equivalent energy.
     // FIXME: Hard-coded to 1.0.

slicPandora/src
DetectorGeometry.cpp 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- DetectorGeometry.cpp	26 Mar 2010 18:48:00 -0000	1.10
+++ DetectorGeometry.cpp	19 May 2010 21:42:14 -0000	1.11
@@ -109,6 +109,8 @@
             float radLen = 0.;
             float intLen = 0.;
             float samplingFrac = 0.;
+            float emSamplingFrac = 0.;
+            float hadSamplingFrac = 0.;
             float cellThickness = 0.;
 
             // Get the layer parameters from the xml attributes.
@@ -116,6 +118,8 @@
             layerElem->QueryFloatAttribute("radLen", &radLen);
             layerElem->QueryFloatAttribute("distanceToIp", &dToIp);
             layerElem->QueryFloatAttribute("samplingFraction", &samplingFrac);
+            layerElem->QueryFloatAttribute("emSamplingFraction", &emSamplingFrac);
+            layerElem->QueryFloatAttribute("hadSamplingFraction", &hadSamplingFrac);
             layerElem->QueryFloatAttribute("cellThickness", &cellThickness);
             
             // Set layer parameters.
@@ -125,6 +129,8 @@
 
             // Set extra layer parameters.
             layerExtra.m_samplingFraction = samplingFrac;
+            layerExtra.m_emSamplingFraction = emSamplingFrac;
+            layerExtra.m_hadSamplingFraction = hadSamplingFrac;
             layerExtra.m_cellThickness = cellThickness;
 
             // Register extra layer parameters.
CVSspam 0.2.8