Print

Print


Commit in slic/include on MAIN
LcioHitsCollectionBuilder.hh+99-941.5 -> 1.6


slic/include
LcioHitsCollectionBuilder.hh 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- LcioHitsCollectionBuilder.hh	27 Apr 2007 01:54:32 -0000	1.5
+++ LcioHitsCollectionBuilder.hh	14 Oct 2009 20:55:10 -0000	1.6
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/LcioHitsCollectionBuilder.hh,v 1.5 2007/04/27 01:54:32 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/LcioHitsCollectionBuilder.hh,v 1.6 2009/10/14 20:55:10 jeremy Exp $
 
 #ifndef SLIC_LCIOHITSCOLLECTIONBUILDER_HH
 #define SLIC_LCIOHITSCOLLECTIONBUILDER_HH
@@ -25,101 +25,106 @@
 namespace slic
 {
 
-  class LcioMcpManager;
+    class LcioMcpManager;
 
-  /**
-     @class LcioHitsCollectionBuilder
-     @brief Builds Lcio hits collections from G4/SLIC event data.
-     @note  Makes use of LcioMcpManager for Mcp hit contributions.
-  */
-  class LcioHitsCollectionBuilder : public Module
-  {
-  public:
-    LcioHitsCollectionBuilder();
-    virtual ~LcioHitsCollectionBuilder();
-
-  public:
-
-    // interface function to create an Lcio event from a G4 event
-    EVENT::LCEvent* createHCsFromG4Event(const G4Event* g4evt, EVENT::LCEvent* lcevt);
-
-    // flags for hits
-    void setLongFlag(bool s = true);
-    void setPDGFlag(bool s = true);
-
-    void setStoreMomentum( bool s = true )
-    {
-      m_storeMomentum = s;
-    }
-
-    bool getStoreMomentum()
+    /**
+       @class LcioHitsCollectionBuilder
+       @brief Builds Lcio hits collections from G4/SLIC event data.
+       @note  Makes use of LcioMcpManager for Mcp hit contributions.
+    */
+    class LcioHitsCollectionBuilder : public Module
     {
-      return m_storeMomentum;
-    }
-
-  private:
-    // create the hit collections in Lcio Event from the current G4Event
-    void createHitCollections();
-
-    // create the LCCollectionVec
-    IMPL::LCCollectionVec* createCollectionVec(G4VHitsCollection* g4HC,
-					       G4SensitiveDetector::EType SDtype);
-
-    // create a tracker coll
-    IMPL::LCCollectionVec* createTrackerCollectionVec(G4VHitsCollection* g4HC);
-
-    // create a calorimeter coll
-    IMPL::LCCollectionVec* createCalorimeterCollectionVec(G4VHitsCollection* g4HC);
-
-    // save cal hits
-    void saveHits(G4CalorimeterHitsCollection* calHits,
-		  IMPL::LCCollectionVec* lcioColl);
-
-    // save trk hits
-    void saveHits(G4TrackerHitsCollection* trkHits,
-		  IMPL::LCCollectionVec* lcioColl);
-
-    // create cal hit from G4 cal hit
-    IMPL::SimCalorimeterHitImpl* createHit(G4CalorimeterHit* calHit);
-
-    // create trk hit from G4 trk hit
-    IMPL::SimTrackerHitImpl* createHit(G4TrackerHit* trkHit);
-
-    // copy MCParticle hit contributions from G4 cal hit to the LCIO cal hit
-    void addMcpContribs( G4CalorimeterHit*, IMPL::SimCalorimeterHitImpl* );
-
-    // setup default flag settings; called in ctor
-    void setCalFlagDefaults();
-
-    // combine Mcp hit contribs using track ID
-    void combineMcpHitContribs(const McpHitContribList& long_contrib,
-			       McpHitContribList& combined_contrib);
-
-    // find single contrib by track ID in the combined list
-    McpHitContrib* findMcpHitContribByTrackID(int trk_id,
-					      McpHitContribList& contribs);
-
-    // set endcap bit in trk or cal flag depending on SD type
-    void setEndcapFlag(G4SensitiveDetector* g4sd);
-
-  private:
-
-    // current Lcio event
-    EVENT::LCEvent* m_currentLCEvent;
-
-    // current G4 event
-    const G4Event* m_currentG4Event;
-
-    // default flags
-    IMPL::LCFlagImpl m_trkCollFlag;
-    IMPL::LCFlagImpl m_calCollFlag;
-
-    // store momentum
-    bool m_storeMomentum;
-
-    // ptr to Lcio Mcp manager for lkp of Mcp data
-    LcioMcpManager* m_mcpManager;
-  };
+        public:
+            LcioHitsCollectionBuilder();
+            virtual ~LcioHitsCollectionBuilder();
+            
+        public:
+            
+            // interface function to create an Lcio event from a G4 event
+            EVENT::LCEvent* createHCsFromG4Event(const G4Event* g4evt, EVENT::LCEvent* lcevt);
+            
+            // flags for hits
+            void setLongFlag(bool s = true);
+            void setPDGFlag(bool s = true);
+            
+            void setStoreMomentum( bool s = true )
+            {
+                m_storeMomentum = s;
+            }
+            
+            bool getStoreMomentum()
+            {
+                return m_storeMomentum;
+            }
+            
+        private:
+            // create the hit collections in Lcio Event from the current G4Event
+            void createHitCollections();
+            
+            // create the LCCollectionVec
+            IMPL::LCCollectionVec* createCollectionVec(G4VHitsCollection* g4HC,
+                                                       G4SensitiveDetector::EType SDtype);
+            
+            // create a tracker coll
+            IMPL::LCCollectionVec* createTrackerCollectionVec(G4VHitsCollection* g4HC);
+            
+            // create a calorimeter coll
+            IMPL::LCCollectionVec* createCalorimeterCollectionVec(G4VHitsCollection* g4HC);
+            
+            // save cal hits
+            void saveHits(G4CalorimeterHitsCollection* calHits,
+                          IMPL::LCCollectionVec* lcioColl);
+            
+            // save trk hits
+            void saveHits(G4TrackerHitsCollection* trkHits,
+                          IMPL::LCCollectionVec* lcioColl);
+            
+            // create cal hit from G4 cal hit
+            IMPL::SimCalorimeterHitImpl* createHit(G4CalorimeterHit* calHit);
+            
+            // create trk hit from G4 trk hit
+            IMPL::SimTrackerHitImpl* createHit(G4TrackerHit* trkHit);
+            
+            // copy MCParticle hit contributions from G4 cal hit to the LCIO cal hit
+            void addMcpContribs( G4CalorimeterHit*, IMPL::SimCalorimeterHitImpl* );
+            
+            // setup default flag settings; called in ctor
+            void setCalFlagDefaults();
+            
+            // combine Mcp hit contribs using track ID
+            void combineMcpHitContribs(const McpHitContribList& long_contrib,
+                                       McpHitContribList& combined_contrib);
+            
+            // find single contrib by track ID in the combined list
+            McpHitContrib* findMcpHitContribByTrackID(int trk_id,
+                                                      McpHitContribList& contribs);
+            
+            // set endcap bit in trk or cal flag depending on SD type
+            void setEndcapFlag(G4SensitiveDetector* g4sd);
+
+            /**
+             * True if the LCEvent contains a collection with given name; False if not.
+             */
+            static bool containsCollection(EVENT::LCEvent*, const std::string&);
+            
+        private:
+            
+            // current Lcio event
+            EVENT::LCEvent* m_currentLCEvent;
+            
+            // current G4 event
+            const G4Event* m_currentG4Event;
+            
+            // default flags
+            IMPL::LCFlagImpl m_trkCollFlag;
+            IMPL::LCFlagImpl m_calCollFlag;
+            
+            // store momentum
+            bool m_storeMomentum;
+            
+            // ptr to Lcio Mcp manager for lkp of Mcp data
+            LcioMcpManager* m_mcpManager;
+    };
 }
 
 #endif
CVSspam 0.2.8