Commit in slicPandora on MAIN
include/SimpleBFieldCalculator.h+30added 1.1
src/SimpleBFieldCalculator.cpp+30added 1.1
   /DetectorGeometry.cpp+2-21.16 -> 1.17
   /JobManager.cpp+81.9 -> 1.10
   /PfoProcessor.cpp+10-31.14 -> 1.15
   /SimpleTrackProcessor.cpp+4-31.16 -> 1.17
+84-8
2 added + 4 modified, total 6 files
add simple bfield calculator and adjust code

slicPandora/include
SimpleBFieldCalculator.h added at 1.1
diff -N SimpleBFieldCalculator.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SimpleBFieldCalculator.h	1 Nov 2010 17:04:20 -0000	1.1
@@ -0,0 +1,30 @@
+// $Id: SimpleBFieldCalculator.h,v 1.1 2010/11/01 17:04:20 speckmay Exp $
+
+#ifndef SimpleBFieldCalculator_h
+#define SimpleBFieldCalculator_h 1
+
+// pandora
+#include "Utilities/BFieldCalculator.h"
+
+// stl
+#include <vector>
+
+/**
+ *  @brief  SimpleBFieldCalculator class
+ */
+class SimpleBFieldCalculator : public pandora::BFieldCalculator
+{
+public:
+    static float        m_innerBField;              ///< The bfield in the main tracker, ecal and hcal, units Tesla
+    static float        m_muonBarrelBField;         ///< The bfield in the muon barrel, units Tesla
+    static float        m_muonEndCapBField;         ///< The bfield in the muon endcap, units Tesla
+
+private:
+    void Initialize(const pandora::GeometryHelper *const pGeometryHelper);
+    float GetBField(const pandora::CartesianVector &positionVector) const;
+
+    float               m_muonEndCapInnerZ;         ///< The muon endcap inner z coordinate, units mm
+    float               m_coilMidPointR;            ///< The r coordinate at the coil midpoint, units mm
+};
+
+#endif

slicPandora/src
SimpleBFieldCalculator.cpp added at 1.1
diff -N SimpleBFieldCalculator.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SimpleBFieldCalculator.cpp	1 Nov 2010 17:04:21 -0000	1.1
@@ -0,0 +1,30 @@
+#include "SimpleBFieldCalculator.h"
+
+#include "SimpleBFieldCalculator.h"
+
+#include <cmath>
+
+float SimpleBFieldCalculator::m_innerBField = 5.f;
+float SimpleBFieldCalculator::m_muonBarrelBField = 1.5f;
+float SimpleBFieldCalculator::m_muonEndCapBField = 0.01f;
+
+//------------------------------------------------------------------------------------------------------------------------------------------
+
+void SimpleBFieldCalculator::Initialize(const pandora::GeometryHelper *const pGeometryHelper)
+{
+    m_muonEndCapInnerZ = pGeometryHelper->GetMuonEndCapParameters().GetInnerZCoordinate();
+    m_coilMidPointR = (0.5f * (pGeometryHelper->GetCoilInnerRadius() + pGeometryHelper->GetCoilOuterRadius()));
+};
+
+//------------------------------------------------------------------------------------------------------------------------------------------
+
+float SimpleBFieldCalculator::GetBField(const pandora::CartesianVector &positionVector) const
+{
+    if (std::fabs(positionVector.GetZ()) >= m_muonEndCapInnerZ)
+        return m_muonEndCapBField;
+
+    if (std::sqrt(positionVector.GetX() * positionVector.GetX() + positionVector.GetY() * positionVector.GetY()) >= m_coilMidPointR)
+        return m_muonBarrelBField;
+
+    return m_innerBField;
+};

slicPandora/src
DetectorGeometry.cpp 1.16 -> 1.17
diff -u -r1.16 -r1.17
--- DetectorGeometry.cpp	1 Oct 2010 15:52:16 -0000	1.16
+++ DetectorGeometry.cpp	1 Nov 2010 17:04:21 -0000	1.17
@@ -5,6 +5,7 @@
 
 // slicPandora
 #include "IDDecoder.h"
+#include "SimpleBFieldCalculator.h"
 
 // stl
 #include <stdexcept>
@@ -278,7 +279,7 @@
     geom.m_coilInnerRadius = cinnerR;
     geom.m_coilOuterRadius = couterR;
     geom.m_coilZExtent = cz;
-    geom.m_bField = bfield;  
+    SimpleBFieldCalculator::m_innerBField = bfield;
 
     // FIXME: Next four are just dummy parameters for the moment.
     geom.m_nRadLengthsInZGap      = 0.;
@@ -292,7 +293,6 @@
     std::cout << "    coilInnerRadius: " << geom.m_coilInnerRadius.Get() << std::endl;
     std::cout << "    coilOuterRadius: " << geom.m_coilOuterRadius.Get() << std::endl;
     std::cout << "    coilZExtent: " << geom.m_coilZExtent.Get() << std::endl;
-    std::cout << "    bField: " << geom.m_bField.Get() << std::endl;
     std::cout << std::endl;
 #endif
 }

slicPandora/src
JobManager.cpp 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- JobManager.cpp	28 Sep 2010 07:44:42 -0000	1.9
+++ JobManager.cpp	1 Nov 2010 17:04:21 -0000	1.10
@@ -4,6 +4,8 @@
 #include "JobConfig.h"
 #include "DetectorGeometry.h"
 #include "EventProcessor.h"
+#include "SimpleBFieldCalculator.h"
+#include "Utilities/HighGranularityPseudoLayerCalculator.h"
 
 // pandora
 #include "PfoConstructionAlgorithm.h"
@@ -45,6 +47,12 @@
     // Create the slicPandora DetectorGeometry.
     PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS,  !=, createGeometry());
 
+    // create a new bfield calculator
+    PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraApi::SetBFieldCalculator(*m_pandora, new SimpleBFieldCalculator()));
+
+    // create a new pseudo layer calculator
+    PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraApi::SetPseudoLayerCalculator(*m_pandora, new pandora::HighGranularityPseudoLayerCalculator()));
+
     // Create the GeometryParameters within Pandora.
     PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraApi::Geometry::Create(*m_pandora, *m_detectorGeometry->getGeometryParameters()));
 

slicPandora/src
PfoProcessor.cpp 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- PfoProcessor.cpp	30 Jul 2010 16:59:58 -0000	1.14
+++ PfoProcessor.cpp	1 Nov 2010 17:04:21 -0000	1.15
@@ -1,4 +1,4 @@
-// $Id: PfoProcessor.cpp,v 1.14 2010/07/30 16:59:58 jeremy Exp $
+// $Id: PfoProcessor.cpp,v 1.15 2010/11/01 17:04:21 speckmay Exp $
 #include "PfoProcessor.h"
 
 // lcio
@@ -20,7 +20,9 @@
 #include "DetectorGeometry.h"
 
 // Pandora
+#include "Objects/CartesianVector.h"
 #include "Objects/ParticleFlowObject.h"
+#include "Helpers/GeometryHelper.h"
 
 using IMPL::LCCollectionVec;
 using IMPL::LCFlagImpl;
@@ -43,6 +45,9 @@
     // Make a container for the clusters.
     LCCollectionVec* clusterVec = new LCCollectionVec(EVENT::LCIO::CLUSTER);
 
+    // Get the GeometryHelper.
+    pandora::GeometryHelper *pGeometryHelper = pandora::GeometryHelper::GetInstance();
+
     // Set flag for pointing back to CalorimeterHits.
     LCFlagImpl clusterFlag(0);
     clusterFlag.setBit(EVENT::LCIO::CLBIT_HITS);
@@ -145,8 +150,10 @@
 
         // Temporary variables to access the track momentum.
         DetectorGeometry* detector = getJobManager()->getDetectorGeometry();
-        PandoraApi::Geometry::Parameters* pandoraGeomParams = detector->getGeometryParameters();
-        double magneticField =  pandoraGeomParams->m_bField.Get();
+//        PandoraApi::Geometry::Parameters* pandoraGeomParams = detector->getGeometryParameters();
+//        double magneticField =  pandoraGeomParams->m_bField.Get(CartesianVector(0.f,0.f,0.f));
+        double magneticField = pGeometryHelper->GetBField(pandora::CartesianVector(0.f,0.f,0.f));
+
 #ifdef PFOPROCESSOR_DEBUG
         std::cout << "BField= " << magneticField << std::endl;
 #endif

slicPandora/src
SimpleTrackProcessor.cpp 1.16 -> 1.17
diff -u -r1.16 -r1.17
--- SimpleTrackProcessor.cpp	6 Oct 2010 22:51:22 -0000	1.16
+++ SimpleTrackProcessor.cpp	1 Nov 2010 17:04:21 -0000	1.17
@@ -1,4 +1,4 @@
-// $Id: SimpleTrackProcessor.cpp,v 1.16 2010/10/06 22:51:22 jeremy Exp $
+// $Id: SimpleTrackProcessor.cpp,v 1.17 2010/11/01 17:04:21 speckmay Exp $
 #include "SimpleTrackProcessor.h"
 
 // slicPandora
@@ -54,7 +54,7 @@
     // Check if MC information is present.
     bool haveMCRelations = false;
     const EVENT::LCCollection *pMCRelationCollection = 0;
-    UTIL::LCRelationNavigator* navigate;
+    UTIL::LCRelationNavigator* navigate = NULL;
     
     // Look for LCRelations collection of HelicalTrackHits to MCParticles.
     try 
@@ -75,7 +75,8 @@
     pandora::GeometryHelper *pGeometryHelper = pandora::GeometryHelper::GetInstance();
 
     // Get the B field.
-    const float magneticField(pGeometryHelper->GetBField());
+    const float magneticField(pGeometryHelper->GetBField(CartesianVector(0.f,0.f,0.f)));
+
 
     // Loop over input tracks.
     int ntracks = trackCollection->getNumberOfElements();
CVSspam 0.2.8