16 modified files
lcio/doc
diff -u -r1.55 -r1.56
--- lcio.xml 7 Jun 2005 12:34:29 -0000 1.55
+++ lcio.xml 19 Sep 2005 15:40:25 -0000 1.56
@@ -96,6 +96,9 @@
<data type="float" name="dedx"></data>
<data type="float" name="time"></data>
<data type="pntr" name="MCParticle"></data>
+ <if condition="(flags&(1<<30)) != 0">
+ <data type="float[3]" name="momentum"></data>
+ </if>
<if condition="1000*major+minor>1000">
<data type="ptag" name="this"></data>
</if>
lcio/doc
diff -u -r1.42 -r1.43
--- versions.readme 7 Jun 2005 11:02:03 -0000 1.42
+++ versions.readme 19 Sep 2005 15:40:25 -0000 1.43
@@ -2,6 +2,9 @@
Describes the changes for the different versions/tags of LCIO
---------------------------------------------------------------
+
+ - added optional momentum[3] to SimTrackerHit (momentum of particle at position of hit)
+
======================
v01-05
=======================
lcio/src/aid/EVENT
diff -u -r1.10 -r1.11
--- Cluster.aid 22 Sep 2004 16:18:31 -0000 1.10
+++ Cluster.aid 19 Sep 2005 15:40:25 -0000 1.11
@@ -10,7 +10,7 @@
/** The LCIO cluster.
*
* @author gaede
- * @version $Id: Cluster.aid,v 1.10 2004/09/22 16:18:31 gaede Exp $
+ * @version $Id: Cluster.aid,v 1.11 2005/09/19 15:40:25 gaede Exp $
*/
@@ -74,8 +74,8 @@
public const ClusterVec& getClusters() const ;
/** The hits that have been combined to this cluster.
- * Only available if CalorimeterHit objects have been saved with
- * LCIO::RCHBIT_PTR==1.
+ * Only available if CalorimeterHit objects have not been saved with
+ * LCIO::RCHBIT_NO_PTR==1.
* @see CalorimeterHit
*/
public const CalorimeterHitVec& getCalorimeterHits() const ;
lcio/src/aid/EVENT
diff -u -r1.47 -r1.48
--- LCIO.aid 31 May 2005 08:15:06 -0000 1.47
+++ LCIO.aid 19 Sep 2005 15:40:26 -0000 1.48
@@ -16,7 +16,7 @@
/** Global constants used in LCIO.
*
* @author gaede
- * @version $Id: LCIO.aid,v 1.47 2005/05/31 08:15:06 gaede Exp $
+ * @version $Id: LCIO.aid,v 1.48 2005/09/19 15:40:26 gaede Exp $
* @see LCObject
* @see LCIO
*/
@@ -52,6 +52,7 @@
// SimTrackerHit
static const int THBIT_BARREL = 31 ; // barrel(1) - endcap(0)
+ static const int THBIT_MOMENTUM = 30 ; // momentum of particle stored(1) - not stored(0)
// Tracks
static const int TRBIT_HITS = 31 ; // hits stored(1) - not stored(0)
@@ -130,6 +131,7 @@
// SimTrackerHit
public static const int THBIT_BARREL = 31 ; // barrel(1) - endcap(0)
+ public static const int THBIT_MOMENTUM = 30 ; // momentum of particle stored(1) - not stored(0)
// Tracks
public static const int TRBIT_HITS = 31 ; // hits stored(1) - not stored(0)
lcio/src/aid/EVENT
diff -u -r1.6 -r1.7
--- SimTrackerHit.aid 8 Feb 2005 16:52:46 -0000 1.6
+++ SimTrackerHit.aid 19 Sep 2005 15:40:26 -0000 1.7
@@ -3,7 +3,7 @@
/** A generic simulated tracker hit.
*
* @author gaede
- * @version $Id: SimTrackerHit.aid,v 1.6 2005/02/08 16:52:46 gaede Exp $
+ * @version $Id: SimTrackerHit.aid,v 1.7 2005/09/19 15:40:26 gaede Exp $
*/
public interface SimTrackerHit extends LCObject {
@@ -30,4 +30,10 @@
*/
public MCParticle* getMCParticle() const ;
+
+ /** Returns the 3-momentum of the particle at the hits position in [GeV] -
+ * optional, only if bit LCIO::THBIT_MOMENTUM is set.
+ */
+ public const float3V getMomentum() const ;
+
}
lcio/src/cpp/include/CPPFORT
diff -u -r1.2 -r1.3
--- lcsth.h 15 Apr 2005 08:37:35 -0000 1.2
+++ lcsth.h 19 Sep 2005 15:40:26 -0000 1.3
@@ -14,6 +14,7 @@
int lcsthgetcellid( PTRTYPE hit ) ;
double lcsthgetposition( PTRTYPE hit, int index ) ;
+float lcsthgetmomentum( PTRTYPE hit, int index ) ;
float lcsthgetdedx( PTRTYPE hit ) ;
float lcsthgettime( PTRTYPE hit ) ;
@@ -21,6 +22,7 @@
int lcsthsetcellid( PTRTYPE hit, int id ) ;
int lcsthsetposition( PTRTYPE hit, double pos[3] ) ;
+int lcsthsetmomentum( PTRTYPE hit, float pos[3] ) ;
int lcsthsetdedx( PTRTYPE hit, float dEdX ) ;
int lcsthsettime( PTRTYPE hit, float t ) ;
int lcsthsetmcparticle( PTRTYPE hit, PTRTYPE particle ) ;
@@ -33,6 +35,7 @@
FCALLSCFUN1(INT, lcsthgetcellid,LCSTHGETCELLID,lcsthgetcellid,CFORTRANPNTR)
FCALLSCFUN2(DOUBLE, lcsthgetposition, LCSTHGETPOSITION, lcsthgetposition, CFORTRANPNTR, INT )
+FCALLSCFUN2(FLOAT, lcsthgetmomentum, LCSTHGETMOMENTUM, lcsthgetmomentum, CFORTRANPNTR, INT )
FCALLSCFUN1(FLOAT, lcsthgetdedx,LCSTHGETDEDX,lcsthgetdedx,CFORTRANPNTR)
FCALLSCFUN1(FLOAT, lcsthgettime,LCSTHGETTIME,lcsthgettime,CFORTRANPNTR)
@@ -40,6 +43,7 @@
FCALLSCFUN2(INT, lcsthsetcellid, LCSTHSETCELLID, lcsthsetcellid, CFORTRANPNTR, INT )
FCALLSCFUN2(INT, lcsthsetposition, LCSTHSETPOSITION, lcsthsetposition, CFORTRANPNTR, DOUBLEV )
+FCALLSCFUN2(INT, lcsthsetmomentum, LCSTHSETMOMENTUM, lcsthsetmomentum, CFORTRANPNTR, FLOATV )
FCALLSCFUN2(INT, lcsthsetdedx, LCSTHSETDEDX, lcsthsetdedx, CFORTRANPNTR, FLOAT )
FCALLSCFUN2(INT, lcsthsettime, LCSTHSETTIME, lcsthsettime, CFORTRANPNTR, FLOAT )
FCALLSCFUN2(INT, lcsthsetmcparticle, LCSTHSETMCPARTICLE, lcsthsetmcparticle, CFORTRANPNTR, CFORTRANPNTR )
lcio/src/cpp/include/IMPL
diff -u -r1.9 -r1.10
--- SimTrackerHitImpl.h 15 Apr 2005 08:37:38 -0000 1.9
+++ SimTrackerHitImpl.h 19 Sep 2005 15:40:26 -0000 1.10
@@ -54,6 +54,12 @@
virtual EVENT::MCParticle * getMCParticle() const ;
+ /** Returns the 3-momentum of the particle at the hits position in [GeV] -
+ * optional, only if bit LCIO::THBIT_MOMENTUM is set.
+ */
+ virtual const float* getMomentum() const ;
+
+
// ---------- setters ------------------------
/** Sets the cell id.
*/
@@ -75,6 +81,13 @@
*/
void setMCParticle( EVENT::MCParticle* particle) ;
+ /** Sets the momentum of the particle at the hit's position.
+ */
+ void setMomentum( float p[3] ) ;
+
+ /** Sets the momentum of the particle at the hit's position.
+ */
+ void setMomentum( float px, float py, float pz ) ;
protected:
int _cellID ;
@@ -82,6 +95,7 @@
float _dEdx ;
float _time ;
EVENT::MCParticle* _particle ;
+ float _p[3] ;
}; // class
} // namespace IMPL
lcio/src/cpp/src/CPPFORT
diff -u -r1.1 -r1.2
--- lcsth.cc 10 Oct 2003 17:13:09 -0000 1.1
+++ lcsth.cc 19 Sep 2005 15:40:27 -0000 1.2
@@ -32,6 +32,11 @@
return sth->getPosition()[index] ;
}
+float lcsthgetmomentum( PTRTYPE hit, int index ){
+ SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
+ return sth->getMomentum()[index] ;
+}
+
float lcsthgetdedx( PTRTYPE hit ){
SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
return sth->getdEdx() ;
@@ -58,6 +63,12 @@
return LCIO::SUCCESS ;
}
+int lcsthsetmomentum( PTRTYPE hit, float pos[3] ){
+ SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
+ sth->setMomentum( pos ) ;
+ return LCIO::SUCCESS ;
+}
+
int lcsthsetdedx( PTRTYPE hit, float dEdX ){
SimTrackerHitImpl* sth = f2c_pointer<SimTrackerHitImpl,LCObject>( hit ) ;
sth->setdEdx( dEdX ) ;
lcio/src/cpp/src/EXAMPLE
diff -u -r1.46 -r1.47
--- simjob.cc 7 Jun 2005 07:05:49 -0000 1.46
+++ simjob.cc 19 Sep 2005 15:40:27 -0000 1.47
@@ -235,7 +235,12 @@
LCCollectionVec* trkVec = new LCCollectionVec( LCIO::SIMTRACKERHIT ) ;
LCCollectionVec* extFVec = new LCCollectionVec( LCIO::LCFLOATVEC ) ;
LCCollectionVec* extIVec = new LCCollectionVec( LCIO::LCINTVEC ) ;
+
+ LCFlagImpl thFlag(0) ;
+ thFlag.setBit( LCIO::THBIT_MOMENTUM ) ;
+ trkVec->setFlag( thFlag.getFlag() ) ;
+
for(int j=0;j<NHITS;j++){
SimTrackerHitImpl* hit = new SimTrackerHitImpl ;
@@ -254,6 +259,7 @@
hit->setMCParticle( dynamic_cast<MCParticle*>(mcVec->getElementAt( mcIndx ) ) ) ;
+ hit->setMomentum( 1. , 2. , 3. ) ;
// fill the extension vectors (4 floats, 2 ints)
extF->push_back( 3.14159 ) ;
lcio/src/cpp/src/IMPL
diff -u -r1.9 -r1.10
--- SimTrackerHitImpl.cc 15 Apr 2005 08:37:47 -0000 1.9
+++ SimTrackerHitImpl.cc 19 Sep 2005 15:40:27 -0000 1.10
@@ -12,7 +12,10 @@
_pos[0] = 0. ;
_pos[1] = 0. ;
_pos[2] = 0. ;
- }
+ _p[0] = 0. ;
+ _p[1] = 0. ;
+ _p[2] = 0. ;
+ }
SimTrackerHitImpl::~SimTrackerHitImpl(){
}
@@ -27,6 +30,9 @@
EVENT::MCParticle * SimTrackerHitImpl::getMCParticle() const { return _particle ; }
+
+ const float* SimTrackerHitImpl::getMomentum() const { return _p ; }
+
void SimTrackerHitImpl::setCellID( int id) {
checkAccess("SimTrackerHitImpl::setCellID") ;
_cellID = id ;
@@ -54,4 +60,20 @@
_particle = particle;
}
+ void SimTrackerHitImpl::setMomentum( float p[3] ) {
+
+ setMomentum( p[0], p[1], p[2] ) ;
+ }
+
+ void SimTrackerHitImpl::setMomentum( float px, float py, float pz ) {
+
+ checkAccess("SimTrackerHitImpl::setMomentum") ;
+ _p[0] = px ;
+ _p[1] = py ;
+ _p[2] = pz ;
+
+ }
+
+
+
} // namespace IMPL
lcio/src/cpp/src/SIO
diff -u -r1.8 -r1.9
--- SIOSimTrackHitHandler.cc 15 Apr 2005 08:37:50 -0000 1.8
+++ SIOSimTrackHitHandler.cc 19 Sep 2005 15:40:27 -0000 1.9
@@ -9,6 +9,8 @@
#include "SIO_functions.h"
#include "SIO_block.h"
+#include "EVENT/LCIO.h"
+#include "IMPL/LCFlagImpl.h"
using namespace EVENT ;
using namespace IMPL ;
@@ -33,6 +35,10 @@
SIO_PNTR( stream , &(hit->_particle) ) ;
+ if( LCFlagImpl(_flag).bitSet( LCIO::THBIT_MOMENTUM ) ){
+ SIO_DATA( stream , hit->_p , 3 ) ;
+ }
+
// read the pointer tag in case we want to point to hits
if( _vers > SIO_VERSION_ENCODE( 1, 0) ) {
SIO_PTAG( stream , dynamic_cast<const SimTrackerHit*>(hit) ) ;
@@ -65,6 +71,11 @@
const MCParticle* part = hit->getMCParticle() ;
SIO_PNTR( stream , &part ) ;
+ if( LCFlagImpl(_flag).bitSet( LCIO::THBIT_MOMENTUM ) ){
+ float* p = const_cast<float*> ( hit->getMomentum() ) ;
+ SIO_DATA( stream , p , 3 ) ;
+ }
+
// write a ptag in order to be able to point to tracker hits - from v1.1
SIO_PTAG( stream , hit ) ;
lcio/src/f77
diff -u -r1.31 -r1.32
--- lciof77api.inc 24 Nov 2004 14:12:19 -0000 1.31
+++ lciof77api.inc 19 Sep 2005 15:40:28 -0000 1.32
@@ -12,7 +12,7 @@
* H. Vogt
* 05/06/2004 (reconstruction part added)
*
-* $Id: lciof77api.inc,v 1.31 2004/11/24 14:12:19 gaede Exp $
+* $Id: lciof77api.inc,v 1.32 2005/09/19 15:40:28 gaede Exp $
***************************************************
#include "lciof77pointer.inc"
@@ -127,8 +127,9 @@
integer lcsthdelete, lcsthgetcellid
real lcsthgetdedx, lcsthgettime
double precision lcsthgetposition
+ real lcsthgetmomentum
integer lcsthsetcellid, lcsthsetposition, lcsthsetdedx
- integer lcsthsettime, lcsthsetmcparticle
+ integer lcsthsettime, lcsthsetmcparticle, lcsthsetmomentum
c-----the TPCHitImpl interface
PTRTYPE lctphcreate
lcio/src/java/hep/lcio/implementation/event
diff -u -r1.7 -r1.8
--- ISimTrackerHit.java 8 Apr 2004 09:58:00 -0000 1.7
+++ ISimTrackerHit.java 19 Sep 2005 15:40:28 -0000 1.8
@@ -7,7 +7,7 @@
/**
* A default implementation of SimTrackerHit
* @author Tony Johnson
- * @version $Id: ISimTrackerHit.java,v 1.7 2004/04/08 09:58:00 gaede Exp $
+ * @version $Id: ISimTrackerHit.java,v 1.8 2005/09/19 15:40:28 gaede Exp $
*/
public class ISimTrackerHit extends ILCObject implements SimTrackerHit
{
@@ -16,6 +16,7 @@
protected float dEdx;
protected float time;
protected int cellID;
+ protected float[] momentum = new float[3] ;
public void setCellID(int cellID)
{
@@ -73,4 +74,16 @@
checkAccess();
this.dEdx = dEdx;
}
+
+public float[] getMomentum() {
+ return momentum;
+}
+
+public void setMomentum(float[] fs) {
+ checkAccess() ;
+ if (fs.length != 3)
+ throw new IllegalArgumentException();
+ momentum = fs;
+}
+
}
lcio/src/java/hep/lcio/implementation/sio
diff -u -r1.37 -r1.38
--- SIOEvent.java 31 May 2005 07:43:30 -0000 1.37
+++ SIOEvent.java 19 Sep 2005 15:40:28 -0000 1.38
@@ -15,7 +15,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOEvent.java,v 1.37 2005/05/31 07:43:30 gaede Exp $
+ * @version $Id: SIOEvent.java,v 1.38 2005/09/19 15:40:28 gaede Exp $
*/
class SIOEvent extends ILCEvent
{
@@ -154,7 +154,7 @@
SIOLCCollection ilc = new SIOLCCollection(type, flags, n);
ilc.setParameters( colParameters ) ;
for (int i = 0; i < n; i++)
- ilc.add(new SIOSimTrackerHit(in, this,major,minor));
+ ilc.add(new SIOSimTrackerHit(in, flags, this,major,minor));
ilc.setOwner(this);
addCollection(ilc, name);
}
@@ -467,7 +467,7 @@
else if (type.equals(LCIO.SIMTRACKERHIT))
{
for (int i = 0; i < n; i++)
- SIOSimTrackerHit.write((SimTrackerHit) col.getElementAt(i), out);
+ SIOSimTrackerHit.write((SimTrackerHit) col.getElementAt(i), out, flags);
}
else if (type.equals(LCIO.TRACKERHIT))
{
lcio/src/java/hep/lcio/implementation/sio
diff -u -r1.12 -r1.13
--- SIOSimTrackerHit.java 15 Apr 2004 14:52:55 -0000 1.12
+++ SIOSimTrackerHit.java 19 Sep 2005 15:40:28 -0000 1.13
@@ -5,6 +5,7 @@
import hep.lcd.io.sio.SIORef;
+import hep.lcio.event.LCIO;
import hep.lcio.event.MCParticle;
import hep.lcio.event.SimTrackerHit;
@@ -16,11 +17,11 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOSimTrackerHit.java,v 1.12 2004/04/15 14:52:55 gaede Exp $
+ * @version $Id: SIOSimTrackerHit.java,v 1.13 2005/09/19 15:40:28 gaede Exp $
*/
class SIOSimTrackerHit extends ISimTrackerHit
{
- SIOSimTrackerHit(SIOInputStream in, SIOEvent owner, int major, int minor) throws IOException
+ SIOSimTrackerHit(SIOInputStream in,int flags, SIOEvent owner, int major, int minor) throws IOException
{
setParent(owner);
cellID = in.readInt();
@@ -30,6 +31,14 @@
dEdx = in.readFloat();
time = in.readFloat();
particle = in.readPntr();
+
+ if ((flags & (1 << LCIO.THBIT_MOMENTUM)) != 0)
+ {
+ momentum[0] = in.readFloat();
+ momentum[1] = in.readFloat();
+ momentum[2] = in.readFloat();
+ }
+
double version = (double) major + ( (double) minor ) / 10. ;
if( version > 1.0 )
in.readPTag(this);
@@ -42,10 +51,10 @@
return (MCParticle) particle;
}
- static void write(SimTrackerHit hit, SIOOutputStream out) throws IOException
+ static void write(SimTrackerHit hit, SIOOutputStream out, int flags) throws IOException
{
if (hit instanceof SIOSimTrackerHit)
- ((SIOSimTrackerHit) hit).write(out);
+ ((SIOSimTrackerHit) hit).write(out,flags);
else
{
out.writeInt(hit.getCellID());
@@ -57,11 +66,19 @@
out.writeFloat(hit.getdEdx());
out.writeFloat(hit.getTime());
out.writePntr(hit.getMCParticle());
+ if ((flags & (1 << LCIO.THBIT_MOMENTUM)) != 0)
+ {
+ float[] p = hit.getMomentum() ;
+ out.writeFloat(p[0] ) ;
+ out.writeFloat(p[1] ) ;
+ out.writeFloat(p[2] ) ;
+ }
+
out.writePTag(hit);
}
}
- private void write(SIOOutputStream out) throws IOException
+ private void write(SIOOutputStream out,int flags) throws IOException
{
out.writeInt(cellID);
out.writeDouble(position[0]);
@@ -70,6 +87,12 @@
out.writeFloat(dEdx);
out.writeFloat(time);
out.writePntr(getMCParticle());
- out.writePTag(this);
+ if ((flags & (1 << LCIO.THBIT_MOMENTUM)) != 0)
+ {
+ out.writeFloat(momentum[0] ) ;
+ out.writeFloat(momentum[1] ) ;
+ out.writeFloat(momentum[2] ) ;
+ }
+ out.writePTag(this);
}
}
lcio/src/latex/manual
diff -u -r1.16 -r1.17
--- f77summary.tex 24 Sep 2004 16:14:46 -0000 1.16
+++ f77summary.tex 19 Sep 2005 15:40:29 -0000 1.17
@@ -168,9 +168,11 @@
setdEdx -> status = lcsthsetdedx( pthit , fdedx )
setTime -> status = lcsthsettime( pthit , ftime )
setMCParticle -> status = lcsthsetmcparticle( pthit , pmcp )
+setMomentum -> status = lcsthsetmomentum( pthit , fpv )
getCellID -> icellid = lcsthgetcellid( pthit )
getPosition -> dposv(i)= lcsthgetposition( pthit , i ) (i=1,2,3)
+getMomentum -> fpv(i) = lcsthgetmomentum( pthit , i ) (i=1,2,3)
getdEdx -> fdedx = lcsthgetdedx( pthit )
getTime -> ftime = lcsthgettime( pthit )
getMCParticle -> pmcp = lcsthgetmcparticle( pthit )
CVSspam 0.2.8