Commit c3495a44 authored by Lynn Garren's avatar Lynn Garren
Browse files

merging changes from 1.9 HepPDT

parent 91b31387
2005-07-27 Lynn Garren <garren@fnal.gov>
* HepPDT/convertTemporaryMap.icc: Fill DecayData properly.
Also get proper particle names when parsing PDG table.
==============================
22.06.05 Release CLHEP-2.0.2.1
==============================
......
2005-07-27 Lynn Garren <garren@fnal.gov>
* convertTemporaryMap.icc: Fill DecayData properly.
Also get proper particle names when parsing PDG table.
==============================
22.06.05 Release CLHEP-2.0.2.1
==============================
......
......@@ -27,7 +27,7 @@ class DecayChannelT {
public:
// --- useful typedef's
//
typedef typename Config::ParticleData PD; // ParticleDataType
typedef typename Config::ParticleData * PD; // ParticleDataType
typedef typename Config::PT PT; // ParticleType
typedef std::vector< PD > ProductMap;
......@@ -80,7 +80,7 @@ private:
std::string itsDecayName;
Measurement itsBranchingFraction;
ProductMap itsDecayChannelProducts;
std::vector<double> itsDecayModelParameters;
std::vector<double> itsDecayModelParameters;
DecayModelBase<Config> * itsDecayModel;
}; // DecayChannelT
......
......@@ -58,10 +58,12 @@ void DecayChannelT<Config>::write( std::ostream & os ) const
{
typename ProductMap::const_iterator cit;
os << " " << itsDecayName << " " << itsBranchingFraction;
for( cit=itsDecayChannelProducts.begin();
cit != itsDecayChannelProducts.end(); ++cit ) {
PD pd = *cit;
os << " " << pd.name();
if( itsDecayChannelProducts.size() > 0 ) {
for( cit=itsDecayChannelProducts.begin();
cit != itsDecayChannelProducts.end(); ++cit ) {
PD pd = *cit;
os << " " << pd->name();
}
}
os << std::endl;
}
......
......@@ -105,6 +105,7 @@ public:
// --- DecayData mutators:
//
void appendMode( DecayChannel const & dcp) { itsDDID->appendMode(dcp); }
void setDecayData( DDID dd ) { itsDDID = dd; }
// --- accessors:
//
......@@ -120,10 +121,6 @@ public:
//
//bool operator < ( ParticleDataT<Config> const & other ) const;
//bool operator == ( ParticleDataT<Config> const & other ) const;
// --- mutator:
//
void setDecayData( DDID dd ) { itsDDID = dd; }
private:
......
......@@ -38,7 +38,7 @@ public:
typedef std::map<ParticleID,TempParticleData> TempMap;
typedef std::map<ParticleID,ParticleData> PDTMap;
typedef std::map<std::string,ParticleData> PDTNameMap;
typedef std::map<std::string,ParticleID> PDTNameMap;
typedef typename PDTMap::const_iterator const_iterator;
typedef typename PDTNameMap::const_iterator const_iteratorByName;
......
......@@ -28,7 +28,7 @@ typename ParticleDataTableT<Config>::ParticleData * ParticleDataTableT<Config>::
return & it->second;
} else {
//std::cerr << "cannot find particle " << id << " in map" << std::endl;
return NULL;
return 0;
}
}
......@@ -42,7 +42,7 @@ typename ParticleDataTableT<Config>::ParticleData const * ParticleDataTableT<Con
return & cit->second;
} else {
//std::cerr << "cannot find particle " << id << " in map" << std::endl;
return NULL;
return 0;
}
}
......@@ -61,26 +61,24 @@ typename ParticleDataTableT<Config>::ParticleData const * ParticleDataTableT<Con
template< class Config >
typename ParticleDataTableT<Config>::ParticleData * ParticleDataTableT<Config>::particle( std::string nkey)
{
nameIterator it;
it = itsNameMap.find( nkey );
nameIterator it = itsNameMap.find( nkey );
if( it != itsNameMap.end() ) {
return & it->second;
return particle(it->second);
} else {
//std::cerr << "cannot find particle " << nkey << " in map" << std::endl;
return NULL;
return 0;
}
}
template< class Config >
typename ParticleDataTableT<Config>::ParticleData const * ParticleDataTableT<Config>::particle( std::string nkey ) const
{
const_iteratorByName cit;
cit = itsNameMap.find( nkey );
const_iteratorByName cit = itsNameMap.find( nkey );
if( cit != itsNameMap.end() ) {
return & cit->second;
return particle(cit->second);
} else {
//std::cerr << "cannot find particle " << nkey << " in map" << std::endl;
return NULL;
return 0;
}
}
......@@ -103,6 +101,7 @@ void ParticleDataTableT<Config>::writeParticleData( std::ostream & outstr )
outstr << std::endl;
outstr << "HepPDT-ParticleDataTable-begin" << std::endl;
outstr << " ***** ParticleDataTable *****" << std::endl;
writeVersion( outstr );
outstr << " Table Name : " << tableName() << std::endl;
outstr << " ( " << size() << " entries )" << std::endl;
outstr << "PARTICLE NAME ID CHARGE COLOR"
......@@ -128,6 +127,7 @@ void ParticleDataTableT<Config>::writeParticleInfo( std::ostream & outstr )
outstr << std::endl;
outstr << "HepPDT-ParticleDataTable-Particle-Information-begin" << std::endl;
outstr << " ***** ParticleDataTable *****" << std::endl;
writeVersion( outstr );
outstr << " Table Name : " << tableName() << std::endl;
outstr << " ( " << size() << " entries )" << std::endl;
outstr << "PARTICLE NAME ID CHARGE COLOR"
......@@ -170,7 +170,7 @@ void ParticleDataTableT<Config>::addParticle( ParticleData const & p )
ParticleID id=p.ID();
//std::string nid(p.name());
itsMap.insert( std::make_pair( id, p ));
itsNameMap.insert( std::make_pair( p.name(), p ));
itsNameMap.insert( std::make_pair( p.name(), id ));
}
} // HepPDT
......@@ -10,10 +10,12 @@
#define HEPPDTVERSION_HH
#include <string>
#include <iostream>
namespace HepPDT {
void version( ); // print version
void version( ); // print version
void writeVersion( std::ostream & os ); // write version to os
std::string versionName( ); // return version
} // HepPDT
......
......@@ -8,21 +8,42 @@
namespace HepPDT {
template< class Config >
void ParticleDataTableT<Config>::convertTemporaryMap( TempMap & tempPDT, std::ostream & os )
void ParticleDataTableT<Config>::convertTemporaryMap( TempMap & tempPDT, std::ostream & err )
{
TempMap::iterator cit;
std::vector<TempDecayData>::const_iterator cit2;
// need an empty DecayData
DecayData nodecay;
DDID edid = addDecayData( nodecay );
// first loop and create a PD map with empty DecayData
for( cit=tempPDT.begin(); cit != tempPDT.end(); ++cit ) {
TempParticleData & tempd = cit->second;
// create CPD and add it to the list
CPD cpd( tempd );
CPDID cid = addParticleData( cpd );
// now create ParticleData and add it to the map
ParticleData pd( cid, edid );
addParticle( pd );
}
// now loop again and add the DecayData
std::vector<TempDecayData>::const_iterator cit2;
for( cit=tempPDT.begin(); cit != tempPDT.end(); ++cit ) {
// find the PD for this particle
TempParticleData & tempd = cit->second;
ParticleDataT<Config>* thisPD( particle( tempd.tempID ));
// convert TempDecayData to DecayChannel
std::vector<DecayChannelT<Config> > dv;
for( cit2=tempd.tempDecayList.begin(); cit2 != tempd.tempDecayList.end(); ++cit2 ) {
TempDecayData tdd = *cit2;
// every PD mentioned here must already be in the list........
std::vector<ParticleDataT<Config> > decaylist;
std::vector< ParticleDataT<Config>* > decaylist;
for( unsigned int i=0; i<tdd.tempDaughterList.size(); ++i ) {
ParticleDataT<Config>* dtr( particle( tdd.tempDaughterList[i] ));
if( dtr ) {
decaylist.push_back( dtr );
//} else {
// err << " cannot find match for decay product "
// << tdd.tempDaughterList[i] << std::endl;
}
}
DecayChannelT<Config> dc( tdd.tempDecayName,
Measurement( tdd.tempBranchingFraction, 0.),
decaylist,
......@@ -32,10 +53,9 @@ void ParticleDataTableT<Config>::convertTemporaryMap( TempMap & tempPDT, std::os
// create DD and add it to the list
DecayData dd( dv );
DDID did = addDecayData( dd );
// now create ParticleData and add it to the map
ParticleData pd( cid, did );
// std::cout << "adding " << pd->ID().pid() << std::endl;
addParticle( pd );
// now add this DecayData to the ParticleData
thisPD->setDecayData( did );
}
}
......
// $Id: examListHerwig.cc,v 1.1.2.4 2005/07/27 18:45:07 garren Exp $
// -------------------------------------------------------------------
//
// List the herwig translation
......
// $Id: examListIsajet.cc,v 1.1.2.4 2005/07/27 18:45:07 garren Exp $
// -------------------------------------------------------------------
//
// List the isajet translation
......
// $Id: examMyPDT.cc,v 1.2.4.3 2005/07/27 18:45:07 garren Exp $
// ----------------------------------------------------------------------
// examMyPDT.cc
//
......
HepPDT-ParticleDataTable-begin
***** ParticleDataTable *****
HepPDT Version: 1.02.00
Table Name :
( 5 entries )
PARTICLE NAME ID CHARGE COLOR SPIN: J S L MASS WIDTH LIFETIME
......
// $Id: examReadEvtGen.cc,v 1.2.4.3 2005/07/27 18:45:07 garren Exp $
// ----------------------------------------------------------------------
// examReadEvtGen.cc
//
......
This diff is collapsed.
This diff is collapsed.
// $Id: examReadPythia.cc,v 1.2.4.3 2005/07/27 18:45:07 garren Exp $
// ----------------------------------------------------------------------
// examReadPythia.cc
//
......
This diff is collapsed.
// $Id: examReadQQ.cc,v 1.2.4.3 2005/07/27 18:45:08 garren Exp $
// ----------------------------------------------------------------------
// examReadQQ.cc
//
......
This diff is collapsed.
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