Commit in lcdd on MAIN
include/G4UnsegmentedCalorimeterSD.hh+26added 1.1
       /UnsegmentedCalorimeterType.hh+29added 1.1
       /unsegmented_calorimeter.hh+29added 1.1
       /G4CalorimeterSD.hh+3-21.14 -> 1.15
src/G4UnsegmentedCalorimeterSD.cc+69added 1.1
   /unsegmented_calorimeterProcess.cc+39added 1.1
   /unsegmented_calorimeterSubscriber.cc+41added 1.1
   /G4CalorimeterSD.cc+3-21.37 -> 1.38
   /LCDDLibLoad.cc+21.26 -> 1.27
   /SensitiveDetectorFactory.cc+137-1161.20 -> 1.21
+378-120
6 added + 4 modified, total 10 files
checkpoint for working version of unsegmented calorimeter; still needs to be added to LCDD schema

lcdd/include
G4UnsegmentedCalorimeterSD.hh added at 1.1
diff -N G4UnsegmentedCalorimeterSD.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ G4UnsegmentedCalorimeterSD.hh	7 Dec 2010 00:52:00 -0000	1.1
@@ -0,0 +1,26 @@
+// $Id: G4UnsegmentedCalorimeterSD.hh,v 1.1 2010/12/07 00:52:00 jeremy Exp $
+
+#ifndef G4UNSEGMENTEDCALORIMETERSD_HH_
+#define G4UNSEGMENTEDCALORIMETERSD_HH_
+
+#include "G4CalorimeterSD.hh"
+
+/**
+ * @class UnsegmentedCalorimeterSD
+ * @brief A sensitive detector that writes out a CalorimeterHit for
+ *        each step.  It does not have any segmentation.
+ */
+class G4UnsegmentedCalorimeterSD : public G4CalorimeterSD
+{
+    public:
+
+        G4UnsegmentedCalorimeterSD(
+                G4String sdName,
+                G4String hcName);
+
+    protected:
+
+        virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
+};
+
+#endif /* G4UNSEGMENTEDCALORIMETERSD_HH_ */

lcdd/include
UnsegmentedCalorimeterType.hh added at 1.1
diff -N UnsegmentedCalorimeterType.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ UnsegmentedCalorimeterType.hh	7 Dec 2010 00:52:00 -0000	1.1
@@ -0,0 +1,29 @@
+#ifndef LCDD_UNSEGMENTEDCALORIMETERTYPE_HH
+#define LCDD_UNSEGMENTEDCALORIMETERTYPE_HH 1
+
+// GDML
+#include "Schema/ContentGroup.h"
+
+// lcdd
+#include "CalorimeterType.hh"
+
+// std
+#include <iostream>
+
+/**
+ * @class UnsegmentedCalorimeterType
+ * @brief UnsegmentedCalorimeterType from schema.
+*/
+class UnsegmentedCalorimeterType : public CalorimeterType
+{
+
+public:
+
+  UnsegmentedCalorimeterType()
+  {}
+
+  virtual ~UnsegmentedCalorimeterType()
+  {}
+};
+
+#endif

lcdd/include
unsegmented_calorimeter.hh added at 1.1
diff -N unsegmented_calorimeter.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unsegmented_calorimeter.hh	7 Dec 2010 00:52:00 -0000	1.1
@@ -0,0 +1,29 @@
+// $Header: /cvs/lcd/lcdd/include/unsegmented_calorimeter.hh,v 1.1 2010/12/07 00:52:00 jeremy Exp $
+#ifndef LCDD_UNSEGMENTEDCALORIMETER_HH
+#define LCDD_UNSEGMENTEDCALORIMETER_HH
+
+#include "Saxana/SAXObject.h"
+
+#include "UnsegmentedCalorimeterType.hh"
+
+/**
+
+   @class unsegmented_calorimeter
+   @brief unsegmented_calorimeter element from LCDD schema.
+ */
+class unsegmented_calorimeter : public SAXObject, public UnsegmentedCalorimeterType
+{
+public:
+  unsegmented_calorimeter()
+  {}
+
+  virtual ~unsegmented_calorimeter()
+  {}
+
+  virtual SAXObject::Type type()
+  {
+    return SAXObject::element;
+  }
+};
+
+#endif

lcdd/include
G4CalorimeterSD.hh 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- G4CalorimeterSD.hh	12 Dec 2007 03:19:00 -0000	1.14
+++ G4CalorimeterSD.hh	7 Dec 2010 00:52:00 -0000	1.15
@@ -1,5 +1,6 @@
-#ifndef LCDD_LCDD_G4CALORIMETERSD_HH
-#define LCDD_LCDD_G4CALORIMETERSD_HH
+// $Id: G4CalorimeterSD.hh,v 1.15 2010/12/07 00:52:00 jeremy Exp $
+#ifndef LCDD_G4CALORIMETERSD_HH
+#define LCDD_G4CALORIMETERSD_HH 1
 
 // geant4
 #include "G4SensitiveDetector.hh"

lcdd/src
G4UnsegmentedCalorimeterSD.cc added at 1.1
diff -N G4UnsegmentedCalorimeterSD.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ G4UnsegmentedCalorimeterSD.cc	7 Dec 2010 00:52:00 -0000	1.1
@@ -0,0 +1,69 @@
+// $Id: G4UnsegmentedCalorimeterSD.cc,v 1.1 2010/12/07 00:52:00 jeremy Exp $
+#include "G4UnsegmentedCalorimeterSD.hh"
+
+G4UnsegmentedCalorimeterSD::G4UnsegmentedCalorimeterSD(
+        G4String sdName,
+        G4String hcName ) :
+    G4CalorimeterSD( sdName, hcName, 0 )
+{
+
+}
+
+G4bool G4UnsegmentedCalorimeterSD::ProcessHits(
+        G4Step* aStep,
+        G4TouchableHistory* )
+{
+#ifdef G4VERBOSE
+    if ( getVerbose() > 0 )
+    {
+        std::cout << "G4UnsegmentedCalorimeterSD::ProcessHits - " << this->GetName() << std::endl;
+    }
+#endif
+
+    /* Cache the step information. */
+    G4SensitiveDetector::ProcessHits( aStep, 0 );
+
+    /* Get the energy deposition. */
+    G4double theEdep = edep();
+
+    /*
+     * This needs to be a <= comparison for cutting on 0,
+     * but it allows geantinos, which always have 0 edep.
+     */
+    if ( theEdep <= getEcut() && !isGeantino() )
+    {
+#ifdef G4VERBOSE
+        if ( getVerbose() > 2 )
+        {
+            std::cout << "G4UnsegmentedCalorimeterSD::ProcessHits - cut on edep " << theEdep << std::endl;
+        }
+#endif
+        return false;
+    }
+
+    /* Get the step mid position. */
+    G4ThreeVector hitPos = midPosition();
+
+    std::cout << "hit at " << hitPos << std::endl;
+
+    /* Create a 64-bit ID. */
+    Id64bit id64 = makeId();
+
+    /* Create a new hit. */
+    G4CalorimeterHit* thisHit = new G4CalorimeterHit( theEdep, hitPos );
+
+    /* Set the 64-bit ID. */
+    thisHit->setId64bit( id64.getId0(), id64.getId1() );
+
+    /* Add hit to lookup map. */
+    hits_vector[0].push_back( thisHit );
+
+    /* Add hit to the HC. */
+    m_hitsCollections[0]->insert( thisHit );
+
+    /* Add an MCParticle contribution for this hit. */
+    thisHit->addMcpHitContrib( McpHitContrib( aStep ) );
+
+    /* Success. */
+    return true;
+}

lcdd/src
unsegmented_calorimeterProcess.cc added at 1.1
diff -N unsegmented_calorimeterProcess.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unsegmented_calorimeterProcess.cc	7 Dec 2010 00:52:00 -0000	1.1
@@ -0,0 +1,39 @@
+// $Header: /cvs/lcd/lcdd/src/unsegmented_calorimeterProcess.cc,v 1.1 2010/12/07 00:52:00 jeremy Exp $
+
+#include "calorimeterProcess.hh"
+
+#include "unsegmented_calorimeter.hh"
+
+//#include "Saxana/ProcessingConfigurator.h"
+#include "Saxana/ProcessingContext.h"
+//#include "Saxana/SAXProcessor.h"
+//#include "Saxana/StateStack.h"
+//#include "Saxana/SAXProcessingState.h"
+//#include "Saxana/SAXStateProcess.h"
+#include "Saxana/SAXComponentFactory.h"
+
+#include <iostream>
+
+/**
+   @class unsegmented_calorimeterProcess
+   @brief SAX process for unsegmented_calorimeter element.
+   @note  Calls SAX processor for SensitiveDetectorTypeProcess parent class.
+*/
+class unsegmented_calorimeterProcess : public calorimeterProcess
+{
+public:
+  unsegmented_calorimeterProcess(const ProcessingContext* context = 0)
+    : calorimeterProcess(context)
+  {}
+
+  virtual ~unsegmented_calorimeterProcess()
+  {}
+
+  virtual const std::string& State() const
+  {
+    static std::string tag = "unsegmented_calorimeter";
+    return tag;
+  }
+};
+
+DECLARE_PROCESS_FACTORY(unsegmented_calorimeterProcess)

lcdd/src
unsegmented_calorimeterSubscriber.cc added at 1.1
diff -N unsegmented_calorimeterSubscriber.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unsegmented_calorimeterSubscriber.cc	7 Dec 2010 00:52:00 -0000	1.1
@@ -0,0 +1,41 @@
+// $Header: /cvs/lcd/lcdd/src/unsegmented_calorimeterSubscriber.cc,v 1.1 2010/12/07 00:52:00 jeremy Exp $
+
+// GDML
+#include "Saxana/SAXSubscriber.h"
+#include "Saxana/SAXComponentFactory.h"
+
+#include "SensitiveDetectorFactory.hh"
+
+/**
+ @class calorimeterSubscriber
+ @brief SAX subscriber for calorimeter element.
+ @note  Delegates to SensitiveDetectorFactory to create G4CalorimeterSD object.
+ */
+class unsegmented_calorimeterSubscriber: virtual public SAXSubscriber
+{
+    public:
+
+        virtual const SAXComponentObject* Build() const
+        {
+            return this;
+        }
+
+    public:
+
+        unsegmented_calorimeterSubscriber()
+        {
+            Subscribe( "unsegmented_calorimeter" );
+        }
+
+        virtual ~unsegmented_calorimeterSubscriber()
+        {
+        }
+
+        virtual void Activate( const SAXObject* object )
+        {
+            std::cout << "unsegmented_calorimeterSubscriber - Activate";
+            SensitiveDetectorFactory::createSensitiveDetector( object );
+        }
+};
+
+DECLARE_SUBSCRIBER_FACTORY( unsegmented_calorimeterSubscriber )

lcdd/src
G4CalorimeterSD.cc 1.37 -> 1.38
diff -u -r1.37 -r1.38
--- G4CalorimeterSD.cc	12 Dec 2007 03:19:01 -0000	1.37
+++ G4CalorimeterSD.cc	7 Dec 2010 00:52:00 -0000	1.38
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/G4CalorimeterSD.cc,v 1.37 2007/12/12 03:19:01 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/G4CalorimeterSD.cc,v 1.38 2010/12/07 00:52:00 jeremy Exp $
 #include "G4CalorimeterSD.hh"
 
 // lcdd
@@ -76,7 +76,8 @@
 {
     bool valid = G4SensitiveDetector::isValidVolume(lv);
   
-    if ( valid ) {
+    if ( valid && m_segmentation != 0 )
+    {
         valid = m_segmentation->isValidSolid( lv->GetSolid() );
     }
   

lcdd/src
LCDDLibLoad.cc 1.26 -> 1.27
diff -u -r1.26 -r1.27
--- LCDDLibLoad.cc	30 Oct 2009 23:16:59 -0000	1.26
+++ LCDDLibLoad.cc	7 Dec 2010 00:52:00 -0000	1.27
@@ -20,6 +20,7 @@
     // SDs
     LOAD_COMPONENT(calorimeterProcess);
     LOAD_COMPONENT(optical_calorimeterProcess);
+    LOAD_COMPONENT(unsegmented_calorimeterProcess);
     LOAD_COMPONENT(trackerProcess);
     LOAD_COMPONENT(scorerProcess);
     LOAD_COMPONENT(sdrefProcess);
@@ -71,6 +72,7 @@
     // SDs
     LOAD_COMPONENT(calorimeterSubscriber);
     LOAD_COMPONENT(optical_calorimeterSubscriber);
+    LOAD_COMPONENT(unsegmented_calorimeterSubscriber);
     LOAD_COMPONENT(trackerSubscriber);
     LOAD_COMPONENT(scorerSubscriber);
 

lcdd/src
SensitiveDetectorFactory.cc 1.20 -> 1.21
diff -u -r1.20 -r1.21
--- SensitiveDetectorFactory.cc	30 Oct 2009 23:16:59 -0000	1.20
+++ SensitiveDetectorFactory.cc	7 Dec 2010 00:52:00 -0000	1.21
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/SensitiveDetectorFactory.cc,v 1.20 2009/10/30 23:16:59 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/SensitiveDetectorFactory.cc,v 1.21 2010/12/07 00:52:00 jeremy Exp $
 #include "SensitiveDetectorFactory.hh"
 
 // lcdd
@@ -6,56 +6,65 @@
 #include "G4ScorerSD.hh"
 #include "G4TrackerSD.hh"
 #include "G4OpticalCalorimeterSD.hh"
-#include "G4CalorimeterSD.hh"
+#include "G4UnsegmentedCalorimeterSD.hh"
+//#include "G4CalorimeterSD.hh"
 #include "PositionComparator.hh"
 #include "IdComparator.hh"
 #include "StringUtil.hh"
 
-G4SensitiveDetector* SensitiveDetectorFactory::createSensitiveDetector(const SAXObject* object)
+G4SensitiveDetector* SensitiveDetectorFactory::createSensitiveDetector(
+        const SAXObject* object )
 {
     G4SensitiveDetector* sd = 0;
 
-    const SensitiveDetectorType* sdt = dynamic_cast<const SensitiveDetectorType*> ( object );
+    const SensitiveDetectorType* sdt =
+            dynamic_cast< const SensitiveDetectorType* > ( object );
 
-    if ( sdt ) {
+    if ( sdt )
+    {
 
         std::string sd_type = sdt->get_type();
 
-        /* create calorimeter */
-        if ( sd_type == "calorimeter" || sd_type == "optical_calorimeter" ) {
+        /* Create calorimeter subdetector. */
+        if ( sd_type == "calorimeter" || sd_type == "optical_calorimeter" || sd_type
+                == "unsegmented_calorimeter" )
+        {
             sd = createCalorimeterSD( object );
         }
-        /* create tracker */
-        else if ( sd_type == "tracker" ) {
+        /* Create tracker subdetector. */
+        else if ( sd_type == "tracker" )
+        {
             sd = createTrackerSD( object );
         }
-        /* create scorer */
-        else if ( sd_type == "scorer" ) {
+        /* Create scorer subdetector. */
+        else if ( sd_type == "scorer" )
+        {
             sd = createScorerSD( object );
         }
-        /* invalid type */
-        else {
+        /* Type not recognized. */
+        else
+        {
             G4cerr << "Invalid sd_type <" << sd_type << ">." << G4endl;
             G4Exception( "Unknown SD type.  Check the LCDD file." );
         }
 
         // set ecut and verbose
-        setBaseSensitiveDetectorAttributes(sd, sdt);   
+        setBaseSensitiveDetectorAttributes( sd, sdt );
 
         // find idspec
-        IdSpec* idspec = findIdSpec(sdt);
+        IdSpec* idspec = findIdSpec( sdt );
 
         // set idspec, if exists (null is ok)
-        if ( idspec != 0 ) {
-            sd->setIdSpec(idspec);
+        if ( idspec != 0 )
+        {
+            sd->setIdSpec( idspec );
         }
 
         // register the SD
         std::string sdName = sd->GetName();
-        LCDDProcessor::instance()->addSensitiveDetector(sdName,
-                                                        sd);
+        LCDDProcessor::instance()->addSensitiveDetector( sdName, sd );
     }
-    else 
+    else
     {
         G4Exception( "Failed cast to SensitiveDetectorType." );
     }
@@ -63,28 +72,29 @@
     return sd;
 }
 
-G4CalorimeterSD* SensitiveDetectorFactory::createCalorimeterSD(const SAXObject* object)
+G4CalorimeterSD* SensitiveDetectorFactory::createCalorimeterSD( const SAXObject* object )
 {
     G4CalorimeterSD* sd = 0;
     G4Segmentation* seg = 0;
 
-    const SensitiveDetectorType* sdt = dynamic_cast<const SensitiveDetectorType*>( object );
+    const SensitiveDetectorType* sdt =
+            dynamic_cast< const SensitiveDetectorType* > ( object );
 
     std::string sd_type = sdt->get_type();
 
     // Create the segmentation.
-    ContentSequence* seq = const_cast<ContentSequence*> ( sdt->get_content() );
+    ContentSequence* seq = const_cast< ContentSequence* > ( sdt->get_content() );
     size_t count = seq->size();
 
     // Look for segmentation tag.
     bool fnd_seg = false;
-    for( size_t i = 0; i < count; i++) 
+    for ( size_t i = 0; i < count; i++ )
     {
-        std::string child_tag = seq->content(i).tag;
-        const ContentGroup::ContentItem& segitem = seq->content(i);
+        std::string child_tag = seq->content( i ).tag;
+        const ContentGroup::ContentItem& segitem = seq->content( i );
 
         // Create segmentation using factory.
-        if ( isSegmentationTag( child_tag ) ) 
+        if ( isSegmentationTag( child_tag ) )
         {
             seg = G4SegmentationFactory::createSegmentation( segitem.object, segitem.tag );
             fnd_seg = true;
@@ -92,88 +102,99 @@
         }
     }
 
-    if ( !fnd_seg ) 
-    {
-        G4Exception("FATAL ERROR: Segmentation tag is required to create a calorimeter.");
-    }
+    //if ( !fnd_seg )
+    //{
+    //    G4Exception( "FATAL ERROR: Segmentation tag is required to create a calorimeter." );
+    //}
 
-    const calorimeter* cal = dynamic_cast<const calorimeter*>( object );
 
-    const std::string& hitCompareStr = cal->get_compare();
+    // create SD with seg and comparator
+    if ( seg )
+    {
+        const calorimeter* cal = dynamic_cast< const calorimeter* > ( object );
 
-    // Comparison algorithm to be used for combining hits, to be determined from SD.
-    HitComparator* hitCompare = 0;
+        const std::string& hitCompareStr = cal->get_compare();
 
-    // Find the IdSpec.  
-    IdSpec* idspec = findIdSpec( sdt ); 
+        // Comparison algorithm to be used for combining hits, to be determined from SD.
+        HitComparator* hitCompare = 0;
 
-    if ( hitCompareStr != "id" && hitCompareStr != "position" ) 
-    {
-        G4Exception("Invalid selection for hit comparison <" + hitCompareStr + ">, for calorimeter <" + sdt->get_name() + ">.");
-    }
+        // Find the IdSpec.
+        IdSpec* idspec = findIdSpec( sdt );
 
-    // Compare on IDs.
-    if ( hitCompareStr == "id" ) 
-    {
-        if ( idspec ) 
+        if ( hitCompareStr != "id" && hitCompareStr != "position" )
         {
-            hitCompare = new IdComparator();
+            G4Exception( "Invalid selection for hit comparison <" + hitCompareStr
+                    + ">, for calorimeter <" + sdt->get_name() + ">." );
         }
-        else 
+
+        // Compare on IDs.
+        if ( hitCompareStr == "id" )
         {
-            std::cerr << "WARNING: IdSpec for <" << sdt->get_name() << "> does not exist!  Position comparison will be used for hit aggregation instead of id." << std::endl;
+            if ( idspec )
+            {
+                hitCompare = new IdComparator();
+            }
+            else
+            {
+                std::cerr << "WARNING: IdSpec for <" << sdt->get_name()
+                        << "> does not exist!  Position comparison will be used for hit aggregation instead of id."
+                        << std::endl;
+            }
         }
-    }
 
-    // Compare on position.
-    if ( !hitCompare ) 
-    {
-        hitCompare = new PositionComparator();
-    }
-
-    // create SD with seg and comparator
-    if ( seg ) 
-    {
+        // Compare on position.
+        if ( !hitCompare )
+        {
+            hitCompare = new PositionComparator();
+        }
 
-        if ( sd_type == "calorimeter" ) 
+        if ( sd_type == "calorimeter" )
         {
-            sd = new G4CalorimeterSD(sdt->get_name(),
-                                     sdt->get_hitsCollectionName(),
-                                     seg,
-                                     hitCompare); 
+            sd = new G4CalorimeterSD(
+                    sdt->get_name(),
+                    sdt->get_hitsCollectionName(),
+                    seg,
+                    hitCompare );
         }
-        else if ( sd_type == "optical_calorimeter" ) 
+        else if ( sd_type == "optical_calorimeter" )
         {
             //
             // in case of optical alorimeter there are 2 hit collections  
             //
             //G4String  hcnames[2];
-            std::vector<G4String> hcnames;
-            hcnames.push_back("Edep_"+sdt->get_hitsCollectionName());
-            hcnames.push_back("Ceren_"+sdt->get_hitsCollectionName());
+            std::vector< G4String > hcnames;
+            hcnames.push_back( "Edep_" + sdt->get_hitsCollectionName() );
+            hcnames.push_back( "Ceren_" + sdt->get_hitsCollectionName() );
             //std::cout<< " now creating optical calorimeter"<<std::endl;
-            sd = new G4OpticalCalorimeterSD(sdt->get_name(),
-                                            hcnames,
-                                            seg,
-                                            hitCompare);        
+            sd = new G4OpticalCalorimeterSD( sdt->get_name(), hcnames, seg, hitCompare );
         }
-        else 
+        else
         {
-            G4Exception("SensitiveDetectorFactory - Unknown sensitive detector type: " + sd_type);
+            G4Exception( "SensitiveDetectorFactory - Unknown sensitive detector type: "
+                    + sd_type );
         }
     }
     // shouldn't happen if fnd_seg fails...
-    else 
+    else
     {
-        G4Exception( "FATAL ERROR: G4SegmentationFactory returned a NULL pointer!" );
+        if ( sd_type == "unsegmented_calorimeter" )
+        {
+            sd = new G4UnsegmentedCalorimeterSD(
+                    sdt->get_name(),
+                    sdt->get_hitsCollectionName() );
+        }
+        else
+        {
+            G4Exception( "Segmentation is required for segmented calorimeter types." );
+        }
     }
 
     return sd;
 }
 
-G4TrackerSD* SensitiveDetectorFactory::createTrackerSD(const SAXObject* object)
+G4TrackerSD* SensitiveDetectorFactory::createTrackerSD( const SAXObject* object )
 {
-    const tracker* trk = dynamic_cast<const tracker*>( object );
+    const tracker* trk = dynamic_cast< const tracker* > ( object );
 
     bool combineHits = StringUtil::toBool( trk->get_combine_hits() );
 
@@ -182,67 +203,68 @@
     std::string nm = trk->get_name();
     std::string hc = trk->get_hitsCollectionName();
 
-    if (checkHCName(hc)) 
+    if ( checkHCName( hc ) )
     {
-        G4Exception("SensitiveDetectorFactory - There was a problem with the name of the hits collection.");
+        G4Exception(
+                "SensitiveDetectorFactory - There was a problem with the name of the hits collection." );
     }
 
     /* tracker that aggregates hits */
-    if ( combineHits ) 
+    if ( combineHits )
     {
-        sd = new G4TrackerCombineSD(nm,
-                                    hc);
+        sd = new G4TrackerCombineSD( nm, hc );
     }
     /* regular tracker */
-    else 
+    else
     {
-        sd = new G4TrackerSD(nm,
-                             hc);
+        sd = new G4TrackerSD( nm, hc );
     }
 
     return sd;
 }
 
-G4ScorerSD* SensitiveDetectorFactory::createScorerSD(const SAXObject* object)
+G4ScorerSD* SensitiveDetectorFactory::createScorerSD( const SAXObject* object )
 {
-    const scorer * scr = dynamic_cast<const scorer*>( object );
+    const scorer * scr = dynamic_cast< const scorer* > ( object );
 
     G4ScorerSD* sd = 0;
 
     std::string nm = scr->get_name();
     std::string hc = scr->get_hitsCollectionName();
 
-    if ( checkHCName(hc) ) 
+    if ( checkHCName( hc ) )
     {
-        G4Exception("SensitiveDetectorFactory - There was a problem with the name of the hits collection.");
+        G4Exception(
+                "SensitiveDetectorFactory - There was a problem with the name of the hits collection." );
     }
 
-    sd = new G4ScorerSD(nm,
-                        hc);
+    sd = new G4ScorerSD( nm, hc );
     return sd;
 }
 
-IdSpec* SensitiveDetectorFactory::findIdSpec(const SensitiveDetectorType* sdt)
+IdSpec* SensitiveDetectorFactory::findIdSpec( const SensitiveDetectorType* sdt )
 {
     IdSpec* idspec = 0;
-    ContentSequence* seq = const_cast<ContentSequence*> ( sdt->get_content() );
+    ContentSequence* seq = const_cast< ContentSequence* > ( sdt->get_content() );
     size_t count = seq->size();
-    for( size_t i = 0; i < count; i++) 
+    for ( size_t i = 0; i < count; i++ )
     {
 
-        std::string child_tag = seq->content(i).tag;
+        std::string child_tag = seq->content( i ).tag;
 
         // find idspec
-        if ( child_tag == "idspecref" ) 
+        if ( child_tag == "idspecref" )
         {
             IdSpecType::idspecref* id_ref =
-                dynamic_cast<IdSpecType::idspecref*> ( seq->content(i).object );
+                    dynamic_cast< IdSpecType::idspecref* > ( seq->content( i ).object );
 
             idspec = IdManager::instance()->getIdSpec( id_ref->get_ref() );
 
-            if (idspec == 0) 
+            if ( idspec == 0 )
             {
-                G4Exception("The IdSpec <" + id_ref->get_ref() + "> referenced by detector <" + sdt->get_name() + "> does not exist!");
+                G4Exception( "The IdSpec <" + id_ref->get_ref()
+                        + "> referenced by detector <" + sdt->get_name()
+                        + "> does not exist!" );
             }
 
             break;
@@ -251,14 +273,16 @@
     return idspec;
 }
 
-void SensitiveDetectorFactory::setBaseSensitiveDetectorAttributes(G4SensitiveDetector* sd, const SensitiveDetectorType* sdt)
+void SensitiveDetectorFactory::setBaseSensitiveDetectorAttributes(
+        G4SensitiveDetector* sd,
+        const SensitiveDetectorType* sdt )
 {
     sd->setEcut( SensitiveDetectorFactory::computeEcut( sdt ) );
     sd->setVerbose( SensitiveDetectorFactory::convertVerbose( sdt ) );
     sd->setEndcapFlag( StringUtil::toBool( sdt->get_endcap_flag() ) );
 }
 
-double SensitiveDetectorFactory::computeEcut(const SensitiveDetectorType* sdt)
+double SensitiveDetectorFactory::computeEcut( const SensitiveDetectorType* sdt )
 {
     GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator();
     std::string sval = sdt->get_ecut();
@@ -267,43 +291,40 @@
     return ecut;
 }
 
-int SensitiveDetectorFactory::convertVerbose(const SensitiveDetectorType* sdt)
+int SensitiveDetectorFactory::convertVerbose( const SensitiveDetectorType* sdt )
 {
     GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator();
     std::string sval = sdt->get_verbose();
-    int verbose = (int)calc->Eval( sval );
+    int verbose = ( int ) calc->Eval( sval );
     return verbose;
 }
 
 // NOTE: New segmentations must appear here!
-bool SensitiveDetectorFactory::isSegmentationTag(const std::string& s)
+bool SensitiveDetectorFactory::isSegmentationTag( const std::string& s )
 {
     // @todo Fix this to know all segmentation types automatically somehow.  (schema?)
-    return ( s == "projective_cylinder" ||
-             s == "grid_xyz" ||
-             s == "global_grid_xy" ||
-             s == "nonprojective_cylinder" ||
-             s == "projective_zplane" );
+    return ( s == "projective_cylinder" || s == "grid_xyz" || s == "global_grid_xy" || s
+            == "nonprojective_cylinder" || s == "projective_zplane" );
 }
 
-bool SensitiveDetectorFactory::checkHCName(const std::string& s)
+bool SensitiveDetectorFactory::checkHCName( const std::string& s )
 {
     bool bad = false;
 
     // is size <= 1 ?
-    if ( s.size() <= 1 ) 
+    if ( s.size() <= 1 )
     {
         bad = true;
         //std::cerr << "HCName <" << s << "> is not enough characters." << std::endl;
     }
-    else 
+    else
     {
         LCDDProcessor* proc = LCDDProcessor::instance();
-        for ( LCDDProcessor::SensitiveDetectors::const_iterator iter = proc->getSensitiveDetectorsBegin();
-              iter != proc->getSensitiveDetectorsBegin();
-              iter++ ) 
+        for ( LCDDProcessor::SensitiveDetectors::const_iterator iter =
+                proc->getSensitiveDetectorsBegin(); iter
+                != proc->getSensitiveDetectorsBegin(); iter++ )
         {
-            if (iter->second->getHCName() == s ) 
+            if ( iter->second->getHCName() == s )
             {
                 bad = true;
                 //std::cerr << "HCName <" << s << "> already assigned to SD <" << iter->second->GetName() << ">." << std::endl;
CVSspam 0.2.8