Print

Print


Commit in slicPandora/src on MAIN
SimCalorimeterHitProcessor.cpp+14-141.17 -> 1.18
add relations to event; should fix mem leak; read back in jas3 okay but not lcio command line

slicPandora/src
SimCalorimeterHitProcessor.cpp 1.17 -> 1.18
diff -u -r1.17 -r1.18
--- SimCalorimeterHitProcessor.cpp	15 Jun 2010 23:28:12 -0000	1.17
+++ SimCalorimeterHitProcessor.cpp	17 Aug 2010 21:55:21 -0000	1.18
@@ -65,24 +65,13 @@
             continue;
         }
 
-        LCCollection* calHits = new LCCollectionVec(EVENT::LCIO::CALORIMETERHIT);        
-
         PandoraApi::GeometryParameters::SubDetectorParameters* subdet = geom->getSubDetectorFromType((*iter));
         std::string subdetName = (*iter);
         const DetectorGeometry::ExtraSubDetectorParameters& xsubdet = subdetExtras->find(subdetName)->second;
-        //const DetectorGeometry::ExtraSubDetectorParameters& xsubdet = subdetExtras->at((*iter));
-
-        float mipSigma = xsubdet.m_mipSigma.Get();
-        float mipCut = xsubdet.m_mipCut.Get();
-        float timeCut = xsubdet.m_timeCut.Get();
-
-        PandoraApi::GeometryParameters::LayerParametersList* layerList = &(subdet->m_layerParametersList);
-
         const std::string& collectionName = xsubdet.m_collection;
-        IDDecoder* decoder = xsubdet.m_decoder;
 
         LCCollection* simCalHits = 0;
-        
+
         // Try to fetch the collection by name from the input LCIO file and skip if doesn't exist.
         try 
         {
@@ -94,6 +83,16 @@
             continue;
         }
 
+        LCCollection* calHits = new LCCollectionVec(EVENT::LCIO::CALORIMETERHIT);        
+
+        float mipSigma = xsubdet.m_mipSigma.Get(); // FIXME: Unused variable.
+        float mipCut = xsubdet.m_mipCut.Get();
+        float timeCut = xsubdet.m_timeCut.Get();
+
+        PandoraApi::GeometryParameters::LayerParametersList* layerList = &(subdet->m_layerParametersList);
+
+        IDDecoder* decoder = xsubdet.m_decoder;
+
         // Set correct flags for output collection.  
         int flag = 1 << EVENT::LCIO::RCHBIT_LONG; // position
         flag |= 1 << EVENT::LCIO::RCHBIT_ID1;     // cellId1
@@ -129,8 +128,6 @@
             // Create a new, empty CalorimeterHit.
             CalorimeterHitImpl* calHit = new CalorimeterHitImpl;
 
-            //std::cout << "nmcp = " << simCalHit->getNMCParticles() << std::endl;
-
             // Get the 32-bit chunks of the id.
             int cellId0 = simCalHit->getCellID0();
             int cellId1 = simCalHit->getCellID1();
@@ -173,4 +170,7 @@
         // Add the CalorimeterHits to the event with the collection name the same as the calorimeter type, e.g. EM_BARREL.
         event->addCollection(calHits, (*iter));
     }
+
+    // Add the CalorimeterHit to SimCalorimeterHit relations.
+    event->addCollection(scRel, "CalorimeterHitRelations");
 }
CVSspam 0.2.8