Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CLHEP
CLHEP
Commits
14ff12cd
Commit
14ff12cd
authored
Mar 18, 2005
by
Lynn Garren
Browse files
try to be intelligent about Isajet numbers not found in the static map
no public access directly to static maps fix some warnings
parent
f8050021
Changes
8
Hide whitespace changes
Inline
Side-by-side
HepPDT/HepPDT/ParticleIDTranslations.hh
View file @
14ff12cd
...
...
@@ -9,8 +9,6 @@
//
// ----------------------------------------------------------------------
#include <map>
namespace
HepPDT
{
// translate between generator ID's and standard numbering scheme
...
...
@@ -23,34 +21,18 @@ int translatePDTtoGeant( const int pid );
int
translatePDTtoEvtGen
(
const
int
pid
);
// Herwig translations
typedef
std
::
map
<
int
,
int
>
HerwigPDTMap
;
typedef
std
::
map
<
int
,
int
>
PDTHerwigMap
;
HerwigPDTMap
const
&
getHerwigPDTMap
();
PDTHerwigMap
const
&
getPDTHerwigMap
();
int
translateHerwigtoPDT
(
const
int
herwigID
);
int
translatePDTtoHerwig
(
const
int
pid
);
// Isajet translations
typedef
std
::
map
<
int
,
int
>
IsajetPDTMap
;
typedef
std
::
map
<
int
,
int
>
PDTIsajetMap
;
IsajetPDTMap
const
&
getIsajetPDTMap
();
PDTIsajetMap
const
&
getPDTIsajetMap
();
int
translateIsajettoPDT
(
const
int
isajetID
);
int
translatePDTtoIsajet
(
const
int
pid
);
// Pythia translations
typedef
std
::
map
<
int
,
int
>
PythiaPDTMap
;
typedef
std
::
map
<
int
,
int
>
PDTPythiaMap
;
PythiaPDTMap
const
&
getPythiaPDTMap
();
PDTPythiaMap
const
&
getPDTPythiaMap
();
int
translatePythiatoPDT
(
const
int
pythiaID
);
int
translatePDTtoPythia
(
const
int
pid
);
// PDG table translations
typedef
std
::
map
<
int
,
int
>
PDGtoPDTMap
;
typedef
std
::
map
<
int
,
int
>
PDTtoPDGMap
;
PDGtoPDTMap
const
&
getPDGtoPDTMap
();
PDTtoPDGMap
const
&
getPDTtoPDGMap
();
int
translatePDGtabletoPDT
(
const
int
pdgID
);
int
translatePDTtoPDGtable
(
const
int
pid
);
...
...
HepPDT/HepPDT/TableBuilderTEvtGen.icc
View file @
14ff12cd
// $Id: TableBuilderTEvtGen.icc,v 1.1.1.1.2.
1
200
4
/0
4/29 19:57:43
garren Exp $
// $Id: TableBuilderTEvtGen.icc,v 1.1.1.1.2.
2
200
5
/0
3/18 17:15:01
garren Exp $
// ----------------------------------------------------------------------
//
// TableBuilderTEvtGen.icc
...
...
@@ -92,7 +92,7 @@ bool addEvtGenParticles( std::istream & pdfile, TableBuilderT<Config> & tb )
template< class Config >
void findDecayModel( TempParticleData & tpd, TableBuilderT<Config> & tb )
{
int cit, it, ddend, iend;
unsigned
int cit, it, ddend, iend;
std::string name;
for( cit=0; cit < tpd.tempDecayList.size(); ++cit ) {
TempDecayData & tdd = tpd.tempDecayList[cit];
...
...
@@ -124,7 +124,7 @@ void findDecayModel( TempParticleData & tpd, TableBuilderT<Config> & tb )
template< class Config >
void findAliasDecayModel( TempAliasData & tad, TableBuilderT<Config> & tb )
{
int cit, it, ddend, iend;
unsigned
int cit, it, ddend, iend;
std::string name;
for( cit=0; cit < tad.tempAliasDecayList.size(); ++cit ) {
TempDecayData & tdd = tad.tempAliasDecayList[cit];
...
...
HepPDT/src/QQChannel.cc
View file @
14ff12cd
// $Id: QQChannel.cc,v 1.1.1.1.2.
1
2005/0
2/04 00:24:43
garren Exp $
// $Id: QQChannel.cc,v 1.1.1.1.2.
2
2005/0
3/18 17:15:02
garren Exp $
// ----------------------------------------------------------------------
//
// QQChannel.cc
...
...
@@ -82,7 +82,7 @@ void QQChannel::write( std::ostream & os ) const
// incomplete
os
<<
" "
<<
itsBranchingFraction
<<
" "
<<
itsMatrixCode
<<
" "
<<
itsSinPhi
<<
" "
<<
itsCPTag
;
for
(
int
i
=
0
;
i
<
itsDaughters
.
size
();
++
i
){
for
(
unsigned
int
i
=
0
;
i
<
itsDaughters
.
size
();
++
i
){
os
<<
" "
<<
itsDaughters
[
i
]
;
}
os
<<
std
::
endl
;
...
...
HepPDT/src/QQDecay.cc
View file @
14ff12cd
// $Id: QQDecay.cc,v 1.1.1.1.2.
1
2005/0
2/04 00:24:43
garren Exp $
// $Id: QQDecay.cc,v 1.1.1.1.2.
2
2005/0
3/18 17:15:02
garren Exp $
// ----------------------------------------------------------------------
//
// QQDecay.cc
...
...
@@ -51,8 +51,7 @@ void QQDecay::write( std::ostream & os ) const
if
(
itsStable
)
{
os
<<
" particle is stable"
<<
std
::
endl
;
}
else
{
int
i
;
for
(
i
=
0
;
i
<
itsChannels
.
size
();
++
i
)
{
for
(
unsigned
int
i
=
0
;
i
<
itsChannels
.
size
();
++
i
)
{
itsChannels
[
i
].
write
(
os
);
}
}
...
...
HepPDT/src/translateHerwig.cc
View file @
14ff12cd
// $Id: translateHerwig.cc,v 1.1.2.
2
2005/03/1
7 22:42:53
garren Exp $
// $Id: translateHerwig.cc,v 1.1.2.
3
2005/03/1
8 17:15:02
garren Exp $
// ------------------------------------
//
// translateHerwig.cc
...
...
@@ -31,6 +31,9 @@ namespace HepPDT {
namespace
{
// HerwigPDTMapInit is private
HerwigPDTMap
const
&
getHerwigPDTMap
();
PDTHerwigMap
const
&
getPDTHerwigMap
();
HerwigPDTMap
const
&
HerwigPDTMapInit
()
{
...
...
@@ -486,8 +489,6 @@ PDTHerwigMap const & PDTHerwigMapInit()
}
return
m
;
}
}
// unnamed namespace
//
// getHerwigPDTMap is the ONLY function allowed to call HerwigPDTMapInit
...
...
@@ -506,7 +507,8 @@ PDTHerwigMap const & getPDTHerwigMap()
static
PDTHerwigMap
const
&
hmap
=
PDTHerwigMapInit
();
return
hmap
;
}
// getPDTHerwigMap()
}
// unnamed namespace
int
translateHerwigtoPDT
(
const
int
id
)
{
...
...
HepPDT/src/translateIsajet.cc
View file @
14ff12cd
...
...
@@ -5,6 +5,9 @@
// translate an ID number to or from the standard numbering scheme and Isajet
// use static maps
//
// Isajet uses a different numbering scheme
// Private methods will attempt to convert mesons and baryons not in the map
//
// The maps are initialized if and only if the public functions are called.
// Because the maps are static, the initialization happens only once.
//
...
...
@@ -31,6 +34,9 @@ namespace HepPDT {
namespace
{
// IsajetPDTMapInit is private
IsajetPDTMap
const
&
getIsajetPDTMap
();
PDTIsajetMap
const
&
getPDTIsajetMap
();
IsajetPDTMap
const
&
IsajetPDTMapInit
()
{
...
...
@@ -670,8 +676,211 @@ PDTIsajetMap const & PDTIsajetMapInit()
}
return
m
;
}
}
// unnamed namespace
// if a number isn't in the map, we try to convert it
int
convIsajettoPDT
(
const
int
id
)
{
// make a ParticleID so we can use some of the methods,
// even though this ID is not a valid PDT number
ParticleID
pid
(
id
);
// we have no idea what to do, these numbers must be in the map
if
(
pid
.
abspid
()
<=
100
)
{
return
0
;
}
if
(
pid
.
abspid
()
>
99999
)
{
return
0
;
}
// find constituents
int
istran
;
unsigned
short
js
=
pid
.
digit
(
nj
);
unsigned
short
i1
=
pid
.
digit
(
nq3
);
unsigned
short
i2
=
pid
.
digit
(
nq2
);
unsigned
short
i3
=
pid
.
digit
(
nq1
);
unsigned
short
i4
=
pid
.
digit
(
nl
);
// mesons
if
(
i1
!=
0
&&
i2
!=
0
&&
i3
==
0
)
{
// u and d have opposite definitions - sometimes
if
(
i2
<=
2
&&
i1
<=
2
){
// don't change
}
else
{
if
(
i1
=
2
)
{
i1
=
1
;
}
else
if
(
i1
=
1
)
{
i1
=
2
;
}
if
(
i2
=
2
)
{
i2
=
1
;
}
else
if
(
i2
=
1
)
{
i2
=
2
;
}
}
istran
=
i1
*
100
+
i2
*
10
+
2
*
js
+
1
+
i4
*
10000
;
if
(
id
<
0
)
{
istran
=
-
istran
;
}
// charmed and top mesons have wrong sign
if
(
i1
==
4
&&
i2
!=
4
)
{
istran
=
-
istran
;
}
if
(
i1
==
6
&&
i2
!=
6
&&
i2
!=
4
)
{
istran
=
-
istran
;
}
// ...check for illegal antiparticles
if
(
i2
==
i1
&&
id
<
0
)
{
istran
=
0
;
}
return
istran
;
}
// diquarks
if
(
i2
!=
0
&&
i3
!=
0
&&
i1
==
0
)
{
// ... u and d have opposite definitions
if
(
i3
=
2
)
{
i3
=
1
;
}
else
if
(
i3
=
1
)
{
i3
=
2
;
}
if
(
i2
=
2
)
{
i2
=
1
;
}
else
if
(
i2
=
1
)
{
i2
=
2
;
}
istran
=
0
;
if
(
i2
<
i3
){
istran
=
i3
*
1000
+
i2
*
100
+
1
;
}
else
if
(
i2
==
i3
){
istran
=
i2
*
1000
+
i3
*
100
+
3
;
}
else
{
istran
=
i2
*
1000
+
i3
*
100
+
1
;
}
if
(
id
<
0
)
{
istran
=
-
istran
;
}
// ... charmed and top quarks have wrong sign
if
(
i2
==
4
&&
i3
!=
4
)
{
istran
=-
istran
;
}
if
(
i2
==
6
&&
i3
!=
6
&&
i3
!=
4
)
{
istran
=-
istran
;
}
return
istran
;
}
// baryons
if
(
i1
!=
0
&&
i3
!=
0
&&
i2
!=
0
)
{
// u and d have opposite definitions
if
(
i3
=
2
)
{
i3
=
1
;
}
else
if
(
i3
=
1
)
{
i3
=
2
;
}
if
(
i2
=
2
)
{
i2
=
1
;
}
else
if
(
i2
=
1
)
{
i2
=
2
;
}
if
(
i1
=
2
)
{
i1
=
1
;
}
else
if
(
i1
=
1
)
{
i1
=
2
;
}
istran
=
0
;
if
(
i1
<=
2
){
istran
=
i3
*
1000
+
i2
*
100
+
i1
*
10
+
2
*
js
+
2
;
}
else
if
(
i3
<=
2
&&
i2
<=
2
){
istran
=
i1
*
1000
+
i3
*
100
+
i2
*
10
+
2
*
js
+
2
;
}
else
{
istran
=
i1
*
1000
+
i2
*
100
+
i3
*
10
+
2
*
js
+
2
;
}
if
(
id
<
0
)
{
istran
=
-
istran
;
}
}
// unknown
return
0
;
}
// if a number isn't in the map, we try to convert it
int
convPDTtoIsajet
(
const
int
id
)
{
// make a ParticleID so we can use the methods
ParticleID
pid
(
id
);
// we have no idea what to do, these numbers must be in the map
if
(
pid
.
fundamentalID
()
!=
0
)
{
return
0
;
}
if
(
pid
.
abspid
()
>
99999
)
{
return
0
;
}
// find constituents
int
istran
;
unsigned
short
js
=
pid
.
digit
(
nj
);
unsigned
short
i1
=
pid
.
digit
(
nq3
);
unsigned
short
i2
=
pid
.
digit
(
nq2
);
unsigned
short
i3
=
pid
.
digit
(
nq1
);
unsigned
short
i4
=
pid
.
digit
(
nl
);
// mesons
if
(
i1
!=
0
&&
i2
!=
0
&&
i3
==
0
)
{
// u and d have opposite definitions - sometimes
if
(
i2
<=
2
&&
i1
<=
2
){
// don't change
}
else
{
if
(
i1
=
2
)
{
i1
=
1
;
}
else
if
(
i1
=
1
)
{
i1
=
2
;
}
if
(
i2
=
2
)
{
i2
=
1
;
}
else
if
(
i2
=
1
)
{
i2
=
2
;
}
}
istran
=
i1
*
100
+
i2
*
10
+
(
js
-
1
)
/
2
+
i4
*
10000
;
if
(
id
<
0
)
{
istran
=
-
istran
;
}
// ... charmed and top mesons have wrong sign
if
(
i2
==
4
&&
i1
!=
4
)
{
istran
=
-
istran
;
}
if
(
i2
==
6
&&
i1
!=
6
&&
i1
!=
4
)
{
istran
=
-
istran
;
}
// ...check for illegal antiparticles
if
(
i2
==
i1
&&
id
<
0
)
{
istran
=
0
;
}
return
istran
;
}
// diquarks
if
(
i1
==
0
){
// ... u and d have opposite definitions
if
(
i3
=
2
)
{
i3
=
1
;
}
else
if
(
i3
=
1
)
{
i3
=
2
;
}
if
(
i2
=
2
)
{
i2
=
1
;
}
else
if
(
i2
=
1
)
{
i2
=
2
;
}
istran
=
0
;
if
(
i3
<
i2
){
istran
=
i3
*
1000
+
i2
*
100
+
(
js
-
1
)
/
2
;
}
else
{
istran
=
i2
*
1000
+
i3
*
100
+
(
js
-
1
)
/
2
;
}
if
(
id
<
0
)
{
istran
=
-
istran
;
}
// ... charmed and top mesons have wrong sign
if
(
i2
==
4
&&
i3
!=
4
)
{
istran
=-
istran
;
}
if
(
i2
==
6
&&
i3
!=
6
&&
i3
!=
4
)
{
istran
=-
istran
;
}
return
istran
;
}
// ...spin 1/2 or spin 3/2 baryons
if
(
i1
!=
0
&&
i3
!=
0
&&
i2
!=
0
&&
(
js
==
2
||
js
==
4
)
&&
i4
==
0
)
{
// u and d have opposite definitions
if
(
i3
=
2
)
{
i3
=
1
;
}
else
if
(
i3
=
1
)
{
i3
=
2
;
}
if
(
i2
=
2
)
{
i2
=
1
;
}
else
if
(
i2
=
1
)
{
i2
=
2
;
}
if
(
i1
=
2
)
{
i1
=
1
;
}
else
if
(
i1
=
1
)
{
i1
=
2
;
}
istran
=
0
;
if
(
i3
<=
2
){
istran
=
i3
*
1000
+
i2
*
100
+
i1
*
10
+
(
js
-
2
)
/
2
;
}
else
if
(
i1
<=
2
&&
i2
<=
2
){
istran
=
i2
*
1000
+
i1
*
100
+
i3
*
10
+
(
js
-
2
)
/
2
;
}
else
{
istran
=
i1
*
1000
+
i2
*
100
+
i3
*
10
+
(
js
-
2
)
/
2
;
}
if
(
id
<
0
)
{
istran
=
-
istran
;
}
return
istran
;
}
// unknown
return
0
;
}
//
// getIsajetPDTMap is the ONLY function allowed to call IsajetPDTMapInit
...
...
@@ -690,28 +899,29 @@ PDTIsajetMap const & getPDTIsajetMap()
static
PDTIsajetMap
const
&
hmap
=
PDTIsajetMapInit
();
return
hmap
;
}
// getPDTIsajetMap()
}
// unnamed namespace
int
translatePDTtoIsajet
(
const
int
id
)
int
translateIsajettoPDT
(
const
int
id
)
{
static
PDT
IsajetMap
const
&
p
map
=
get
PDT
IsajetMap
();
static
Isajet
PDT
Map
const
&
h
map
=
getIsajet
PDT
Map
();
PDT
IsajetMap
::
const_iterator
const
cit
=
p
map
.
find
(
id
);
// fo
r Isajet, if it isn't in the map, then it isn't a valid particle
return
(
cit
=
=
p
map
.
end
()
)
?
0
:
cit
->
second
;
Isajet
PDT
Map
::
const_iterator
const
cit
=
h
map
.
find
(
id
);
// fo
und it in the map
if
(
cit
!
=
h
map
.
end
()
)
{
return
cit
->
second
;
}
// try converting anyway
return
convIsajettoPDT
(
id
)
;
}
int
translateIsajet
toPDT
(
const
int
id
)
int
translate
PDTto
Isajet
(
const
int
id
)
{
static
Isajet
PDT
Map
const
&
h
map
=
getIsajet
PDT
Map
();
static
PDT
IsajetMap
const
&
p
map
=
get
PDT
IsajetMap
();
Isajet
PDT
Map
::
const_iterator
const
cit
=
h
map
.
find
(
id
);
// fo
r Isajet, if it isn't in the map, then it isn't a valid particle
return
(
cit
=
=
h
map
.
end
()
)
?
0
:
cit
->
second
;
PDT
IsajetMap
::
const_iterator
const
cit
=
p
map
.
find
(
id
);
// fo
und it in the map
if
(
cit
!
=
p
map
.
end
()
)
{
return
cit
->
second
;
}
// try converting anyway
return
convPDTtoIsajet
(
id
)
;
}
}
// HepPDT
HepPDT/src/translatePDG.cc
View file @
14ff12cd
...
...
@@ -31,6 +31,9 @@ namespace HepPDT {
namespace
{
// PDGtoPDTMapInit is private
PDGtoPDTMap
const
&
getPDGtoPDTMap
();
PDTtoPDGMap
const
&
getPDTtoPDGMap
();
PDGtoPDTMap
const
&
PDGtoPDTMapInit
()
{
...
...
@@ -267,8 +270,6 @@ PDTtoPDGMap const & PDTtoPDGMapInit()
}
return
m
;
}
}
// unnamed namespace
//
// getPDGtoPDTMap is the ONLY function allowed to call PDGtoPDTMapInit
...
...
@@ -287,7 +288,8 @@ PDTtoPDGMap const & getPDTtoPDGMap()
static
PDTtoPDGMap
const
&
hmap
=
PDTtoPDGMapInit
();
return
hmap
;
}
// getPDTtoPDGMap()
}
// unnamed namespace
int
translatePDGtabletoPDT
(
const
int
id
)
{
...
...
HepPDT/src/translatePythia.cc
View file @
14ff12cd
...
...
@@ -31,6 +31,9 @@ namespace HepPDT {
namespace
{
// PythiaPDTMapInit is private
PythiaPDTMap
const
&
getPythiaPDTMap
();
PDTPythiaMap
const
&
getPDTPythiaMap
();
PythiaPDTMap
const
&
PythiaPDTMapInit
()
{
...
...
@@ -597,8 +600,6 @@ PDTPythiaMap const & PDTPythiaMapInit()
}
return
m
;
}
}
// unnamed namespace
//
// getPythiaPDTMap is the ONLY function allowed to call PythiaPDTMapInit
...
...
@@ -618,6 +619,7 @@ PDTPythiaMap const & getPDTPythiaMap()
return
hmap
;
}
// getPDTPythiaMap()
}
// unnamed namespace
int
translatePythiatoPDT
(
const
int
id
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment