Print

Print


Commit in lcio/src on v01-07-vtx
aid/EVENT/LCIO.aid+3-11.53 -> 1.53.4.1
         /Vertex.aid+10-101.2.2.2 -> 1.2.2.3
cpp/include/IMPL/VertexImpl.h+13-141.1.2.2 -> 1.1.2.3
cpp/include/IOIMPL/VertexIOImpl.h+28added 1.1.2.1
cpp/include/SIO/SIOVertexHandler.h+33added 1.1.2.1
cpp/include/UTIL/LCIOTypeInfo.h+31.1 -> 1.1.4.1
cpp/src/IMPL/LCIO.cc+11.21 -> 1.21.4.1
            /VertexImpl.cc+11-251.1.2.2 -> 1.1.2.3
cpp/src/SIO/SIOVertexHandler.cc+102added 1.1.2.1
           /SIOHandlerMgr.cc+21.23 -> 1.23.6.1
+206-50
3 added + 7 modified, total 10 files
added IO functionality to Vertex Class (Not complete yet!! ReconstructedParticle Class still needs changes to read/write it's associated start/end vertices' references from/to an I/O file)

lcio/src/aid/EVENT
LCIO.aid 1.53 -> 1.53.4.1
diff -u -r1.53 -r1.53.4.1
--- LCIO.aid	24 Mar 2006 06:33:43 -0000	1.53
+++ LCIO.aid	15 Aug 2006 13:01:09 -0000	1.53.4.1
@@ -16,7 +16,7 @@
 /** Global constants used in LCIO.
  * 
  * @author gaede 
- * @version $Id: LCIO.aid,v 1.53 2006/03/24 06:33:43 jeremy Exp $
+ * @version $Id: LCIO.aid,v 1.53.4.1 2006/08/15 13:01:09 engels Exp $
  * @see LCObject
  * @see LCIO
  */
@@ -107,6 +107,7 @@
     static const char* LCRELATION ; 
     static const char* LCGENERICOBJECT ; 
     static const char* PARTICLEID;
+    static const char* VERTEX;
 
     // reserved names, e.g. name of event/collections paramaters
     
@@ -188,6 +189,7 @@
   public static const String LCRELATION = "LCRelation" ; 
   public static const String LCGENERICOBJECT = "LCGenericObject"; 
   public static const String PARTICLEID = "ParticleID"; 
+  public static const String VERTEX = "Vertex"; 
 
   // reserved names, e.g. name of event/collections paramaters
     

lcio/src/aid/EVENT
Vertex.aid 1.2.2.2 -> 1.2.2.3
diff -u -r1.2.2.2 -r1.2.2.3
--- Vertex.aid	14 Aug 2006 16:10:01 -0000	1.2.2.2
+++ Vertex.aid	15 Aug 2006 13:01:09 -0000	1.2.2.3
@@ -14,7 +14,7 @@
  *  <p>UNDER DEVELOPMENT!</p>
  *  
  * @author gaede, engels
- * @version $Id: Vertex.aid,v 1.2.2.2 2006/08/14 16:10:01 engels Exp $
+ * @version $Id: Vertex.aid,v 1.2.2.3 2006/08/15 13:01:09 engels Exp $
  */
 
 public interface Vertex extends LCObject {
@@ -32,22 +32,22 @@
      */
     public boolean isPrimary() const ;
 
-    /** Position of the cluster.
+     /** Chi squared of the vertex fit.
      */
-    public const float3V getPosition() const;
+    public float getChi2() const ;	
 
-    /** Covariance matrix of the position (stored as lower triangle matrix, i.e. 
-     *  cov(xx),cov(y,x),cov(y,y) ).
+    /** Probability of the vertex fit.
      */
-    public const FloatVec & getCovMatrix() const ;
+    public float getProbability() const ;	
 
-    /** Chi squared of the vertex fit.
+    /** Position of the cluster.//TODO:cluster?
      */
-    public float getChi2() const ;	
+    public const float3V getPosition() const;
 
-    /** Probability of the vertex fit.
+    /** Covariance matrix of the position (stored as lower triangle matrix, i.e. 
+     *  cov(xx),cov(y,x),cov(y,y) ).
      */
-    public float getProbability() const ;	
+    public const FloatVec & getCovMatrix() const ;
 
     /** Additional parameters related to this vertex - check/set the collection
      *  parameter "VertexParameterNames" for the parameters' meaning.

lcio/src/cpp/include/IMPL
VertexImpl.h 1.1.2.2 -> 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- VertexImpl.h	14 Aug 2006 16:10:02 -0000	1.1.2.2
+++ VertexImpl.h	15 Aug 2006 13:01:11 -0000	1.1.2.3
@@ -37,6 +37,14 @@
      */
     virtual bool isPrimary() const ;
     
+    /** Chi squared of the vertex fit.
+     */
+    virtual float getChi2() const;
+                                                                                                         
+    /** Probability of the vertex fit.
+     */
+    virtual float getProbability() const;
+                                                                                                         
     /** Position of the vertex 
      */
     virtual const float* getPosition() const;
@@ -46,14 +54,6 @@
      */
     virtual const EVENT::FloatVec & getCovMatrix() const;
                                                                                                          
-    /** Chi squared of the vertex fit.
-     */
-    virtual float getChi2() const;
-                                                                                                         
-    /** Probability of the vertex fit.
-     */
-    virtual float getProbability() const;
-                                                                                                         
     /** Additional parameters related to this vertex - check/set the collection
      *  parameter "VertexParameterNames" for the parameters' meaning.
      */
@@ -65,21 +65,20 @@
 
     // setters
     void setPrimary(bool primary) ;
-    void setPosition( float vpos[3] ) ;
-    void setPosition( float px, float py, float pz ) ;
     void setChi2( float chi2 ) ;
     void setProbability( float probability ) ;
+    void setPosition( float vpos[3] ) ;
+    void setPosition( float px, float py, float pz ) ;
     void setCovMatrix( const float* cov ) ;
     void setCovMatrix( const EVENT::FloatVec & ) ;
-    void setParameters( const float* par ) ;
-    void setParameters( const EVENT::FloatVec& ) ;
     void setAssociatedParticle( EVENT::ReconstructedParticle * aP ) ;
+    void addParameter( float p );
 
   protected:
-    bool _primary ;
-    float _vpos[3] ;
+    int _primary ;
     float _chi2 ;
     float _probability ;
+    float _vpos[3] ;
     EVENT::FloatVec _cov ;
     EVENT::FloatVec _par ;
     EVENT::ReconstructedParticle* _aParticle ;

lcio/src/cpp/include/IOIMPL
VertexIOImpl.h added at 1.1.2.1
diff -N VertexIOImpl.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ VertexIOImpl.h	15 Aug 2006 13:01:13 -0000	1.1.2.1
@@ -0,0 +1,28 @@
+#ifndef SIO_VERTEXIOIMPL_H
+#define SIO_VERTEXIOIMPL_H 1
+
+#include "IMPL/VertexImpl.h"
+
+// forward declaration
+namespace SIO{ 
+  class SIOVertexHandler ;
+}
+
+namespace IOIMPL {
+
+  class SIOVertexHandler ;
+  
+/** Adding stuff needed for io (friend declarations, etc.)
+ * 
+ * @author gaede, engels
+ * @version Aug 15, 2006
+ */
+  class VertexIOImpl : public IMPL::VertexImpl {
+    
+    friend class SIO::SIOVertexHandler ;
+    
+  }; // class
+
+} // namespace
+
+#endif /* ifndef SIO_VERTEXIOIMPL_H */

lcio/src/cpp/include/SIO
SIOVertexHandler.h added at 1.1.2.1
diff -N SIOVertexHandler.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SIOVertexHandler.h	15 Aug 2006 13:01:14 -0000	1.1.2.1
@@ -0,0 +1,33 @@
+#ifndef SIO_SIOVERTEXHANDLER_H
+#define SIO_SIOVERTEXHANDLER_H 1
+
+#include "SIO/SIOObjectHandler.h"
+
+
+namespace SIO {
+    
+    
+/** Implementation of SIOObjectHandler to handle IO of Vertexes.
+ *
+ * @author gaede, engels
+ * @version $Id: SIOVertexHandler.h,v 1.1.2.1 2006/08/15 13:01:14 engels Exp $
+ */
+
+  class SIOVertexHandler : public SIOObjectHandler {
+	
+  public:
+	
+    /** Reads lcio Vertex objects from an SIO stream.
+     */
+    virtual unsigned int read(SIO_stream* stream, 
+			      EVENT::LCObject** objP)  ;
+	
+    /** Writes lcio Vertex objects to an SIO stream.
+     */
+    virtual unsigned int write(SIO_stream* stream, 
+			       const EVENT::LCObject* obj) ;
+	
+  }; // class
+} // namespace
+
+#endif /* ifndef SIO_SIOVERTEXHANDLER_H */

lcio/src/cpp/include/UTIL
LCIOTypeInfo.h 1.1 -> 1.1.4.1
diff -u -r1.1 -r1.1.4.1
--- LCIOTypeInfo.h	24 Mar 2006 11:56:41 -0000	1.1
+++ LCIOTypeInfo.h	15 Aug 2006 13:01:14 -0000	1.1.4.1
@@ -22,6 +22,7 @@
 #include "EVENT/ReconstructedParticle.h"
 #include "EVENT/LCGenericObject.h"
 #include "EVENT/LCRelation.h"
+#include "EVENT/Vertex.h"
 
 #include <vector>
 #include <sstream>
@@ -63,6 +64,7 @@
   template<> const char* lctypename<EVENT::ReconstructedParticle>() { return EVENT::LCIO::RECONSTRUCTEDPARTICLE ; }
   template<> const char* lctypename<EVENT::LCRelation>() { return EVENT::LCIO::LCRELATION ; }
   template<> const char* lctypename<EVENT::LCGenericObject>() { return EVENT::LCIO::LCGENERICOBJECT ; }
+  template<> const char* lctypename<EVENT::Vertex>() { return EVENT::LCIO::VERTEX ; }
   
   
   /** Template that returns the LCIO type name as used in the LCCollctions (and files) based on 
@@ -101,6 +103,7 @@
     if( dynamic_cast<const EVENT::ReconstructedParticle*>(o) != 0 ) return   lctypename<EVENT::ReconstructedParticle>() ;
     if( dynamic_cast<const EVENT::LCRelation*>(o) != 0 ) return   lctypename<EVENT::LCRelation>() ;
     if( dynamic_cast<const EVENT::LCGenericObject*>(o) != 0 ) return   lctypename<EVENT::LCGenericObject>() ;
+    if( dynamic_cast<const EVENT::Vertex*>(o) != 0 ) return   lctypename<EVENT::Vertex>() ;
     
     return "UNKNOWN" ;
   }

lcio/src/cpp/src/IMPL
LCIO.cc 1.21 -> 1.21.4.1
diff -u -r1.21 -r1.21.4.1
--- LCIO.cc	24 Mar 2006 05:03:13 -0000	1.21
+++ LCIO.cc	15 Aug 2006 13:01:15 -0000	1.21.4.1
@@ -26,6 +26,7 @@
 const char* LCIO::LCRELATION = "LCRelation" ; 
 const char* LCIO::LCGENERICOBJECT = "LCGenericObject" ; 
 const char* LCIO::PARTICLEID = "ParticleID" ; 
+const char* LCIO::VERTEX = "Vertex" ; 
 
 const char* LCIO::CellIDEncoding = "CellIDEncoding" ; 
 }

lcio/src/cpp/src/IMPL
VertexImpl.cc 1.1.2.2 -> 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- VertexImpl.cc	14 Aug 2006 16:10:05 -0000	1.1.2.2
+++ VertexImpl.cc	15 Aug 2006 13:01:15 -0000	1.1.2.3
@@ -13,36 +13,26 @@
     _aParticle(0)
   {
     _cov.resize( NCOVARIANCE ) ;
-    //     for(int i=0 ; i < NCOVARIANCE ; i++ ) { _cov.push_back( 0.0 ) ;  }
     _vpos[0] = 0. ;
     _vpos[1] = 0. ;
     _vpos[2] = 0. ;
   }
 
-  VertexImpl::~VertexImpl(){	  
-	  
-    /*
-    // delete the pids owned by this particle
-    for(  ParticleIDVec::iterator iter = _pid.begin() ; iter != _pid.end() ; iter++){
-      delete *iter ;
-    }
-    */
-  }
+  VertexImpl::~VertexImpl(){ /*TODO*/ }
  
-  const float* VertexImpl::getPosition() const { return  _vpos ; }
-  const EVENT::FloatVec & VertexImpl::getCovMatrix() const { return _cov ; }
+  bool VertexImpl::isPrimary() const { return _primary ;}
   float VertexImpl::getChi2() const { return _chi2 ; }
   float VertexImpl::getProbability() const { return _probability ; }
+  const float* VertexImpl::getPosition() const { return  _vpos ; }
+  const EVENT::FloatVec & VertexImpl::getCovMatrix() const { return _cov ; }
   const EVENT::FloatVec & VertexImpl::getParameters() const { return _par ; }
   EVENT::ReconstructedParticle * VertexImpl::getAssociatedParticle() const { return _aParticle  ; }
-  
-  bool VertexImpl::isPrimary() const { return _primary ;}
 
 
   //setters
   void VertexImpl::setPrimary(bool primary){
     checkAccess("VertexImpl::setPrimary" );
-    _primary = primary ;
+    _primary = (primary==0?0:1);
   }
   
   void VertexImpl::setChi2(float chi2){
@@ -75,21 +65,17 @@
     checkAccess("VertexImpl::" );
     for(int i=0;i<NCOVARIANCE;i++) _cov[i] = cov[i] ;
   }
-  
-  void VertexImpl::setParameters( const float* par ){
-    checkAccess("VertexImpl::setParameters" );
-    //_par = par;
-  }
-  
-  void VertexImpl::setParameters( const EVENT::FloatVec& par ){
-    checkAccess("VertexImpl::" );
-    //_par = par;
-  }
 
   void VertexImpl::setAssociatedParticle( EVENT::ReconstructedParticle *aP ){
     checkAccess("VertexImpl::setAssociatedParticle" );
     _aParticle = aP;
   }
+
+  void VertexImpl::addParameter( float p ){
+    checkAccess("VertexImpl::addParameter") ;
+    _par.push_back( p ) ;
+  }
+
  
 } // end namespace
 

lcio/src/cpp/src/SIO
SIOVertexHandler.cc added at 1.1.2.1
diff -N SIOVertexHandler.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SIOVertexHandler.cc	15 Aug 2006 13:01:18 -0000	1.1.2.1
@@ -0,0 +1,102 @@
+#include "SIO/SIOVertexHandler.h"
+
+#include "SIO/LCSIO.h"
+
+#include "EVENT/LCIO.h"
+#include "IOIMPL/VertexIOImpl.h"
+#include "IMPL/LCFlagImpl.h"
+
+#include "SIO_functions.h"
+#include "SIO_block.h"
+
+
+using namespace EVENT ;
+using namespace IMPL ;
+using namespace IOIMPL ;
+
+
+namespace SIO{
+    
+  unsigned int SIOVertexHandler::read(SIO_stream* stream, 
+				      LCObject** objP){
+    unsigned int status ; 
+	
+
+    // create a new object :
+    VertexIOImpl* vtx  = new VertexIOImpl ;
+    *objP = vtx ;
+
+    //read data
+    SIO_DATA( stream ,  &(vtx->_primary)  , 1 ) ;
+    SIO_DATA( stream ,  &(vtx->_chi2)  , 1 ) ;
+    SIO_DATA( stream ,  &(vtx->_probability)  , 1 ) ;
+    SIO_DATA( stream ,  vtx->_vpos  , 3 ) ;
+
+    //read covMatrix
+    float cov[NCOVARIANCE] ;
+    SIO_DATA( stream ,  cov  ,  NCOVARIANCE ) ;
+    vtx->setCovMatrix( cov ) ;
+
+    //read parameters
+    int nPara  ;
+    SIO_DATA( stream ,  &nPara  , 1 ) ;
+    float aParameter ;
+    for(int i=0; i<nPara; i++){
+      SIO_DATA( stream ,  &aParameter  , 1 ) ;
+      vtx->addParameter( aParameter ) ;
+    }
+
+    //read pointer to associated reconstructed particle
+    SIO_PNTR( stream ,   &(vtx->_aParticle) ) ;
+
+    // read the pointer tag 
+    SIO_PTAG( stream , dynamic_cast<const Vertex*>(vtx) ) ;
+    return ( SIO_BLOCK_SUCCESS ) ;
+  }
+    
+    
+  unsigned int SIOVertexHandler::write(SIO_stream* stream, 
+				       const LCObject* obj){
+    
+    unsigned int status ; 
+    
+    // this is where we gave up type safety in order to
+    // simplify the API and the implementation
+    // by having a common collection of objects
+    const Vertex* vtx = dynamic_cast<const Vertex*>(obj)  ;
+
+    //write data
+    LCSIO_WRITE( stream, vtx->isPrimary()  ) ;
+    LCSIO_WRITE( stream, vtx->getChi2()  ) ;
+    LCSIO_WRITE( stream, vtx->getProbability()  ) ;
+
+    //write position of the vertex
+    float* pos = const_cast<float*> ( vtx->getPosition() ) ; 
+    SIO_DATA( stream,  pos , 3 ) ;
+    
+    //write covariance matrix
+    const FloatVec& cov = vtx->getCovMatrix() ;
+    for(unsigned int i=0; i<cov.size(); i++){
+      LCSIO_WRITE( stream, cov[i]  ) ;
+    }
+
+    //write parameters
+    int nPara = vtx->getParameters().size() ;
+    SIO_DATA( stream ,  &nPara  , 1 ) ;
+    for(int i=0; i<nPara; i++){
+      LCSIO_WRITE( stream, vtx->getParameters()[i]  ) ;
+    }
+
+    //write pointer to associated reconstructed particle
+    EVENT::ReconstructedParticle* recP = vtx->getAssociatedParticle() ;
+    SIO_PNTR( stream , &recP  ) ;
+	
+    
+    // write a ptag in order to be able to point to vertexes
+    SIO_PTAG( stream , vtx ) ;
+
+    return ( SIO_BLOCK_SUCCESS ) ;
+    
+  }
+  
+} // namespace

lcio/src/cpp/src/SIO
SIOHandlerMgr.cc 1.23 -> 1.23.6.1
diff -u -r1.23 -r1.23.6.1
--- SIOHandlerMgr.cc	31 May 2005 07:43:28 -0000	1.23
+++ SIOHandlerMgr.cc	15 Aug 2006 13:01:17 -0000	1.23.6.1
@@ -19,6 +19,7 @@
 #include "SIO/SIOTrackerRawDataHandler.h" 
 #include "SIO/SIOTrackerDataHandler.h" 
 #include "SIO/SIOTrackerPulseHandler.h" 
+#include "SIO/SIOVertexHandler.h"
 
 #include "EVENT/LCIO.h"
 
@@ -47,6 +48,7 @@
     _map[ LCIO::CLUSTER ] = new SIOClusterHandler ;
     _map[ LCIO::RECONSTRUCTEDPARTICLE ] = new SIOReconstructedParticleHandler ;
     _map[ LCIO::LCRELATION] = new SIOLCRelationHandler ;
+    _map[ LCIO::VERTEX] = new SIOVertexHandler ;
     // generic arrays/vectors
     _map[ LCIO::LCSTRVEC ] = new SIOStrVecHandler ;
     _map[ LCIO::LCFLOATVEC ] = new SIOFloatVecHandler ;
CVSspam 0.2.8