File indexing completed on 2025-01-30 10:11:34
0001
0002
0003
0004
0005
0006
0007 #ifndef ParticleDataTable_HH
0008 #define ParticleDataTable_HH
0009
0010 #include <iostream>
0011 #include <string>
0012 #include <map>
0013 #include <list>
0014
0015 #include "HepPDT/ParticleID.hh"
0016 #include "HepPDT/DecayData.hh"
0017 #include "HepPDT/DecayChannel.hh"
0018 #include "HepPDT/ParticleData.hh"
0019 #include "HepPDT/ParticleDataTableComparison.hh"
0020 #include "HepPDT/ProcessUnknownID.hh"
0021 #include "HepPDT/SimpleProcessUnknownID.hh"
0022 #include "HepPDT/Version.hh"
0023
0024
0025
0026
0027
0028
0029
0030 namespace HepPDT {
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 class ParticleDataTable {
0048
0049 public:
0050 typedef CommonParticleData CPD;
0051
0052 typedef std::list<CommonParticleData> CPDlist;
0053 typedef std::list<DecayData> DDlist;
0054
0055 typedef CPDlist::const_iterator CPDID;
0056 typedef DDlist::const_iterator DDID;
0057
0058 typedef std::map<ParticleID,TempParticleData> TempMap;
0059 typedef std::map<ParticleID,ParticleData,ParticleDataTableComparison> PDTMap;
0060 typedef std::map<std::string,ParticleID> PDTNameMap;
0061
0062 typedef PDTMap::const_iterator const_iterator;
0063 typedef PDTNameMap::const_iterator const_iteratorByName;
0064
0065
0066
0067
0068
0069 ParticleDataTable( std::string name = " ", ProcessUnknownID* = new SimpleProcessUnknownID );
0070 ~ParticleDataTable();
0071
0072
0073
0074
0075 int size() const { return itsMap.size(); }
0076
0077 const_iterator begin() const { return itsMap.begin(); }
0078
0079 const_iterator end() const { return itsMap.end(); }
0080
0081 int sizeNameMap() const { return itsNameMap.size(); }
0082
0083 const_iteratorByName beginNameMap() const { return itsNameMap.begin(); }
0084
0085 const_iteratorByName endNameMap() const { return itsNameMap.end(); }
0086
0087 std::string tableName() const { return itsTableName; }
0088
0089
0090 ParticleData const * particle( ParticleID ) const;
0091
0092 ParticleData * particle( ParticleID );
0093
0094 ParticleData const * particle( std::string ) const;
0095
0096 ParticleData * particle( std::string );
0097
0098
0099 ParticleData * operator [] ( ParticleID );
0100
0101 ParticleData const * operator [] ( ParticleID ) const;
0102
0103 ParticleData * operator [] ( std::string );
0104
0105 ParticleData const * operator [] ( std::string ) const;
0106
0107
0108 void writeParticleData( std::ostream & outstr );
0109
0110 void writeParticleInfo( std::ostream & outstr );
0111
0112 void writeParticleTranslation( std::ostream & outstr );
0113
0114 void writeParticleStatus( std::ostream & );
0115
0116
0117 void convertTemporaryMap( TempMap & tempPDT, std::ostream & err );
0118
0119
0120 DDID addDecayData( DecayData const d );
0121
0122 private:
0123
0124 CPDlist mutable itsCPDlist;
0125 DDlist itsDDlist;
0126 PDTMap mutable itsMap;
0127 PDTNameMap mutable itsNameMap;
0128 std::string itsTableName;
0129 ProcessUnknownID * itsProcessUnknownID;
0130
0131
0132 ParticleDataTable( const ParticleDataTable & orig );
0133 ParticleDataTable& operator=( const ParticleDataTable & );
0134
0135
0136 void addParticle( ParticleData const & p ) const;
0137 CPDID addParticleData( CPD const cpd ) const;
0138
0139 ParticleData * DealWithUnknownID( ParticleID & ) const;
0140
0141 typedef PDTMap::iterator iterator;
0142 typedef PDTNameMap::iterator nameIterator;
0143
0144 };
0145
0146
0147
0148
0149 bool writePDGStream (std::ostream & os, const ParticleDataTable & table);
0150
0151 bool writePythiaStream (std::ostream & os, const ParticleDataTable & table);
0152
0153 bool writeHerwigStream (std::ostream & os, const ParticleDataTable & table);
0154
0155 bool writeIsajetStream (std::ostream & os, const ParticleDataTable & table);
0156
0157 bool writeQQStream (std::ostream & os, const ParticleDataTable & table);
0158
0159 bool writeEvtGenStream (std::ostream & os, const ParticleDataTable & table);
0160
0161
0162 }
0163
0164 #include "HepPDT/ParticleDataTable.icc"
0165
0166 #endif