Commit 469d569a authored by Lynn Garren's avatar Lynn Garren
Browse files

merging changes from 2.0 branch into head

parent b964817a
2005-04-07 Lynn Garren <garren@fnal.gov>
* configure.in: set AR and ARFLAGS
2005-03-15 Lynn Garren <garren@fnal.gov>
* examples are now installed
2005-03-11 Lynn Garren <garren@fnal.gov>
* add RandomState class which "saves" the random state as a string
2005-02-18 Lynn Garren <garren@fnal.gov>
* configure.in, Makefile.am: Stop using libtool.
The newer releases of libtool seem to have dropped support for
Windows Visual C++.
2005-02-14 Lynn Garren <garren@fnal.gov>
* configure.in: Visual C++ flags are now "-EHsc -nologo -GR -GX -MD"
2005-02-03 Lynn Garren <garren@fnal.gov>
* configure.in: install step creates libCLHEP.a, libCLHEP.so,
and/or libCLHEP.dylib by adding a symbolic link.
2005-02-02 Andreas PFEIFFER <andreas.pfeiffer@cern.ch>
* configure.in: modified compiler flags for windows:
added "-O -GR -GX -MD" as this is needed for the multi-thread
environments used.
==============================
30.11.04 Release CLHEP-2.0.1.2
==============================
==============================
27.10.04 Release CLHEP-2.0.1.1
==============================
Fri Sep 24 2004 Lynn Garren <garren@fnal.gov>
* use AM_CXXFLAGS
* require autoconf 2.59, automake 1.9.1, and libtool 1.9b
Tue Aug 31 2004 Lynn Garren <garren@fnal.gov>
* change Solaris CC compile flags from "-O -mt" to "-O"
* libtools 1.9b or later is required for Solaris CC
==============================
23.07.04 Release CLHEP-2.0.1.0
==============================
==============================
11.05.04 Release CLHEP-2.0.0.2
==============================
......@@ -5,7 +59,7 @@
==============================
11.05.04 Release CLHEP-1.9.0.2
==============================
==============================
21.04.04 Release CLHEP-2.0.0.1
==============================
......
#-------------------------------------------------------------
# platform specific issues
#-------------------------------------------------------------
This package requires autoconf 2.59 or later and automake 1.9.1 or later.
If you bootstrap, you will probably have to build these yourself.
See "building autotools" below.
The new libtool no longer properly supports shared libraries for gcc 2.95.2.
If you build CLHEP with gcc 2.95.2, you must configure --disable-shared.
To build for Solaris CC, configure with CXX=CC CC=cc and use gmake.
#-------------------------------------------------------------
# installing from a source code tar ball
#-------------------------------------------------------------
......@@ -65,11 +78,13 @@ Now continue with directions as if you unpacked a source code tarball.
# building autotools
#-------------------------------------------------------------
If you do not have at least autoconf 2.57 and automake 1.6, you will
If you do not have at least autoconf 2.59 and automake 1.9.1, you will
need to build autoconf, automake, and libtool. On some platforms,
you may also need to build m4 and texinfo.
Download the relevant tarballs from gnu.org.
Download the relevant tarballs from gnu.org
(http://www.gnu.org/software/autoconf/, http://www.gnu.org/software/automake/,
and http://www.gnu.org/software/libtool/)
Untar them in a common source code tree.
Decide whether you want to install them in /usr/local or your own
install directory. If you use your own install directory, use
......
## Process this file with automake to produce Makefile.in
if USE_GMAKE
MAKE = gmake
endif
includedir = $(prefix)/include/CLHEP
# put . first so that CLHEP directory is built before anything else
SUBDIRS = StdHep . src
SUBDIRS = StdHep . src test examples
# list all subdirectories - for distribution and cleaning
DIST_SUBDIRS = StdHep . src examples
DIST_SUBDIRS = StdHep . src test examples
bin_SCRIPTS = StdHep-config
all-local: $(top_builddir)/CLHEP
......
#! /bin/sh
# @configure_input@
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
usage()
{
cat <<EOF
Usage: StdHep-config [OPTION]
Known values for OPTION are:
--prefix show installation prefix
--cxx print compilation command
--cppflags print pre-processor flags
--cxxflags print C++ compiler flags
--ldflags print linker flags
--libs print libraries to link against
--help display this help and exit
--version output version information
EOF
exit $1
}
if test $# -eq 0; then
usage 1
fi
while test $# -gt 0; do
case "$1" in
-*=*)
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
;;
*)
optarg=
;;
esac
case "$1" in
--prefix=*)
prefix="$optarg"
;;
--prefix)
echo "$prefix"
;;
--version)
echo @PACKAGE@ @VERSION@
exit 0
;;
--help)
usage 0
;;
--cxx)
echo "CXX: " @CXX@
echo "CC: " @CC@
echo "CPP: " @CPP@
echo "CXXCPP: " @CXXCPP@
;;
--cppflags)
echo @CPPFLAGS@ @StdHep_CPPFLAGS@
;;
--cxxflags)
echo @AM_CXXFLAGS@ @CXXFLAGS@
;;
--ldflags)
echo @LDFLAGS@ @StdHep_LDFLAGS@
;;
--libs)
echo @LIBS@ @StdHep_LIBS@ -lm
;;
*)
usage
exit 1
;;
esac
shift
done
exit 0
// $Id: CBcm.hh,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
// CBcm.hh
// ----------------------------------------------------------------------
......
// $Id: CBstdhep.hh,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
// CBstdhep.hh
// ----------------------------------------------------------------------
......
// $Id: CBstdhep.icc,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
// CBstdhep.icc
// ----------------------------------------------------------------------
......
// $Id: ConversionMethods.hh,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
//
// ConversionMethods.hh
......
## Process this file with automake to produce Makefile.in
if USE_GMAKE
MAKE = gmake
endif
includedir = $(prefix)/include/CLHEP
tempincludedir = $(TEMPDIR)/CLHEP/@PACKAGE@
COPY_P = @COPY_P@
......@@ -19,6 +23,7 @@ pkginclude_HEADERS = \
StdHep.hh \
StdHeptoGenEvent.icc \
StdHepVersion.h \
RandomState.hh \
StdRunInfoConvert.hh \
StdRunInfoConvert.icc \
StdRunInfo.hh \
......
#ifndef STDHEP_RANDOMSTATE_HH
#define STDHEP_RANDOMSTATE_HH
// ----------------------------------------------------------------------
// RandomState.hh
// Author: Lynn Garren
//
// Container for the random state
// ----------------------------------------------------------------------
#include <vector>
#include <string>
#include <iostream>
namespace StdHep {
/**
* @author
* @ingroup stdhep
*/
class RandomState {
public:
// --- birth/death:
//
RandomState( );
RandomState( const RandomState & orig );
RandomState& operator=( const RandomState & );
~RandomState();
// --- accessors:
//
std::ostream& getStateAsStream( std::ostream& ) const;
std::vector<unsigned long> getStateAsLongs( ) const;
std::string getStateAsString() const { return myRandomState; }
void print( std::ostream & os = std::cout ) const;
// --- mutators:
//
void putState( std::istream& );
void putState( std::string const & );
void putState( std::vector<unsigned long> const & );
void appendSeed( unsigned long sd );
void appendSeed( double sd );
void clear( );
private:
std::string myRandomState;
}; // RandomState
}
#endif // STDHEP_RANDOMSTATE_HH
// $Id: ReadStdHep.hh,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
//
// ReadStdHep.hh
......
// $Id: StdEvent.hh,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// -*- C++ -*-
//
// ----------------------------------------------------------------------
// StdEvent.hh
// Author: Lynn Garren
//
// StdCollision has been replaced by GenEvent
// ----------------------------------------------------------------------
......
// $Id: StdEventConvert.hh,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
//
// StdEventConvert.hh
......
// $Id: StdEventConvert.icc,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
//
// StdEventConvert.icc
......
// $Id: StdHep.hh,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
//
// StdHep.hh
......
// $Id: StdHepfromStdEvent.icc,v 1.2 2003/08/29 02:06:13 garren Exp $
// ----------------------------------------------------------------------
// HEPEVTfromStdEvent.icc
// ----------------------------------------------------------------------
// Author: Lynn Garren, Marc Paterno,
// Author: Lynn Garren, Marc Paterno
//
#include "CLHEP/HepMC/GenParticle.h"
......
// $Id: StdHeptoGenEvent.icc,v 1.2 2003/08/29 02:06:13 garren Exp $
// ----------------------------------------------------------------------
//
// StdHeptoHepMC::GenEvent.icc
// Author: Lynn Garren
//
// builds HepMC::GenEvent from the information in HEPEVT
//
......
// ----------------------------------------------------------------------
// StdRunInfo.hh
// Author: Lynn Garren
// ----------------------------------------------------------------------
#ifndef STDRUNINFO_HH
......@@ -8,6 +9,8 @@
#include <vector>
#include <string>
#include "CLHEP/StdHep/RandomState.hh"
namespace StdHep {
class StdRunInfo {
......@@ -30,8 +33,9 @@ public:
int eventsWritten() const { return itsEventsWritten; }
double CoMEnergy() const { return itsCoMEnergy; }
double crossSection() const { return itsCrossSection; }
double seed( int i ) const { return itsSeedList[i]; }
unsigned int size() const { return itsSeedList.size(); }
std::vector<unsigned long> seedArray() const { return itsSeedList.getStateAsLongs(); }
std::string seedStream() const { return itsSeedList.getStateAsString(); }
std::ostream& seedString(std::ostream& os) const { return itsSeedList.getStateAsStream(os); }
std::string runIdentifier() const { return itsRunIdentifier; }
std::string generatorName() const { return itsGeneratorName; }
std::string pdfName() const { return itsPDFName; }
......@@ -44,8 +48,12 @@ public:
void setEventsWritten ( int nwrt ) { itsEventsWritten = nwrt; }
void setCoMEnergy ( double com ) { itsCoMEnergy = com; }
void setCrossSection ( double xsec ) { itsCrossSection = xsec; }
void appendSeed ( double sd ) { itsSeedList.push_back( sd ); }
void appendSeed ( unsigned long sd ) { itsSeedList.appendSeed( sd ); }
void appendSeed ( double sd ) { itsSeedList.appendSeed( sd ); }
void clearSeeds ( ) { itsSeedList.clear(); }
void saveSeeds ( std::istream seed ) { itsSeedList.putState(seed); }
void saveSeeds ( std::string& seed ) { itsSeedList.putState(seed); }
void saveSeeds ( std::vector<unsigned long> seed ) { itsSeedList.putState(seed); }
void setRunIdentifier ( std::string & name );
void setGeneratorName ( std::string & name );
void setPdfName ( std::string & name );
......@@ -61,7 +69,7 @@ private:
std::string itsRunIdentifier;
std::string itsGeneratorName;
std::string itsPDFName;
std::vector<double> itsSeedList;
RandomState itsSeedList;
}; // StdRunInfo
......
// $Id: StdRunInfoConvert.hh,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
//
// StdRunInfoConvert.hh
......
// $Id: StdRunInfoConvert.icc,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// ----------------------------------------------------------------------
//
// StdRunInfoConvert.icc
// L. Garren
//
// defines free functions to build StdRunInfo from HEPEVT, and vice-versa
// random seeds are saved as a pair of doubles in the stdcm1 common block
//
// ----------------------------------------------------------------------
#include "CLHEP/StdHep/CBcm.hh"
#include "CLHEP/HepMC/CBInterface.h"
#include "CLHEP/HepMC/DoubleConversion.hh"
namespace StdHep {
......@@ -23,8 +24,12 @@ StdRunInfo * getRunInfoFromSTDCM( int irun )
(*cm)->stdcm1()->nevtwrt,
(double)(*cm)->stdcm1()->stdecom,
(double)(*cm)->stdcm1()->stdxsec );
run->appendSeed( (*cm)->stdcm1()->stdseed1 );
run->appendSeed( (*cm)->stdcm1()->stdseed2 );
// convert doubles to longs and save
std::vector<unsigned long> state(4);
HepMC::DoubleConversion::dto2longs((*cm)->stdcm1()->stdseed1,state[0],state[1]);
HepMC::DoubleConversion::dto2longs((*cm)->stdcm1()->stdseed2,state[2],state[3]);
run->saveSeeds( state );
// save names
std::string gname = (*cm)->stdcm2()->generatorname;
std::string pname = (*cm)->stdcm2()->pdfname;
run->setGeneratorName( gname );
......@@ -40,8 +45,17 @@ bool RunInfoToSTDCM( StdRunInfo * run )
(*cm)->stdcm1()->nevtwrt = run->eventsWritten();
(*cm)->stdcm1()->stdecom = (float)run->CoMEnergy();
(*cm)->stdcm1()->stdxsec = (float)run->crossSection();
if( run->size() > 0 ) (*cm)->stdcm1()->stdseed1 = run->seed(0);
if( run->size() > 1 ) (*cm)->stdcm1()->stdseed2 = run->seed(1);
// convert longs to double
std::vector<unsigned long> state = run->seedArray();
std::vector<double> result;
for( unsigned int i=0; i<(state.size()-1); ++i ) {
double dd = HepMC::DoubleConversion::longs2double(state[i],state[i+1]);
++i;
result.push_back(dd);
}
if( result.size() > 1 ) (*cm)->stdcm1()->stdseed1 = result[0];
if( result.size() > 3 ) (*cm)->stdcm1()->stdseed2 = result[1];
// check run number
if( run->runNumber() == 0 ) return false;
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment