9 modified files
lcio/doc
diff -u -r1.62 -r1.63
--- versions.readme 8 Nov 2007 18:34:13 -0000 1.62
+++ versions.readme 8 Nov 2007 19:35:37 -0000 1.63
@@ -5,11 +5,15 @@
=====================
v01-09
=====================
- no changes in file format and API
+ no changes in file format
+
- made compatible with new stdhep files (Java/C++)
+
- LCStdHepRdr now fills MCParticle::charge properly (C++)
+
- Java uses new sio classes from hep.io.sio
+ - added event weight: LCEvent.getWeight() (Java/C++)
=====================
v01-08-05
lcio/src/aid/EVENT
diff -u -r1.13 -r1.14
--- LCEvent.aid 2 Feb 2007 09:34:26 -0000 1.13
+++ LCEvent.aid 8 Nov 2007 19:35:37 -0000 1.14
@@ -8,7 +8,7 @@
* the corresponding types.
*
* @author gaede
- * @version $Id: LCEvent.aid,v 1.13 2007/02/02 09:34:26 gaede Exp $
+ * @version $Id: LCEvent.aid,v 1.14 2007/11/08 19:35:37 gaede Exp $
* @see LCCollection
*/
@@ -32,6 +32,11 @@
*/
public long64 getTimeStamp() const ;
+ /** Returns the event weight.
+ */
+ public double getWeight() const ;
+
+
/** Returns the names of the collections in the event.
*/
public const String[]* getCollectionNames() const ;
lcio/src/cpp/include/IMPL
diff -u -r1.18 -r1.19
--- LCEventImpl.h 2 Feb 2007 09:34:26 -0000 1.18
+++ LCEventImpl.h 8 Nov 2007 19:35:37 -0000 1.19
@@ -57,6 +57,10 @@
*/
virtual EVENT::long64 getTimeStamp() const ;
+ /** Returns the event weight.
+ */
+ virtual double getWeight() const ;
+
/** Returns the names of the collections in the event.
*/
virtual const std::vector<std::string> * getCollectionNames() const;
@@ -147,6 +151,9 @@
*/
void setTimeStamp(EVENT::long64 ts) ;
+ /** Set the event weight.
+ */
+ void setWeight(double w) ;
protected:
void setAccessMode( int accessMode ) ;
lcio/src/cpp/src/EXAMPLE
diff -u -r1.54 -r1.55
--- simjob.cc 19 Feb 2007 17:38:47 -0000 1.54
+++ simjob.cc 8 Nov 2007 19:35:37 -0000 1.55
@@ -115,6 +115,7 @@
evt->setTimeStamp( now.timeStamp() ) ;
evt->setDetectorName( detName ) ;
+ evt->setWeight( 1.*rand()/RAND_MAX ) ;
evt->parameters().setValue("Description"," event can have it's own set of parameters" ) ;
evt->parameters().setValue("Thrust", (float) 0.671 ) ;
lcio/src/cpp/src/IMPL
diff -u -r1.22 -r1.23
--- LCEventImpl.cc 2 Feb 2007 09:34:26 -0000 1.22
+++ LCEventImpl.cc 8 Nov 2007 19:35:37 -0000 1.23
@@ -4,6 +4,7 @@
#include "IMPL/AccessChecked.h"
#include "IMPL/LCCollectionVec.h"
+#define EVT_WGT "_weight"
using namespace EVENT ;
//using namespace DATA ;
@@ -70,7 +71,14 @@
return _timeStamp ;
}
+double LCEventImpl::getWeight() const {
+ double w = _params.getFloatVal( EVT_WGT ) ;
+ return w == 0 ? 1. : w ;
+
+}
+
+
const std::vector<std::string>* LCEventImpl::getCollectionNames() const {
// return pointer to updated vector _colNames
@@ -178,7 +186,12 @@
_timeStamp = ts ;
}
-
+
+void LCEventImpl::setWeight(double w) {
+ checkAccess("LCEventImpl::setWeight") ;
+ _params.setValue( EVT_WGT , (float) w ) ;
+}
+
void LCEventImpl::setAccessMode( int accessMode ) {
lcio/src/cpp/src/UTIL
diff -u -r1.54 -r1.55
--- LCTOOLS.cc 8 Nov 2007 17:35:55 -0000 1.54
+++ LCTOOLS.cc 8 Nov 2007 19:35:37 -0000 1.55
@@ -83,12 +83,13 @@
// the event:
cout << endl
- << "==============================================================" << endl ;
+ << "============================================================================" << endl ;
cout << " Event : " << evt->getEventNumber()
<< " - run: " << evt->getRunNumber()
<< " - timestamp " << evt->getTimeStamp()
+ << " - weight " << evt->getWeight()
<< endl ;
- cout << "==============================================================" << endl ;
+ cout << "============================================================================" << endl ;
LCTime evtTime( evt->getTimeStamp() ) ;
cout << " date: " << evtTime.getDateString() << endl ;
lcio/src/java/hep/lcio/example
diff -u -r1.20 -r1.21
--- SimJob.java 20 Sep 2006 15:30:54 -0000 1.20
+++ SimJob.java 8 Nov 2007 19:35:37 -0000 1.21
@@ -15,7 +15,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SimJob.java,v 1.20 2006/09/20 15:30:54 gaede Exp $
+ * @version $Id: SimJob.java,v 1.21 2007/11/08 19:35:37 gaede Exp $
*/
public class SimJob
{
@@ -66,6 +66,7 @@
evt.setRunNumber(rn);
evt.setEventNumber(i);
evt.setDetectorName("D09TileHcal");
+ evt.setWeight( random.nextFloat() ) ;
// create and add some mc particles
ILCCollection mcVec = new ILCCollection(LCIO.MCPARTICLE);
lcio/src/java/hep/lcio/implementation/event
diff -u -r1.13 -r1.14
--- ILCEvent.java 2 Feb 2007 09:34:26 -0000 1.13
+++ ILCEvent.java 8 Nov 2007 19:35:37 -0000 1.14
@@ -14,7 +14,7 @@
* A default implementation of LCEvent
*
* @author Tony Johnson
- * @version $Id: ILCEvent.java,v 1.13 2007/02/02 09:34:26 gaede Exp $
+ * @version $Id: ILCEvent.java,v 1.14 2007/11/08 19:35:37 gaede Exp $
*/
public class ILCEvent extends ILCObject implements LCEvent
{
@@ -89,6 +89,16 @@
return timeStamp;
}
+ public double getWeight() {
+ double w = (double) parameters.getFloatVal("_weight") ;
+ return w == 0 ? 1. : w ;
+ }
+
+ public void setWeight( double w) {
+ checkAccess();
+ parameters.setValue("_weight", (float) w ) ;
+ }
+
public void addCollection(LCCollection col, String name)
{
if( !isValidCollectionName(name))
lcio/src/java/hep/lcio/util
diff -u -r1.8 -r1.9
--- Printer.java 26 Sep 2007 21:12:11 -0000 1.8
+++ Printer.java 8 Nov 2007 19:35:38 -0000 1.9
@@ -121,6 +121,7 @@
ps.println(" Event : " + event.getEventNumber());
ps.println(" Detector : " + event.getDetectorName());
ps.println(" Time Stamp : " + event.getTimeStamp());
+ ps.println(" Weight : " + event.getWeight());
ps.println(" ==============================================================");
ps.println();
@@ -1163,4 +1164,4 @@
return LCIO.TRACKERRAWDATA;
}
}
-}
\ No newline at end of file
+}
CVSspam 0.2.8